Skip to content

Commit

Permalink
Bug 1421384 - Inherit touch-action flags down in the compositor hit-t…
Browse files Browse the repository at this point in the history
…est 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
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent 4e3b1fa commit 9d38877
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gfx/layers/apz/test/mochitest/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
[test_group_pointerevents.html]
skip-if = os == 'win' && os_version == '10.0' # Bug 1404836
[test_group_touchevents.html]
skip-if = webrender || (verify && debug && (os == 'win')) # bug 1424752
skip-if = (verify && debug && (os == 'win'))
[test_group_wheelevents.html]
skip-if = (toolkit == 'android') # wheel events not supported on mobile
[test_group_zoom.html]
Expand Down
21 changes: 21 additions & 0 deletions layout/generic/nsFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11263,10 +11263,31 @@ nsIFrame::GetCompositorHitTestInfo(nsDisplayListBuilder* aBuilder)
}
}






CompositorHitTestInfo inheritedTouchAction = CompositorHitTestInfo::eInvisibleToHitTest;
if (nsDisplayCompositorHitTestInfo* parentInfo = aBuilder->GetCompositorHitTestInfo()) {
inheritedTouchAction = (parentInfo->HitTestInfo() & CompositorHitTestInfo::eTouchActionMask);
}

nsIFrame* touchActionFrame = this;
if (nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this)) {
touchActionFrame = do_QueryFrame(scrollFrame);





CompositorHitTestInfo panMask = CompositorHitTestInfo::eTouchActionPanXDisabled
| CompositorHitTestInfo::eTouchActionPanYDisabled;
inheritedTouchAction &= ~panMask;
}

result |= inheritedTouchAction;

const uint32_t touchAction = nsLayoutUtils::GetTouchActionFromFrame(touchActionFrame);


Expand Down
4 changes: 4 additions & 0 deletions layout/painting/nsDisplayList.h
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,10 @@ class nsDisplayListBuilder {
{
mCompositorHitTestInfo = aHitTestInfo;
}
nsDisplayCompositorHitTestInfo* GetCompositorHitTestInfo() const
{
return mCompositorHitTestInfo;
}



Expand Down

0 comments on commit 9d38877

Please sign in to comment.