Bug 1453668 - Restrict the retained display list stacking context optimization to frames that are also containing blocks for position:fixed. r=miko
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 16 Apr 2018 14:23:47 +1200
changeset 467480 229be2ad5ee3a60ddc31568792725bee2a6564dc
parent 467479 c783649db622b222fbe2477998006cb3d20a1ff9
child 467481 32220a5b1ba8827b89a099b1c7ebd02a88e18241
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko
bugs1453668
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453668 - Restrict the retained display list stacking context optimization to frames that are also containing blocks for position:fixed. r=miko MozReview-Commit-ID: GP4uMpR2Lq0
layout/painting/RetainedDisplayListBuilder.cpp
layout/reftests/display-list/retained-dl-style-change-stacking-context-1.html
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -747,17 +747,18 @@ ProcessFrame(nsIFrame* aFrame, nsDisplay
       aOverflow.IntersectRect(aOverflow, currentFrame->GetVisualOverflowRectRelativeToSelf());
     }
 
     if (aOverflow.IsEmpty()) {
       break;
     }
 
     if (currentFrame != aBuilder.RootReferenceFrame() &&
-        currentFrame->IsStackingContext()) {
+        currentFrame->IsStackingContext() &&
+        currentFrame->IsFixedPosContainingBlock()) {
       CRR_LOG("Frame belongs to stacking context frame %p\n", currentFrame);
       // If we found an intermediate stacking context with an existing display item
       // then we can store the dirty rect there and stop. If we couldn't find one then
       // we need to keep bubbling up to the next stacking context.
       nsDisplayItem* wrapperItem = GetFirstDisplayItemWithChildren(currentFrame);
       if (!wrapperItem) {
         continue;
       }
--- a/layout/reftests/display-list/retained-dl-style-change-stacking-context-1.html
+++ b/layout/reftests/display-list/retained-dl-style-change-stacking-context-1.html
@@ -12,22 +12,18 @@
   }
 </style>
 </head>
 <body>
   <div id="first" style="background-color:green; width:200px; height:200px" class="reftest-no-display-list"></div>
   <div style="transform:translateZ(1px)">
     <div id="second" style="background-color:red"></div>
   </div>
-  <div style="position:fixed; left:100px">
-    <div id="third" style="background-color:red"></div>
-  </div>
 </body>
 <script>
 function doTest() {
   document.getElementById("second").style.backgroundColor = "green";
-  document.getElementById("third").style.backgroundColor = "green";
   document.documentElement.removeAttribute("class");
 }
 
 window.addEventListener("MozReftestInvalidate", doTest);
 </script>
 </html>