Bug 1462477 - Always initialize the value of aOutIsTransformedFixed, even we don't have an image to paint. r?mstange
This value is used to determine whether we should create nsDisplayFixedPosition, and if the result changes without an invalidation, then retained-dl gets confused with the insertion/removal of a wrap list.
MozReview-Commit-ID: JuXwCzKOxec
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -3255,18 +3255,32 @@ nsCSSRendering::PrepareImageLayer(nsPres
}
if (aFlags & nsCSSRendering::PAINTBG_TO_WINDOW) {
irFlags |= nsImageRenderer::FLAG_PAINTING_TO_WINDOW;
}
nsBackgroundLayerState state(aForFrame, &aLayer.mImage, irFlags);
if (!state.mImageRenderer.PrepareImage()) {
// There's no image or it's not ready to be painted.
- if (aOutIsTransformedFixed) {
- *aOutIsTransformedFixed = false;
+ if (aOutIsTransformedFixed &&
+ StyleImageLayerAttachment::Fixed == aLayer.mAttachment) {
+
+ nsIFrame* attachedToFrame = aPresContext->PresShell()->GetRootFrame();
+ NS_ASSERTION(attachedToFrame, "no root frame");
+ nsIFrame* pageContentFrame = nullptr;
+ if (aPresContext->IsPaginated()) {
+ pageContentFrame = nsLayoutUtils::GetClosestFrameOfType(
+ aForFrame, LayoutFrameType::PageContent);
+ if (pageContentFrame) {
+ attachedToFrame = pageContentFrame;
+ }
+ // else this is an embedded shell and its root frame is what we want
+ }
+
+ *aOutIsTransformedFixed = nsLayoutUtils::IsTransformed(aForFrame, attachedToFrame);
}
return state;
}
// The frame to which the background is attached
nsIFrame* attachedToFrame = aForFrame;
// Is the background marked 'fixed', but affected by a transform?
bool transformedFixed = false;