Skip to content

Commit 9d38877

Browse files
committed
Bug 1421384 - Inherit touch-action flags down in the compositor hit-test infos. r=miko
Per the touch-action spec, the effective touch-action on an element includes touch-action restrictions from ancestor elements up to and including the element that has the "default action". This patch implements that behaviour so that WebRender gets correct touch-action values on its display items. MozReview-Commit-ID: Cw5uqAsE9qm UltraBlame original commit: 6659f392f4af0cef3cb4a5e19eef7e0e1b045f37
1 parent 4e3b1fa commit 9d38877

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

gfx/layers/apz/test/mochitest/mochitest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
[test_group_pointerevents.html]
7070
skip-if = os == 'win' && os_version == '10.0' # Bug 1404836
7171
[test_group_touchevents.html]
72-
skip-if = webrender || (verify && debug && (os == 'win')) # bug 1424752
72+
skip-if = (verify && debug && (os == 'win'))
7373
[test_group_wheelevents.html]
7474
skip-if = (toolkit == 'android') # wheel events not supported on mobile
7575
[test_group_zoom.html]

layout/generic/nsFrame.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11263,10 +11263,31 @@ nsIFrame::GetCompositorHitTestInfo(nsDisplayListBuilder* aBuilder)
1126311263
}
1126411264
}
1126511265

11266+
11267+
11268+
11269+
11270+
11271+
CompositorHitTestInfo inheritedTouchAction = CompositorHitTestInfo::eInvisibleToHitTest;
11272+
if (nsDisplayCompositorHitTestInfo* parentInfo = aBuilder->GetCompositorHitTestInfo()) {
11273+
inheritedTouchAction = (parentInfo->HitTestInfo() & CompositorHitTestInfo::eTouchActionMask);
11274+
}
11275+
1126611276
nsIFrame* touchActionFrame = this;
1126711277
if (nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this)) {
1126811278
touchActionFrame = do_QueryFrame(scrollFrame);
11279+
11280+
11281+
11282+
11283+
11284+
CompositorHitTestInfo panMask = CompositorHitTestInfo::eTouchActionPanXDisabled
11285+
| CompositorHitTestInfo::eTouchActionPanYDisabled;
11286+
inheritedTouchAction &= ~panMask;
1126911287
}
11288+
11289+
result |= inheritedTouchAction;
11290+
1127011291
const uint32_t touchAction = nsLayoutUtils::GetTouchActionFromFrame(touchActionFrame);
1127111292

1127211293

layout/painting/nsDisplayList.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ class nsDisplayListBuilder {
734734
{
735735
mCompositorHitTestInfo = aHitTestInfo;
736736
}
737+
nsDisplayCompositorHitTestInfo* GetCompositorHitTestInfo() const
738+
{
739+
return mCompositorHitTestInfo;
740+
}
737741

738742

739743

0 commit comments

Comments
 (0)