diff --git a/gfx/layers/LayerMetricsWrapper.h b/gfx/layers/LayerMetricsWrapper.h index ab37e281aa35..d78b1e04c578 100644 --- a/gfx/layers/LayerMetricsWrapper.h +++ b/gfx/layers/LayerMetricsWrapper.h @@ -406,6 +406,12 @@ class MOZ_STACK_CLASS LayerMetricsWrapper final { return mLayer->GetFixedPositionScrollContainerId(); } + SideBits GetFixedPositionSides() const { + MOZ_ASSERT(IsValid()); + + return mLayer->GetFixedPositionSides(); + } + Maybe GetZoomAnimationId() const { MOZ_ASSERT(IsValid()); // This function is only really needed for template-compatibility with diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 3033d516863b..da2c58def670 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -992,7 +992,8 @@ HitTestingTreeNode* APZCTreeManager::PrepareNodeForLayer( : Nothing()); node->SetScrollbarData(aLayer.GetScrollbarAnimationId(), aLayer.GetScrollbarData()); - node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId()); + node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId(), + aLayer.GetFixedPositionSides()); return node; } @@ -1216,7 +1217,8 @@ HitTestingTreeNode* APZCTreeManager::PrepareNodeForLayer( // when those properties change. node->SetScrollbarData(aLayer.GetScrollbarAnimationId(), aLayer.GetScrollbarData()); - node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId()); + node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId(), + aLayer.GetFixedPositionSides()); return node; } diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp index 202ad948b1fe..249653ce2028 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.cpp +++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp @@ -133,14 +133,17 @@ const ScrollbarData& HitTestingTreeNode::GetScrollbarData() const { } void HitTestingTreeNode::SetFixedPosData( - ScrollableLayerGuid::ViewID aFixedPosTarget) { + ScrollableLayerGuid::ViewID aFixedPosTarget, SideBits aFixedPosSides) { mFixedPosTarget = aFixedPosTarget; + mFixedPosSides = aFixedPosSides; } ScrollableLayerGuid::ViewID HitTestingTreeNode::GetFixedPosTarget() const { return mFixedPosTarget; } +SideBits HitTestingTreeNode::GetFixedPosSides() const { return mFixedPosSides; } + void HitTestingTreeNode::SetPrevSibling(HitTestingTreeNode* aSibling) { mPrevSibling = aSibling; if (aSibling) { diff --git a/gfx/layers/apz/src/HitTestingTreeNode.h b/gfx/layers/apz/src/HitTestingTreeNode.h index f229aa24871e..a1a252552b67 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.h +++ b/gfx/layers/apz/src/HitTestingTreeNode.h @@ -125,8 +125,10 @@ class HitTestingTreeNode { /* Fixed pos info */ - void SetFixedPosData(ScrollableLayerGuid::ViewID aFixedPosTarget); + void SetFixedPosData(ScrollableLayerGuid::ViewID aFixedPosTarget, + SideBits aFixedPosSides); ScrollableLayerGuid::ViewID GetFixedPosTarget() const; + SideBits GetFixedPosSides() const; /* Convert |aPoint| into the LayerPixel space for the layer corresponding to * this node. |aTransform| is the complete (content + async) transform for @@ -183,6 +185,7 @@ class HitTestingTreeNode { ScrollbarData mScrollbarData; ScrollableLayerGuid::ViewID mFixedPosTarget; + SideBits mFixedPosSides; /* Let {L,M} be the {layer, scrollable metrics} pair that this node * corresponds to in the layer tree. mEventRegions contains the event regions diff --git a/gfx/layers/wr/WebRenderScrollDataWrapper.h b/gfx/layers/wr/WebRenderScrollDataWrapper.h index dcbc673dca6d..962877951f8f 100644 --- a/gfx/layers/wr/WebRenderScrollDataWrapper.h +++ b/gfx/layers/wr/WebRenderScrollDataWrapper.h @@ -364,6 +364,13 @@ class MOZ_STACK_CLASS WebRenderScrollDataWrapper final { return mLayer->GetFixedPositionScrollContainerId(); } + SideBits GetFixedPositionSides() const { + MOZ_ASSERT(IsValid()); + + // TODO: Implement for WebRender. + return eSideBitsNone; + } + Maybe GetZoomAnimationId() const { MOZ_ASSERT(IsValid()); return mLayer->GetZoomAnimationId();