Bug 1504659 Part 1: Make RefreshVisualViewportSize allow non-APZ zooming, and call it during RefreshViewportSize. r=botond
☠☠ backed out by 4e65e04a0d2b ☠ ☠
authorBrad Werth <bwerth@mozilla.com>
Wed, 05 Dec 2018 17:16:34 +0000
changeset 508654 45f63618f66e184f8b20da48fe37fb3f546094f2
parent 508653 89fd36f5fbe5e90bf16563342819fa6700431ccb
child 508655 f2574f5b186e520f5ee9a1626c8bc828f2761bf1
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1504659
milestone65.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 1504659 Part 1: Make RefreshVisualViewportSize allow non-APZ zooming, and call it during RefreshViewportSize. r=botond Differential Revision: https://phabricator.services.mozilla.com/D13173
layout/base/MobileViewportManager.cpp
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -392,20 +392,16 @@ void MobileViewportManager::UpdateDispla
         scrollable, nsLayoutUtils::RepaintMode::DoNotRepaint);
   }
 }
 
 void MobileViewportManager::RefreshVisualViewportSize() {
   // This function is a subset of RefreshViewportSize, and only updates the
   // visual viewport size.
 
-  if (!gfxPrefs::APZAllowZooming()) {
-    return;
-  }
-
   ScreenIntSize displaySize = ViewAs<ScreenPixel>(
       mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds);
 
   CSSToLayoutDeviceScale cssToDev =
       mPresShell->GetPresContext()->CSSToDevPixelScale();
   LayoutDeviceToLayerScale res(mPresShell->GetResolution());
   CSSToScreenScale zoom = ViewTargetAs<ScreenPixel>(
       cssToDev * res / ParentLayerToLayerScale(1),
@@ -471,16 +467,20 @@ void MobileViewportManager::RefreshViewp
   // If it's the first-paint or the viewport changed, we need to update
   // various APZ properties (the zoom and some things that might depend on it)
   MVM_LOG("%p: Updating properties because %d || %d\n", this, mIsFirstPaint,
           mMobileViewportSize != viewport);
 
   if (gfxPrefs::APZAllowZooming()) {
     UpdateResolution(viewportInfo, displaySize, viewport,
                      displayWidthChangeRatio, UpdateType::ViewportSize);
+  } else {
+    // Even without zoom, we need to update that the visual viewport size
+    // has changed.
+    RefreshVisualViewportSize();
   }
   if (gfxPlatform::AsyncPanZoomEnabled()) {
     UpdateDisplayPortMargins();
   }
 
   CSSSize oldSize = mMobileViewportSize;
 
   // Update internal state.