Bug 1448841 - Part 3: Disable partial display list building when we have overlay scrollbars. r=mstange
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 29 Mar 2018 23:01:47 +1300
changeset 775154 130a8f287efe6f34a909090b3386fc72ebf4f358
parent 775153 f49364d5ebad1bdc8db3c3b7ef785335feefadc8
child 775155 fba4de2167c2e96e79d4626ad60230c369d902e0
push id104638
push userbmo:jlorenzo@mozilla.com
push dateFri, 30 Mar 2018 13:27:33 +0000
reviewersmstange
bugs1448841
milestone61.0a1
Bug 1448841 - Part 3: Disable partial display list building when we have overlay scrollbars. r=mstange MozReview-Commit-ID: HeMaqItUJdD
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3345,16 +3345,25 @@ ScrollFrameHelper::BuildDisplayList(nsDi
       if (mScrollPosForLayerPixelAlignment == nsPoint(-1,-1)) {
         mScrollPosForLayerPixelAlignment = mScrollPosAtLastPaint;
       }
     } else {
       mScrollPosForLayerPixelAlignment = nsPoint(-1,-1);
     }
   }
 
+  // Adding overlay scrollbars requires us to look at the display list
+  // for the highest z-index item, which isn't possible during partial
+  // building. Mark the frame modified and do a full rebuild of this
+  // scrollframe.
+  if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) &&
+      aBuilder->IsRetainingDisplayList()) {
+    aBuilder->MarkCurrentFrameModifiedDuringBuilding();
+  }
+
   // It's safe to get this value before the DecideScrollableLayer call below
   // because that call cannot create a displayport for root scroll frames,
   // and hence it cannot create an ignore scroll frame.
   bool ignoringThisScrollFrame =
     aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping();
 
   // Overflow clipping can never clip frames outside our subtree, so there
   // is no need to worry about whether we are a moving frame that might clip