Bug 1501665 Part 5: Change UpdateShouldBuildAsyncZoomContainer to check if document is zoomable. r=botond
authorBrad Werth <bwerth@mozilla.com>
Mon, 18 Mar 2019 14:57:20 +0000
changeset 464840 05efd157254b238c0bcb14807bf8ce2ddec20250
parent 464839 7a7781e568c2a8509de7a51dbb68878514d99417
child 464841 7d0c48d43cbd967bd70aa05fb1866571f061324f
push id35727
push userdvarga@mozilla.com
push dateTue, 19 Mar 2019 09:48:59 +0000
treeherdermozilla-central@70baa37ae1eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1501665
milestone68.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 1501665 Part 5: Change UpdateShouldBuildAsyncZoomContainer to check if document is zoomable. r=botond Also update ScrollFrameHelper::LayoutScrollbars() to correctly handle overlay scrollbars when zoomed in in RDM. Differential Revision: https://phabricator.services.mozilla.com/D20591
layout/generic/nsGfxScrollFrame.cpp
layout/painting/nsDisplayList.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -5916,20 +5916,21 @@ void ScrollFrameHelper::LayoutScrollbars
                                          const nsRect& aContentArea,
                                          const nsRect& aOldScrollArea) {
   NS_ASSERTION(!mSuppressScrollbarUpdate, "This should have been suppressed");
 
   nsIPresShell* presShell = mOuter->PresShell();
 
   bool hasResizer = HasResizer();
   bool scrollbarOnLeft = !IsScrollbarOnRight();
+  bool overlayScrollBars =
+      LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) ||
+      presShell->GetDocument()->InRDMPane();
   bool overlayScrollBarsWithZoom =
-      mIsRoot &&
-      LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) &&
-      presShell->IsVisualViewportSizeSet();
+      overlayScrollBars && mIsRoot && presShell->IsVisualViewportSizeSet();
 
   nsSize scrollPortClampingSize = mScrollPort.Size();
   double res = 1.0;
   if (overlayScrollBarsWithZoom) {
     scrollPortClampingSize = presShell->GetVisualViewportSize();
     res = presShell->GetCumulativeResolution();
   }
 
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1256,17 +1256,18 @@ AnimatedGeometryRoot* nsDisplayListBuild
     if (viewportFrame) {
       return FindAnimatedGeometryRootFor(viewportFrame);
     }
   }
   return FindAnimatedGeometryRootFor(aItem->Frame());
 }
 
 void nsDisplayListBuilder::UpdateShouldBuildAsyncZoomContainer() {
-  mBuildAsyncZoomContainer = gfxPrefs::APZAllowZooming() &&
+  Document* document = mReferenceFrame->PresContext()->Document();
+  mBuildAsyncZoomContainer = nsLayoutUtils::AllowZoomingForDocument(document) &&
                              !gfxPrefs::LayoutUseContainersForRootFrames();
 }
 
 bool nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
                                                         nsIFrame* aFrame) {
   MOZ_ASSERT(aFrame->GetParent() == aDirtyFrame);
   nsRect dirty;
   nsRect visible = OutOfFlowDisplayData::ComputeVisibleRectForFrame(