Bug 1384565 - Clean up DOMTitleChanged listener. r=billm
authorDão Gottwald <dao@mozilla.com>
Wed, 26 Jul 2017 15:18:05 +0200
changeset 420169 433c42e1980fd609bbe00e82c532af1731a4d8f7
parent 420168 5894beca0ec268b4ec9a592e9545b9c4039080ff
child 420170 32cff21188b719ea9f9228dafbd19d69b4378854
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1384565
milestone56.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 1384565 - Clean up DOMTitleChanged listener. r=billm MozReview-Commit-ID: GFioUI3P6Hk
toolkit/content/browser-child.js
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -420,25 +420,19 @@ var ControllerCommands = {
         break;
     }
   }
 }
 
 ControllerCommands.init()
 
 addEventListener("DOMTitleChanged", function(aEvent) {
-  let document = content.document;
-  switch (aEvent.type) {
-  case "DOMTitleChanged":
-    if (!aEvent.isTrusted || aEvent.target.defaultView != content)
-      return;
-
-    sendAsyncMessage("DOMTitleChanged", { title: document.title });
-    break;
-  }
+  if (!aEvent.isTrusted || aEvent.target.defaultView != content)
+    return;
+  sendAsyncMessage("DOMTitleChanged", { title: content.document.title });
 }, false);
 
 addEventListener("DOMWindowClose", function(aEvent) {
   if (!aEvent.isTrusted)
     return;
   sendAsyncMessage("DOMWindowClose");
 }, false);