diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index f696cafb968c..84a7a267c141 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -278,7 +278,7 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext, nsIFrame* aFrame, nsChangeHint aChange) { - // We check StyleDisplay()->HasTransform() in addition to checking + // We check StyleDisplay()->HasTransformStyle() in addition to checking // IsTransformed() since we can get here for some frames that don't support // CSS transforms. NS_ASSERTION(!(aChange & nsChangeHint_UpdateTransformLayer) || @@ -295,22 +295,29 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext, } } - // If the frame's background is propagated to an ancestor, walk up to - // that ancestor. - nsStyleContext *bgSC; - while (!nsCSSRendering::FindBackground(aFrame, &bgSC)) { - aFrame = aFrame->GetParent(); - NS_ASSERTION(aFrame, "root frame must paint"); - } - // Trigger rendering updates by damaging this frame and any // continuations of this frame. - - // XXX this needs to detect the need for a view due to an opacity change and deal with it... - #ifdef DEBUG gInApplyRenderingChangeToTree = true; #endif + if (aChange & nsChangeHint_RepaintFrame) { + // If the frame's background is propagated to an ancestor, walk up to + // that ancestor and apply the RepaintFrame change hint to it. + nsStyleContext *bgSC; + nsIFrame* propagatedFrame = aFrame; + while (!nsCSSRendering::FindBackground(propagatedFrame, &bgSC)) { + propagatedFrame = propagatedFrame->GetParent(); + NS_ASSERTION(aFrame, "root frame must paint"); + } + + if (propagatedFrame != aFrame) { + DoApplyRenderingChangeToTree(propagatedFrame, nsChangeHint_RepaintFrame); + aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame); + if (!aChange) { + return; + } + } + } DoApplyRenderingChangeToTree(aFrame, aChange); #ifdef DEBUG gInApplyRenderingChangeToTree = false; diff --git a/layout/reftests/bugs/1013054-1-ref.html b/layout/reftests/bugs/1013054-1-ref.html new file mode 100644 index 000000000000..e26a17cb1cd7 --- /dev/null +++ b/layout/reftests/bugs/1013054-1-ref.html @@ -0,0 +1,3 @@ + + +Hello diff --git a/layout/reftests/bugs/1013054-1.html b/layout/reftests/bugs/1013054-1.html new file mode 100644 index 000000000000..1942f939e6f2 --- /dev/null +++ b/layout/reftests/bugs/1013054-1.html @@ -0,0 +1,13 @@ + + +Hello + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 7dc28038d4f0..482fd05ef2f3 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1811,6 +1811,7 @@ skip-if(Android) == 966510-2.html 966510-2-ref.html # same as above fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,24) == 991046-1.html 991046-1-ref.html pref(layout.css.overflow-clip-box.enabled,true) == 992447.html 992447-ref.html pref(layout.css.sticky.enabled,true) == 1005405-1.html 1005405-1-ref.html +== 1013054-1.html 1013054-1-ref.html pref(layout.css.will-change.enabled,true) == 1018522-1.html 1018522-1-ref.html pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html == 1022612-1.html 1022612-1-ref.html