Bug 1552608 - Propagate the fixed-position sides to the hit testing tree. r=tnikkel

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-10-07 21:41:20 +00:00
Родитель a3395bb518
Коммит 4268dbf031
5 изменённых файлов: 25 добавлений и 4 удалений

Просмотреть файл

@ -406,6 +406,12 @@ class MOZ_STACK_CLASS LayerMetricsWrapper final {
return mLayer->GetFixedPositionScrollContainerId();
}
SideBits GetFixedPositionSides() const {
MOZ_ASSERT(IsValid());
return mLayer->GetFixedPositionSides();
}
Maybe<uint64_t> GetZoomAnimationId() const {
MOZ_ASSERT(IsValid());
// This function is only really needed for template-compatibility with

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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

Просмотреть файл

@ -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<uint64_t> GetZoomAnimationId() const {
MOZ_ASSERT(IsValid());
return mLayer->GetZoomAnimationId();