From f534fe074395db35e438598abffb6e891fedb57e Mon Sep 17 00:00:00 2001 From: Miko Mynttinen Date: Mon, 21 Jan 2019 22:03:10 +0000 Subject: [PATCH] Bug 1514653 - Use the reference frame of the first flattened effect when recycling the layer r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D17079 --HG-- extra : moz-landing-system : lando --- layout/painting/FrameLayerBuilder.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/layout/painting/FrameLayerBuilder.cpp b/layout/painting/FrameLayerBuilder.cpp index ea9a84585902..ae678ad4d05a 100644 --- a/layout/painting/FrameLayerBuilder.cpp +++ b/layout/painting/FrameLayerBuilder.cpp @@ -4416,6 +4416,7 @@ void ContainerState::ProcessDisplayItems(nsDisplayList* aList) { // AGR and ASR for the container item that was flattened. AnimatedGeometryRoot* containerAGR = nullptr; const ActiveScrolledRoot* containerASR = nullptr; + nsIFrame* containerReferenceFrame = nullptr; RefPtr transformNode = nullptr; const auto InTransform = [&]() { return transformNode; }; @@ -5044,7 +5045,8 @@ void ContainerState::ProcessDisplayItems(nsDisplayList* aList) { if (!paintedLayerData->mLayer) { // Try to recycle the old layer of this display item. RefPtr layer = AttemptToRecyclePaintedLayer( - itemAGR, item, topLeft, referenceFrame); + itemAGR, item, topLeft, + inEffect ? containerReferenceFrame : referenceFrame); if (layer) { paintedLayerData->mLayer = layer; @@ -5066,14 +5068,16 @@ void ContainerState::ProcessDisplayItems(nsDisplayList* aList) { selectedLayer = nullptr; containerAGR = nullptr; containerASR = nullptr; + containerReferenceFrame = nullptr; } }; const auto SelectLayerIfNeeded = [&]() { if (!selectedLayer) { selectedLayer = paintedLayerData; - containerAGR = item->GetAnimatedGeometryRoot(); - containerASR = item->GetActiveScrolledRoot(); + containerAGR = itemAGR; + containerASR = itemASR; + containerReferenceFrame = const_cast(referenceFrame); } };