Bug 1633488 - Stop listening for FullZoomChange in MobileViewportManager. r=botond
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 28 Apr 2020 05:06:44 +0000
changeset 526576 897f08396a2f09f5b4c4fc3d354bd6e3f0acdcd2
parent 526575 92172b9cef6b88934c7d54beb7e3d311a69df127
child 526577 929422dd5bc617b86714d9140d23f6ceb20fe6b4
push id37358
push useropoprus@mozilla.com
push dateWed, 29 Apr 2020 03:05:14 +0000
treeherdermozilla-central@6bb8423186c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1633488
milestone77.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 1633488 - Stop listening for FullZoomChange in MobileViewportManager. r=botond When the full zoom changes, it affects the layout viewport, and thus RefreshViewportSize(false) gets called via PresShell::ResizeReflow, so it's not needed. This is in preparation to firing FullZoomChange only in the browser element. Differential Revision: https://phabricator.services.mozilla.com/D72711
layout/base/MobileViewportManager.cpp
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -19,46 +19,43 @@
 
 static mozilla::LazyLogModule sApzMvmLog("apz.mobileviewport");
 #define MVM_LOG(...) MOZ_LOG(sApzMvmLog, LogLevel::Debug, (__VA_ARGS__))
 
 NS_IMPL_ISUPPORTS(MobileViewportManager, nsIDOMEventListener, nsIObserver)
 
 #define DOM_META_ADDED NS_LITERAL_STRING("DOMMetaAdded")
 #define DOM_META_CHANGED NS_LITERAL_STRING("DOMMetaChanged")
-#define FULL_ZOOM_CHANGE NS_LITERAL_STRING("FullZoomChange")
 #define LOAD NS_LITERAL_STRING("load")
 #define BEFORE_FIRST_PAINT NS_LITERAL_CSTRING("before-first-paint")
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
 MobileViewportManager::MobileViewportManager(MVMContext* aContext)
     : mContext(aContext), mIsFirstPaint(false), mPainted(false) {
   MOZ_ASSERT(mContext);
 
   MVM_LOG("%p: creating with context %p\n", this, mContext.get());
 
   mContext->AddEventListener(DOM_META_ADDED, this, false);
   mContext->AddEventListener(DOM_META_CHANGED, this, false);
-  mContext->AddEventListener(FULL_ZOOM_CHANGE, this, false);
   mContext->AddEventListener(LOAD, this, true);
 
   mContext->AddObserver(this, BEFORE_FIRST_PAINT.Data(), false);
 }
 
 MobileViewportManager::~MobileViewportManager() = default;
 
 void MobileViewportManager::Destroy() {
   MVM_LOG("%p: destroying\n", this);
 
   mContext->RemoveEventListener(DOM_META_ADDED, this, false);
   mContext->RemoveEventListener(DOM_META_CHANGED, this, false);
-  mContext->RemoveEventListener(FULL_ZOOM_CHANGE, this, false);
   mContext->RemoveEventListener(LOAD, this, true);
 
   mContext->RemoveObserver(this, BEFORE_FIRST_PAINT.Data());
 
   mContext->Destroy();
   mContext = nullptr;
 }
 
@@ -127,19 +124,16 @@ MobileViewportManager::HandleEvent(dom::
   nsAutoString type;
   event->GetType(type);
 
   if (type.Equals(DOM_META_ADDED)) {
     HandleDOMMetaAdded();
   } else if (type.Equals(DOM_META_CHANGED)) {
     MVM_LOG("%p: got a dom-meta-changed event\n", this);
     RefreshViewportSize(mPainted);
-  } else if (type.Equals(FULL_ZOOM_CHANGE)) {
-    MVM_LOG("%p: got a full-zoom-change event\n", this);
-    RefreshViewportSize(false);
   } else if (type.Equals(LOAD)) {
     MVM_LOG("%p: got a load event\n", this);
     if (!mPainted) {
       // Load event got fired before the before-first-paint message
       SetInitialViewport();
     }
   }
   return NS_OK;