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
This commit is contained in:
Miko Mynttinen 2019-01-21 22:03:10 +00:00
Родитель 7292107f24
Коммит f534fe0743
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -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<TransformClipNode> 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<PaintedLayer> 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<nsIFrame*>(referenceFrame);
}
};