mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
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 --HG-- extra : rebase_source : ef6e24a66385e097d50b3a03c06091464b1bb5b9
This commit is contained in:
parent
6adee62041
commit
4294162115
@ -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]
|
||||
|
@ -11263,10 +11263,31 @@ nsIFrame::GetCompositorHitTestInfo(nsDisplayListBuilder* aBuilder)
|
||||
}
|
||||
}
|
||||
|
||||
// Inherit the touch-action flags from the parent, if there is one. We do this
|
||||
// because of how the touch-action on a frame combines the touch-action from
|
||||
// ancestor DOM elements. Refer to the documentation in TouchActionHelper.cpp
|
||||
// for details; this code is meant to be equivalent to that code, but woven
|
||||
// into the top-down recursive display list building process.
|
||||
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);
|
||||
// On scrollframes, stop inheriting the pan-x and pan-y flags; instead,
|
||||
// reset them back to zero to allow panning on the scrollframe unless we
|
||||
// encounter an element that disables it that's inside the scrollframe.
|
||||
// This is equivalent to the |considerPanning| variable in
|
||||
// TouchActionHelper.cpp, but for a top-down traversal.
|
||||
CompositorHitTestInfo panMask = CompositorHitTestInfo::eTouchActionPanXDisabled
|
||||
| CompositorHitTestInfo::eTouchActionPanYDisabled;
|
||||
inheritedTouchAction &= ~panMask;
|
||||
}
|
||||
|
||||
result |= inheritedTouchAction;
|
||||
|
||||
const uint32_t touchAction = nsLayoutUtils::GetTouchActionFromFrame(touchActionFrame);
|
||||
// The CSS allows the syntax auto | none | [pan-x || pan-y] | manipulation
|
||||
// so we can eliminate some combinations of things.
|
||||
|
@ -734,6 +734,10 @@ public:
|
||||
{
|
||||
mCompositorHitTestInfo = aHitTestInfo;
|
||||
}
|
||||
nsDisplayCompositorHitTestInfo* GetCompositorHitTestInfo() const
|
||||
{
|
||||
return mCompositorHitTestInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a new nsDisplayCompositorHitTestInfo for the frame |aFrame| if
|
||||
|
Loading…
Reference in New Issue
Block a user