Bug 975789 - Sync the computation of whether we have a pseudo stacking context between two different places - r=dbaron
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 27 Feb 2014 15:09:09 -0500
changeset 171352 1b4c49b077908f5d7e0296d3027a269caa1c94e9
parent 171351 de5bdfd57eb317f8b76dd8913ac405112cc25686
child 171353 96c94ab2c0bae926048c625a5ffe5b4dd5e08d17
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersdbaron
bugs975789
milestone30.0a1
Bug 975789 - Sync the computation of whether we have a pseudo stacking context between two different places - r=dbaron
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2198,16 +2198,17 @@ nsIFrame::BuildDisplayListForChild(nsDis
     (isPositioned && (disp->mPosition == NS_STYLE_POSITION_STICKY ||
                       pos->mZIndex.GetUnit() == eStyleUnit_Integer)) ||
      (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
      isVisuallyAtomic || (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
 
   if (isVisuallyAtomic || isPositioned || (!isSVG && disp->IsFloating(child)) ||
       ((disp->mClipFlags & NS_STYLE_CLIP_RECT) &&
        IsSVGContentWithCSSClip(child)) ||
+       (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
       (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
     // If you change this, also change IsPseudoStackingContextFromStyle()
     pseudoStackingContext = true;
   }
   NS_ASSERTION(!isStackingContext || pseudoStackingContext,
                "Stacking contexts must also be pseudo-stacking-contexts");
 
   nsDisplayListBuilder::AutoBuildingDisplayList
@@ -8376,19 +8377,22 @@ void
 nsIFrame::DestroyRegion(void* aPropertyValue)
 {
   delete static_cast<nsRegion*>(aPropertyValue);
 }
 
 bool
 nsIFrame::IsPseudoStackingContextFromStyle() {
   const nsStyleDisplay* disp = StyleDisplay();
+  // If you change this, also change the computation of pseudoStackingContext
+  // in BuildDisplayListForChild()
   return disp->mOpacity != 1.0f ||
          disp->IsPositioned(this) ||
-         disp->IsFloating(this);
+         disp->IsFloating(this) ||
+         (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT);
 }
 
 Element*
 nsIFrame::GetPseudoElement(nsCSSPseudoElements::Type aType)
 {
   nsIFrame* frame = nullptr;
 
   if (aType == nsCSSPseudoElements::ePseudo_before) {