Bug 1552608 - Add a helper APZCTreeManager::IsFixedToRootContent(node). r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D48378

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-10-07 21:56:36 +00:00
parent 194efdc5a5
commit c747ab0102
2 changed files with 13 additions and 0 deletions

View File

@ -3193,6 +3193,18 @@ already_AddRefed<AsyncPanZoomController> APZCTreeManager::CommonAncestor(
return ancestor.forget();
}
bool APZCTreeManager::IsFixedToRootContent(
const HitTestingTreeNode* aNode) const {
mTreeLock.AssertCurrentThreadIn();
ScrollableLayerGuid::ViewID fixedTarget = aNode->GetFixedPosTarget();
if (fixedTarget == ScrollableLayerGuid::NULL_SCROLL_ID) {
return false;
}
RefPtr<AsyncPanZoomController> targetApzc =
GetTargetAPZC(aNode->GetLayersId(), fixedTarget);
return targetApzc && targetApzc->IsRootContent();
}
LayerToParentLayerMatrix4x4 APZCTreeManager::ComputeTransformForNode(
const HitTestingTreeNode* aNode) const {
mTreeLock.AssertCurrentThreadIn();

View File

@ -630,6 +630,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge {
AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
already_AddRefed<AsyncPanZoomController> CommonAncestor(
AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
bool IsFixedToRootContent(const HitTestingTreeNode* aNode) const;
/**
* Perform hit testing for a touch-start event.
*