Bug 1304052 - Use the unprefixed fullscreenchange event, and register the listener in the system group. r=xidorn, a=ritu
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 22 Sep 2016 09:42:44 -0400
changeset 355741 ca3cbd08d0406e26ef21907477e4438409f1e845
parent 355740 ab151f902b5fff983472eb39f288572709089020
child 355742 da90ddb4a187bd14359b8e1326c7b29cd378318a
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn, ritu
bugs1304052
milestone51.0a2
Bug 1304052 - Use the unprefixed fullscreenchange event, and register the listener in the system group. r=xidorn, a=ritu MozReview-Commit-ID: DH4PrG6BKgE
layout/base/ZoomConstraintsClient.cpp
--- a/layout/base/ZoomConstraintsClient.cpp
+++ b/layout/base/ZoomConstraintsClient.cpp
@@ -24,17 +24,17 @@
 
 #define ZCC_LOG(...)
 // #define ZCC_LOG(...) printf_stderr("ZCC: " __VA_ARGS__)
 
 NS_IMPL_ISUPPORTS(ZoomConstraintsClient, nsIDOMEventListener, nsIObserver)
 
 static const nsLiteralString DOM_META_ADDED = NS_LITERAL_STRING("DOMMetaAdded");
 static const nsLiteralString DOM_META_CHANGED = NS_LITERAL_STRING("DOMMetaChanged");
-static const nsLiteralString FULLSCREEN_CHANGED = NS_LITERAL_STRING("mozfullscreenchange");
+static const nsLiteralString FULLSCREEN_CHANGED = NS_LITERAL_STRING("fullscreenchange");
 static const nsLiteralCString BEFORE_FIRST_PAINT = NS_LITERAL_CSTRING("before-first-paint");
 static const nsLiteralCString NS_PREF_CHANGED = NS_LITERAL_CSTRING("nsPref:changed");
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
 ZoomConstraintsClient::ZoomConstraintsClient() :
   mDocument(nullptr),
@@ -71,17 +71,17 @@ ZoomConstraintsClient::Destroy()
     return;
   }
 
   ZCC_LOG("Destroying %p\n", this);
 
   if (mEventTarget) {
     mEventTarget->RemoveEventListener(DOM_META_ADDED, this, false);
     mEventTarget->RemoveEventListener(DOM_META_CHANGED, this, false);
-    mEventTarget->RemoveEventListener(FULLSCREEN_CHANGED, this, false);
+    mEventTarget->RemoveSystemEventListener(FULLSCREEN_CHANGED, this, false);
     mEventTarget = nullptr;
   }
 
   nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
   if (observerService) {
     observerService->RemoveObserver(this, BEFORE_FIRST_PAINT.Data());
   }
 
@@ -111,17 +111,17 @@ ZoomConstraintsClient::Init(nsIPresShell
   mDocument = aDocument;
 
   if (nsCOMPtr<nsPIDOMWindowOuter> window = mDocument->GetWindow()) {
     mEventTarget = window->GetParentTarget();
   }
   if (mEventTarget) {
     mEventTarget->AddEventListener(DOM_META_ADDED, this, false);
     mEventTarget->AddEventListener(DOM_META_CHANGED, this, false);
-    mEventTarget->AddEventListener(FULLSCREEN_CHANGED, this, false);
+    mEventTarget->AddSystemEventListener(FULLSCREEN_CHANGED, this, false);
   }
 
   nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
   if (observerService) {
     observerService->AddObserver(this, BEFORE_FIRST_PAINT.Data(), false);
   }
 
   Preferences::AddStrongObserver(this, "browser.ui.zoom.force-user-scalable");