From c2c75edc7289711570eaca5c8d730ef3e6072462 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Mon, 18 Mar 2019 14:57:20 +0000 Subject: [PATCH] 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 --HG-- extra : source : 6a84e97d0e62839c3028a3c3ac89cd944f8e39e5 --- layout/generic/nsGfxScrollFrame.cpp | 7 ++++--- layout/painting/nsDisplayList.cpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 39a1bf1019d9..9d262450ef8a 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -5921,10 +5921,11 @@ void ScrollFrameHelper::LayoutScrollbars(nsBoxLayoutState& aState, 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; diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index f234e873fed9..65af591267fd 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1261,7 +1261,8 @@ AnimatedGeometryRoot* nsDisplayListBuilder::FindAnimatedGeometryRootFor( } void nsDisplayListBuilder::UpdateShouldBuildAsyncZoomContainer() { - mBuildAsyncZoomContainer = gfxPrefs::APZAllowZooming() && + Document* document = mReferenceFrame->PresContext()->Document(); + mBuildAsyncZoomContainer = nsLayoutUtils::AllowZoomingForDocument(document) && !gfxPrefs::LayoutUseContainersForRootFrames(); }