Bug 1589022 - Ignore displayport properties in GetDisplayPortImpl() if APZ is disabled. r=tnikkel
authorBotond Ballo <botond@mozilla.com>
Mon, 11 Nov 2019 09:23:45 +0000
changeset 502511 081aa9877fc18f4ff43201375a12f77bdf4becfb
parent 502510 408a199d1d47d782a0a6f43991d72a00a7a7da49
child 502512 610f541e1fd6e34b31df7fecb0bc14a6ece963b9
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1589022
milestone72.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 1589022 - Ignore displayport properties in GetDisplayPortImpl() if APZ is disabled. r=tnikkel This facilitates disabling APZ "live", such as when moving a tab from an APZ window into a non-APZ window. Depends on D51468 Differential Revision: https://phabricator.services.mozilla.com/D51469
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1063,25 +1063,29 @@ static bool GetDisplayPortImpl(
     MaxSizeExceededBehaviour aBehaviour = MaxSizeExceededBehaviour::Assert) {
   DisplayPortPropertyData* rectData = nullptr;
   DisplayPortMarginsPropertyData* marginsData = nullptr;
 
   if (!GetDisplayPortData(aContent, &rectData, &marginsData)) {
     return false;
   }
 
+  nsIFrame* frame = aContent->GetPrimaryFrame();
+  if (frame && !frame->PresShell()->AsyncPanZoomEnabled()) {
+    return false;
+  }
+
   if (!aResult) {
     // We have displayport data, but the caller doesn't want the actual
     // rect, so we don't need to actually compute it.
     return true;
   }
 
   bool isDisplayportSuppressed = false;
 
-  nsIFrame* frame = aContent->GetPrimaryFrame();
   if (frame) {
     nsPresContext* presContext = frame->PresContext();
     MOZ_ASSERT(presContext);
     PresShell* presShell = presContext->PresShell();
     MOZ_ASSERT(presShell);
     isDisplayportSuppressed = presShell->IsDisplayportSuppressed();
   }