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 350399 bdc62dc8c7d1167f8e9cf5c25f67c8b95bb63bc3
parent 350398 5d734d96dc24cd7107bfeda30451f93d963ee9a5
child 350400 93dcc6faa48fe53df0408e909442f53f58303a13
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn, ritu
bugs1304052
milestone50.0
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");