Bug 1508823 - Enable ESLint for dom/browser-element (automatic changes). r=Ehsan
authorMark Banner <standard8@mozilla.com>
Tue, 19 Mar 2019 20:56:10 +0000
changeset 465109 21cd0b75c1c32c030b1ecef94315df2706013d63
parent 465108 7976a9441fb9faa2045c38d16c3b4df7f6c79ac2
child 465110 a52b7d427119e56bf69f22ba85e2ea662cf043a9
push id35732
push useropoprus@mozilla.com
push dateWed, 20 Mar 2019 10:52:37 +0000
treeherdermozilla-central@708979f9c3f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1508823
milestone68.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 1508823 - Enable ESLint for dom/browser-element (automatic changes). r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D21215
dom/browser-element/BrowserElementChild.js
dom/browser-element/BrowserElementChildPreload.js
dom/browser-element/BrowserElementCopyPaste.js
dom/browser-element/BrowserElementParent.jsm
dom/browser-element/BrowserElementPromptService.jsm
dom/browser-element/mochitest/async.js
dom/browser-element/mochitest/browserElementTestHelpers.js
dom/browser-element/mochitest/browserElement_Alert.js
dom/browser-element/mochitest/browserElement_AlertInFrame.js
dom/browser-element/mochitest/browserElement_Auth.js
dom/browser-element/mochitest/browserElement_BackForward.js
dom/browser-element/mochitest/browserElement_BrowserWindowNamespace.js
dom/browser-element/mochitest/browserElement_BrowserWindowResize.js
dom/browser-element/mochitest/browserElement_Close.js
dom/browser-element/mochitest/browserElement_CloseFromOpener.js
dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
dom/browser-element/mochitest/browserElement_CookiesNotThirdParty.js
dom/browser-element/mochitest/browserElement_CopyPaste.js
dom/browser-element/mochitest/browserElement_DataURI.js
dom/browser-element/mochitest/browserElement_DataURILoad.js
dom/browser-element/mochitest/browserElement_DocumentFirstPaint.js
dom/browser-element/mochitest/browserElement_ErrorSecurity.js
dom/browser-element/mochitest/browserElement_ExposableURI.js
dom/browser-element/mochitest/browserElement_FirstPaint.js
dom/browser-element/mochitest/browserElement_ForwardName.js
dom/browser-element/mochitest/browserElement_FrameWrongURI.js
dom/browser-element/mochitest/browserElement_Iconchange.js
dom/browser-element/mochitest/browserElement_LoadEvents.js
dom/browser-element/mochitest/browserElement_Metachange.js
dom/browser-element/mochitest/browserElement_OpenNamed.js
dom/browser-element/mochitest/browserElement_OpenTab.js
dom/browser-element/mochitest/browserElement_OpenWindow.js
dom/browser-element/mochitest/browserElement_OpenWindowDifferentOrigin.js
dom/browser-element/mochitest/browserElement_OpenWindowEmpty.js
dom/browser-element/mochitest/browserElement_OpenWindowInFrame.js
dom/browser-element/mochitest/browserElement_OpenWindowRejected.js
dom/browser-element/mochitest/browserElement_OpenWindowRejected2.js
dom/browser-element/mochitest/browserElement_Opensearch.js
dom/browser-element/mochitest/browserElement_PrivateBrowsing.js
dom/browser-element/mochitest/browserElement_PromptCheck.js
dom/browser-element/mochitest/browserElement_PromptConfirm.js
dom/browser-element/mochitest/browserElement_Reload.js
dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js
dom/browser-element/mochitest/browserElement_ScrollEvent.js
dom/browser-element/mochitest/browserElement_SecurityChange.js
dom/browser-element/mochitest/browserElement_SendEvent.js
dom/browser-element/mochitest/browserElement_Stop.js
dom/browser-element/mochitest/browserElement_TargetBlank.js
dom/browser-element/mochitest/browserElement_TargetTop.js
dom/browser-element/mochitest/browserElement_ThemeColor.js
dom/browser-element/mochitest/browserElement_Titlechange.js
dom/browser-element/mochitest/browserElement_TopBarrier.js
dom/browser-element/mochitest/browserElement_Viewmode.js
dom/browser-element/mochitest/browserElement_XFrameOptions.js
dom/browser-element/mochitest/browserElement_XFrameOptionsAllowFrom.js
dom/browser-element/mochitest/browserElement_XFrameOptionsDeny.js
dom/browser-element/mochitest/browserElement_XFrameOptionsSameOrigin.js
dom/browser-element/mochitest/file_browserElement_AlertInFrame_Inner.html
dom/browser-element/mochitest/file_browserElement_BrowserWindowNamespace.html
dom/browser-element/mochitest/file_browserElement_CloseFromOpener.html
dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html
dom/browser-element/mochitest/file_browserElement_ForwardName.html
dom/browser-element/mochitest/file_browserElement_LoadEvents.html
dom/browser-element/mochitest/file_browserElement_Open1.html
dom/browser-element/mochitest/file_browserElement_OpenNamed.html
dom/browser-element/mochitest/file_browserElement_OpenNamed2.html
dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html
dom/browser-element/mochitest/file_browserElement_OpenWindowRejected.html
dom/browser-element/mochitest/file_browserElement_SecurityChange.html
dom/browser-element/mochitest/file_browserElement_SendEvent.html
dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Inner.html
dom/browser-element/mochitest/file_browserElement_TargetBlank.html
dom/browser-element/mochitest/file_browserElement_TargetTop.html
dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
dom/browser-element/mochitest/file_browserElement_XFrameOptionsDeny.html
dom/browser-element/mochitest/file_empty.html
dom/browser-element/mochitest/file_focus.html
dom/browser-element/mochitest/file_post_request.html
dom/browser-element/mochitest/test_browserElement_NoAttr.html
dom/browser-element/mochitest/test_browserElement_NoPermission.html
dom/browser-element/mochitest/test_browserElement_NoPref.html
--- a/dom/browser-element/BrowserElementChild.js
+++ b/dom/browser-element/BrowserElementChild.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function debug(msg) {
-  //dump("BrowserElementChild - " + msg + "\n");
+  // dump("BrowserElementChild - " + msg + "\n");
 }
 
 // NB: this must happen before we process any messages from
 // mozbrowser API clients.
 docShell.isActive = true;
 
 function parentDocShell(docshell) {
   if (!docshell) {
@@ -31,19 +31,19 @@ function isTopBrowserElement(docShell) {
   }
   return true;
 }
 
 var BrowserElementIsReady;
 
 debug(`Might load BE scripts: BEIR: ${BrowserElementIsReady}`);
 if (!BrowserElementIsReady) {
-  debug("Loading BE scripts")
+  debug("Loading BE scripts");
   if (!("BrowserElementIsPreloaded" in this)) {
-    if(Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
+    if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
       // general content apps
       if (isTopBrowserElement(docShell)) {
         Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementCopyPaste.js", this);
       }
     } else {
       // rocketbar in system app and other in-process case (ex. B2G desktop client)
       Services.scriptloader.loadSubScript("chrome://global/content/BrowserElementCopyPaste.js", this);
     }
@@ -65,9 +65,9 @@ if (!BrowserElementIsReady) {
   }
   addMessageListener("browser-element-api:destroy", onDestroy);
 
   BrowserElementIsReady = true;
 } else {
   debug("BE already loaded, abort");
 }
 
-sendAsyncMessage('browser-element-api:call', { 'msg_name': 'hello' });
+sendAsyncMessage("browser-element-api:call", { "msg_name": "hello" });
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -28,41 +28,41 @@ function sendAsyncMsg(msg, data) {
     return;
   }
 
   if (!data) {
     data = { };
   }
 
   data.msg_name = msg;
-  sendAsyncMessage('browser-element-api:call', data);
+  sendAsyncMessage("browser-element-api:call", data);
 }
 
 function sendSyncMsg(msg, data) {
   // Ensure that we don't send any messages before BrowserElementChild.js
   // finishes loading.
   if (!BrowserElementIsReady) {
     return;
   }
 
   if (!data) {
     data = { };
   }
 
   data.msg_name = msg;
-  return sendSyncMessage('browser-element-api:call', data);
+  return sendSyncMessage("browser-element-api:call", data);
 }
 
-var CERTIFICATE_ERROR_PAGE_PREF = 'security.alternate_certificate_error_page';
+var CERTIFICATE_ERROR_PAGE_PREF = "security.alternate_certificate_error_page";
 
 var OBSERVED_EVENTS = [
-  'xpcom-shutdown',
-  'audio-playback',
-  'activity-done',
-  'will-launch-app'
+  "xpcom-shutdown",
+  "audio-playback",
+  "activity-done",
+  "will-launch-app",
 ];
 
 var LISTENED_EVENTS = [
   { type: "DOMTitleChanged", useCapture: true, wantsUntrusted: false },
   { type: "DOMLinkAdded", useCapture: true, wantsUntrusted: false },
   { type: "MozScrolledAreaChanged", useCapture: true, wantsUntrusted: false },
   { type: "MozDOMFullscreen:Request", useCapture: true, wantsUntrusted: false },
   { type: "MozDOMFullscreen:NewOrigin", useCapture: true, wantsUntrusted: false },
@@ -105,24 +105,24 @@ var global = this;
 
 function BrowserElementChild() {
   // Maps outer window id --> weak ref to window.  Used by modal dialog code.
   this._windowIDDict = {};
 
   this._isContentWindowCreated = false;
 
   this._init();
-};
+}
 
 BrowserElementChild.prototype = {
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
 
-  _init: function() {
+  _init() {
     debug("Starting up.");
 
     BrowserElementPromptService.mapWindowToBrowserElementChild(content, this);
 
     docShell.QueryInterface(Ci.nsIWebProgress)
             .addProgressListener(this._progressListener,
                                  Ci.nsIWebProgress.NOTIFY_LOCATION |
                                  Ci.nsIWebProgress.NOTIFY_SECURITY |
@@ -132,35 +132,35 @@ BrowserElementChild.prototype = {
     if (!webNavigation.sessionHistory) {
       // XXX(nika): I don't think this code should ever be hit? We should run
       // TabChild::Init before we run this code which will perform this setup
       // for us.
       docShell.initSessionHistory();
     }
 
     // This is necessary to get security web progress notifications.
-    var securityUI = Cc['@mozilla.org/secure_browser_ui;1']
+    var securityUI = Cc["@mozilla.org/secure_browser_ui;1"]
                        .createInstance(Ci.nsISecureBrowserUI);
     securityUI.init(docShell);
 
     // A cache of the menuitem dom objects keyed by the id we generate
     // and pass to the embedder
     this._ctxHandlers = {};
     // Counter of contextmenu events fired
     this._ctxCounter = 0;
 
     this._shuttingDown = false;
 
     LISTENED_EVENTS.forEach(event => {
       addEventListener(event.type, this, event.useCapture, event.wantsUntrusted);
     });
 
     // Registers a MozAfterPaint handler for the very first paint.
-    this._addMozAfterPaintHandler(function () {
-      sendAsyncMsg('firstpaint');
+    this._addMozAfterPaintHandler(function() {
+      sendAsyncMsg("firstpaint");
     });
 
     addMessageListener("browser-element-api:call", this);
 
     let els = Cc["@mozilla.org/eventlistenerservice;1"]
                 .getService(Ci.nsIEventListenerService);
     LISTENED_SYSTEM_EVENTS.forEach(event => {
       els.addSystemEventListener(global, event.type, this, event.useCapture);
@@ -172,17 +172,17 @@ BrowserElementChild.prototype = {
   },
 
   /**
    * Shut down the frame's side of the browser API.  This is called when:
    *   - our TabChildGlobal starts to die
    *   - the content is moved to frame without the browser API
    * This is not called when the page inside |content| unloads.
    */
-  destroy: function() {
+  destroy() {
     debug("Destroying");
     this._shuttingDown = true;
 
     BrowserElementPromptService.unmapWindowToBrowserElementChild(content);
 
     docShell.QueryInterface(Ci.nsIWebProgress)
             .removeProgressListener(this._progressListener);
 
@@ -198,17 +198,17 @@ BrowserElementChild.prototype = {
       els.removeSystemEventListener(global, event.type, this, event.useCapture);
     });
 
     OBSERVED_EVENTS.forEach((aTopic) => {
       Services.obs.removeObserver(this, aTopic);
     });
   },
 
-  handleEvent: function(event) {
+  handleEvent(event) {
     switch (event.type) {
       case "DOMTitleChanged":
         this._titleChangedHandler(event);
         break;
       case "DOMLinkAdded":
         this._linkAddedHandler(event);
         break;
       case "MozScrolledAreaChanged":
@@ -254,66 +254,66 @@ BrowserElementChild.prototype = {
         this._contextmenuHandler(event);
         break;
       case "scroll":
         this._scrollEventHandler(event);
         break;
     }
   },
 
-  receiveMessage: function(message) {
+  receiveMessage(message) {
     let self = this;
 
     let mmCalls = {
       "send-mouse-event": this._recvSendMouseEvent,
       "get-can-go-back": this._recvCanGoBack,
       "get-can-go-forward": this._recvCanGoForward,
       "go-back": this._recvGoBack,
       "go-forward": this._recvGoForward,
       "reload": this._recvReload,
       "stop": this._recvStop,
       "zoom": this._recvZoom,
       "unblock-modal-prompt": this._recvStopWaiting,
       "fire-ctx-callback": this._recvFireCtxCallback,
       "owner-visibility-change": this._recvOwnerVisibilityChange,
       "entered-fullscreen": this._recvEnteredFullscreen,
       "exit-fullscreen": this._recvExitFullscreen,
-    }
+    };
 
     if (message.data.msg_name in mmCalls) {
       return mmCalls[message.data.msg_name].apply(self, arguments);
     }
   },
 
   _paintFrozenTimer: null,
-  observe: function(subject, topic, data) {
+  observe(subject, topic, data) {
     // Ignore notifications not about our document.  (Note that |content| /can/
     // be null; see bug 874900.)
 
-    if (topic !== 'activity-done' &&
-        topic !== 'audio-playback' &&
-        topic !== 'will-launch-app' &&
+    if (topic !== "activity-done" &&
+        topic !== "audio-playback" &&
+        topic !== "will-launch-app" &&
         (!content || subject !== content.document)) {
       return;
     }
-    if (topic == 'activity-done' && docShell !== subject)
+    if (topic == "activity-done" && docShell !== subject)
       return;
     switch (topic) {
-      case 'activity-done':
-        sendAsyncMsg('activitydone', { success: (data == 'activity-success') });
+      case "activity-done":
+        sendAsyncMsg("activitydone", { success: (data == "activity-success") });
         break;
-      case 'audio-playback':
+      case "audio-playback":
         if (subject === content) {
-          sendAsyncMsg('audioplaybackchange', { _payload_: data });
+          sendAsyncMsg("audioplaybackchange", { _payload_: data });
         }
         break;
-      case 'xpcom-shutdown':
+      case "xpcom-shutdown":
         this._shuttingDown = true;
         break;
-      case 'will-launch-app':
+      case "will-launch-app":
         // If the launcher is not visible, let's ignore the message.
         if (!docShell.isActive) {
           return;
         }
 
         // If this is not a content process, let's not freeze painting.
         if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_CONTENT) {
           return;
@@ -322,60 +322,59 @@ BrowserElementChild.prototype = {
         docShell.contentViewer.pausePainting();
 
         this._paintFrozenTimer && this._paintFrozenTimer.cancel();
         this._paintFrozenTimer = new Timer(this, 3000, Ci.nsITimer.TYPE_ONE_SHOT);
         break;
     }
   },
 
-  notify: function(timer) {
+  notify(timer) {
     docShell.contentViewer.resumePainting();
     this._paintFrozenTimer.cancel();
     this._paintFrozenTimer = null;
   },
 
   get _windowUtils() {
     return content.document.defaultView.windowUtils;
   },
 
-  _tryGetInnerWindowID: function(win) {
+  _tryGetInnerWindowID(win) {
     let utils = win.windowUtils;
     try {
       return utils.currentInnerWindowID;
-    }
-    catch(e) {
+    } catch (e) {
       return null;
     }
   },
 
   /**
    * Show a modal prompt.  Called by BrowserElementPromptService.
    */
-  showModalPrompt: function(win, args) {
+  showModalPrompt(win, args) {
     let utils = win.windowUtils;
 
     args.windowID = { outer: utils.outerWindowID,
                       inner: this._tryGetInnerWindowID(win) };
-    sendAsyncMsg('showmodalprompt', args);
+    sendAsyncMsg("showmodalprompt", args);
 
     let returnValue = this._waitForResult(win);
 
-    if (args.promptType == 'prompt' ||
-        args.promptType == 'confirm' ||
-        args.promptType == 'custom-prompt') {
+    if (args.promptType == "prompt" ||
+        args.promptType == "confirm" ||
+        args.promptType == "custom-prompt") {
       return returnValue;
     }
   },
 
   /**
    * Spin in a nested event loop until we receive a unblock-modal-prompt message for
    * this window.
    */
-  _waitForResult: function(win) {
+  _waitForResult(win) {
     debug("_waitForResult(" + win + ")");
     let utils = win.windowUtils;
 
     let outerWindowID = utils.outerWindowID;
     let innerWindowID = this._tryGetInnerWindowID(win);
     if (innerWindowID === null) {
       // I have no idea what waiting for a result means when there's no inner
       // window, so let's just bail.
@@ -431,17 +430,17 @@ BrowserElementChild.prototype = {
       utils.leaveModalState();
     }
 
     debug("Leaving modal state (outerID=" + outerWindowID + ", " +
                                "innerID=" + innerWindowID + ")");
     return returnValue;
   },
 
-  _recvStopWaiting: function(msg) {
+  _recvStopWaiting(msg) {
     let outerID = msg.json.windowID.outer;
     let innerID = msg.json.windowID.inner;
     let returnValue = msg.json.returnValue;
     debug("recvStopWaiting(outer=" + outerID + ", inner=" + innerID +
           ", returnValue=" + returnValue + ")");
 
     if (!this._windowIDDict[outerID]) {
       debug("recvStopWaiting: No record of outer window ID " + outerID);
@@ -460,570 +459,566 @@ BrowserElementChild.prototype = {
       return;
     }
 
     debug("recvStopWaiting " + win);
     win.modalReturnValue = returnValue;
     win.modalDepth--;
   },
 
-  _recvEnteredFullscreen: function() {
+  _recvEnteredFullscreen() {
     if (!this._windowUtils.handleFullscreenRequests() &&
         !content.document.fullscreenElement) {
       // If we don't actually have any pending fullscreen request
       // to handle, neither we have been in fullscreen, tell the
       // parent to just exit.
       sendAsyncMsg("exit-dom-fullscreen");
     }
   },
 
-  _recvExitFullscreen: function() {
+  _recvExitFullscreen() {
     this._windowUtils.exitFullscreen();
   },
 
-  _titleChangedHandler: function(e) {
+  _titleChangedHandler(e) {
     debug("Got titlechanged: (" + e.target.title + ")");
     var win = e.target.defaultView;
 
     // Ignore titlechanges which don't come from the top-level
     // <iframe mozbrowser> window.
     if (win == content) {
-      sendAsyncMsg('titlechange', { _payload_: e.target.title });
-    }
-    else {
+      sendAsyncMsg("titlechange", { _payload_: e.target.title });
+    } else {
       debug("Not top level!");
     }
   },
 
-  _maybeCopyAttribute: function(src, target, attribute) {
+  _maybeCopyAttribute(src, target, attribute) {
     if (src.getAttribute(attribute)) {
       target[attribute] = src.getAttribute(attribute);
     }
   },
 
-  _iconChangedHandler: function(e) {
-    debug('Got iconchanged: (' + e.target.href + ')');
+  _iconChangedHandler(e) {
+    debug("Got iconchanged: (" + e.target.href + ")");
     let icon = { href: e.target.href };
-    this._maybeCopyAttribute(e.target, icon, 'sizes');
-    this._maybeCopyAttribute(e.target, icon, 'rel');
-    sendAsyncMsg('iconchange', icon);
+    this._maybeCopyAttribute(e.target, icon, "sizes");
+    this._maybeCopyAttribute(e.target, icon, "rel");
+    sendAsyncMsg("iconchange", icon);
   },
 
-  _openSearchHandler: function(e) {
-    debug('Got opensearch: (' + e.target.href + ')');
+  _openSearchHandler(e) {
+    debug("Got opensearch: (" + e.target.href + ")");
 
     if (e.target.type !== "application/opensearchdescription+xml") {
       return;
     }
 
-    sendAsyncMsg('opensearch', { title: e.target.title,
+    sendAsyncMsg("opensearch", { title: e.target.title,
                                  href: e.target.href });
-
   },
 
   // Processes the "rel" field in <link> tags and forward to specific handlers.
-  _linkAddedHandler: function(e) {
+  _linkAddedHandler(e) {
     let win = e.target.ownerGlobal;
     // Ignore links which don't come from the top-level
     // <iframe mozbrowser> window.
     if (win != content) {
-      debug('Not top level!');
+      debug("Not top level!");
       return;
     }
 
     let handlers = {
-      'icon': this._iconChangedHandler.bind(this),
-      'apple-touch-icon': this._iconChangedHandler.bind(this),
-      'apple-touch-icon-precomposed': this._iconChangedHandler.bind(this),
-      'search': this._openSearchHandler,
+      "icon": this._iconChangedHandler.bind(this),
+      "apple-touch-icon": this._iconChangedHandler.bind(this),
+      "apple-touch-icon-precomposed": this._iconChangedHandler.bind(this),
+      "search": this._openSearchHandler,
     };
 
-    debug('Got linkAdded: (' + e.target.href + ') ' + e.target.rel);
-    e.target.rel.split(' ').forEach(function(x) {
+    debug("Got linkAdded: (" + e.target.href + ") " + e.target.rel);
+    e.target.rel.split(" ").forEach(function(x) {
       let token = x.toLowerCase();
       if (handlers[token]) {
         handlers[token](e);
       }
     }, this);
   },
 
-  _metaChangedHandler: function(e) {
+  _metaChangedHandler(e) {
     let win = e.target.ownerGlobal;
     // Ignore metas which don't come from the top-level
     // <iframe mozbrowser> window.
     if (win != content) {
-      debug('Not top level!');
+      debug("Not top level!");
       return;
     }
 
     var name = e.target.name;
     var property = e.target.getAttributeNS(null, "property");
 
     if (!name && !property) {
       return;
     }
 
-    debug('Got metaChanged: (' + (name || property) + ') ' +
+    debug("Got metaChanged: (" + (name || property) + ") " +
           e.target.content);
 
     let handlers = {
-      'viewmode': this._genericMetaHandler,
-      'theme-color': this._genericMetaHandler,
-      'theme-group': this._genericMetaHandler,
-      'application-name': this._applicationNameChangedHandler
+      "viewmode": this._genericMetaHandler,
+      "theme-color": this._genericMetaHandler,
+      "theme-group": this._genericMetaHandler,
+      "application-name": this._applicationNameChangedHandler,
     };
     let handler = handlers[name];
 
     if ((property || name).match(/^og:/)) {
       name = property || name;
       handler = this._genericMetaHandler;
     }
 
     if (handler) {
       handler(name, e.type, e.target);
     }
   },
 
-  _applicationNameChangedHandler: function(name, eventType, target) {
-    if (eventType !== 'DOMMetaAdded') {
+  _applicationNameChangedHandler(name, eventType, target) {
+    if (eventType !== "DOMMetaAdded") {
       // Bug 1037448 - Decide what to do when <meta name="application-name">
       // changes
       return;
     }
 
-    let meta = { name: name,
+    let meta = { name,
                  content: target.content };
 
     let lang;
     let elm;
 
     for (elm = target;
          !lang && elm && elm.nodeType == target.ELEMENT_NODE;
          elm = elm.parentNode) {
-      if (elm.hasAttribute('lang')) {
-        lang = elm.getAttribute('lang');
+      if (elm.hasAttribute("lang")) {
+        lang = elm.getAttribute("lang");
         continue;
       }
 
-      if (elm.hasAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang')) {
-        lang = elm.getAttributeNS('http://www.w3.org/XML/1998/namespace', 'lang');
+      if (elm.hasAttributeNS("http://www.w3.org/XML/1998/namespace", "lang")) {
+        lang = elm.getAttributeNS("http://www.w3.org/XML/1998/namespace", "lang");
         continue;
       }
     }
 
     // No lang has been detected.
     if (!lang && elm.nodeType == target.DOCUMENT_NODE) {
       lang = elm.contentLanguage;
     }
 
     if (lang) {
       meta.lang = lang;
     }
 
-    sendAsyncMsg('metachange', meta);
+    sendAsyncMsg("metachange", meta);
   },
 
-  _ScrollViewChangeHandler: function(e) {
+  _ScrollViewChangeHandler(e) {
     e.stopPropagation();
     let detail = {
       state: e.state,
     };
-    sendAsyncMsg('scrollviewchange', detail);
+    sendAsyncMsg("scrollviewchange", detail);
   },
 
-  _ClickHandler: function(e) {
-
+  _ClickHandler(e) {
     let isHTMLLink = node =>
         ((ChromeUtils.getClassName(node) === "HTMLAnchorElement" && node.href) ||
          (ChromeUtils.getClassName(node) === "HTMLAreaElement" && node.href) ||
          ChromeUtils.getClassName(node) === "HTMLLinkElement");
 
     // Open in a new tab if middle click or ctrl/cmd-click,
     // and e.target is a link or inside a link.
-    if ((Services.appinfo.OS == 'Darwin' && e.metaKey) ||
-        (Services.appinfo.OS != 'Darwin' && e.ctrlKey) ||
+    if ((Services.appinfo.OS == "Darwin" && e.metaKey) ||
+        (Services.appinfo.OS != "Darwin" && e.ctrlKey) ||
          e.button == 1) {
-
       let node = e.target;
       while (node && !isHTMLLink(node)) {
         node = node.parentNode;
       }
 
       if (node) {
-        sendAsyncMsg('opentab', {url: node.href});
+        sendAsyncMsg("opentab", {url: node.href});
       }
     }
   },
 
-  _genericMetaHandler: function(name, eventType, target) {
+  _genericMetaHandler(name, eventType, target) {
     let meta = {
-      name: name,
+      name,
       content: target.content,
-      type: eventType.replace('DOMMeta', '').toLowerCase()
+      type: eventType.replace("DOMMeta", "").toLowerCase(),
     };
-    sendAsyncMsg('metachange', meta);
+    sendAsyncMsg("metachange", meta);
   },
 
-  _addMozAfterPaintHandler: function(callback) {
+  _addMozAfterPaintHandler(callback) {
     function onMozAfterPaint() {
       let uri = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
       if (uri.spec != "about:blank") {
         debug("Got afterpaint event: " + uri.spec);
-        removeEventListener('MozAfterPaint', onMozAfterPaint,
+        removeEventListener("MozAfterPaint", onMozAfterPaint,
                             /* useCapture = */ true);
         callback();
       }
     }
 
-    addEventListener('MozAfterPaint', onMozAfterPaint, /* useCapture = */ true);
+    addEventListener("MozAfterPaint", onMozAfterPaint, /* useCapture = */ true);
     return onMozAfterPaint;
   },
 
-  _windowCloseHandler: function(e) {
+  _windowCloseHandler(e) {
     let win = e.target;
     if (win != content || e.defaultPrevented) {
       return;
     }
 
     debug("Closing window " + win);
-    sendAsyncMsg('close');
+    sendAsyncMsg("close");
 
     // Inform the window implementation that we handled this close ourselves.
     e.preventDefault();
   },
 
-  _windowCreatedHandler: function(e) {
+  _windowCreatedHandler(e) {
     let targetDocShell = e.target.defaultView.docShell;
     if (targetDocShell != docShell) {
       return;
     }
 
     let uri = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
     debug("Window created: " + uri.spec);
     if (uri.spec != "about:blank") {
-      this._addMozAfterPaintHandler(function () {
-        sendAsyncMsg('documentfirstpaint');
+      this._addMozAfterPaintHandler(function() {
+        sendAsyncMsg("documentfirstpaint");
       });
       this._isContentWindowCreated = true;
     }
   },
 
-  _windowResizeHandler: function(e) {
+  _windowResizeHandler(e) {
     let win = e.target;
     if (win != content || e.defaultPrevented) {
       return;
     }
 
     debug("resizing window " + win);
-    sendAsyncMsg('resize', { width: e.detail.width, height: e.detail.height });
+    sendAsyncMsg("resize", { width: e.detail.width, height: e.detail.height });
 
     // Inform the window implementation that we handled this resize ourselves.
     e.preventDefault();
   },
 
-  _contextmenuHandler: function(e) {
+  _contextmenuHandler(e) {
     debug("Got contextmenu");
 
     if (e.defaultPrevented) {
       return;
     }
 
     this._ctxCounter++;
     this._ctxHandlers = {};
 
     var elem = e.target;
     var menuData = {systemTargets: [], contextmenu: null};
     var ctxMenuId = null;
-    var clipboardPlainTextOnly = Services.prefs.getBoolPref('clipboard.plainTextOnly');
+    var clipboardPlainTextOnly = Services.prefs.getBoolPref("clipboard.plainTextOnly");
     var copyableElements = {
       image: false,
       link: false,
-      hasElements: function() {
+      hasElements() {
         return this.image || this.link;
-      }
+      },
     };
 
     // Set the event target as the copy image command needs it to
     // determine what was context-clicked on.
     docShell.contentViewer.QueryInterface(Ci.nsIContentViewerEdit).setCommandNode(elem);
 
     while (elem && elem.parentNode) {
       var ctxData = this._getSystemCtxMenuData(elem);
       if (ctxData) {
         menuData.systemTargets.push({
           nodeName: elem.nodeName,
-          data: ctxData
+          data: ctxData,
         });
       }
 
-      if (!ctxMenuId && 'hasAttribute' in elem && elem.hasAttribute('contextmenu')) {
-        ctxMenuId = elem.getAttribute('contextmenu');
+      if (!ctxMenuId && "hasAttribute" in elem && elem.hasAttribute("contextmenu")) {
+        ctxMenuId = elem.getAttribute("contextmenu");
       }
 
       // Enable copy image/link option
-      if (elem.nodeName == 'IMG') {
+      if (elem.nodeName == "IMG") {
         copyableElements.image = !clipboardPlainTextOnly;
-      } else if (elem.nodeName == 'A') {
+      } else if (elem.nodeName == "A") {
         copyableElements.link = true;
       }
 
       elem = elem.parentNode;
     }
 
     if (ctxMenuId || copyableElements.hasElements()) {
       var menu = null;
       if (ctxMenuId) {
         menu = e.target.ownerDocument.getElementById(ctxMenuId);
       }
-      menuData.contextmenu = this._buildMenuObj(menu, '', copyableElements);
+      menuData.contextmenu = this._buildMenuObj(menu, "", copyableElements);
     }
 
     // Pass along the position where the context menu should be located
     menuData.clientX = e.clientX;
     menuData.clientY = e.clientY;
     menuData.screenX = e.screenX;
     menuData.screenY = e.screenY;
 
     // The value returned by the contextmenu sync call is true if the embedder
     // called preventDefault() on its contextmenu event.
     //
     // We call preventDefault() on our contextmenu event if the embedder called
     // preventDefault() on /its/ contextmenu event.  This way, if the embedder
     // ignored the contextmenu event, TabChild will fire a click.
-    if (sendSyncMsg('contextmenu', menuData)[0]) {
+    if (sendSyncMsg("contextmenu", menuData)[0]) {
       e.preventDefault();
     } else {
       this._ctxHandlers = {};
     }
   },
 
-  _getSystemCtxMenuData: function(elem) {
+  _getSystemCtxMenuData(elem) {
     let documentURI =
       docShell.QueryInterface(Ci.nsIWebNavigation).currentURI.spec;
 
     if ((ChromeUtils.getClassName(elem) === "HTMLAnchorElement" && elem.href) ||
         (ChromeUtils.getClassName(elem) === "HTMLAreaElement" && elem.href)) {
       return {uri: elem.href,
-              documentURI: documentURI,
+              documentURI,
               text: elem.textContent.substring(0, kLongestReturnedString)};
     }
     if (elem instanceof Ci.nsIImageLoadingContent &&
         (elem.currentRequestFinalURI || elem.currentURI)) {
       let uri = elem.currentRequestFinalURI || elem.currentURI;
-      return {uri: uri.spec, documentURI: documentURI};
+      return {uri: uri.spec, documentURI};
     }
     if (ChromeUtils.getClassName(elem) === "HTMLImageElement") {
-      return {uri: elem.src, documentURI: documentURI};
+      return {uri: elem.src, documentURI};
     }
     if (ChromeUtils.getClassName(elem) === "HTMLVideoElement" ||
         ChromeUtils.getClassName(elem) === "HTMLAudioElement") {
       let hasVideo = !(elem.readyState >= elem.HAVE_METADATA &&
                        (elem.videoWidth == 0 || elem.videoHeight == 0));
       return {uri: elem.currentSrc || elem.src,
-              hasVideo: hasVideo,
-              documentURI: documentURI};
+              hasVideo,
+              documentURI};
     }
     if (ChromeUtils.getClassName(elem) === "HTMLInputElement" &&
         elem.hasAttribute("name")) {
       // For input elements, we look for a parent <form> and if there is
       // one we return the form's method and action uri.
       let parent = elem.parentNode;
       while (parent) {
         if (ChromeUtils.getClassName(parent) === "HTMLFormElement" &&
             parent.hasAttribute("action")) {
           let actionHref = docShell.QueryInterface(Ci.nsIWebNavigation)
                                    .currentURI
                                    .resolve(parent.getAttribute("action"));
           let method = parent.hasAttribute("method")
             ? parent.getAttribute("method").toLowerCase()
             : "get";
           return {
-            documentURI: documentURI,
+            documentURI,
             action: actionHref,
-            method: method,
+            method,
             name: elem.getAttribute("name"),
-          }
+          };
         }
         parent = parent.parentNode;
       }
     }
     return false;
   },
 
-  _scrollEventHandler: function(e) {
+  _scrollEventHandler(e) {
     let win = e.target.defaultView;
     if (win != content) {
       return;
     }
 
     debug("scroll event " + win);
     sendAsyncMsg("scroll", { top: win.scrollY, left: win.scrollX });
   },
 
-  _mozScrollAreaChanged: function(e) {
-    sendAsyncMsg('scrollareachanged', {
+  _mozScrollAreaChanged(e) {
+    sendAsyncMsg("scrollareachanged", {
       width: e.width,
-      height: e.height
+      height: e.height,
     });
   },
 
-  _mozRequestedDOMFullscreen: function(e) {
+  _mozRequestedDOMFullscreen(e) {
     sendAsyncMsg("requested-dom-fullscreen");
   },
 
-  _mozFullscreenOriginChange: function(e) {
+  _mozFullscreenOriginChange(e) {
     sendAsyncMsg("fullscreen-origin-change", {
-      originNoSuffix: e.target.nodePrincipal.originNoSuffix
+      originNoSuffix: e.target.nodePrincipal.originNoSuffix,
     });
   },
 
-  _mozExitDomFullscreen: function(e) {
+  _mozExitDomFullscreen(e) {
     sendAsyncMsg("exit-dom-fullscreen");
   },
 
-  _recvFireCtxCallback: function(data) {
+  _recvFireCtxCallback(data) {
     debug("Received fireCtxCallback message: (" + data.json.menuitem + ")");
 
     let doCommandIfEnabled = (command) => {
       if (docShell.isCommandEnabled(command)) {
         docShell.doCommand(command);
       }
     };
 
-    if (data.json.menuitem == 'copy-image') {
-      doCommandIfEnabled('cmd_copyImage');
-    } else if (data.json.menuitem == 'copy-link') {
-      doCommandIfEnabled('cmd_copyLink');
+    if (data.json.menuitem == "copy-image") {
+      doCommandIfEnabled("cmd_copyImage");
+    } else if (data.json.menuitem == "copy-link") {
+      doCommandIfEnabled("cmd_copyLink");
     } else if (data.json.menuitem in this._ctxHandlers) {
       this._ctxHandlers[data.json.menuitem].click();
       this._ctxHandlers = {};
     } else {
       // We silently ignore if the embedder uses an incorrect id in the callback
       debug("Ignored invalid contextmenu invocation");
     }
   },
 
-  _buildMenuObj: function(menu, idPrefix, copyableElements) {
-    var menuObj = {type: 'menu', customized: false, items: []};
+  _buildMenuObj(menu, idPrefix, copyableElements) {
+    var menuObj = {type: "menu", customized: false, items: []};
     // Customized context menu
     if (menu) {
-      this._maybeCopyAttribute(menu, menuObj, 'label');
+      this._maybeCopyAttribute(menu, menuObj, "label");
 
       for (var i = 0, child; child = menu.children[i++];) {
-        if (child.nodeName === 'MENU') {
-          menuObj.items.push(this._buildMenuObj(child, idPrefix + i + '_', false));
-        } else if (child.nodeName === 'MENUITEM') {
-          var id = this._ctxCounter + '_' + idPrefix + i;
-          var menuitem = {id: id, type: 'menuitem'};
-          this._maybeCopyAttribute(child, menuitem, 'label');
-          this._maybeCopyAttribute(child, menuitem, 'icon');
+        if (child.nodeName === "MENU") {
+          menuObj.items.push(this._buildMenuObj(child, idPrefix + i + "_", false));
+        } else if (child.nodeName === "MENUITEM") {
+          var id = this._ctxCounter + "_" + idPrefix + i;
+          var menuitem = {id, type: "menuitem"};
+          this._maybeCopyAttribute(child, menuitem, "label");
+          this._maybeCopyAttribute(child, menuitem, "icon");
           this._ctxHandlers[id] = child;
           menuObj.items.push(menuitem);
         }
       }
 
       if (menuObj.items.length > 0) {
         menuObj.customized = true;
       }
     }
     // Note: Display "Copy Link" first in order to make sure "Copy Image" is
     //       put together with other image options if elem is an image link.
     // "Copy Link" menu item
     if (copyableElements.link) {
-      menuObj.items.push({id: 'copy-link'});
+      menuObj.items.push({id: "copy-link"});
     }
     // "Copy Image" menu item
     if (copyableElements.image) {
-      menuObj.items.push({id: 'copy-image'});
+      menuObj.items.push({id: "copy-image"});
     }
 
     return menuObj;
   },
 
   /**
    * Called when the window which contains this iframe becomes hidden or
    * visible.
    */
-  _recvOwnerVisibilityChange: function(data) {
+  _recvOwnerVisibilityChange(data) {
     debug("Received ownerVisibilityChange: (" + data.json.visible + ")");
     var visible = data.json.visible;
     if (docShell && docShell.isActive !== visible) {
       docShell.isActive = visible;
 
       // Ensure painting is not frozen if the app goes visible.
       if (visible && this._paintFrozenTimer) {
         this.notify();
       }
     }
   },
 
-  _recvSendMouseEvent: function(data) {
+  _recvSendMouseEvent(data) {
     let json = data.json;
     let utils = content.windowUtils;
     utils.sendMouseEventToWindow(json.type, json.x, json.y, json.button,
                                  json.clickCount, json.modifiers);
   },
 
-  _recvCanGoBack: function(data) {
+  _recvCanGoBack(data) {
     var webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
-    sendAsyncMsg('got-can-go-back', {
+    sendAsyncMsg("got-can-go-back", {
       id: data.json.id,
-      successRv: webNav.canGoBack
+      successRv: webNav.canGoBack,
     });
   },
 
-  _recvCanGoForward: function(data) {
+  _recvCanGoForward(data) {
     var webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
-    sendAsyncMsg('got-can-go-forward', {
+    sendAsyncMsg("got-can-go-forward", {
       id: data.json.id,
-      successRv: webNav.canGoForward
+      successRv: webNav.canGoForward,
     });
   },
 
-  _recvGoBack: function(data) {
+  _recvGoBack(data) {
     try {
       docShell.QueryInterface(Ci.nsIWebNavigation).goBack();
-    } catch(e) {
+    } catch (e) {
       // Silently swallow errors; these happen when we can't go back.
     }
   },
 
-  _recvGoForward: function(data) {
+  _recvGoForward(data) {
     try {
       docShell.QueryInterface(Ci.nsIWebNavigation).goForward();
-    } catch(e) {
+    } catch (e) {
       // Silently swallow errors; these happen when we can't go forward.
     }
   },
 
-  _recvReload: function(data) {
+  _recvReload(data) {
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     let reloadFlags = data.json.hardReload ?
       webNav.LOAD_FLAGS_BYPASS_PROXY | webNav.LOAD_FLAGS_BYPASS_CACHE :
       webNav.LOAD_FLAGS_NONE;
     try {
       webNav.reload(reloadFlags);
-    } catch(e) {
+    } catch (e) {
       // Silently swallow errors; these can happen if a used cancels reload
     }
   },
 
-  _recvStop: function(data) {
+  _recvStop(data) {
     let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.stop(webNav.STOP_NETWORK);
   },
 
   // The docShell keeps a weak reference to the progress listener, so we need
   // to keep a strong ref to it ourselves.
   _progressListener: {
     QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
                                             Ci.nsISupportsWeakReference]),
     _seenLoadStart: false,
 
-    onLocationChange: function(webProgress, request, location, flags) {
+    onLocationChange(webProgress, request, location, flags) {
       // We get progress events from subshells here, which is kind of weird.
       if (webProgress != docShell) {
         return;
       }
 
       // Ignore locationchange events which occur before the first loadstart.
       // These are usually about:blank loads we don't care about.
       if (!this._seenLoadStart) {
@@ -1031,218 +1026,213 @@ BrowserElementChild.prototype = {
       }
 
       // Remove password from uri.
       location = Cc["@mozilla.org/docshell/urifixup;1"]
         .getService(Ci.nsIURIFixup).createExposableURI(location);
 
       var webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
 
-      sendAsyncMsg('locationchange', { url: location.spec,
+      sendAsyncMsg("locationchange", { url: location.spec,
                                        canGoBack: webNav.canGoBack,
                                        canGoForward: webNav.canGoForward });
     },
 
-    onStateChange: function(webProgress, request, stateFlags, status) {
+    onStateChange(webProgress, request, stateFlags, status) {
       if (webProgress != docShell) {
         return;
       }
 
       if (stateFlags & Ci.nsIWebProgressListener.STATE_START) {
         this._seenLoadStart = true;
-        sendAsyncMsg('loadstart');
+        sendAsyncMsg("loadstart");
       }
 
       if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
-        let bgColor = 'transparent';
+        let bgColor = "transparent";
         try {
           bgColor = content.getComputedStyle(content.document.body)
-                           .getPropertyValue('background-color');
+                           .getPropertyValue("background-color");
         } catch (e) {}
-        sendAsyncMsg('loadend', {backgroundColor: bgColor});
+        sendAsyncMsg("loadend", {backgroundColor: bgColor});
 
         switch (status) {
           case Cr.NS_OK :
           case Cr.NS_BINDING_ABORTED :
             // Ignoring NS_BINDING_ABORTED, which is set when loading page is
             // stopped.
           case Cr.NS_ERROR_PARSED_DATA_CACHED:
             return;
 
           // TODO See nsDocShell::DisplayLoadError to see what extra
           // information we should be annotating this first block of errors
           // with. Bug 1107091.
           case Cr.NS_ERROR_UNKNOWN_PROTOCOL :
-            sendAsyncMsg('error', { type: 'unknownProtocolFound' });
+            sendAsyncMsg("error", { type: "unknownProtocolFound" });
             return;
           case Cr.NS_ERROR_FILE_NOT_FOUND :
-            sendAsyncMsg('error', { type: 'fileNotFound' });
+            sendAsyncMsg("error", { type: "fileNotFound" });
             return;
           case Cr.NS_ERROR_UNKNOWN_HOST :
-            sendAsyncMsg('error', { type: 'dnsNotFound' });
+            sendAsyncMsg("error", { type: "dnsNotFound" });
             return;
           case Cr.NS_ERROR_CONNECTION_REFUSED :
-            sendAsyncMsg('error', { type: 'connectionFailure' });
+            sendAsyncMsg("error", { type: "connectionFailure" });
             return;
           case Cr.NS_ERROR_NET_INTERRUPT :
-            sendAsyncMsg('error', { type: 'netInterrupt' });
+            sendAsyncMsg("error", { type: "netInterrupt" });
             return;
           case Cr.NS_ERROR_NET_TIMEOUT :
-            sendAsyncMsg('error', { type: 'netTimeout' });
+            sendAsyncMsg("error", { type: "netTimeout" });
             return;
           case Cr.NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION :
-            sendAsyncMsg('error', { type: 'cspBlocked' });
+            sendAsyncMsg("error", { type: "cspBlocked" });
             return;
           case Cr.NS_ERROR_PHISHING_URI :
-            sendAsyncMsg('error', { type: 'deceptiveBlocked' });
+            sendAsyncMsg("error", { type: "deceptiveBlocked" });
             return;
           case Cr.NS_ERROR_MALWARE_URI :
-            sendAsyncMsg('error', { type: 'malwareBlocked' });
+            sendAsyncMsg("error", { type: "malwareBlocked" });
             return;
           case Cr.NS_ERROR_HARMFUL_URI :
-            sendAsyncMsg('error', { type: 'harmfulBlocked' });
+            sendAsyncMsg("error", { type: "harmfulBlocked" });
             return;
           case Cr.NS_ERROR_UNWANTED_URI :
-            sendAsyncMsg('error', { type: 'unwantedBlocked' });
+            sendAsyncMsg("error", { type: "unwantedBlocked" });
             return;
           case Cr.NS_ERROR_FORBIDDEN_URI :
-            sendAsyncMsg('error', { type: 'forbiddenBlocked' });
+            sendAsyncMsg("error", { type: "forbiddenBlocked" });
             return;
 
           case Cr.NS_ERROR_OFFLINE :
-            sendAsyncMsg('error', { type: 'offline' });
+            sendAsyncMsg("error", { type: "offline" });
             return;
           case Cr.NS_ERROR_MALFORMED_URI :
-            sendAsyncMsg('error', { type: 'malformedURI' });
+            sendAsyncMsg("error", { type: "malformedURI" });
             return;
           case Cr.NS_ERROR_REDIRECT_LOOP :
-            sendAsyncMsg('error', { type: 'redirectLoop' });
+            sendAsyncMsg("error", { type: "redirectLoop" });
             return;
           case Cr.NS_ERROR_UNKNOWN_SOCKET_TYPE :
-            sendAsyncMsg('error', { type: 'unknownSocketType' });
+            sendAsyncMsg("error", { type: "unknownSocketType" });
             return;
           case Cr.NS_ERROR_NET_RESET :
-            sendAsyncMsg('error', { type: 'netReset' });
+            sendAsyncMsg("error", { type: "netReset" });
             return;
           case Cr.NS_ERROR_DOCUMENT_NOT_CACHED :
-            sendAsyncMsg('error', { type: 'notCached' });
+            sendAsyncMsg("error", { type: "notCached" });
             return;
           case Cr.NS_ERROR_DOCUMENT_IS_PRINTMODE :
-            sendAsyncMsg('error', { type: 'isprinting' });
+            sendAsyncMsg("error", { type: "isprinting" });
             return;
           case Cr.NS_ERROR_PORT_ACCESS_NOT_ALLOWED :
-            sendAsyncMsg('error', { type: 'deniedPortAccess' });
+            sendAsyncMsg("error", { type: "deniedPortAccess" });
             return;
           case Cr.NS_ERROR_UNKNOWN_PROXY_HOST :
-            sendAsyncMsg('error', { type: 'proxyResolveFailure' });
+            sendAsyncMsg("error", { type: "proxyResolveFailure" });
             return;
           case Cr.NS_ERROR_PROXY_CONNECTION_REFUSED :
-            sendAsyncMsg('error', { type: 'proxyConnectFailure' });
+            sendAsyncMsg("error", { type: "proxyConnectFailure" });
             return;
           case Cr.NS_ERROR_INVALID_CONTENT_ENCODING :
-            sendAsyncMsg('error', { type: 'contentEncodingFailure' });
+            sendAsyncMsg("error", { type: "contentEncodingFailure" });
             return;
           case Cr.NS_ERROR_REMOTE_XUL :
-            sendAsyncMsg('error', { type: 'remoteXUL' });
+            sendAsyncMsg("error", { type: "remoteXUL" });
             return;
           case Cr.NS_ERROR_UNSAFE_CONTENT_TYPE :
-            sendAsyncMsg('error', { type: 'unsafeContentType' });
+            sendAsyncMsg("error", { type: "unsafeContentType" });
             return;
           case Cr.NS_ERROR_CORRUPTED_CONTENT :
-            sendAsyncMsg('error', { type: 'corruptedContentErrorv2' });
+            sendAsyncMsg("error", { type: "corruptedContentErrorv2" });
             return;
           case Cr.NS_ERROR_BLOCKED_BY_POLICY :
-            sendAsyncMsg('error', { type: 'blockedByPolicy' });
+            sendAsyncMsg("error", { type: "blockedByPolicy" });
             return;
 
           default:
             // getErrorClass() will throw if the error code passed in is not a NSS
             // error code.
             try {
-              let nssErrorsService = Cc['@mozilla.org/nss_errors_service;1']
+              let nssErrorsService = Cc["@mozilla.org/nss_errors_service;1"]
                                        .getService(Ci.nsINSSErrorsService);
               if (nssErrorsService.getErrorClass(status)
                     == Ci.nsINSSErrorsService.ERROR_CLASS_BAD_CERT) {
                 // XXX Is there a point firing the event if the error page is not
                 // certerror? If yes, maybe we should add a property to the
                 // event to to indicate whether there is a custom page. That would
                 // let the embedder have more control over the desired behavior.
                 let errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF, "");
 
-                if (errorPage == 'certerror') {
-                  sendAsyncMsg('error', { type: 'certerror' });
+                if (errorPage == "certerror") {
+                  sendAsyncMsg("error", { type: "certerror" });
                   return;
                 }
               }
             } catch (e) {}
 
-            sendAsyncMsg('error', { type: 'other' });
-            return;
+            sendAsyncMsg("error", { type: "other" });
         }
       }
     },
 
-    onSecurityChange: function(webProgress, request, state) {
+    onSecurityChange(webProgress, request, state) {
       if (webProgress != docShell) {
         return;
       }
 
       var securityStateDesc;
       if (state & Ci.nsIWebProgressListener.STATE_IS_SECURE) {
-        securityStateDesc = 'secure';
-      }
-      else if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN) {
-        securityStateDesc = 'broken';
-      }
-      else if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE) {
-        securityStateDesc = 'insecure';
-      }
-      else {
+        securityStateDesc = "secure";
+      } else if (state & Ci.nsIWebProgressListener.STATE_IS_BROKEN) {
+        securityStateDesc = "broken";
+      } else if (state & Ci.nsIWebProgressListener.STATE_IS_INSECURE) {
+        securityStateDesc = "insecure";
+      } else {
         debug("Unexpected securitychange state!");
-        securityStateDesc = '???';
+        securityStateDesc = "???";
       }
 
       var mixedStateDesc;
       if (state & Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
-        mixedStateDesc = 'blocked_mixed_active_content';
-      }
-      else if (state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
+        mixedStateDesc = "blocked_mixed_active_content";
+      } else if (state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
         // Note that STATE_LOADED_MIXED_ACTIVE_CONTENT implies STATE_IS_BROKEN
-        mixedStateDesc = 'loaded_mixed_active_content';
+        mixedStateDesc = "loaded_mixed_active_content";
       }
 
       var isEV = !!(state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL);
       var isMixedContent = !!(state &
         (Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT |
         Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT));
 
-      sendAsyncMsg('securitychange', {
+      sendAsyncMsg("securitychange", {
         state: securityStateDesc,
         mixedState: mixedStateDesc,
         extendedValidation: isEV,
         mixedContent: isMixedContent,
       });
     },
   },
 
   // Expose the message manager for WebApps and others.
   _messageManagerPublic: {
     sendAsyncMessage: global.sendAsyncMessage.bind(global),
     sendSyncMessage: global.sendSyncMessage.bind(global),
     addMessageListener: global.addMessageListener.bind(global),
-    removeMessageListener: global.removeMessageListener.bind(global)
+    removeMessageListener: global.removeMessageListener.bind(global),
   },
 
   get messageManager() {
     return this._messageManagerPublic;
-  }
+  },
 };
 
 var api = null;
-if ('DoPreloadPostfork' in this && typeof this.DoPreloadPostfork === 'function') {
+if ("DoPreloadPostfork" in this && typeof this.DoPreloadPostfork === "function") {
   // If we are preloaded, instantiate BrowserElementChild after a content
   // process is forked.
   this.DoPreloadPostfork(function() {
     api = new BrowserElementChild();
   });
 } else {
   api = new BrowserElementChild();
 }
--- a/dom/browser-element/BrowserElementCopyPaste.js
+++ b/dom/browser-element/BrowserElementCopyPaste.js
@@ -9,70 +9,70 @@
 function debug(msg) {
   // dump("BrowserElementCopyPaste - " + msg + "\n");
 }
 
 debug("loaded");
 
 var CopyPasteAssistent = {
   COMMAND_MAP: {
-    'cut': 'cmd_cut',
-    'copy': 'cmd_copy',
-    'paste': 'cmd_paste',
-    'selectall': 'cmd_selectAll'
+    "cut": "cmd_cut",
+    "copy": "cmd_copy",
+    "paste": "cmd_paste",
+    "selectall": "cmd_selectAll",
   },
 
-  init: function() {
+  init() {
     addEventListener("mozcaretstatechanged", this,
                      /* useCapture = */ true, /* wantsUntrusted = */ false);
     addMessageListener("browser-element-api:call", this);
   },
 
-  destroy: function() {
+  destroy() {
     removeEventListener("mozcaretstatechanged", this,
                         /* useCapture = */ true, /* wantsUntrusted = */ false);
     removeMessageListener("browser-element-api:call", this);
   },
 
-  handleEvent: function(event) {
+  handleEvent(event) {
     switch (event.type) {
       case "mozcaretstatechanged":
         this._caretStateChangedHandler(event);
         break;
     }
   },
 
-  receiveMessage: function(message) {
+  receiveMessage(message) {
     switch (message.name) {
       case "browser-element-api:call":
         this._browserAPIHandler(message);
         break;
     }
   },
 
-  _browserAPIHandler: function(e) {
+  _browserAPIHandler(e) {
     switch (e.data.msg_name) {
-      case 'copypaste-do-command':
+      case "copypaste-do-command":
         if (this._isCommandEnabled(e.data.command)) {
           docShell.doCommand(this.COMMAND_MAP[e.data.command]);
         }
         break;
     }
   },
 
-  _isCommandEnabled: function(cmd) {
+  _isCommandEnabled(cmd) {
     let command = this.COMMAND_MAP[cmd];
     if (!command) {
       return false;
     }
 
     return docShell.isCommandEnabled(command);
   },
 
-  _caretStateChangedHandler: function(e) {
+  _caretStateChangedHandler(e) {
     e.stopPropagation();
 
     let boundingClientRect = e.boundingClientRect;
     let canPaste = this._isCommandEnabled("paste");
     let zoomFactor = content.innerWidth == 0 ? 1 : content.screen.width / content.innerWidth;
 
     let detail = {
       rect: {
@@ -84,38 +84,38 @@ var CopyPasteAssistent = {
         right: boundingClientRect ? boundingClientRect.right : 0,
       },
       commands: {
         canSelectAll: this._isCommandEnabled("selectall"),
         canCut: this._isCommandEnabled("cut"),
         canCopy: this._isCommandEnabled("copy"),
         canPaste: this._isCommandEnabled("paste"),
       },
-      zoomFactor: zoomFactor,
+      zoomFactor,
       reason: e.reason,
       collapsed: e.collapsed,
       caretVisible: e.caretVisible,
       selectionVisible: e.selectionVisible,
       selectionEditable: e.selectionEditable,
-      selectedTextContent: e.selectedTextContent
+      selectedTextContent: e.selectedTextContent,
     };
 
     // Get correct geometry information if we have nested iframe.
     let currentWindow = e.target.defaultView;
     while (currentWindow.realFrameElement) {
       let currentRect = currentWindow.realFrameElement.getBoundingClientRect();
       detail.rect.top += currentRect.top;
       detail.rect.bottom += currentRect.top;
       detail.rect.left += currentRect.left;
       detail.rect.right += currentRect.left;
       currentWindow = currentWindow.realFrameElement.ownerGlobal;
 
       let targetDocShell = currentWindow.docShell;
-      if(targetDocShell.isMozBrowser) {
+      if (targetDocShell.isMozBrowser) {
         break;
       }
     }
 
-    sendAsyncMsg('caretstatechanged', detail);
+    sendAsyncMsg("caretstatechanged", detail);
   },
 };
 
 CopyPasteAssistent.init();
--- a/dom/browser-element/BrowserElementParent.jsm
+++ b/dom/browser-element/BrowserElementParent.jsm
@@ -8,24 +8,23 @@
  * child.  We then listen to messages from the child script and take
  * appropriate action here in the parent.
  */
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {BrowserElementPromptService} = ChromeUtils.import("resource://gre/modules/BrowserElementPromptService.jsm");
 
 function debug(msg) {
-  //dump("BrowserElementParent - " + msg + "\n");
+  // dump("BrowserElementParent - " + msg + "\n");
 }
 
 function getIntPref(prefName, def) {
   try {
     return Services.prefs.getIntPref(prefName);
-  }
-  catch(err) {
+  } catch (err) {
     return def;
   }
 }
 
 function handleWindowEvent(e) {
   if (this._browserElementParents) {
     let beps = ChromeUtils.nondeterministicGetWeakMapKeys(this._browserElementParents);
     beps.forEach(bep => bep._handleOwnerEvent(e));
@@ -56,31 +55,31 @@ function definePromiseMethod(msgName) {
 function BrowserElementParent() {
   debug("Creating new BrowserElementParent object");
   this._promiseCounter = 0;
   this._domRequestReady = false;
   this._pendingAPICalls = [];
   this._pendingPromises = {};
   this._pendingDOMFullscreen = false;
 
-  Services.obs.addObserver(this, 'oop-frameloader-crashed', /* ownsWeak = */ true);
-  Services.obs.addObserver(this, 'ask-children-to-execute-copypaste-command', /* ownsWeak = */ true);
-  Services.obs.addObserver(this, 'back-docommand', /* ownsWeak = */ true);
+  Services.obs.addObserver(this, "oop-frameloader-crashed", /* ownsWeak = */ true);
+  Services.obs.addObserver(this, "ask-children-to-execute-copypaste-command", /* ownsWeak = */ true);
+  Services.obs.addObserver(this, "back-docommand", /* ownsWeak = */ true);
 }
 
 BrowserElementParent.prototype = {
 
   classDescription: "BrowserElementAPI implementation",
   classID: Components.ID("{9f171ac4-0939-4ef8-b360-3408aedc3060}"),
   contractID: "@mozilla.org/dom/browser-element-api;1",
   QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserElementAPI,
                                           Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
 
-  setFrameLoader: function(frameLoader) {
+  setFrameLoader(frameLoader) {
     debug("Setting frameLoader");
     this._frameLoader = frameLoader;
     this._frameElement = frameLoader.ownerElement;
     if (!this._frameElement) {
       debug("No frame element?");
       return;
     }
     // Listen to visibilitychange on the iframe's owner window, and forward
@@ -91,17 +90,17 @@ BrowserElementParent.prototype = {
     // To accomplish this, we register just one listener on the window, and have
     // it reference a WeakMap whose keys are all the BrowserElementParent objects
     // on the window.  Then when the listener fires, we iterate over the
     // WeakMap's keys (which we can do, because we're chrome) to notify the
     // BrowserElementParents.
     if (!this._window._browserElementParents) {
       this._window._browserElementParents = new WeakMap();
       let handler = handleWindowEvent.bind(this._window);
-      let windowEvents = ['visibilitychange', 'fullscreenchange'];
+      let windowEvents = ["visibilitychange", "fullscreenchange"];
       let els = Cc["@mozilla.org/eventlistenerservice;1"]
                   .getService(Ci.nsIEventListenerService);
       for (let event of windowEvents) {
         els.addSystemEventListener(this._window, event, handler,
                                    /* useCapture = */ true);
       }
     }
 
@@ -112,37 +111,37 @@ BrowserElementParent.prototype = {
     this._setupMessageListener();
   },
 
   destroyFrameScripts() {
     debug("Destroying frame scripts");
     this._mm.sendAsyncMessage("browser-element-api:destroy");
   },
 
-  _runPendingAPICall: function() {
+  _runPendingAPICall() {
     if (!this._pendingAPICalls) {
       return;
     }
     for (let i = 0; i < this._pendingAPICalls.length; i++) {
       try {
         this._pendingAPICalls[i]();
       } catch (e) {
         // throw the expections from pending functions.
-        debug('Exception when running pending API call: ' +  e);
+        debug("Exception when running pending API call: " + e);
       }
     }
     delete this._pendingAPICalls;
   },
 
-  _setupMessageListener: function() {
+  _setupMessageListener() {
     this._mm = this._frameLoader.messageManager;
-    this._mm.addMessageListener('browser-element-api:call', this);
+    this._mm.addMessageListener("browser-element-api:call", this);
   },
 
-  receiveMessage: function(aMsg) {
+  receiveMessage(aMsg) {
     if (!this._isAlive()) {
       return;
     }
 
     // Messages we receive are handed to functions which take a (data) argument,
     // where |data| is the message manager's data object.
     // We use a single message and dispatch to various function based
     // on data.msg_name
@@ -172,49 +171,49 @@ BrowserElementParent.prototype = {
       "iconchange": this._fireEventFromMsg,
       "scrollareachanged": this._fireEventFromMsg,
       "titlechange": this._fireProfiledEventFromMsg,
       "opensearch": this._fireEventFromMsg,
       "metachange": this._fireEventFromMsg,
       "resize": this._fireEventFromMsg,
       "activitydone": this._fireEventFromMsg,
       "scroll": this._fireEventFromMsg,
-      "opentab": this._fireEventFromMsg
+      "opentab": this._fireEventFromMsg,
     };
 
     if (aMsg.data.msg_name in mmCalls) {
       return mmCalls[aMsg.data.msg_name].apply(this, arguments);
     } else if (aMsg.data.msg_name in mmSecuritySensitiveCalls) {
       return mmSecuritySensitiveCalls[aMsg.data.msg_name].apply(this, arguments);
     }
   },
 
-  _removeMessageListener: function() {
-    this._mm.removeMessageListener('browser-element-api:call', this);
+  _removeMessageListener() {
+    this._mm.removeMessageListener("browser-element-api:call", this);
   },
 
   /**
    * You shouldn't touch this._frameElement or this._window if _isAlive is
    * false.  (You'll likely get an exception if you do.)
    */
-  _isAlive: function() {
+  _isAlive() {
     return !Cu.isDeadWrapper(this._frameElement) &&
            !Cu.isDeadWrapper(this._frameElement.ownerDocument) &&
            !Cu.isDeadWrapper(this._frameElement.ownerGlobal);
   },
 
   get _window() {
     return this._frameElement.ownerGlobal;
   },
 
   get _windowUtils() {
     return this._window.windowUtils;
   },
 
-  promptAuth: function(authDetail, callback) {
+  promptAuth(authDetail, callback) {
     let evt;
     let self = this;
     let callbackCalled = false;
     let cancelCallback = function() {
       if (!callbackCalled) {
         callbackCalled = true;
         callback(false, null, null);
       }
@@ -226,52 +225,52 @@ BrowserElementParent.prototype = {
       return;
     }
 
     /* username and password */
     let detail = {
       host:     authDetail.host,
       path:     authDetail.path,
       realm:    authDetail.realm,
-      isProxy:  authDetail.isProxy
+      isProxy:  authDetail.isProxy,
     };
 
-    evt = this._createEvent('usernameandpasswordrequired', detail,
+    evt = this._createEvent("usernameandpasswordrequired", detail,
                             /* cancelable */ true);
     Cu.exportFunction(function(username, password) {
       if (callbackCalled)
         return;
       callbackCalled = true;
       callback(true, username, password);
-    }, evt.detail, { defineAs: 'authenticate' });
+    }, evt.detail, { defineAs: "authenticate" });
 
-    Cu.exportFunction(cancelCallback, evt.detail, { defineAs: 'cancel' });
+    Cu.exportFunction(cancelCallback, evt.detail, { defineAs: "cancel" });
 
     this._frameElement.dispatchEvent(evt);
 
     if (!evt.defaultPrevented) {
       cancelCallback();
     }
   },
 
-  _sendAsyncMsg: function(msg, data) {
+  _sendAsyncMsg(msg, data) {
     try {
       if (!data) {
         data = { };
       }
 
       data.msg_name = msg;
-      this._mm.sendAsyncMessage('browser-element-api:call', data);
+      this._mm.sendAsyncMessage("browser-element-api:call", data);
     } catch (e) {
       return false;
     }
     return true;
   },
 
-  _recvHello: function() {
+  _recvHello() {
     debug("recvHello");
 
     // Inform our child if our owner element's document is invisible.  Note
     // that we must do so here, rather than in the BrowserElementParent
     // constructor, because the BrowserElementChild may not be initialized when
     // we run our constructor.
     if (this._window.document.hidden) {
       this._ownerVisibilityChange();
@@ -280,106 +279,106 @@ BrowserElementParent.prototype = {
     if (!this._domRequestReady) {
       // At least, one message listener such as for hello is registered.
       // So we can use sendAsyncMessage now.
       this._domRequestReady = true;
       this._runPendingAPICall();
     }
   },
 
-  _fireCtxMenuEvent: function(data) {
+  _fireCtxMenuEvent(data) {
     let detail = data.json;
     let evtName = detail.msg_name;
 
-    debug('fireCtxMenuEventFromMsg: ' + evtName + ' ' + detail);
+    debug("fireCtxMenuEventFromMsg: " + evtName + " " + detail);
     let evt = this._createEvent(evtName, detail, /* cancellable */ true);
 
     if (detail.contextmenu) {
       var self = this;
       Cu.exportFunction(function(id) {
-        self._sendAsyncMsg('fire-ctx-callback', {menuitem: id});
-      }, evt.detail, { defineAs: 'contextMenuItemSelected' });
+        self._sendAsyncMsg("fire-ctx-callback", {menuitem: id});
+      }, evt.detail, { defineAs: "contextMenuItemSelected" });
     }
 
     // The embedder may have default actions on context menu events, so
     // we fire a context menu event even if the child didn't define a
     // custom context menu
     return !this._frameElement.dispatchEvent(evt);
   },
 
   /**
    * add profiler marker for each event fired.
    */
-  _fireProfiledEventFromMsg: function(data) {
+  _fireProfiledEventFromMsg(data) {
     if (Services.profiler !== undefined) {
       Services.profiler.AddMarker(data.json.msg_name);
     }
     this._fireEventFromMsg(data);
   },
 
   /**
    * Fire either a vanilla or a custom event, depending on the contents of
    * |data|.
    */
-  _fireEventFromMsg: function(data) {
+  _fireEventFromMsg(data) {
     let detail = data.json;
     let name = detail.msg_name;
 
     // For events that send a "_payload_" property, we just want to transmit
     // this in the event.
     if ("_payload_" in detail) {
       detail = detail._payload_;
     }
 
-    debug('fireEventFromMsg: ' + name + ', ' + JSON.stringify(detail));
+    debug("fireEventFromMsg: " + name + ", " + JSON.stringify(detail));
     let evt = this._createEvent(name, detail,
                                 /* cancelable = */ false);
     this._frameElement.dispatchEvent(evt);
   },
 
-  _handleShowModalPrompt: function(data) {
+  _handleShowModalPrompt(data) {
     // Fire a showmodalprmopt event on the iframe.  When this method is called,
     // the child is spinning in a nested event loop waiting for an
     // unblock-modal-prompt message.
     //
     // If the embedder calls preventDefault() on the showmodalprompt event,
     // we'll block the child until event.detail.unblock() is called.
     //
     // Otherwise, if preventDefault() is not called, we'll send the
     // unblock-modal-prompt message to the child as soon as the event is done
     // dispatching.
 
     let detail = data.json;
-    debug('handleShowPrompt ' + JSON.stringify(detail));
+    debug("handleShowPrompt " + JSON.stringify(detail));
 
     // Strip off the windowID property from the object we send along in the
     // event.
     let windowID = detail.windowID;
     delete detail.windowID;
     debug("Event will have detail: " + JSON.stringify(detail));
-    let evt = this._createEvent('showmodalprompt', detail,
+    let evt = this._createEvent("showmodalprompt", detail,
                                 /* cancelable = */ true);
 
     let self = this;
     let unblockMsgSent = false;
     function sendUnblockMsg() {
       if (unblockMsgSent) {
         return;
       }
       unblockMsgSent = true;
 
       // We don't need to sanitize evt.detail.returnValue (e.g. converting the
       // return value of confirm() to a boolean); Gecko does that for us.
 
-      let data = { windowID: windowID,
+      let data = { windowID,
                    returnValue: evt.detail.returnValue };
-      self._sendAsyncMsg('unblock-modal-prompt', data);
+      self._sendAsyncMsg("unblock-modal-prompt", data);
     }
 
-    Cu.exportFunction(sendUnblockMsg, evt.detail, { defineAs: 'unblock' });
+    Cu.exportFunction(sendUnblockMsg, evt.detail, { defineAs: "unblock" });
 
     this._frameElement.dispatchEvent(evt);
 
     if (!evt.defaultPrevented) {
       // Unblock the inner frame immediately.  Otherwise we'll unblock upon
       // evt.detail.unblock().
       sendUnblockMsg();
     }
@@ -397,77 +396,77 @@ BrowserElementParent.prototype = {
   //            "updateposition", "longpressonemptycontent", "taponcaret", "presscaret",
   //            "releasecaret".
   //  - collapsed: Indicate current selection is collapsed or not.
   //  - caretVisible: Indicate the caret visiibility.
   //  - selectionVisible: Indicate current selection is visible or not.
   //  - selectionEditable: Indicate current selection is editable or not.
   //  - selectedTextContent: Contains current selected text content, which is
   //                         equivalent to the string returned by Selection.toString().
-  _handleCaretStateChanged: function(data) {
-    let evt = this._createEvent('caretstatechanged', data.json,
+  _handleCaretStateChanged(data) {
+    let evt = this._createEvent("caretstatechanged", data.json,
                                 /* cancelable = */ false);
 
     let self = this;
     function sendDoCommandMsg(cmd) {
       let data = { command: cmd };
-      self._sendAsyncMsg('copypaste-do-command', data);
+      self._sendAsyncMsg("copypaste-do-command", data);
     }
-    Cu.exportFunction(sendDoCommandMsg, evt.detail, { defineAs: 'sendDoCommandMsg' });
+    Cu.exportFunction(sendDoCommandMsg, evt.detail, { defineAs: "sendDoCommandMsg" });
 
     this._frameElement.dispatchEvent(evt);
   },
 
-  _handleScrollViewChange: function(data) {
+  _handleScrollViewChange(data) {
     let evt = this._createEvent("scrollviewchange", data.json,
                                 /* cancelable = */ false);
     this._frameElement.dispatchEvent(evt);
   },
 
-  _createEvent: function(evtName, detail, cancelable) {
+  _createEvent(evtName, detail, cancelable) {
     // This will have to change if we ever want to send a CustomEvent with null
     // detail.  For now, it's OK.
     if (detail !== undefined && detail !== null) {
       detail = Cu.cloneInto(detail, this._window);
-      return new this._window.CustomEvent('mozbrowser' + evtName,
+      return new this._window.CustomEvent("mozbrowser" + evtName,
                                           { bubbles: true,
-                                            cancelable: cancelable,
-                                            detail: detail });
+                                            cancelable,
+                                            detail });
     }
 
-    return new this._window.Event('mozbrowser' + evtName,
+    return new this._window.Event("mozbrowser" + evtName,
                                   { bubbles: true,
-                                    cancelable: cancelable });
+                                    cancelable });
   },
 
   /**
    * Kick off an async operation in the child process.
    *
    * We'll send a message called |msgName| to the child process, passing along
    * an object with two fields:
    *
    *  - id:  the ID of this async call.
    *  - arg: arguments to pass to the child along with this async call.
    *
    * We expect the child to pass the ID back to us upon completion of the
    * call.  See _gotAsyncResult.
    */
-  _sendAsyncRequest: function(msgName, args) {
-    let id = 'req_' + this._promiseCounter++;
+  _sendAsyncRequest(msgName, args) {
+    let id = "req_" + this._promiseCounter++;
     let resolve, reject;
     let p = new this._window.Promise((res, rej) => {
       resolve = res;
       reject = rej;
     });
     let self = this;
     let send = function() {
       if (!self._isAlive()) {
         return;
       }
-      if (self._sendAsyncMsg(msgName, {id: id, args: args})) {
+      if (self._sendAsyncMsg(msgName, {id, args})) {
         self._pendingPromises[id] = { p, resolve, reject };
       } else {
         reject(new this._window.DOMException("fail"));
       }
     };
     if (this._domRequestReady) {
       send();
     } else {
@@ -485,26 +484,25 @@ BrowserElementParent.prototype = {
    * The fields have the following meanings:
    *
    *  - id:        the ID of the async call (see _sendAsyncRequest)
    *  - successRv: the call's return value, if the call succeeded
    *  - errorMsg:  the message to pass to the Promise reject callback, if the
    *               call failed.
    *
    */
-  _gotAsyncResult: function(data) {
+  _gotAsyncResult(data) {
     let p = this._pendingPromises[data.json.id];
     delete this._pendingPromises[data.json.id];
 
-    if ('successRv' in data.json) {
+    if ("successRv" in data.json) {
       debug("Successful gotAsyncResult.");
       let clientObj = Cu.cloneInto(data.json.successRv, this._window);
       p.resolve(clientObj);
-    }
-    else {
+    } else {
       debug("Got error in gotAsyncResult.");
       p.reject(new this._window.DOMException(
         Cu.cloneInto(data.json.errorMsg, this._window)));
     }
   },
 
   sendMouseEvent: defineNoReturnMethod(function(type, x, y, button, clickCount, modifiers) {
     // This method used to attempt to transform from the parent
@@ -512,100 +510,100 @@ BrowserElementParent.prototype = {
     // transform was always a no-op, because this._frameLoader.tabParent
     // was null.
     this._sendAsyncMsg("send-mouse-event", {
       "type": type,
       "x": x,
       "y": y,
       "button": button,
       "clickCount": clickCount,
-      "modifiers": modifiers
+      "modifiers": modifiers,
     });
   }),
 
-  getCanGoBack: definePromiseMethod('get-can-go-back'),
-  getCanGoForward: definePromiseMethod('get-can-go-forward'),
+  getCanGoBack: definePromiseMethod("get-can-go-back"),
+  getCanGoForward: definePromiseMethod("get-can-go-forward"),
 
   goBack: defineNoReturnMethod(function() {
-    this._sendAsyncMsg('go-back');
+    this._sendAsyncMsg("go-back");
   }),
 
   goForward: defineNoReturnMethod(function() {
-    this._sendAsyncMsg('go-forward');
+    this._sendAsyncMsg("go-forward");
   }),
 
   reload: defineNoReturnMethod(function(hardReload) {
-    this._sendAsyncMsg('reload', {hardReload: hardReload});
+    this._sendAsyncMsg("reload", {hardReload});
   }),
 
   stop: defineNoReturnMethod(function() {
-    this._sendAsyncMsg('stop');
+    this._sendAsyncMsg("stop");
   }),
 
   /**
    * Called when the visibility of the window which owns this iframe changes.
    */
-  _ownerVisibilityChange: function() {
-    this._sendAsyncMsg('owner-visibility-change',
+  _ownerVisibilityChange() {
+    this._sendAsyncMsg("owner-visibility-change",
                        {visible: !this._window.document.hidden});
   },
 
-  _requestedDOMFullscreen: function() {
+  _requestedDOMFullscreen() {
     this._pendingDOMFullscreen = true;
     this._windowUtils.remoteFrameFullscreenChanged(this._frameElement);
   },
 
-  _fullscreenOriginChange: function(data) {
+  _fullscreenOriginChange(data) {
     Services.obs.notifyObservers(
       this._frameElement, "fullscreen-origin-change", data.json.originNoSuffix);
   },
 
-  _exitDomFullscreen: function(data) {
+  _exitDomFullscreen(data) {
     this._windowUtils.remoteFrameFullscreenReverted();
   },
 
-  _handleOwnerEvent: function(evt) {
+  _handleOwnerEvent(evt) {
     switch (evt.type) {
-      case 'visibilitychange':
+      case "visibilitychange":
         this._ownerVisibilityChange();
         break;
-      case 'fullscreenchange':
+      case "fullscreenchange":
         if (!this._window.document.fullscreenElement) {
-          this._sendAsyncMsg('exit-fullscreen');
+          this._sendAsyncMsg("exit-fullscreen");
         } else if (this._pendingDOMFullscreen) {
           this._pendingDOMFullscreen = false;
-          this._sendAsyncMsg('entered-fullscreen');
+          this._sendAsyncMsg("entered-fullscreen");
         }
         break;
     }
   },
 
-  _fireFatalError: function() {
-    let evt = this._createEvent('error', {type: 'fatal'},
+  _fireFatalError() {
+    let evt = this._createEvent("error", {type: "fatal"},
                                 /* cancelable = */ false);
     this._frameElement.dispatchEvent(evt);
   },
 
-  observe: function(subject, topic, data) {
-    switch(topic) {
-    case 'oop-frameloader-crashed':
+  observe(subject, topic, data) {
+    switch (topic) {
+    case "oop-frameloader-crashed":
       if (this._isAlive() && subject == this._frameLoader) {
         this._fireFatalError();
       }
       break;
-    case 'ask-children-to-execute-copypaste-command':
+    case "ask-children-to-execute-copypaste-command":
       if (this._isAlive() && this._frameElement == subject.wrappedJSObject) {
-        this._sendAsyncMsg('copypaste-do-command', { command: data });
+        this._sendAsyncMsg("copypaste-do-command", { command: data });
       }
       break;
-    case 'back-docommand':
+    case "back-docommand":
       if (this._isAlive() && this._frameLoader.visible) {
           this.goBack();
       }
       break;
     default:
-      debug('Unknown topic: ' + topic);
+      debug("Unknown topic: " + topic);
       break;
-    };
+    }
   },
 };
 
 var EXPORTED_SYMBOLS = ["BrowserElementParent"];
--- a/dom/browser-element/BrowserElementPromptService.jsm
+++ b/dom/browser-element/BrowserElementPromptService.jsm
@@ -10,176 +10,176 @@ var Cm = Components.manager.QueryInterfa
 var EXPORTED_SYMBOLS = ["BrowserElementPromptService"];
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
 const BROWSER_FRAMES_ENABLED_PREF = "dom.mozBrowserFramesEnabled";
 
 function debug(msg) {
-  //dump("BrowserElementPromptService - " + msg + "\n");
+  // dump("BrowserElementPromptService - " + msg + "\n");
 }
 
 function BrowserElementPrompt(win, browserElementChild) {
   this._win = win;
   this._browserElementChild = browserElementChild;
 }
 
 BrowserElementPrompt.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPrompt]),
 
-  alert: function(title, text) {
+  alert(title, text) {
     this._browserElementChild.showModalPrompt(
-      this._win, {promptType: "alert", title: title, message: text, returnValue: undefined});
+      this._win, {promptType: "alert", title, message: text, returnValue: undefined});
   },
 
-  alertCheck: function(title, text, checkMsg, checkState) {
+  alertCheck(title, text, checkMsg, checkState) {
     // Treat this like a normal alert() call, ignoring the checkState.  The
     // front-end can do its own suppression of the alert() if it wants.
     this.alert(title, text);
   },
 
-  confirm: function(title, text) {
+  confirm(title, text) {
     return this._browserElementChild.showModalPrompt(
-      this._win, {promptType: "confirm", title: title, message: text, returnValue: undefined});
+      this._win, {promptType: "confirm", title, message: text, returnValue: undefined});
   },
 
-  confirmCheck: function(title, text, checkMsg, checkState) {
+  confirmCheck(title, text, checkMsg, checkState) {
     return this.confirm(title, text);
   },
 
   // Each button is described by an object with the following schema
   // {
   //   string messageType,  // 'builtin' or 'custom'
   //   string message, // 'ok', 'cancel', 'yes', 'no', 'save', 'dontsave',
   //                   // 'revert' or a string from caller if messageType was 'custom'.
   // }
   //
   // Expected result from embedder:
   // {
   //   int button, // Index of the button that user pressed.
   //   boolean checked, // True if the check box is checked.
   // }
-  confirmEx: function(title, text, buttonFlags, button0Title, button1Title,
+  confirmEx(title, text, buttonFlags, button0Title, button1Title,
                       button2Title, checkMsg, checkState) {
     let buttonProperties = this._buildConfirmExButtonProperties(buttonFlags,
                                                                 button0Title,
                                                                 button1Title,
                                                                 button2Title);
     let defaultReturnValue = { selectedButton: buttonProperties.defaultButton };
     if (checkMsg) {
       defaultReturnValue.checked = checkState.value;
     }
     let ret = this._browserElementChild.showModalPrompt(
       this._win,
       {
         promptType: "custom-prompt",
-        title: title,
+        title,
         message: text,
         defaultButton: buttonProperties.defaultButton,
         buttons: buttonProperties.buttons,
         showCheckbox: !!checkMsg,
         checkboxMessage: checkMsg,
         checkboxCheckedByDefault: !!checkState.value,
-        returnValue: defaultReturnValue
+        returnValue: defaultReturnValue,
       }
     );
     if (checkMsg) {
       checkState.value = ret.checked;
     }
     return buttonProperties.indexToButtonNumberMap[ret.selectedButton];
   },
 
-  prompt: function(title, text, value, checkMsg, checkState) {
+  prompt(title, text, value, checkMsg, checkState) {
     let rv = this._browserElementChild.showModalPrompt(
       this._win,
       { promptType: "prompt",
-        title: title,
+        title,
         message: text,
         initialValue: value.value,
         returnValue: null });
 
     value.value = rv;
 
     // nsIPrompt::Prompt returns true if the user pressed "OK" at the prompt,
     // and false if the user pressed "Cancel".
     //
     // BrowserElementChild returns null for "Cancel" and returns the string the
     // user entered otherwise.
     return rv !== null;
   },
 
-  promptUsernameAndPassword: function(title, text, username, password, checkMsg, checkState) {
+  promptUsernameAndPassword(title, text, username, password, checkMsg, checkState) {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
 
-  promptPassword: function(title, text, password, checkMsg, checkState) {
+  promptPassword(title, text, password, checkMsg, checkState) {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
 
-  select: function(title, text, aCount, aSelectList, aOutSelection) {
+  select(title, text, aCount, aSelectList, aOutSelection) {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
 
-  _buildConfirmExButtonProperties: function(buttonFlags, button0Title,
+  _buildConfirmExButtonProperties(buttonFlags, button0Title,
                                             button1Title, button2Title) {
     let r = {
       defaultButton: -1,
       buttons: [],
       // This map is for translating array index to the button number that
       // is recognized by Gecko. This shouldn't be exposed to embedder.
-      indexToButtonNumberMap: []
+      indexToButtonNumberMap: [],
     };
 
-    let defaultButton = 0;  // Default to Button 0.
+    let defaultButton = 0; // Default to Button 0.
     if (buttonFlags & Ci.nsIPrompt.BUTTON_POS_1_DEFAULT) {
       defaultButton = 1;
     } else if (buttonFlags & Ci.nsIPrompt.BUTTON_POS_2_DEFAULT) {
       defaultButton = 2;
     }
 
     // Properties of each button.
     let buttonPositions = [
       Ci.nsIPrompt.BUTTON_POS_0,
       Ci.nsIPrompt.BUTTON_POS_1,
-      Ci.nsIPrompt.BUTTON_POS_2
+      Ci.nsIPrompt.BUTTON_POS_2,
     ];
 
     function buildButton(buttonTitle, buttonNumber) {
       let ret = {};
       let buttonPosition = buttonPositions[buttonNumber];
-      let mask = 0xff * buttonPosition;  // 8 bit mask
+      let mask = 0xff * buttonPosition; // 8 bit mask
       let titleType = (buttonFlags & mask) / buttonPosition;
 
-      ret.messageType = 'builtin';
-      switch(titleType) {
+      ret.messageType = "builtin";
+      switch (titleType) {
       case Ci.nsIPrompt.BUTTON_TITLE_OK:
-        ret.message = 'ok';
+        ret.message = "ok";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_CANCEL:
-        ret.message = 'cancel';
+        ret.message = "cancel";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_YES:
-        ret.message = 'yes';
+        ret.message = "yes";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_NO:
-        ret.message = 'no';
+        ret.message = "no";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_SAVE:
-        ret.message = 'save';
+        ret.message = "save";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_DONT_SAVE:
-        ret.message = 'dontsave';
+        ret.message = "dontsave";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_REVERT:
-        ret.message = 'revert';
+        ret.message = "revert";
         break;
       case Ci.nsIPrompt.BUTTON_TITLE_IS_STRING:
         ret.message = buttonTitle;
-        ret.messageType = 'custom';
+        ret.messageType = "custom";
         break;
       default:
         // This button is not shown.
         return;
       }
 
       // If this is the default button, set r.defaultButton to
       // the index of this button in the array. This value is going to be
@@ -237,52 +237,52 @@ BrowserElementAuthPrompt.prototype = {
 
     if (!browserElementParent) {
       debug("Failed to load browser element parent.");
       throw Cr.NS_ERROR_FAILURE;
     }
 
     let consumer = {
       QueryInterface: ChromeUtils.generateQI([Ci.nsICancelable]),
-      callback: callback,
-      context: context,
-      cancel: function() {
+      callback,
+      context,
+      cancel() {
         this.callback.onAuthCancelled(this.context, false);
         this.callback = null;
         this.context = null;
-      }
+      },
     };
 
     let [hostname, httpRealm] = this._getAuthTarget(channel, authInfo);
     let hashKey = level + "|" + hostname + "|" + httpRealm;
     let asyncPrompt = this._asyncPrompts[hashKey];
     if (asyncPrompt) {
       asyncPrompt.consumers.push(consumer);
       return consumer;
     }
 
     asyncPrompt = {
       consumers: [consumer],
-      channel: channel,
-      authInfo: authInfo,
-      level: level,
+      channel,
+      authInfo,
+      level,
       inProgress: false,
-      browserElementParent: browserElementParent
+      browserElementParent,
     };
 
     this._asyncPrompts[hashKey] = asyncPrompt;
     this._doAsyncPrompt();
     return consumer;
   },
 
   // Utilities for nsIAuthPrompt2 ----------------
 
   _asyncPrompts: {},
   _asyncPromptInProgress: new WeakMap(),
-  _doAsyncPrompt: function() {
+  _doAsyncPrompt() {
     // Find the key of a prompt whose browser element parent does not have
     // async prompt in progress.
     let hashKey = null;
     for (let key in this._asyncPrompts) {
       let prompt = this._asyncPrompts[key];
       if (!this._asyncPromptInProgress.get(prompt.browserElementParent)) {
         hashKey = key;
         break;
@@ -351,47 +351,47 @@ BrowserElementAuthPrompt.prototype = {
         } catch (e) { /* Throw away exceptions caused by callback */ }
       }
 
       // Process the next prompt, if one is pending.
       self._doAsyncPrompt();
     };
 
     let runnable = {
-      run: function() {
+      run() {
         // Call promptAuth of browserElementParent, to show the prompt.
         prompt.browserElementParent.promptAuth(
           self._createAuthDetail(prompt.channel, prompt.authInfo),
           callback);
-      }
-    }
+      },
+    };
 
     Services.tm.dispatchToMainThread(runnable);
   },
 
-  _getFrameFromChannel: function(channel) {
+  _getFrameFromChannel(channel) {
     let loadContext = channel.notificationCallbacks.getInterface(Ci.nsILoadContext);
     return loadContext.topFrameElement;
   },
 
-  _createAuthDetail: function(channel, authInfo) {
+  _createAuthDetail(channel, authInfo) {
     let [hostname, httpRealm] = this._getAuthTarget(channel, authInfo);
     return {
       host:             hostname,
       path:             channel.URI.pathQueryRef,
       realm:            httpRealm,
       username:         authInfo.username,
       isProxy:          !!(authInfo.flags & Ci.nsIAuthInformation.AUTH_PROXY),
-      isOnlyPassword:   !!(authInfo.flags & Ci.nsIAuthInformation.ONLY_PASSWORD)
+      isOnlyPassword:   !!(authInfo.flags & Ci.nsIAuthInformation.ONLY_PASSWORD),
     };
   },
 
   // The code is taken from nsLoginManagerPrompter.js, with slight
   // modification for parameter name consistency here.
-  _getAuthTarget : function (channel, authInfo) {
+  _getAuthTarget(channel, authInfo) {
     let hostname, realm;
 
     // If our proxy is demanding authentication, don't use the
     // channel's actual destination.
     if (authInfo.flags & Ci.nsIAuthInformation.AUTH_PROXY) {
       if (!(channel instanceof Ci.nsIProxiedChannel))
         throw new Error("proxy auth needs nsIProxiedChannel");
 
@@ -423,91 +423,88 @@ BrowserElementAuthPrompt.prototype = {
       realm = hostname;
 
     return [hostname, realm];
   },
 
   /**
    * Strip out things like userPass and path for display.
    */
-  _getFormattedHostname : function(uri) {
+  _getFormattedHostname(uri) {
     return uri.scheme + "://" + uri.hostPort;
   },
 };
 
 
 function AuthPromptWrapper(oldImpl, browserElementImpl) {
   this._oldImpl = oldImpl;
   this._browserElementImpl = browserElementImpl;
 }
 
 AuthPromptWrapper.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAuthPrompt2]),
-  promptAuth: function(channel, level, authInfo) {
+  promptAuth(channel, level, authInfo) {
     if (this._canGetParentElement(channel)) {
       return this._browserElementImpl.promptAuth(channel, level, authInfo);
-    } else {
+    }
       return this._oldImpl.promptAuth(channel, level, authInfo);
-    }
   },
 
-  asyncPromptAuth: function(channel, callback, context, level, authInfo) {
+  asyncPromptAuth(channel, callback, context, level, authInfo) {
     if (this._canGetParentElement(channel)) {
       return this._browserElementImpl.asyncPromptAuth(channel, callback, context, level, authInfo);
-    } else {
+    }
       return this._oldImpl.asyncPromptAuth(channel, callback, context, level, authInfo);
-    }
   },
 
-  _canGetParentElement: function(channel) {
+  _canGetParentElement(channel) {
     try {
       let context = channel.notificationCallbacks.getInterface(Ci.nsILoadContext);
       let frame = context.topFrameElement;
       if (!frame) {
         // This function returns a boolean value
         return !!context.nestedFrameId;
       }
 
       if (!BrowserElementPromptService.getBrowserElementParentForFrame(frame))
         return false;
 
       return true;
     } catch (e) {
       return false;
     }
-  }
+  },
 };
 
 function BrowserElementPromptFactory(toWrap) {
   this._wrapped = toWrap;
 }
 
 BrowserElementPromptFactory.prototype = {
   classID: Components.ID("{24f3d0cf-e417-4b85-9017-c9ecf8bb1299}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIPromptFactory]),
 
-  _mayUseNativePrompt: function() {
+  _mayUseNativePrompt() {
     try {
       return Services.prefs.getBoolPref("browser.prompt.allowNative");
     } catch (e) {
       // This properity is default to true.
       return true;
     }
   },
 
-  _getNativePromptIfAllowed: function(win, iid, err) {
+  _getNativePromptIfAllowed(win, iid, err) {
     if (this._mayUseNativePrompt())
       return this._wrapped.getPrompt(win, iid);
-    else {
+
       // Not allowed, throw an exception.
       throw err;
-    }
   },
 
-  getPrompt: function(win, iid) {
+  getPrompt(win, iid) {
     // It is possible for some object to get a prompt without passing
     // valid reference of window, like nsNSSComponent. In such case, we
     // should just fall back to the native prompt service
     if (!win)
       return this._getNativePromptIfAllowed(win, iid, Cr.NS_ERROR_INVALID_ARG);
 
     if (iid.number != Ci.nsIPrompt.number &&
         iid.number != Ci.nsIAuthPrompt2.number) {
@@ -537,42 +534,41 @@ BrowserElementPromptFactory.prototype = 
       // it doesn't mean that we should fallback. It is possible that we can
       // get the BrowserElementParent from nsIChannel that passed to
       // functions of nsIAuthPrompt2.
       if (this._mayUseNativePrompt()) {
         return new AuthPromptWrapper(
             this._wrapped.getPrompt(win, iid),
             new BrowserElementAuthPrompt().QueryInterface(iid))
           .QueryInterface(iid);
-      } else {
+      }
         // Falling back is not allowed, so we don't need wrap the
         // BrowserElementPrompt.
         return new BrowserElementAuthPrompt().QueryInterface(iid);
-      }
     }
 
     if (!browserElementChild) {
       debug("We can't find a browserElementChild for " +
             win + ", " + win.location);
       return this._getNativePromptIfAllowed(win, iid, Cr.NS_ERROR_FAILURE);
     }
 
     debug("Returning wrapped getPrompt for " + win);
     return new BrowserElementPrompt(win, browserElementChild)
                                    .QueryInterface(iid);
-  }
+  },
 };
 
 var BrowserElementPromptService = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
 
   _initialized: false,
 
-  _init: function() {
+  _init() {
     if (this._initialized) {
       return;
     }
 
     // If the pref is disabled, do nothing except wait for the pref to change.
     if (!this._browserFramesPrefEnabled()) {
       var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
       prefs.addObserver(BROWSER_FRAMES_ENABLED_PREF, this, /* ownsWeak = */ true);
@@ -595,82 +591,81 @@ var BrowserElementPromptService = {
       debug("WARNING: Wrapped prompt factory is already installed!");
       return;
     }
 
     var oldInstance = oldFactory.createInstance(null, Ci.nsIPromptFactory);
     var newInstance = new BrowserElementPromptFactory(oldInstance);
 
     var newFactory = {
-      createInstance: function(outer, iid) {
+      createInstance(outer, iid) {
         if (outer != null) {
           throw Cr.NS_ERROR_NO_AGGREGATION;
         }
         return newInstance.QueryInterface(iid);
-      }
+      },
     };
     Cm.registerFactory(newCID,
                        "BrowserElementPromptService's prompter;1 wrapper",
                        contractID, newFactory);
 
     debug("Done installing new prompt factory.");
   },
 
-  _getOuterWindowID: function(win) {
+  _getOuterWindowID(win) {
     return win.windowUtils.outerWindowID;
   },
 
   _browserElementChildMap: {},
-  mapWindowToBrowserElementChild: function(win, browserElementChild) {
+  mapWindowToBrowserElementChild(win, browserElementChild) {
     this._browserElementChildMap[this._getOuterWindowID(win)] = browserElementChild;
   },
-  unmapWindowToBrowserElementChild: function(win) {
+  unmapWindowToBrowserElementChild(win) {
     delete this._browserElementChildMap[this._getOuterWindowID(win)];
   },
 
-  getBrowserElementChildForWindow: function(win) {
+  getBrowserElementChildForWindow(win) {
     // We only have a mapping for <iframe mozbrowser>s, not their inner
     // <iframes>, so we look up win.top below.  window.top (when called from
     // script) respects <iframe mozbrowser> boundaries.
     return this._browserElementChildMap[this._getOuterWindowID(win.top)];
   },
 
-  mapFrameToBrowserElementParent: function(frame, browserElementParent) {
+  mapFrameToBrowserElementParent(frame, browserElementParent) {
     this._browserElementParentMap.set(frame, browserElementParent);
   },
 
-  getBrowserElementParentForFrame: function(frame) {
+  getBrowserElementParentForFrame(frame) {
     return this._browserElementParentMap.get(frame);
   },
 
-  _observeOuterWindowDestroyed: function(outerWindowID) {
+  _observeOuterWindowDestroyed(outerWindowID) {
     let id = outerWindowID.QueryInterface(Ci.nsISupportsPRUint64).data;
     debug("observeOuterWindowDestroyed " + id);
     delete this._browserElementChildMap[outerWindowID.data];
   },
 
-  _browserFramesPrefEnabled: function() {
+  _browserFramesPrefEnabled() {
     var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
     try {
       return prefs.getBoolPref(BROWSER_FRAMES_ENABLED_PREF);
-    }
-    catch(e) {
+    } catch (e) {
       return false;
     }
   },
 
-  observe: function(subject, topic, data) {
-    switch(topic) {
+  observe(subject, topic, data) {
+    switch (topic) {
     case NS_PREFBRANCH_PREFCHANGE_TOPIC_ID:
       if (data == BROWSER_FRAMES_ENABLED_PREF) {
         this._init();
       }
       break;
     case "outer-window-destroyed":
       this._observeOuterWindowDestroyed(subject);
       break;
     default:
       debug("Observed unexpected topic " + topic);
     }
-  }
+  },
 };
 
 BrowserElementPromptService._init();
--- a/dom/browser-element/mochitest/async.js
+++ b/dom/browser-element/mochitest/async.js
@@ -34,19 +34,19 @@
   function async(func, self) {
     return function asyncFunction() {
       const functionArgs = Array.from(arguments);
       return new Promise(function(resolve, reject) {
         var gen;
         if (typeof func !== "function") {
           reject(new TypeError("Expected a Function."));
         }
-        //not a generator, wrap it.
+        // not a generator, wrap it.
         if (func.constructor.name !== "GeneratorFunction") {
-          gen = (function*() {
+          gen = (function* () {
             return func.apply(self, functionArgs);
           }());
         } else {
           gen = func.apply(self, functionArgs);
         }
         try {
           step(gen.next(undefined));
         } catch (err) {
--- a/dom/browser-element/mochitest/browserElementTestHelpers.js
+++ b/dom/browser-element/mochitest/browserElementTestHelpers.js
@@ -4,129 +4,128 @@
 // Helpers for managing the browser frame preferences.
 "use strict";
 
 function _getPath() {
   if (window.location.protocol == "chrome:") {
     return "/chrome/dom/browser-element/mochitest";
   }
   return window.location.pathname
-               .substring(0, window.location.pathname.lastIndexOf('/'))
+               .substring(0, window.location.pathname.lastIndexOf("/"))
                .replace("/priority", "");
 }
 
 const browserElementTestHelpers = {
-  _getBoolPref: function(pref) {
+  _getBoolPref(pref) {
     try {
       return SpecialPowers.getBoolPref(pref);
-    }
-    catch (e) {
+    } catch (e) {
       return undefined;
     }
   },
 
-  _setPref: function(pref, value) {
+  _setPref(pref, value) {
     this.lockTestReady();
     if (value !== undefined && value !== null) {
-      SpecialPowers.pushPrefEnv({'set': [[pref, value]]}, this.unlockTestReady.bind(this));
+      SpecialPowers.pushPrefEnv({"set": [[pref, value]]}, this.unlockTestReady.bind(this));
     } else {
-      SpecialPowers.pushPrefEnv({'clear': [[pref]]}, this.unlockTestReady.bind(this));
+      SpecialPowers.pushPrefEnv({"clear": [[pref]]}, this.unlockTestReady.bind(this));
     }
   },
 
-  _setPrefs: function() {
+  _setPrefs() {
     this.lockTestReady();
-    SpecialPowers.pushPrefEnv({'set': Array.slice(arguments)}, this.unlockTestReady.bind(this));
+    SpecialPowers.pushPrefEnv({"set": Array.slice(arguments)}, this.unlockTestReady.bind(this));
   },
 
   _testReadyLockCount: 0,
   _firedTestReady: false,
-  lockTestReady: function() {
+  lockTestReady() {
     this._testReadyLockCount++;
   },
 
-  unlockTestReady: function() {
+  unlockTestReady() {
     this._testReadyLockCount--;
     if (this._testReadyLockCount == 0 && !this._firedTestReady) {
       this._firedTestReady = true;
       dispatchEvent(new Event("testready"));
     }
   },
 
-  enableProcessPriorityManager: function() {
+  enableProcessPriorityManager() {
     this._setPrefs(
-      ['dom.ipc.processPriorityManager.testMode', true],
-      ['dom.ipc.processPriorityManager.enabled', true]
+      ["dom.ipc.processPriorityManager.testMode", true],
+      ["dom.ipc.processPriorityManager.enabled", true]
     );
   },
 
-  setClipboardPlainTextOnlyPref: function(value) {
-    this._setPref('clipboard.plainTextOnly', value);
+  setClipboardPlainTextOnlyPref(value) {
+    this._setPref("clipboard.plainTextOnly", value);
   },
 
-  setEnabledPref: function(value) {
-    this._setPrefs(['dom.mozBrowserFramesEnabled', value],
-                   ['network.disable.ipc.security', value]);
+  setEnabledPref(value) {
+    this._setPrefs(["dom.mozBrowserFramesEnabled", value],
+                   ["network.disable.ipc.security", value]);
   },
 
-  setupAccessibleCaretPref: function() {
-    this._setPref('layout.accessiblecaret.enabled', true);
+  setupAccessibleCaretPref() {
+    this._setPref("layout.accessiblecaret.enabled", true);
     // Disable hide carets for mouse input for select-all tests so that we can
     // get mozbrowsercaretstatechanged events.
-    this._setPref('layout.accessiblecaret.hide_carets_for_mouse_input', false);
+    this._setPref("layout.accessiblecaret.hide_carets_for_mouse_input", false);
   },
 
-  getOOPByDefaultPref: function() {
+  getOOPByDefaultPref() {
     return this._getBoolPref("dom.ipc.browser_frames.oop_by_default");
   },
 
-  addPermission: function() {
+  addPermission() {
     this.lockTestReady();
     SpecialPowers.pushPermissions(
-      [{'type': "browser", 'allow': 1, 'context': document}],
+      [{"type": "browser", "allow": 1, "context": document}],
       this.unlockTestReady.bind(this));
   },
 
-  allowTopLevelDataURINavigation: function() {
+  allowTopLevelDataURINavigation() {
     this._setPref("security.data_uri.block_toplevel_data_uri_navigations", false);
   },
 
   _observers: [],
 
   // This function is a wrapper which lets you register an observer to one of
   // the process priority manager's test-only topics.  observerFn should be a
   // function which takes (subject, topic, data).
   //
   // We'll clean up any observers you add at the end of the test.
-  addProcessPriorityObserver: function(processPriorityTopic, observerFn) {
+  addProcessPriorityObserver(processPriorityTopic, observerFn) {
     var topic = "process-priority-manager:TEST-ONLY:" + processPriorityTopic;
 
     // SpecialPowers appears to require that the observer be an object, not a
     // function.
     var observer = {
-      observe: observerFn
+      observe: observerFn,
     };
 
     SpecialPowers.addObserver(observer, topic);
     this._observers.push([observer, topic]);
   },
 
-  cleanUp: function() {
+  cleanUp() {
     for (var i = 0; i < this._observers.length; i++) {
       SpecialPowers.removeObserver(this._observers[i][0],
                                    this._observers[i][1]);
     }
   },
 
   // Some basically-empty pages from different domains you can load.
-  'emptyPage1': 'http://example.com' + _getPath() + '/file_empty.html',
-  'fileEmptyPage1': 'file_empty.html',
-  'emptyPage2': 'http://example.org' + _getPath() + '/file_empty.html',
-  'emptyPage3': 'http://test1.example.org' + _getPath() + '/file_empty.html',
-  'focusPage': 'http://example.org' + _getPath() + '/file_focus.html',
+  "emptyPage1": "http://example.com" + _getPath() + "/file_empty.html",
+  "fileEmptyPage1": "file_empty.html",
+  "emptyPage2": "http://example.org" + _getPath() + "/file_empty.html",
+  "emptyPage3": "http://test1.example.org" + _getPath() + "/file_empty.html",
+  "focusPage": "http://example.org" + _getPath() + "/file_focus.html",
 };
 
 // Returns a promise which is resolved when a subprocess is created.  The
 // argument to resolve() is the childID of the subprocess.
 function expectProcessCreated(/* optional */ initialPriority) {
   return new Promise(function(resolve, reject) {
     var observed = false;
     browserElementTestHelpers.addProcessPriorityObserver(
@@ -135,17 +134,17 @@ function expectProcessCreated(/* optiona
         // Don't run this observer twice, so we don't ok(true) twice.  (It's fine
         // to resolve a promise twice; the second resolve() call does nothing.)
         if (observed) {
           return;
         }
         observed = true;
 
         var childID = parseInt(data);
-        ok(true, 'Got new process, id=' + childID);
+        ok(true, "Got new process, id=" + childID);
         if (initialPriority) {
           expectPriorityChange(childID, initialPriority).then(function() {
             resolve(childID);
           });
         } else {
           resolve(childID);
         }
       }
@@ -154,65 +153,65 @@ function expectProcessCreated(/* optiona
 }
 
 // Just like expectProcessCreated(), except we'll call ok(false) if a second
 // process is created.
 function expectOnlyOneProcessCreated(/* optional */ initialPriority) {
   var p = expectProcessCreated(initialPriority);
   p.then(function() {
     expectProcessCreated().then(function(childID) {
-      ok(false, 'Got unexpected process creation, childID=' + childID);
+      ok(false, "Got unexpected process creation, childID=" + childID);
     });
   });
   return p;
 }
 
 // Returns a promise which is resolved or rejected the next time the process
 // childID changes its priority. We resolve if the priority matches
 // expectedPriority, and we reject otherwise.
 
 function expectPriorityChange(childID, expectedPriority) {
   return new Promise(function(resolve, reject) {
     var observed = false;
     browserElementTestHelpers.addProcessPriorityObserver(
-      'process-priority-set',
+      "process-priority-set",
       function(subject, topic, data) {
         if (observed) {
           return;
         }
 
         var [id, priority] = data.split(":");
         if (id != childID) {
           return;
         }
 
         // Make sure we run the is() calls in this observer only once, otherwise
         // we'll expect /every/ priority change to match expectedPriority.
         observed = true;
 
         is(priority, expectedPriority,
-           'Expected priority of childID ' + childID +
-           ' to change to ' + expectedPriority);
+           "Expected priority of childID " + childID +
+           " to change to " + expectedPriority);
 
         if (priority == expectedPriority) {
           resolve();
         } else {
           reject();
         }
       }
     );
   });
 }
 
 // Returns a promise which is resolved the first time the given iframe fires
 // the mozbrowser##eventName event.
 function expectMozbrowserEvent(iframe, eventName) {
   return new Promise(function(resolve, reject) {
-    iframe.addEventListener('mozbrowser' + eventName, function handler(e) {
-      iframe.removeEventListener('mozbrowser' + eventName, handler);
+    iframe.addEventListener("mozbrowser" + eventName, function handler(e) {
+      iframe.removeEventListener("mozbrowser" + eventName, handler);
       resolve(e);
     });
   });
 }
 
 // Set some prefs:
 //
 //  * browser.pagethumbnails.capturing_disabled: true
@@ -244,28 +243,28 @@ function expectMozbrowserEvent(iframe, e
 //    it to false.
 //
 //  * security.mixed_content.block_active_content: false
 //
 //    Disable mixed active content blocking, so that tests can confirm that mixed
 //    content results in a broken security state.
 
 (function() {
-  var oop = !location.pathname.includes('_inproc_');
+  var oop = !location.pathname.includes("_inproc_");
 
   browserElementTestHelpers.lockTestReady();
   SpecialPowers.setBoolPref("network.disable.ipc.security", true);
   SpecialPowers.pushPrefEnv({set: [["browser.pagethumbnails.capturing_disabled", true],
                                    ["dom.ipc.browser_frames.oop_by_default", oop],
                                    ["dom.ipc.tabs.disabled", false],
                                    ["security.mixed_content.block_active_content", false]]},
                             browserElementTestHelpers.unlockTestReady.bind(browserElementTestHelpers));
 })();
 
-addEventListener('unload', function() {
+addEventListener("unload", function() {
   browserElementTestHelpers.cleanUp();
 });
 
 // Wait for the load event before unlocking the test-ready event.
 browserElementTestHelpers.lockTestReady();
-addEventListener('load', function() {
+addEventListener("load", function() {
   SimpleTest.executeSoon(browserElementTestHelpers.unlockTestReady.bind(browserElementTestHelpers));
 });
--- a/dom/browser-element/mochitest/browserElement_Alert.js
+++ b/dom/browser-element/mochitest/browserElement_Alert.js
@@ -8,44 +8,43 @@ SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 var numPendingChildTests = 0;
 var iframe;
 var mm;
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
-  mm.addMessageListener('test-success', function(msg) {
+  mm.addMessageListener("test-success", function(msg) {
     numPendingChildTests--;
     ok(true, SpecialPowers.wrap(msg).json);
   });
-  mm.addMessageListener('test-fail', function(msg) {
+  mm.addMessageListener("test-fail", function(msg) {
     numPendingChildTests--;
     ok(false, SpecialPowers.wrap(msg).json);
   });
 
   // Wait for the initial load to finish, then navigate the page, then wait
   // for that load to finish, then start test1.
-  iframe.addEventListener('mozbrowserloadend', function() {
+  iframe.addEventListener("mozbrowserloadend", function() {
     iframe.src = browserElementTestHelpers.emptyPage1;
 
-    iframe.addEventListener('mozbrowserloadend', function() {
+    iframe.addEventListener("mozbrowserloadend", function() {
       SimpleTest.executeSoon(test1);
     }, {once: true});
   }, {once: true});
-
 }
 
 function test1() {
-  iframe.addEventListener('mozbrowsershowmodalprompt', test2);
+  iframe.addEventListener("mozbrowsershowmodalprompt", test2);
 
   // Do window.alert within the iframe, then modify the global |testState|
   // after the alert.
   var script = 'data:,\
     this.testState = 0; \
     content.alert("Hello, world!"); \
     this.testState = 1; \
   ';
@@ -54,17 +53,17 @@ function test1() {
 
   // Triggers a mozbrowsershowmodalprompt event, which sends us down to test2.
 }
 
 // test2 is a mozbrowsershowmodalprompt listener.
 function test2(e) {
   iframe.removeEventListener("mozbrowsershowmodalprompt", test2);
 
-  is(e.detail.message, 'Hello, world!');
+  is(e.detail.message, "Hello, world!");
   e.preventDefault(); // cause the alert to block.
 
   SimpleTest.executeSoon(function() { test2a(e); });
 }
 
 function test2a(e) {
   // The iframe should be blocked on the alert call at the moment, so testState
   // should still be 0.
@@ -93,78 +92,78 @@ function test3(e) {
     else { \
       sendAsyncMessage("test-try-again", "2: Wrong testState (for now): " + this.testState); \
     }';
 
   // Urgh.  e.unblock() didn't necessarily unblock us immediately, so we have
   // to spin and wait.
   function onTryAgain() {
     SimpleTest.executeSoon(function() {
-      //dump('onTryAgain\n');
+      // dump('onTryAgain\n');
       mm.loadFrameScript(script2, /* allowDelayedLoad = */ false);
     });
   }
 
-  mm.addMessageListener('test-try-again', onTryAgain);
+  mm.addMessageListener("test-try-again", onTryAgain);
   numPendingChildTests++;
 
   onTryAgain();
   waitForPendingTests(function() {
-    mm.removeMessageListener('test-try-again', onTryAgain);
+    mm.removeMessageListener("test-try-again", onTryAgain);
     test4();
   });
 }
 
 function test4() {
   // Navigate the iframe while an alert is pending.  This shouldn't screw
   // things up.
 
   iframe.addEventListener("mozbrowsershowmodalprompt", test5);
 
   var script = 'data:,content.alert("test4");';
   mm.loadFrameScript(script, /* allowDelayedLoad = */ false);
 }
 
 // test4 is a mozbrowsershowmodalprompt listener.
 function test5(e) {
-  iframe.removeEventListener('mozbrowsershowmodalprompt', test5);
+  iframe.removeEventListener("mozbrowsershowmodalprompt", test5);
 
-  is(e.detail.message, 'test4');
+  is(e.detail.message, "test4");
   e.preventDefault(); // cause the page to block.
 
   SimpleTest.executeSoon(test5a);
 }
 
 function test5a() {
-  iframe.addEventListener('mozbrowserloadend', test5b);
+  iframe.addEventListener("mozbrowserloadend", test5b);
   iframe.src = browserElementTestHelpers.emptyPage2;
 }
 
 function test5b() {
-  iframe.removeEventListener('mozbrowserloadend', test5b);
+  iframe.removeEventListener("mozbrowserloadend", test5b);
   SimpleTest.executeSoon(test6);
 }
 
 // Test nested alerts
 var promptBlockers = [];
 function test6() {
   iframe.addEventListener("mozbrowsershowmodalprompt", test6a);
 
-  var script = 'data:,\
+  var script = "data:,\
     this.testState = 0; \
     content.alert(1); \
     this.testState = 3; \
-  ';
+  ";
   mm.loadFrameScript(script, /* allowDelayedLoad = */ false);
 }
 
 function test6a(e) {
   iframe.removeEventListener("mozbrowsershowmodalprompt", test6a);
 
-  is(e.detail.message, '1');
+  is(e.detail.message, "1");
   e.preventDefault(); // cause the alert to block.
   promptBlockers.push(e);
 
   SimpleTest.executeSoon(test6b);
 }
 
 function test6b() {
   var script = 'data:,\
@@ -178,28 +177,28 @@ function test6b() {
   numPendingChildTests++;
 
   waitForPendingTests(test6c);
 }
 
 function test6c() {
   iframe.addEventListener("mozbrowsershowmodalprompt", test6d);
 
-  var script = 'data:,\
+  var script = "data:,\
     this.testState = 1; \
     content.alert(2); \
     this.testState = 2; \
-  ';
+  ";
   mm.loadFrameScript(script, /* allowDelayedLoad = */ false);
 }
 
 function test6d(e) {
   iframe.removeEventListener("mozbrowsershowmodalprompt", test6d);
 
-  is(e.detail.message, '2');
+  is(e.detail.message, "2");
   e.preventDefault(); // cause the alert to block.
   promptBlockers.push(e);
 
   SimpleTest.executeSoon(test6e);
 }
 
 function test6e() {
   var script = 'data:,\
@@ -227,27 +226,27 @@ function test6f() {
     else { \
       sendAsyncMessage("test-try-again", "3: Wrong testState (for now): " + this.testState); \
     }';
 
   // Urgh.  e.unblock() didn't necessarily unblock us immediately, so we have
   // to spin and wait.
   function onTryAgain() {
     SimpleTest.executeSoon(function() {
-      //dump('onTryAgain\n');
+      // dump('onTryAgain\n');
       mm.loadFrameScript(script2, /* allowDelayedLoad = */ false);
     });
   }
 
-  mm.addMessageListener('test-try-again', onTryAgain);
+  mm.addMessageListener("test-try-again", onTryAgain);
   numPendingChildTests++;
 
   onTryAgain();
   waitForPendingTests(function() {
-    mm.removeMessageListener('test-try-again', onTryAgain);
+    mm.removeMessageListener("test-try-again", onTryAgain);
     test6g();
   });
 }
 
 function test6g() {
   var e = promptBlockers.pop();
   // Now unblock the iframe and check that the script completed.
   e.detail.unblock();
@@ -259,27 +258,27 @@ function test6g() {
     else { \
       sendAsyncMessage("test-try-again", "4: Wrong testState (for now): " + this.testState); \
     }';
 
   // Urgh.  e.unblock() didn't necessarily unblock us immediately, so we have
   // to spin and wait.
   function onTryAgain() {
     SimpleTest.executeSoon(function() {
-      //dump('onTryAgain\n');
+      // dump('onTryAgain\n');
       mm.loadFrameScript(script2, /* allowDelayedLoad = */ false);
     });
   }
 
-  mm.addMessageListener('test-try-again', onTryAgain);
+  mm.addMessageListener("test-try-again", onTryAgain);
   numPendingChildTests++;
 
   onTryAgain();
   waitForPendingTests(function() {
-    mm.removeMessageListener('test-try-again', onTryAgain);
+    mm.removeMessageListener("test-try-again", onTryAgain);
     test6h();
   });
 }
 
 function test6h() {
   SimpleTest.finish();
 }
 
@@ -294,9 +293,9 @@ function waitForPendingTests(next) {
     SimpleTest.executeSoon(function() { waitForPendingTests(next); });
     return;
   }
 
   prevNumPendingTests = null;
   next();
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_AlertInFrame.js
+++ b/dom/browser-element/mochitest/browserElement_AlertInFrame.js
@@ -4,21 +4,21 @@
 // Test that alert works from inside an <iframe> inside an <iframe mozbrowser>.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    is(e.detail.message, 'Hello');
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    is(e.detail.message, "Hello");
     SimpleTest.finish();
   });
 
-  iframe.src = 'file_browserElement_AlertInFrame.html';
+  iframe.src = "file_browserElement_AlertInFrame.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Auth.js
+++ b/dom/browser-element/mochitest/browserElement_Auth.js
@@ -3,210 +3,210 @@
 
 // Test that auth prompt works.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
-const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm');
+const { NetUtil } = SpecialPowers.Cu.import("resource://gre/modules/NetUtil.jsm");
 
 function testFail(msg) {
   ok(false, JSON.stringify(msg));
 }
 
 var iframe;
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   // Wait for the initial load to finish, then navigate the page, then start test
   // by loading SJS with http 401 response.
-  iframe.addEventListener('mozbrowserloadend', function() {
-    iframe.addEventListener('mozbrowserusernameandpasswordrequired', testHttpAuthCancel);
+  iframe.addEventListener("mozbrowserloadend", function() {
+    iframe.addEventListener("mozbrowserusernameandpasswordrequired", testHttpAuthCancel);
     SimpleTest.executeSoon(function() {
       // Use absolute path because we need to specify host.
-      iframe.src = 'http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs';
+      iframe.src = "http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs";
     });
   }, {once: true});
 }
 
 function testHttpAuthCancel(e) {
   iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testHttpAuthCancel);
   // Will cancel authentication, but prompt should not be shown again. Instead,
   // we will be led to fail message
   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail);
   iframe.addEventListener("mozbrowsertitlechange", function(e) {
     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail);
-    is(e.detail, 'http auth failed', 'expected authentication to fail');
-    iframe.addEventListener('mozbrowserusernameandpasswordrequired', testHttpAuth);
+    is(e.detail, "http auth failed", "expected authentication to fail");
+    iframe.addEventListener("mozbrowserusernameandpasswordrequired", testHttpAuth);
     SimpleTest.executeSoon(function() {
       // Use absolute path because we need to specify host.
-      iframe.src = 'http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs';
+      iframe.src = "http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs";
     });
   }, {once: true});
 
-  is(e.detail.realm, 'http_realm', 'expected realm matches');
-  is(e.detail.host, 'http://test', 'expected host matches');
+  is(e.detail.realm, "http_realm", "expected realm matches");
+  is(e.detail.host, "http://test", "expected host matches");
   is(e.detail.path,
-     '/tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-     'expected path matches');
+     "/tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+     "expected path matches");
   e.preventDefault();
 
   SimpleTest.executeSoon(function() {
     e.detail.cancel();
   });
 }
 
 function testHttpAuth(e) {
   iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testHttpAuth);
 
   // Will authenticate with correct password, prompt should not be
   // called again.
   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail);
   iframe.addEventListener("mozbrowsertitlechange", function(e) {
     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail);
-    is(e.detail, 'http auth success', 'expect authentication to succeed');
+    is(e.detail, "http auth success", "expect authentication to succeed");
     SimpleTest.executeSoon(testProxyAuth);
   }, {once: true});
 
-  is(e.detail.realm, 'http_realm', 'expected realm matches');
-  is(e.detail.host, 'http://test', 'expected host matches');
+  is(e.detail.realm, "http_realm", "expected realm matches");
+  is(e.detail.host, "http://test", "expected host matches");
   is(e.detail.path,
-     '/tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-     'expected path matches');
-  is(e.detail.isProxy, false, 'expected isProxy is false');
+     "/tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+     "expected path matches");
+  is(e.detail.isProxy, false, "expected isProxy is false");
   e.preventDefault();
 
   SimpleTest.executeSoon(function() {
     e.detail.authenticate("httpuser", "httppass");
   });
 }
 
 function testProxyAuth(e) {
   // The testingSJS simulates the 407 proxy authentication required response
   // for proxy server, which will trigger the browser element to send prompt
   // event with proxy infomation.
-  var testingSJS = 'http://test/tests/dom/browser-element/mochitest/file_http_407_response.sjs';
+  var testingSJS = "http://test/tests/dom/browser-element/mochitest/file_http_407_response.sjs";
   var mozproxy;
 
   function onUserNameAndPasswordRequired(e) {
     iframe.removeEventListener("mozbrowserusernameandpasswordrequired",
                                onUserNameAndPasswordRequired);
     iframe.addEventListener("mozbrowsertitlechange", function(e) {
       iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail);
-      is(e.detail, 'http auth success', 'expect authentication to succeed');
+      is(e.detail, "http auth success", "expect authentication to succeed");
       SimpleTest.executeSoon(testAuthJarNoInterfere);
     }, {once: true});
 
-    is(e.detail.realm, 'http_realm', 'expected realm matches');
-    is(e.detail.host, mozproxy, 'expected host matches');
+    is(e.detail.realm, "http_realm", "expected realm matches");
+    is(e.detail.host, mozproxy, "expected host matches");
     is(e.detail.path,
-       '/tests/dom/browser-element/mochitest/file_http_407_response.sjs',
-       'expected path matches');
-    is(e.detail.isProxy, true, 'expected isProxy is true');
+       "/tests/dom/browser-element/mochitest/file_http_407_response.sjs",
+       "expected path matches");
+    is(e.detail.isProxy, true, "expected isProxy is true");
     e.preventDefault();
 
     SimpleTest.executeSoon(function() {
       e.detail.authenticate("proxyuser", "proxypass");
     });
   }
 
   // Resolve proxy information used by the test suite, we need it to validate
   // whether the proxy information delivered with the prompt event is correct.
   var resolveCallback = SpecialPowers.wrapCallbackObject({
-    QueryInterface: function (iid) {
+    // eslint-disable-next-line mozilla/use-chromeutils-generateqi
+    QueryInterface(iid) {
       const interfaces = [Ci.nsIProtocolProxyCallback, Ci.nsISupports];
-
-      if (!interfaces.some( function(v) { return iid.equals(v) } )) {
+      if (!interfaces.some( function(v) { return iid.equals(v); } )) {
         throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
       }
       return this;
     },
 
-    onProxyAvailable: function (req, channel, pi, status) {
-      isnot(pi, null, 'expected proxy information available');
+    onProxyAvailable(req, channel, pi, status) {
+      isnot(pi, null, "expected proxy information available");
       if (pi) {
         mozproxy = "moz-proxy://" + pi.host + ":" + pi.port;
       }
       iframe.addEventListener("mozbrowserusernameandpasswordrequired",
                               onUserNameAndPasswordRequired);
 
       iframe.src = testingSJS;
-    }
+    },
   });
 
   var channel = NetUtil.newChannel({
     uri: testingSJS,
-    loadUsingSystemPrincipal: true
+    loadUsingSystemPrincipal: true,
   });
 
   var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"]
             .getService();
 
   pps.asyncResolve(channel, 0, resolveCallback);
 }
 
 function testAuthJarNoInterfere(e) {
-  var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
+  var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"]
     .getService(SpecialPowers.Ci.nsIHttpAuthManager);
   var secMan = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
                .getService(SpecialPowers.Ci.nsIScriptSecurityManager);
   var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
                   .getService(SpecialPowers.Ci.nsIIOService);
   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs");
 
   // Set a bunch of auth data that should not conflict with the correct auth data already
   // stored in the cache.
   var attrs = {appId: 1};
   var principal = secMan.createCodebasePrincipal(uri, attrs);
-  authMgr.setAuthIdentity('http', 'test', -1, 'basic', 'http_realm',
-                          'tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-                          '', 'httpuser', 'wrongpass', false, principal);
+  authMgr.setAuthIdentity("http", "test", -1, "basic", "http_realm",
+                          "tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+                          "", "httpuser", "wrongpass", false, principal);
   attrs = {appId: 1, inIsolatedMozBrowser: true};
   principal = secMan.createCodebasePrincipal(uri, attrs);
-  authMgr.setAuthIdentity('http', 'test', -1, 'basic', 'http_realm',
-                          'tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-                          '', 'httpuser', 'wrongpass', false, principal);
+  authMgr.setAuthIdentity("http", "test", -1, "basic", "http_realm",
+                          "tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+                          "", "httpuser", "wrongpass", false, principal);
   principal = secMan.createCodebasePrincipal(uri, {});
-  authMgr.setAuthIdentity('http', 'test', -1, 'basic', 'http_realm',
-                          'tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-                          '', 'httpuser', 'wrongpass', false, principal);
+  authMgr.setAuthIdentity("http", "test", -1, "basic", "http_realm",
+                          "tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+                          "", "httpuser", "wrongpass", false, principal);
 
   // Will authenticate with correct password, prompt should not be
   // called again.
   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail);
   iframe.addEventListener("mozbrowsertitlechange", function(e) {
     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail);
-    is(e.detail, 'http auth success', 'expected authentication success');
+    is(e.detail, "http auth success", "expected authentication success");
     SimpleTest.executeSoon(testAuthJarInterfere);
   }, {once: true});
 
   // Once more with feeling. Ensure that our new auth data doesn't interfere with this mozbrowser's
   // auth data.
-  iframe.src = 'http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs';
+  iframe.src = "http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs";
 }
 
 function testAuthJarInterfere(e) {
-  var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
+  var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"]
     .getService(SpecialPowers.Ci.nsIHttpAuthManager);
   var secMan = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
                .getService(SpecialPowers.Ci.nsIScriptSecurityManager);
   var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
                   .getService(SpecialPowers.Ci.nsIIOService);
   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs");
 
   // Set some auth data that should overwrite the successful stored details.
   var principal = secMan.createCodebasePrincipal(uri, {inIsolatedMozBrowser: true});
-  authMgr.setAuthIdentity('http', 'test', -1, 'basic', 'http_realm',
-                          'tests/dom/browser-element/mochitest/file_http_401_response.sjs',
-                          '', 'httpuser', 'wrongpass', false, principal);
+  authMgr.setAuthIdentity("http", "test", -1, "basic", "http_realm",
+                          "tests/dom/browser-element/mochitest/file_http_401_response.sjs",
+                          "", "httpuser", "wrongpass", false, principal);
 
   // Will authenticate with correct password, prompt should not be
   // called again.
   var gotusernamepasswordrequired = false;
   function onUserNameAndPasswordRequired() {
       gotusernamepasswordrequired = true;
   }
   iframe.addEventListener("mozbrowserusernameandpasswordrequired",
@@ -216,29 +216,28 @@ function testAuthJarInterfere(e) {
                                onUserNameAndPasswordRequired);
     ok(gotusernamepasswordrequired,
        "Should have dispatched mozbrowserusernameandpasswordrequired event");
     testFinish();
   }, {once: true});
 
   // Once more with feeling. Ensure that our new auth data interferes with this mozbrowser's
   // auth data.
-  iframe.src = 'http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs';
+  iframe.src = "http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs";
 }
 
 function testFinish() {
   // Clear login information stored in password manager.
-  var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
+  var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"]
     .getService(SpecialPowers.Ci.nsIHttpAuthManager);
   authMgr.clearAll();
 
   var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
     .getService(SpecialPowers.Ci.nsILoginManager);
   pwmgr.removeAllLogins();
 
   SimpleTest.finish();
 }
 
-addEventListener('testready', function() {
+addEventListener("testready", function() {
   // Enable http authentiication.
-  SpecialPowers.pushPrefEnv({'set': [['network.auth.non-web-content-triggered-resources-http-auth-allow', true]]}, runTest);
+  SpecialPowers.pushPrefEnv({"set": [["network.auth.non-web-content-triggered-resources-http-auth-allow", true]]}, runTest);
 });
-
--- a/dom/browser-element/mochitest/browserElement_BackForward.js
+++ b/dom/browser-element/mochitest/browserElement_BackForward.js
@@ -8,26 +8,26 @@
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 
 var iframe;
 function addOneShotIframeEventListener(event, fn) {
   function wrapper(e) {
     iframe.removeEventListener(event, wrapper);
     fn(e);
-  };
+  }
 
   iframe.addEventListener(event, wrapper);
 }
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  addOneShotIframeEventListener('mozbrowserloadend', function() {
+  addOneShotIframeEventListener("mozbrowserloadend", function() {
     SimpleTest.executeSoon(test2);
   });
 
   iframe.src = browserElementTestHelpers.emptyPage1;
   document.body.appendChild(iframe);
 }
 
 function checkCanGoBackAndForward(canGoBack, canGoForward, nextTest) {
@@ -54,51 +54,51 @@ function checkCanGoBackAndForward(canGoB
   }
 }
 
 function test2() {
   checkCanGoBackAndForward(false, false, test3);
 }
 
 function test3() {
-  addOneShotIframeEventListener('mozbrowserloadend', function() {
+  addOneShotIframeEventListener("mozbrowserloadend", function() {
     checkCanGoBackAndForward(true, false, test4);
   });
 
   SimpleTest.executeSoon(function() {
     iframe.src = browserElementTestHelpers.emptyPage2;
   });
 }
 
 function test4() {
-  addOneShotIframeEventListener('mozbrowserlocationchange', function(e) {
+  addOneShotIframeEventListener("mozbrowserlocationchange", function(e) {
     is(e.detail.url, browserElementTestHelpers.emptyPage3);
     is(e.detail.canGoBack, true);
     is(e.detail.canGoForward, false);
     checkCanGoBackAndForward(true, false, test5);
   });
 
   SimpleTest.executeSoon(function() {
     iframe.src = browserElementTestHelpers.emptyPage3;
   });
 }
 
 function test5() {
-  addOneShotIframeEventListener('mozbrowserlocationchange', function(e) {
+  addOneShotIframeEventListener("mozbrowserlocationchange", function(e) {
     is(e.detail.url, browserElementTestHelpers.emptyPage2);
     is(e.detail.canGoBack, true);
     is(e.detail.canGoForward, true);
     checkCanGoBackAndForward(true, true, test6);
   });
   iframe.goBack();
 }
 
 function test6() {
-  addOneShotIframeEventListener('mozbrowserlocationchange', function(e) {
+  addOneShotIframeEventListener("mozbrowserlocationchange", function(e) {
     is(e.detail.url, browserElementTestHelpers.emptyPage1);
     is(e.detail.canGoBack, false);
     is(e.detail.canGoForward, true);
     checkCanGoBackAndForward(false, true, SimpleTest.finish);
   });
   iframe.goBack();
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_BrowserWindowNamespace.js
+++ b/dom/browser-element/mochitest/browserElement_BrowserWindowNamespace.js
@@ -7,51 +7,50 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
 
   // Two mozbrowser frames with the same code both do the same
   // window.open("foo", "bar") call.  We should only get one
   // mozbrowseropenwindow event.
 
-  iframe1.addEventListener('mozbrowseropenwindow', function(e) {
+  iframe1.addEventListener("mozbrowseropenwindow", function(e) {
     ok(true, "Got first mozbrowseropenwindow event.");
     document.body.appendChild(e.detail.frameElement);
 
-    e.detail.frameElement.addEventListener('mozbrowserlocationchange', function(e) {
+    e.detail.frameElement.addEventListener("mozbrowserlocationchange", function(e) {
       if (e.detail.url == "http://example.com/#2") {
         ok(true, "Got locationchange to http://example.com/#2");
         SimpleTest.finish();
-      }
-      else {
+      } else {
         ok(true, "Got locationchange to " + e.detail.url);
       }
     });
 
     SimpleTest.executeSoon(function() {
-      var iframe2 = document.createElement('iframe');
+      var iframe2 = document.createElement("iframe");
       // Make sure that iframe1 and iframe2 are in the same TabGroup by linking
       // them through opener. Right now this API requires chrome privileges, as
       // it is on MozFrameLoaderOwner.
       SpecialPowers.wrap(iframe2).presetOpenerWindow(iframe1.contentWindow);
-      iframe2.setAttribute('mozbrowser', 'true');
+      iframe2.setAttribute("mozbrowser", "true");
 
-      iframe2.addEventListener('mozbrowseropenwindow', function(e) {
+      iframe2.addEventListener("mozbrowseropenwindow", function(e) {
         ok(false, "Got second mozbrowseropenwindow event.");
       });
 
       document.body.appendChild(iframe2);
-      iframe2.src = 'file_browserElement_BrowserWindowNamespace.html#2';
+      iframe2.src = "file_browserElement_BrowserWindowNamespace.html#2";
     });
   });
 
   document.body.appendChild(iframe1);
-  iframe1.src = 'file_browserElement_BrowserWindowNamespace.html#1';
+  iframe1.src = "file_browserElement_BrowserWindowNamespace.html#1";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js
+++ b/dom/browser-element/mochitest/browserElement_BrowserWindowResize.js
@@ -20,33 +20,33 @@ function runTest() {
     <script type='application/javascript'> \
       window.resizeBy(-100, -100);         \
     <\/script>                             \
   ";
 
   var count = 0;
   function checkSize(iframe) {
     count++;
-    is(iframe.clientWidth,  400, "iframe width does not change");
+    is(iframe.clientWidth, 400, "iframe width does not change");
     is(iframe.clientHeight, 400, "iframe height does not change");
     if (count == 2) {
       SimpleTest.finish();
     }
   }
 
   function testIFrameWithSrc(src) {
-    var iframe = document.createElement('iframe');
-    iframe.setAttribute('mozbrowser', 'true');
+    var iframe = document.createElement("iframe");
+    iframe.setAttribute("mozbrowser", "true");
     iframe.style = "border:none; width:400px; height:400px;";
     iframe.src = src;
-    iframe.addEventListener("mozbrowserresize", function (e) {
-      is(e.detail.width,  300, "Received correct resize event width");
+    iframe.addEventListener("mozbrowserresize", function(e) {
+      is(e.detail.width, 300, "Received correct resize event width");
       is(e.detail.height, 300, "Received correct resize event height");
       SimpleTest.executeSoon(checkSize.bind(undefined, iframe));
     });
     document.body.appendChild(iframe);
   }
 
   testIFrameWithSrc(srcResizeTo);
   testIFrameWithSrc(srcResizeBy);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Close.js
+++ b/dom/browser-element/mochitest/browserElement_Close.js
@@ -5,21 +5,21 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   iframe.addEventListener("mozbrowserclose", function(e) {
     ok(true, "got mozbrowserclose event.");
     SimpleTest.finish();
   });
 
-  iframe.src = "data:text/html,<html><body><script>window.close()</scr"+"ipt></body></html>";
+  iframe.src = "data:text/html,<html><body><script>window.close()</scr" + "ipt></body></html>";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_CloseFromOpener.js
+++ b/dom/browser-element/mochitest/browserElement_CloseFromOpener.js
@@ -4,20 +4,20 @@
 // Bug 764718 - Test that window.close() works from the opener window.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
     ok(true, "got openwindow event.");
     document.body.appendChild(e.detail.frameElement);
 
     e.detail.frameElement.addEventListener("mozbrowserclose", function(e) {
       ok(true, "got mozbrowserclose event.");
       SimpleTest.finish();
     });
   });
@@ -25,9 +25,9 @@ function runTest() {
 
   document.body.appendChild(iframe);
 
   // file_browserElement_CloseFromOpener opens a new window and then calls
   // close() on it.
   iframe.src = "file_browserElement_CloseFromOpener.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
+++ b/dom/browser-element/mochitest/browserElement_ContextmenuEvents.js
@@ -1,352 +1,352 @@
-'use strict';
+"use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.setClipboardPlainTextOnlyPref(false);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
-var audioUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/audio.ogg';
-var videoUrl = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/short-video.ogv';
+var audioUrl = "http://mochi.test:8888/tests/dom/browser-element/mochitest/audio.ogg";
+var videoUrl = "http://mochi.test:8888/tests/dom/browser-element/mochitest/short-video.ogv";
 
 function runTests() {
   createIframe(function onIframeLoaded() {
     checkEmptyContextMenu();
   });
 }
 
 function checkEmptyContextMenu() {
-  sendContextMenuTo('body', function onContextMenu(detail) {
-    is(detail.contextmenu, null, 'Body context clicks have no context menu');
+  sendContextMenuTo("body", function onContextMenu(detail) {
+    is(detail.contextmenu, null, "Body context clicks have no context menu");
 
     checkInnerContextMenu();
   });
 }
 
 function checkInnerContextMenu() {
-  sendContextMenuTo('#inner-link', function onContextMenu(detail) {
-    is(detail.systemTargets.length, 1, 'Includes anchor data');
-    is(detail.contextmenu.items.length, 3, 'Inner clicks trigger correct customized menu');
-    is(detail.contextmenu.items[0].label, 'foo', 'Customized menu has a "foo" menu item');
-    is(detail.contextmenu.items[1].label, 'bar', 'Customized menu has a "bar" menu item');
-    is(detail.contextmenu.items[2].id, 'copy-link', '#inner-link has a copy-link menu item');
-    is(detail.contextmenu.customized, true, 'Make sure contextmenu has customized items');
+  sendContextMenuTo("#inner-link", function onContextMenu(detail) {
+    is(detail.systemTargets.length, 1, "Includes anchor data");
+    is(detail.contextmenu.items.length, 3, "Inner clicks trigger correct customized menu");
+    is(detail.contextmenu.items[0].label, "foo", 'Customized menu has a "foo" menu item');
+    is(detail.contextmenu.items[1].label, "bar", 'Customized menu has a "bar" menu item');
+    is(detail.contextmenu.items[2].id, "copy-link", "#inner-link has a copy-link menu item");
+    is(detail.contextmenu.customized, true, "Make sure contextmenu has customized items");
 
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'A', 'Reports correct nodeName');
-    is(target.data.uri, 'foo.html', 'Reports correct uri');
-    is(target.data.text, 'Menu 1', 'Reports correct link text');
+    is(target.nodeName, "A", "Reports correct nodeName");
+    is(target.data.uri, "foo.html", "Reports correct uri");
+    is(target.data.text, "Menu 1", "Reports correct link text");
 
     checkCustomContextMenu();
   });
 }
 
 function checkCustomContextMenu() {
-  sendContextMenuTo('#menu1-trigger', function onContextMenu(detail) {
-    is(detail.contextmenu.items.length, 2, 'trigger custom contextmenu');
+  sendContextMenuTo("#menu1-trigger", function onContextMenu(detail) {
+    is(detail.contextmenu.items.length, 2, "trigger custom contextmenu");
 
     checkNestedContextMenu();
   });
 }
 
 function checkNestedContextMenu() {
-  sendContextMenuTo('#menu2-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu2-trigger", function onContextMenu(detail) {
     var innerMenu = detail.contextmenu.items.filter(function(x) {
-      return x.type === 'menu';
+      return x.type === "menu";
     });
-    is(detail.systemTargets.length, 2, 'Includes two systemTargets');
-    is(detail.systemTargets[0].nodeName, 'IMG', 'Includes "IMG" node');
-    is(detail.systemTargets[0].data.uri, 'example.png', 'Img data has the correct uri');
-    is(detail.systemTargets[1].nodeName, 'A', 'Includes "A" node');
-    is(detail.systemTargets[1].data.uri, 'bar.html', 'Anchor has the correct uri');
-    ok(innerMenu.length > 0, 'Menu contains a nested menu');
+    is(detail.systemTargets.length, 2, "Includes two systemTargets");
+    is(detail.systemTargets[0].nodeName, "IMG", 'Includes "IMG" node');
+    is(detail.systemTargets[0].data.uri, "example.png", "Img data has the correct uri");
+    is(detail.systemTargets[1].nodeName, "A", 'Includes "A" node');
+    is(detail.systemTargets[1].data.uri, "bar.html", "Anchor has the correct uri");
+    ok(innerMenu.length > 0, "Menu contains a nested menu");
 
-    is(detail.contextmenu.items.length, 4, 'We have correct # of menu items')
-    is(detail.contextmenu.customized, true, 'Make sure contextmenu has customized items');
-    is(detail.contextmenu.items[0].label, 'outer', 'Customized menu has an "outer" menu item');
-    is(detail.contextmenu.items[1].label, 'submenu', 'Customized menu has an "submenu" menu item');
-    is(detail.contextmenu.items[2].id, 'copy-link', 'Has a copy-link menu item');
-    is(detail.contextmenu.items[3].id, 'copy-image', 'Has a copy-image menu item');
+    is(detail.contextmenu.items.length, 4, "We have correct # of menu items");
+    is(detail.contextmenu.customized, true, "Make sure contextmenu has customized items");
+    is(detail.contextmenu.items[0].label, "outer", 'Customized menu has an "outer" menu item');
+    is(detail.contextmenu.items[1].label, "submenu", 'Customized menu has an "submenu" menu item');
+    is(detail.contextmenu.items[2].id, "copy-link", "Has a copy-link menu item");
+    is(detail.contextmenu.items[3].id, "copy-image", "Has a copy-image menu item");
     checkPreviousContextMenuHandler();
   });
 }
 
  // Finished testing the data passed to the contextmenu handler,
  // now we start selecting contextmenu items
 function checkPreviousContextMenuHandler() {
   // This is previously triggered contextmenu data, since we have
   // fired subsequent contextmenus this should not be mistaken
   // for a current menuitem
   var detail = previousContextMenuDetail;
   var previousId = detail.contextmenu.items[0].id;
   checkContextMenuCallbackForId(detail, previousId, function onCallbackFired(label) {
-    is(label, null, 'Callback label should be empty since this handler is old');
+    is(label, null, "Callback label should be empty since this handler is old");
 
     checkCurrentContextMenuHandler();
   });
 }
 
 function checkCurrentContextMenuHandler() {
   // This triggers a current menuitem
   var detail = currentContextMenuDetail;
 
   var innerMenu = detail.contextmenu.items.filter(function(x) {
-    return x.type === 'menu';
+    return x.type === "menu";
   });
 
   var currentId = innerMenu[0].items[1].id;
   checkContextMenuCallbackForId(detail, currentId, function onCallbackFired(label) {
-    is(label, 'inner 2', 'Callback label should be set correctly');
+    is(label, "inner 2", "Callback label should be set correctly");
 
     checkAgainCurrentContextMenuHandler();
   });
 }
 
 function checkAgainCurrentContextMenuHandler() {
   // Once an item it selected, subsequent selections are ignored
   var detail = currentContextMenuDetail;
 
   var innerMenu = detail.contextmenu.items.filter(function(x) {
-    return x.type === 'menu';
+    return x.type === "menu";
   });
 
   var currentId = innerMenu[0].items[1].id;
   checkContextMenuCallbackForId(detail, currentId, function onCallbackFired(label) {
-    is(label, null, 'Callback label should be empty since this handler has already been used');
+    is(label, null, "Callback label should be empty since this handler has already been used");
 
     checkCallbackWithPreventDefault();
   });
-};
+}
 
 // Finished testing callbacks if the embedder calls preventDefault() on the
 // mozbrowsercontextmenu event, now we start checking for some cases where the embedder
 // does not want to call preventDefault() for some reasons.
 function checkCallbackWithPreventDefault() {
-  sendContextMenuTo('#menu1-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu1-trigger", function onContextMenu(detail) {
     var id = detail.contextmenu.items[0].id;
     checkContextMenuCallbackForId(detail, id, function onCallbackFired(label) {
-      is(label, 'foo', 'Callback label should be set correctly');
+      is(label, "foo", "Callback label should be set correctly");
 
       checkCallbackWithoutPreventDefault();
     });
   });
 }
 
 function checkCallbackWithoutPreventDefault() {
-  sendContextMenuTo('#menu1-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu1-trigger", function onContextMenu(detail) {
     var id = detail.contextmenu.items[0].id;
     checkContextMenuCallbackForId(detail, id, function onCallbackFired(label) {
-      is(label, null, 'Callback label should be null');
+      is(label, null, "Callback label should be null");
 
       checkImageContextMenu();
     });
   }, /* ignorePreventDefault */ true);
 }
 
 function checkImageContextMenu() {
-  sendContextMenuTo('#menu3-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu3-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'IMG', 'Reports correct nodeName');
-    is(target.data.uri, 'example.png', 'Reports correct uri');
-    is(detail.contextmenu.items.length, 1, 'Reports correct # of menu items');
-    is(detail.contextmenu.items[0].id, 'copy-image', 'IMG has a copy-image menu item');
-    is(detail.contextmenu.customized, false, 'Make sure we do not have customized items');
+    is(target.nodeName, "IMG", "Reports correct nodeName");
+    is(target.data.uri, "example.png", "Reports correct uri");
+    is(detail.contextmenu.items.length, 1, "Reports correct # of menu items");
+    is(detail.contextmenu.items[0].id, "copy-image", "IMG has a copy-image menu item");
+    is(detail.contextmenu.customized, false, "Make sure we do not have customized items");
 
     checkVideoContextMenu();
   }, /* ignorePreventDefault */ true);
 }
 
 function checkVideoContextMenu() {
-  sendContextMenuTo('#menu4-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu4-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'VIDEO', 'Reports correct nodeName');
-    is(target.data.uri, videoUrl, 'Reports uri correctly in data');
+    is(target.nodeName, "VIDEO", "Reports correct nodeName");
+    is(target.data.uri, videoUrl, "Reports uri correctly in data");
     is(target.data.hasVideo, true, 'Video data in video tag does "hasVideo"');
 
     checkAudioContextMenu();
   }, /* ignorePreventDefault */ true);
 }
 
 function checkAudioContextMenu() {
-  sendContextMenuTo('#menu6-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu6-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'AUDIO', 'Reports correct nodeName');
-    is(target.data.uri, audioUrl, 'Reports uri correctly in data');
+    is(target.nodeName, "AUDIO", "Reports correct nodeName");
+    is(target.data.uri, audioUrl, "Reports uri correctly in data");
 
     checkAudioinVideoContextMenu();
   }, /* ignorePreventDefault */ true);
 }
 
 function checkAudioinVideoContextMenu() {
-  sendSrcTo('#menu5-trigger', audioUrl, function onSrcSet() {
-    sendContextMenuTo('#menu5-trigger', function onContextMenu(detail) {
+  sendSrcTo("#menu5-trigger", audioUrl, function onSrcSet() {
+    sendContextMenuTo("#menu5-trigger", function onContextMenu(detail) {
       var target = detail.systemTargets[0];
-      is(target.nodeName, 'VIDEO', 'Reports correct nodeName');
-      is(target.data.uri, audioUrl, 'Reports uri correctly in data');
+      is(target.nodeName, "VIDEO", "Reports correct nodeName");
+      is(target.data.uri, audioUrl, "Reports uri correctly in data");
       is(target.data.hasVideo, false, 'Audio data in video tag reports no "hasVideo"');
 
       checkFormNoMethod();
     }, /* ignorePreventDefault */ true);
   });
 }
 
 function checkFormNoMethod() {
-  sendContextMenuTo('#menu7-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu7-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'INPUT', 'Reports correct nodeName');
-    is(target.data.method, 'get', 'Reports correct method');
-    is(target.data.action, 'no_method', 'Reports correct action url');
-    is(target.data.name, 'input1', 'Reports correct input name');
+    is(target.nodeName, "INPUT", "Reports correct nodeName");
+    is(target.data.method, "get", "Reports correct method");
+    is(target.data.action, "no_method", "Reports correct action url");
+    is(target.data.name, "input1", "Reports correct input name");
 
     checkFormGetMethod();
   }, /* ignorePreventDefault */ true);
 }
 
 function checkFormGetMethod() {
-  sendContextMenuTo('#menu8-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu8-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'INPUT', 'Reports correct nodeName');
-    is(target.data.method, 'get', 'Reports correct method');
-    is(target.data.action, 'http://example.com/get_method', 'Reports correct action url');
-    is(target.data.name, 'input2', 'Reports correct input name');
+    is(target.nodeName, "INPUT", "Reports correct nodeName");
+    is(target.data.method, "get", "Reports correct method");
+    is(target.data.action, "http://example.com/get_method", "Reports correct action url");
+    is(target.data.name, "input2", "Reports correct input name");
 
     checkFormPostMethod();
   }, /* ignorePreventDefault */ true);
 }
 
 function checkFormPostMethod() {
-  sendContextMenuTo('#menu9-trigger', function onContextMenu(detail) {
+  sendContextMenuTo("#menu9-trigger", function onContextMenu(detail) {
     var target = detail.systemTargets[0];
-    is(target.nodeName, 'INPUT', 'Reports correct nodeName');
-    is(target.data.method, 'post', 'Reports correct method');
-    is(target.data.action, 'post_method', 'Reports correct action url');
-    is(target.data.name, 'input3', 'Reports correct input name');
+    is(target.nodeName, "INPUT", "Reports correct nodeName");
+    is(target.data.method, "post", "Reports correct method");
+    is(target.data.action, "post_method", "Reports correct action url");
+    is(target.data.name, "input3", "Reports correct input name");
 
     SimpleTest.finish();
   }, /* ignorePreventDefault */ true);
 }
 
 /* Helpers */
 var mm = null;
 var previousContextMenuDetail = null;
 var currentContextMenuDetail = null;
 
 function sendSrcTo(selector, src, callback) {
-  mm.sendAsyncMessage('setsrc', { 'selector': selector, 'src': src });
-  mm.addMessageListener('test:srcset', function onSrcSet(msg) {
-    mm.removeMessageListener('test:srcset', onSrcSet);
+  mm.sendAsyncMessage("setsrc", { "selector": selector, "src": src });
+  mm.addMessageListener("test:srcset", function onSrcSet(msg) {
+    mm.removeMessageListener("test:srcset", onSrcSet);
     callback();
   });
 }
 
 function sendContextMenuTo(selector, callback, ignorePreventDefault) {
-  iframe.addEventListener('mozbrowsercontextmenu', function oncontextmenu(e) {
+  iframe.addEventListener("mozbrowsercontextmenu", function oncontextmenu(e) {
     iframe.removeEventListener(e.type, oncontextmenu);
 
     // The embedder should call preventDefault() on the event if it will handle
-    // it. Not calling preventDefault() means it won't handle the event and 
+    // it. Not calling preventDefault() means it won't handle the event and
     // should not be able to deal with context menu callbacks.
     if (ignorePreventDefault !== true) {
       e.preventDefault();
     }
 
     // Keep a reference to previous/current contextmenu event details.
     previousContextMenuDetail = currentContextMenuDetail;
     currentContextMenuDetail = e.detail;
 
     setTimeout(function() { callback(e.detail); });
   });
 
-  mm.sendAsyncMessage('contextmenu', { 'selector': selector });
+  mm.sendAsyncMessage("contextmenu", { "selector": selector });
 }
 
 function checkContextMenuCallbackForId(detail, id, callback) {
-  mm.addMessageListener('test:callbackfired', function onCallbackFired(msg) {
-    mm.removeMessageListener('test:callbackfired', onCallbackFired);
+  mm.addMessageListener("test:callbackfired", function onCallbackFired(msg) {
+    mm.removeMessageListener("test:callbackfired", onCallbackFired);
 
     msg = SpecialPowers.wrap(msg);
     setTimeout(function() { callback(msg.data.label); });
   });
 
   detail.contextMenuItemSelected(id);
 }
 
 
 var iframe = null;
 function createIframe(callback) {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.src = 'data:text/html,<html>' +
-    '<body>' +
+  iframe.src = "data:text/html,<html>" +
+    "<body>" +
     '<menu type="context" id="menu1" label="firstmenu">' +
       '<menuitem label="foo" onclick="window.onContextMenuCallbackFired(event)"></menuitem>' +
       '<menuitem label="bar" onclick="window.onContextMenuCallbackFired(event)"></menuitem>' +
-    '</menu>' +
+    "</menu>" +
     '<menu type="context" id="menu2" label="secondmenu">' +
       '<menuitem label="outer" onclick="window.onContextMenuCallbackFired(event)"></menuitem>' +
       '<menu label="submenu">' +
         '<menuitem label="inner 1"></menuitem>' +
         '<menuitem label="inner 2" onclick="window.onContextMenuCallbackFired(event)"></menuitem>' +
-      '</menu>' +
-    '</menu>' +
+      "</menu>" +
+    "</menu>" +
     '<div id="menu1-trigger" contextmenu="menu1"><a id="inner-link" href="foo.html">Menu 1</a></div>' +
     '<a href="bar.html" contextmenu="menu2"><img id="menu2-trigger" src="example.png" /></a>' +
     '<img id="menu3-trigger" src="example.png" />' +
     '<video id="menu4-trigger" src="' + videoUrl + '"></video>' +
     '<video id="menu5-trigger" preload="metadata"></video>' +
     '<audio id="menu6-trigger" src="' + audioUrl + '"></audio>' +
     '<form action="no_method"><input id="menu7-trigger" name="input1"></input></form>' +
     '<form action="http://example.com/get_method" method="get"><input id="menu8-trigger" name="input2"></input></form>' +
     '<form action="post_method" method="post"><input id="menu9-trigger" name="input3"></input></form>' +
-    '</body></html>';
+    "</body></html>";
   document.body.appendChild(iframe);
 
   // The following code will be included in the child
   // =========================================================================
   function iframeScript() {
-    addMessageListener('contextmenu', function onContextMenu(msg) {
+    addMessageListener("contextmenu", function onContextMenu(msg) {
       var document = content.document;
-      var evt = document.createEvent('HTMLEvents');
-      evt.initEvent('contextmenu', true, true);
+      var evt = document.createEvent("HTMLEvents");
+      evt.initEvent("contextmenu", true, true);
       document.querySelector(msg.data.selector).dispatchEvent(evt);
     });
 
-    addMessageListener('setsrc', function onContextMenu(msg) {
+    addMessageListener("setsrc", function onContextMenu(msg) {
       var wrappedTarget = content.document.querySelector(msg.data.selector);
       var target = XPCNativeWrapper.unwrap(wrappedTarget);
-      target.addEventListener('loadedmetadata', function() {
-        sendAsyncMessage('test:srcset');
+      target.addEventListener("loadedmetadata", function() {
+        sendAsyncMessage("test:srcset");
       });
       target.src = msg.data.src;
     });
 
-    addMessageListener('browser-element-api:call', function onCallback(msg) {
-      if (msg.data.msg_name != 'fire-ctx-callback')
+    addMessageListener("browser-element-api:call", function onCallback(msg) {
+      if (msg.data.msg_name != "fire-ctx-callback")
         return;
 
       /* Use setTimeout in order to react *after* the platform */
       content.setTimeout(function() {
-        sendAsyncMessage('test:callbackfired', { label: label });
+        sendAsyncMessage("test:callbackfired", { label });
         label = null;
       });
     });
 
     var label = null;
     XPCNativeWrapper.unwrap(content).onContextMenuCallbackFired = function(e) {
-      label = e.target.getAttribute('label');
+      label = e.target.getAttribute("label");
     };
   }
   // =========================================================================
 
-  iframe.addEventListener('mozbrowserloadend', function onload(e) {
+  iframe.addEventListener("mozbrowserloadend", function onload(e) {
     iframe.removeEventListener(e.type, onload);
     mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
-    mm.loadFrameScript('data:,(' + iframeScript.toString() + ')();', false);
+    mm.loadFrameScript("data:,(" + iframeScript.toString() + ")();", false);
 
     // Now we're ready, let's start testing.
     callback();
   });
 }
 
-addEventListener('testready', runTests);
+addEventListener("testready", runTests);
--- a/dom/browser-element/mochitest/browserElement_CookiesNotThirdParty.js
+++ b/dom/browser-element/mochitest/browserElement_CookiesNotThirdParty.js
@@ -5,47 +5,47 @@
 // third-party.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  const innerPage = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html';
+  const innerPage = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html";
 
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    if (e.detail.message == 'next') {
-      iframe.src = innerPage + '?step=2';
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    if (e.detail.message == "next") {
+      iframe.src = innerPage + "?step=2";
       return;
     }
 
-    if (e.detail.message.startsWith('success:')) {
+    if (e.detail.message.startsWith("success:")) {
       ok(true, e.detail.message);
       return;
     }
 
-    if (e.detail.message.startsWith('failure:')) {
+    if (e.detail.message.startsWith("failure:")) {
       ok(false, e.detail.message);
       return;
     }
 
-    if (e.detail.message == 'finish') {
+    if (e.detail.message == "finish") {
       SimpleTest.finish();
     }
   });
 
   // innerPage will set a cookie and then alert('next').  We'll load
   // innerPage?step=2.  That page will check that the cooke exists (despite the
   // fact that we've disabled third-party cookies) and alert('success:') or
   // alert('failure:'), as appropriate.  Finally, the page will
   // alert('finish');
   iframe.src = innerPage;
   document.body.appendChild(iframe);
 }
 
 // Disable third-party cookies for this test.
-addEventListener('testready', function() {
-  SpecialPowers.pushPrefEnv({'set': [['network.cookie.cookieBehavior', 1]]}, runTest);
+addEventListener("testready", function() {
+  SpecialPowers.pushPrefEnv({"set": [["network.cookie.cookieBehavior", 1]]}, runTest);
 });
--- a/dom/browser-element/mochitest/browserElement_CopyPaste.js
+++ b/dom/browser-element/mochitest/browserElement_CopyPaste.js
@@ -5,17 +5,17 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.setupAccessibleCaretPref();
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
-const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm');
+const { Services } = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm");
 
 var gTextarea = null;
 var mm;
 var iframeOuter;
 var iframeInner;
 var state = 0;
 var stateMeaning;
 var defaultData;
@@ -43,58 +43,58 @@ function getScriptForGetContent() {
         txt = elt.value; \
       } \
     } \
     sendAsyncMessage("content-text", txt);';
   return script;
 }
 
 function getScriptForSetFocus() {
-  var script = 'data:,' + focusScript + 'sendAsyncMessage("content-focus")';
+  var script = "data:," + focusScript + 'sendAsyncMessage("content-focus")';
   return script;
 }
 
 function runTest() {
-  iframeOuter = document.createElement('iframe');
-  iframeOuter.setAttribute('mozbrowser', 'true');
+  iframeOuter = document.createElement("iframe");
+  iframeOuter.setAttribute("mozbrowser", "true");
   if (createEmbededFrame) {
     iframeOuter.src = "file_empty.html";
   }
   document.body.appendChild(iframeOuter);
 
-  gTextarea = document.createElement('textarea');
+  gTextarea = document.createElement("textarea");
   document.body.appendChild(gTextarea);
 
   iframeOuter.addEventListener("mozbrowserloadend", function(e) {
     if (createEmbededFrame) {
       var contentWin = SpecialPowers.wrap(iframeOuter)
                              .frameLoader.docShell.contentViewer.DOMDocument.defaultView;
       var contentDoc = contentWin.document;
-      iframeInner = contentDoc.createElement('iframe');
-      iframeInner.setAttribute('mozbrowser', true);
-      iframeInner.setAttribute('remote', 'false');
+      iframeInner = contentDoc.createElement("iframe");
+      iframeInner.setAttribute("mozbrowser", true);
+      iframeInner.setAttribute("remote", "false");
       contentDoc.body.appendChild(iframeInner);
       iframeInner.addEventListener("mozbrowserloadend", function(e) {
         mm = SpecialPowers.getBrowserFrameMessageManager(iframeInner);
         dispatchTest(e);
       }, {once: true});
     } else {
       iframeInner = iframeOuter;
       mm = SpecialPowers.getBrowserFrameMessageManager(iframeInner);
       dispatchTest(e);
     }
   }, {once: true});
 }
 
 function doCommand(cmd) {
   var COMMAND_MAP = {
-    'cut': 'cmd_cut',
-    'copy': 'cmd_copy',
-    'paste': 'cmd_paste',
-    'selectall': 'cmd_selectAll'
+    "cut": "cmd_cut",
+    "copy": "cmd_copy",
+    "paste": "cmd_paste",
+    "selectall": "cmd_selectAll",
   };
   var script = 'data:,docShell.doCommand("' + COMMAND_MAP[cmd] + '");';
   mm.loadFrameScript(script, false);
 }
 
 function dispatchTest(e) {
   iframeInner.addEventListener("mozbrowserloadend", function(e) {
     iframeInner.focus();
@@ -193,20 +193,20 @@ function testSelectAll(e) {
       ok(true, "got mozbrowsercaretstatechanged event." + stateMeaning);
       ok(e.detail, "event.detail is not null." + stateMeaning);
       ok(e.detail.width != 0, "event.detail.width is not zero" + stateMeaning);
       ok(e.detail.height != 0, "event.detail.height is not zero" + stateMeaning);
       SimpleTest.executeSoon(function() { testCopy1(e); });
     }, {capture: true, once: true});
   }
 
-  mm.addMessageListener('content-focus', function messageforfocus(msg) {
-    mm.removeMessageListener('content-focus', messageforfocus);
+  mm.addMessageListener("content-focus", function messageforfocus(msg) {
+    mm.removeMessageListener("content-focus", messageforfocus);
     // test selectall command, after calling this the caretstatechanged event should be fired.
-    doCommand('selectall');
+    doCommand("selectall");
     if (isChildProcess()) {
       SimpleTest.executeSoon(function() { testCopy1(e); });
     }
   });
 
   mm.loadFrameScript(getScriptForSetFocus(), false);
 }
 
@@ -220,40 +220,40 @@ function testCopy1(e) {
 
     let nextTest = function(success) {
       ok(success, "copy command works" + stateMeaning);
       SimpleTest.executeSoon(function() { testPaste1(e); });
     };
 
     let success = function() {
       nextTest(true);
-    }
+    };
 
     let fail = function() {
       nextTest(false);
-    }
+    };
 
     let compareData = defaultData;
     SimpleTest.waitForClipboard(compareData, setup, success, fail);
   });
 }
 
 function testPaste1(e) {
   // Next test paste command, first we copy to global clipboard in parent side.
   // Then paste it to child side.
   copyToClipboard(pasteData, () => {
-    doCommand('selectall');
+    doCommand("selectall");
     doCommand("paste");
     SimpleTest.executeSoon(function() { testPaste2(e); });
   });
 }
 
 function testPaste2(e) {
-  mm.addMessageListener('content-text', function messageforpaste(msg) {
-    mm.removeMessageListener('content-text', messageforpaste);
+  mm.addMessageListener("content-text", function messageforpaste(msg) {
+    mm.removeMessageListener("content-text", messageforpaste);
     if (state == 4) {
       // normal div cannot paste, so the content remain unchange
       ok(SpecialPowers.wrap(msg).json === defaultData, "paste command works" + stateMeaning);
     } else if (state == 3 && browserElementTestHelpers.getOOPByDefaultPref()) {
       // Something weird when we doCommand with content editable element in OOP. Mark this case as todo
       todo(false, "paste command works" + stateMeaning);
     } else {
       ok(SpecialPowers.wrap(msg).json === pasteData, "paste command works" + stateMeaning);
@@ -279,39 +279,39 @@ function testCut1(e) {
       } else {
         ok(success, "cut function works" + stateMeaning);
       }
       SimpleTest.executeSoon(function() { testCut2(e); });
     };
 
     let success = function() {
       nextTest(true);
-    }
+    };
 
     let fail = function() {
       nextTest(false);
-    }
+    };
 
     let compareData = pasteData;
 
     // Something weird when we doCommand with content editable element in OOP.
     // Always true in this case
     // Normal div case cannot cut, always true as well.
     if ((state == 3 && browserElementTestHelpers.getOOPByDefaultPref()) ||
         state == 4) {
-      compareData = function() { return true; }
+      compareData = function() { return true; };
     }
 
     SimpleTest.waitForClipboard(compareData, setup, success, fail);
   });
 }
 
 function testCut2(e) {
-  mm.addMessageListener('content-text', function messageforcut(msg) {
-    mm.removeMessageListener('content-text', messageforcut);
+  mm.addMessageListener("content-text", function messageforcut(msg) {
+    mm.removeMessageListener("content-text", messageforcut);
     // normal div cannot cut
     if (state == 4) {
       ok(SpecialPowers.wrap(msg).json !== "", "cut command works" + stateMeaning);
     } else if (state == 3 && browserElementTestHelpers.getOOPByDefaultPref()) {
       // Something weird when we doCommand with content editable element in OOP. Mark this case as todo
       todo(false, "cut command works" + stateMeaning);
     } else {
       ok(SpecialPowers.wrap(msg).json === "", "cut command works" + stateMeaning);
@@ -326,14 +326,14 @@ function testCut2(e) {
 
 // Give our origin permission to open browsers, and remove it when the test is complete.
 var principal = SpecialPowers.wrap(document).nodePrincipal;
 var context = { url: SpecialPowers.wrap(principal.URI).spec,
                 originAttributes: {
                   appId: principal.appId,
                   inIsolatedMozBrowser: true }};
 
-addEventListener('testready', function() {
+addEventListener("testready", function() {
   SpecialPowers.pushPermissions([
-    {type: 'browser', allow: 1, context: context}
+    {type: "browser", allow: 1, context},
   ], runTest);
 });
 
--- a/dom/browser-element/mochitest/browserElement_DataURI.js
+++ b/dom/browser-element/mochitest/browserElement_DataURI.js
@@ -5,64 +5,64 @@
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
-  iframe1.id = 'iframe1';
-  iframe1.addEventListener('mozbrowserloadend', function() {
-    ok(true, 'Got first loadend event.');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
+  iframe1.id = "iframe1";
+  iframe1.addEventListener("mozbrowserloadend", function() {
+    ok(true, "Got first loadend event.");
     SimpleTest.executeSoon(runTest2);
   }, {once: true});
   iframe1.src = browserElementTestHelpers.emptyPage1;
   document.body.appendChild(iframe1);
 
-  var iframe2 = document.createElement('iframe');
-  iframe2.id = 'iframe2';
+  var iframe2 = document.createElement("iframe");
+  iframe2.id = "iframe2";
   document.body.appendChild(iframe2);
 }
 
 function runTest2() {
-  var iframe1 = document.getElementById('iframe1');
-  var iframe2 = document.getElementById('iframe2');
+  var iframe1 = document.getElementById("iframe1");
+  var iframe2 = document.getElementById("iframe2");
 
   var sawLoadEnd = false;
   var sawLocationChange = false;
 
-  iframe1.addEventListener('mozbrowserlocationchange', function(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!sawLocationChange, 'Just one locationchange event.');
-    ok(!sawLoadEnd, 'locationchange before load.');
-    is(e.detail.url, 'data:text/html,1', "event's reported location");
+  iframe1.addEventListener("mozbrowserlocationchange", function(e) {
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!sawLocationChange, "Just one locationchange event.");
+    ok(!sawLoadEnd, "locationchange before load.");
+    is(e.detail.url, "data:text/html,1", "event's reported location");
     sawLocationChange = true;
   });
 
-  iframe1.addEventListener('mozbrowserloadend', function() {
-    ok(sawLocationChange, 'Loadend after locationchange.');
-    ok(!sawLoadEnd, 'Just one loadend event.');
+  iframe1.addEventListener("mozbrowserloadend", function() {
+    ok(sawLocationChange, "Loadend after locationchange.");
+    ok(!sawLoadEnd, "Just one loadend event.");
     sawLoadEnd = true;
   });
 
   function iframe2Load() {
     if (!sawLoadEnd || !sawLocationChange) {
       // Spin if iframe1 hasn't loaded yet.
       SimpleTest.executeSoon(iframe2Load);
       return;
     }
-    ok(true, 'Got iframe2 load.');
+    ok(true, "Got iframe2 load.");
     SimpleTest.finish();
   }
-  iframe2.addEventListener('load', iframe2Load);
+  iframe2.addEventListener("load", iframe2Load);
 
 
-  iframe1.src = 'data:text/html,1';
+  iframe1.src = "data:text/html,1";
 
   // Load something into iframe2 to check that it doesn't trigger a
   // locationchange for our iframe1 listener.
   iframe2.src = browserElementTestHelpers.emptyPage2;
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_DataURILoad.js
+++ b/dom/browser-element/mochitest/browserElement_DataURILoad.js
@@ -12,46 +12,46 @@ browserElementTestHelpers.addPermission(
 const PREF = "security.data_uri.block_toplevel_data_uri_navigations";
 browserElementTestHelpers._setPref(PREF, true);
 
 const INNER = "foo";
 const DATA_URI = "data:text/html,<html><body>" + INNER + "</body></html>";
 const HTTP_URI = "browserElement_DataURILoad.html";
 
 function runTest1() {
-  let frame = document.createElement('iframe');
-  frame.setAttribute('mozbrowser', 'true');
-  frame.src = DATA_URI
+  let frame = document.createElement("iframe");
+  frame.setAttribute("mozbrowser", "true");
+  frame.src = DATA_URI;
   document.body.appendChild(frame);
   let wrappedFrame = SpecialPowers.wrap(frame);
 
   // wait for 1000ms and check that the data: URI did not load
-  setTimeout(function () {
+  setTimeout(function() {
     isnot(wrappedFrame.contentWindow.document.body.innerHTML,
-          INNER, 
+          INNER,
           "data: URI navigation should be blocked");
     runTest2();
   }, 1000);
 }
 
 function runTest2() {
-  let frame = document.createElement('iframe');
-  frame.setAttribute('mozbrowser', 'true');
+  let frame = document.createElement("iframe");
+  frame.setAttribute("mozbrowser", "true");
   frame.src = HTTP_URI;
   document.body.appendChild(frame);
   let wrappedFrame = SpecialPowers.wrap(frame);
 
   wrappedFrame.addEventListener("mozbrowserloadend", function onloadend(e) {
     ok(wrappedFrame.contentWindow.document.location.href.endsWith(HTTP_URI),
        "http: URI navigation should be allowed");
-    frame.src = DATA_URI
+    frame.src = DATA_URI;
 
     // wait for 1000ms and check that the data: URI did not load
-    setTimeout(function () {
+    setTimeout(function() {
       isnot(wrappedFrame.contentWindow.document.body.innerHTML,
-            INNER, 
+            INNER,
             "data: URI navigation should be blocked");
       SimpleTest.finish();
     }, 1000);
   }, {once: true});
 }
 
-addEventListener('testready', runTest1);
+addEventListener("testready", runTest1);
--- a/dom/browser-element/mochitest/browserElement_DocumentFirstPaint.js
+++ b/dom/browser-element/mochitest/browserElement_DocumentFirstPaint.js
@@ -15,18 +15,18 @@ function runTestQueue(queue) {
     return;
   }
 
   var gotFirstPaint = false;
   var gotFirstLocationChange = false;
   var test = queue.shift();
 
   function runNext() {
-    iframe.removeEventListener('mozbrowserdocumentfirstpaint', documentfirstpainthandler);
-    iframe.removeEventListener('mozbrowserloadend', loadendhandler);
+    iframe.removeEventListener("mozbrowserdocumentfirstpaint", documentfirstpainthandler);
+    iframe.removeEventListener("mozbrowserloadend", loadendhandler);
     runTestQueue(queue);
   }
 
   function documentfirstpainthandler(e) {
     ok(!gotFirstPaint, "Got firstpaint only once");
     gotFirstPaint = true;
     if (gotFirstLocationChange) {
       runNext();
@@ -35,18 +35,18 @@ function runTestQueue(queue) {
 
   function loadendhandler(e) {
     gotFirstLocationChange = true;
     if (gotFirstPaint) {
       runNext();
     }
   }
 
-  iframe.addEventListener('mozbrowserdocumentfirstpaint', documentfirstpainthandler);
-  iframe.addEventListener('mozbrowserloadend', loadendhandler);
+  iframe.addEventListener("mozbrowserdocumentfirstpaint", documentfirstpainthandler);
+  iframe.addEventListener("mozbrowserloadend", loadendhandler);
 
   test();
 }
 
 function testChangeLocation() {
   iframe.src = browserElementTestHelpers.emptyPage1 + "?2";
 }
 
@@ -55,15 +55,15 @@ function testReload() {
 }
 
 function testFirstLoad() {
   document.body.appendChild(iframe);
   iframe.src = browserElementTestHelpers.emptyPage1;
 }
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   runTestQueue([testFirstLoad, testReload, testChangeLocation]);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ErrorSecurity.js
+++ b/dom/browser-element/mochitest/browserElement_ErrorSecurity.js
@@ -6,18 +6,18 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 var iframe = null;
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   checkForDnsError();
 }
 
 function checkForDnsError() {
   iframe.addEventListener("mozbrowsererror", function onDnsError(e) {
     iframe.removeEventListener(e.type, onDnsError);
@@ -50,9 +50,9 @@ function checkForNoCertificateError() {
     ok(e.detail.type == "certerror", "Event's detail has a |type| param with the value '" + e.detail.type + "'.");
 
     SimpleTest.finish();
   });
 
   iframe.src = "https://nocert.example.com";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ExposableURI.js
+++ b/dom/browser-element/mochitest/browserElement_ExposableURI.js
@@ -9,27 +9,27 @@ SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 var iframe;
 
 function testPassword() {
   function locationchange(e) {
     var uri = e.detail.url;
-    is(uri, 'http://mochi.test:8888/tests/dom/browser-element/mochitest/file_empty.html',
+    is(uri, "http://mochi.test:8888/tests/dom/browser-element/mochitest/file_empty.html",
        "Username and password shouldn't be exposed in uri.");
     SimpleTest.finish();
   }
 
-  iframe.addEventListener('mozbrowserlocationchange', locationchange);
+  iframe.addEventListener("mozbrowserlocationchange", locationchange);
   iframe.src = "http://iamuser:iampassword@mochi.test:8888/tests/dom/browser-element/mochitest/file_empty.html";
 }
 
 function runTest() {
-  SpecialPowers.pushPrefEnv({set: [["network.http.rcwn.enabled", false]]}, _=>{
-    iframe = document.createElement('iframe');
-    iframe.setAttribute('mozbrowser', 'true');
+  SpecialPowers.pushPrefEnv({set: [["network.http.rcwn.enabled", false]]}, _ => {
+    iframe = document.createElement("iframe");
+    iframe.setAttribute("mozbrowser", "true");
     document.body.appendChild(iframe);
     testPassword();
   });
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_FirstPaint.js
+++ b/dom/browser-element/mochitest/browserElement_FirstPaint.js
@@ -4,40 +4,39 @@
 // Bug 787378 - Add mozbrowserfirstpaint event.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotFirstPaint = false;
   var gotFirstLocationChange = false;
-  iframe.addEventListener('mozbrowserfirstpaint', function(e) {
+  iframe.addEventListener("mozbrowserfirstpaint", function(e) {
     ok(!gotFirstPaint, "Got only one first paint.");
     gotFirstPaint = true;
 
     if (gotFirstLocationChange) {
-      iframe.src = browserElementTestHelpers.emptyPage1 + '?2';
+      iframe.src = browserElementTestHelpers.emptyPage1 + "?2";
     }
   });
 
-  iframe.addEventListener('mozbrowserlocationchange', function(e) {
+  iframe.addEventListener("mozbrowserlocationchange", function(e) {
     if (e.detail.url == browserElementTestHelpers.emptyPage1) {
       gotFirstLocationChange = true;
       if (gotFirstPaint) {
-        iframe.src = browserElementTestHelpers.emptyPage1 + '?2';
+        iframe.src = browserElementTestHelpers.emptyPage1 + "?2";
       }
-    }
-    else if (e.detail.url.endsWith('?2')) {
+    } else if (e.detail.url.endsWith("?2")) {
       SimpleTest.finish();
     }
   });
 
   document.body.appendChild(iframe);
 
   iframe.src = browserElementTestHelpers.emptyPage1;
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ForwardName.js
+++ b/dom/browser-element/mochitest/browserElement_ForwardName.js
@@ -6,38 +6,38 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-  iframe.setAttribute('name', 'foo');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
+  iframe.setAttribute("name", "foo");
 
   iframe.addEventListener("mozbrowseropenwindow", function(e) {
-    ok(false, 'Got mozbrowseropenwindow, but should not have.');
+    ok(false, "Got mozbrowseropenwindow, but should not have.");
   });
 
-  iframe.addEventListener('mozbrowserlocationchange', function(e) {
+  iframe.addEventListener("mozbrowserlocationchange", function(e) {
     ok(true, "Got locationchange to " + e.detail.url);
     if (e.detail.url.endsWith("ForwardName.html#finish")) {
       SimpleTest.finish();
     }
   });
 
   // The file sends us messages via alert() that start with "success:" or
   // "failure:".
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    ok(e.detail.message.startsWith('success:'), e.detail.message);
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    ok(e.detail.message.startsWith("success:"), e.detail.message);
   });
 
   document.body.appendChild(iframe);
 
   // This file does window.open('file_browserElement_ForwardName.html#finish',
   // 'foo');  That should open in the curent window, because the window should
   // be named foo.
-  iframe.src = 'file_browserElement_ForwardName.html';
+  iframe.src = "file_browserElement_ForwardName.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_FrameWrongURI.js
+++ b/dom/browser-element/mochitest/browserElement_FrameWrongURI.js
@@ -4,49 +4,48 @@
 // Bug 804446 - Test that window.open(javascript:..) works with <iframe mozbrowser>.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframeJS = document.createElement('iframe');
-  iframeJS.setAttribute('mozbrowser', 'true');
+  var iframeJS = document.createElement("iframe");
+  iframeJS.setAttribute("mozbrowser", "true");
 
-  iframeJS.addEventListener('mozbrowserloadstart', function(e) {
+  iframeJS.addEventListener("mozbrowserloadstart", function(e) {
     ok(false, "This should not happen!");
   });
 
-  iframeJS.addEventListener('mozbrowserloadend', function(e) {
+  iframeJS.addEventListener("mozbrowserloadend", function(e) {
     ok(false, "This should not happen!");
   });
 
   iframeJS.src = 'javascript:alert("Foo");';
   document.body.appendChild(iframeJS);
 
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotPopup = false;
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(gotPopup, false, 'Should get just one popup.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(gotPopup, false, "Should get just one popup.");
     gotPopup = true;
 
     document.body.appendChild(e.detail.frameElement);
   });
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    ok(gotPopup, 'Got mozbrowseropenwindow event before showmodalprompt event.');
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    ok(gotPopup, "Got mozbrowseropenwindow event before showmodalprompt event.");
     if (e.detail.message.indexOf("success") == 0) {
       ok(true, e.detail.message);
       SimpleTest.finish();
-    }
-    else {
+    } else {
       ok(false, "Got invalid message: " + e.detail.message);
     }
   });
 
-  iframe.src = 'file_browserElement_FrameWrongURI.html';
+  iframe.src = "file_browserElement_FrameWrongURI.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Iconchange.js
+++ b/dom/browser-element/mochitest/browserElement_Iconchange.js
@@ -5,126 +5,118 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function createHtml(link) {
-  return 'data:text/html,<html><head>' + link + '<body></body></html>';
+  return "data:text/html,<html><head>" + link + "<body></body></html>";
 }
 
 function createLink(name, sizes, rel) {
-  var s = sizes ? 'sizes="' + sizes + '"' : '';
+  var s = sizes ? 'sizes="' + sizes + '"' : "";
   if (!rel) {
-    rel = 'icon';
+    rel = "icon";
   }
   return '<link rel="' + rel + '" type="image/png" ' + s +
     ' href="http://example.com/' + name + '.png">';
 }
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe1);
 
   // iframe2 is a red herring; we modify its favicon but don't listen for
   // iconchanges; we want to make sure that its iconchange events aren't
   // picked up by the listener on iframe1.
-  var iframe2 = document.createElement('iframe');
-  iframe2.setAttribute('mozbrowser', 'true');
+  var iframe2 = document.createElement("iframe");
+  iframe2.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe2);
 
   // iframe3 is another red herring.  It's not a mozbrowser, so we shouldn't
   // get any iconchange events on it.
-  var iframe3 = document.createElement('iframe');
+  var iframe3 = document.createElement("iframe");
   document.body.appendChild(iframe3);
 
   var numIconChanges = 0;
 
-  iframe1.addEventListener('mozbrowsericonchange', function(e) {
-
+  iframe1.addEventListener("mozbrowsericonchange", function(e) {
     numIconChanges++;
 
     if (numIconChanges == 1) {
-      is(e.detail.href, 'http://example.com/myicon.png');
+      is(e.detail.href, "http://example.com/myicon.png");
 
       // We should recieve iconchange events when the user creates new links
       // to a favicon, but only when we listen for them
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.title='New title';",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=ICON href=http://example.com/newicon.png>')",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe2)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=ICON href=http://example.com/newicon.png>')",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numIconChanges == 2) {
-      is(e.detail.href, 'http://example.com/newicon.png');
+    } else if (numIconChanges == 2) {
+      is(e.detail.href, "http://example.com/newicon.png");
 
       // Full new pages should trigger iconchange events
-      iframe1.src = createHtml(createLink('3rdicon'));
-    }
-    else if (numIconChanges == 3) {
-      is(e.detail.href, 'http://example.com/3rdicon.png');
+      iframe1.src = createHtml(createLink("3rdicon"));
+    } else if (numIconChanges == 3) {
+      is(e.detail.href, "http://example.com/3rdicon.png");
 
       // the rel attribute can have various space seperated values, make
       // sure we only pick up correct values for 'icon'
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=shortcuticon href=http://example.com/newicon.png>')",
                                     /* allowDelayedLoad = */ false);
       // Test setting a page with multiple links elements
-      iframe1.src = createHtml(createLink('another') + createLink('icon'));
-    }
-    else if (numIconChanges == 4) {
-      is(e.detail.href, 'http://example.com/another.png');
+      iframe1.src = createHtml(createLink("another") + createLink("icon"));
+    } else if (numIconChanges == 4) {
+      is(e.detail.href, "http://example.com/another.png");
       // 2 events will be triggered by previous test, wait for next
-    }
-    else if (numIconChanges == 5) {
-      is(e.detail.href, 'http://example.com/icon.png');
+    } else if (numIconChanges == 5) {
+      is(e.detail.href, "http://example.com/icon.png");
 
       // Make sure icon check is case insensitive
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=ICON href=http://example.com/ucaseicon.png>')",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numIconChanges == 6) {
-      is(e.detail.href, 'http://example.com/ucaseicon.png');
-      iframe1.src = createHtml(createLink('testsize', '50x50', 'icon'));
-    }
-    else if (numIconChanges == 7) {
-      is(e.detail.href, 'http://example.com/testsize.png');
-      is(e.detail.sizes, '50x50');
-      iframe1.src = createHtml(createLink('testapple1', '100x100', 'apple-touch-icon'));
+    } else if (numIconChanges == 6) {
+      is(e.detail.href, "http://example.com/ucaseicon.png");
+      iframe1.src = createHtml(createLink("testsize", "50x50", "icon"));
+    } else if (numIconChanges == 7) {
+      is(e.detail.href, "http://example.com/testsize.png");
+      is(e.detail.sizes, "50x50");
+      iframe1.src = createHtml(createLink("testapple1", "100x100", "apple-touch-icon"));
     } else if (numIconChanges == 8) {
-      is(e.detail.href, 'http://example.com/testapple1.png');
-      is(e.detail.rel, 'apple-touch-icon');
-      is(e.detail.sizes, '100x100');
+      is(e.detail.href, "http://example.com/testapple1.png");
+      is(e.detail.rel, "apple-touch-icon");
+      is(e.detail.sizes, "100x100");
 
-      iframe1.src = createHtml(createLink('testapple2', '100x100', 'apple-touch-icon-precomposed'));
+      iframe1.src = createHtml(createLink("testapple2", "100x100", "apple-touch-icon-precomposed"));
     } else if (numIconChanges == 9) {
-      is(e.detail.href, 'http://example.com/testapple2.png');
-      is(e.detail.rel, 'apple-touch-icon-precomposed');
-      is(e.detail.sizes, '100x100');
+      is(e.detail.href, "http://example.com/testapple2.png");
+      is(e.detail.rel, "apple-touch-icon-precomposed");
+      is(e.detail.sizes, "100x100");
       SimpleTest.finish();
     } else {
-      ok(false, 'Too many iconchange events.');
+      ok(false, "Too many iconchange events.");
     }
   });
 
-  iframe3.addEventListener('mozbrowsericonchange', function(e) {
-    ok(false, 'Should not get a iconchange event for iframe3.');
+  iframe3.addEventListener("mozbrowsericonchange", function(e) {
+    ok(false, "Should not get a iconchange event for iframe3.");
   });
 
 
-  iframe1.src = createHtml(createLink('myicon'));
+  iframe1.src = createHtml(createLink("myicon"));
   // We should not recieve icon change events for either of the below iframes
-  iframe2.src = createHtml(createLink('myicon'));
-  iframe3.src = createHtml(createLink('myicon'));
-
+  iframe2.src = createHtml(createLink("myicon"));
+  iframe3.src = createHtml(createLink("myicon"));
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_LoadEvents.js
+++ b/dom/browser-element/mochitest/browserElement_LoadEvents.js
@@ -14,111 +14,111 @@ function runTest() {
   // call runTest2.
   //
   // This should trigger loadstart, locationchange, and loadend events.
 
   var seenLoadEnd = false;
   var seenLoadStart = false;
   var seenLocationChange = false;
 
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-  iframe.id = 'iframe';
-  iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_LoadEvents.html';
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
+  iframe.id = "iframe";
+  iframe.src = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_LoadEvents.html";
 
   function loadstart(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!seenLoadEnd, 'loadstart before loadend.');
-    ok(!seenLoadStart, 'Just one loadstart event.');
-    ok(!seenLocationChange, 'loadstart before locationchange.');
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!seenLoadEnd, "loadstart before loadend.");
+    ok(!seenLoadStart, "Just one loadstart event.");
+    ok(!seenLocationChange, "loadstart before locationchange.");
     seenLoadStart = true;
   }
 
   function locationchange(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!seenLocationChange, 'Just one locationchange event.');
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!seenLocationChange, "Just one locationchange event.");
     seenLocationChange = true;
-    ok(seenLoadStart, 'Location change after load start.');
-    ok(!seenLoadEnd, 'Location change before load end.');
+    ok(seenLoadStart, "Location change after load start.");
+    ok(!seenLoadEnd, "Location change before load end.");
     // XXX: Switched to from ok() to todo_is() in Bug 1467712. Follow up in 1503862
     // Fails with: event's reported location -
     //   got "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_LoadEvents.html",
     //   expected "http://example.com/tests/dom/browser-element/mochitest/file_empty.html"
     todo_is(e.detail.url, browserElementTestHelpers.emptyPage1, "event's reported location");
   }
 
   function loadend(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(seenLoadStart, 'loadend after loadstart.');
-    ok(!seenLoadEnd, 'Just one loadend event.');
-    ok(seenLocationChange, 'loadend after locationchange.');
-    is(e.detail.backgroundColor, 'rgb(0, 128, 0)', 'Expected background color reported')
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(seenLoadStart, "loadend after loadstart.");
+    ok(!seenLoadEnd, "Just one loadend event.");
+    ok(seenLocationChange, "loadend after locationchange.");
+    is(e.detail.backgroundColor, "rgb(0, 128, 0)", "Expected background color reported");
     seenLoadEnd = true;
   }
 
-  iframe.addEventListener('mozbrowserloadstart', loadstart);
-  iframe.addEventListener('mozbrowserlocationchange', locationchange);
-  iframe.addEventListener('mozbrowserloadend', loadend);
+  iframe.addEventListener("mozbrowserloadstart", loadstart);
+  iframe.addEventListener("mozbrowserlocationchange", locationchange);
+  iframe.addEventListener("mozbrowserloadend", loadend);
 
   function waitForAllCallbacks() {
     if (!seenLoadStart || !seenLoadEnd) {
       SimpleTest.executeSoon(waitForAllCallbacks);
       return;
     }
 
-    iframe.removeEventListener('mozbrowserloadstart', loadstart);
-    iframe.removeEventListener('mozbrowserlocationchange', locationchange);
-    iframe.removeEventListener('mozbrowserloadend', loadend);
+    iframe.removeEventListener("mozbrowserloadstart", loadstart);
+    iframe.removeEventListener("mozbrowserlocationchange", locationchange);
+    iframe.removeEventListener("mozbrowserloadend", loadend);
     runTest2();
   }
 
   document.body.appendChild(iframe);
   waitForAllCallbacks();
 }
 
 function runTest2() {
   var seenLoadStart = false;
   var seenLoadEnd = false;
   var seenLocationChange = false;
 
   // Add this event listener to the document; the events should bubble.
-  document.addEventListener('mozbrowserloadstart', function(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!seenLoadStart, 'Just one loadstart event.');
+  document.addEventListener("mozbrowserloadstart", function(e) {
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!seenLoadStart, "Just one loadstart event.");
     seenLoadStart = true;
-    ok(!seenLoadEnd, 'Got mozbrowserloadstart before loadend.');
-    ok(!seenLocationChange, 'Got mozbrowserloadstart before locationchange.');
+    ok(!seenLoadEnd, "Got mozbrowserloadstart before loadend.");
+    ok(!seenLocationChange, "Got mozbrowserloadstart before locationchange.");
   });
 
-  var iframe = document.getElementById('iframe');
-  iframe.addEventListener('mozbrowserlocationchange', function(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!seenLocationChange, 'Just one locationchange event.');
+  var iframe = document.getElementById("iframe");
+  iframe.addEventListener("mozbrowserlocationchange", function(e) {
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!seenLocationChange, "Just one locationchange event.");
     seenLocationChange = true;
-    ok(seenLoadStart, 'Location change after load start.');
-    ok(!seenLoadEnd, 'Location change before load end.');
+    ok(seenLoadStart, "Location change after load start.");
+    ok(!seenLoadEnd, "Location change before load end.");
     is(e.detail.url, browserElementTestHelpers.emptyPage2, "event's reported location");
   });
 
-  iframe.addEventListener('mozbrowserloadend', function(e) {
-    ok(e.isTrusted, 'Event should be trusted.');
-    ok(!seenLoadEnd, 'Just one load end event.');
+  iframe.addEventListener("mozbrowserloadend", function(e) {
+    ok(e.isTrusted, "Event should be trusted.");
+    ok(!seenLoadEnd, "Just one load end event.");
     seenLoadEnd = true;
-    ok(seenLoadStart, 'Load end after load start.');
-    ok(seenLocationChange, 'Load end after location change.');
-    is(e.detail.backgroundColor, 'rgba(0, 0, 0, 0)', 'Expected background color reported')
+    ok(seenLoadStart, "Load end after load start.");
+    ok(seenLocationChange, "Load end after location change.");
+    is(e.detail.backgroundColor, "rgba(0, 0, 0, 0)", "Expected background color reported");
   });
 
   iframe.src = browserElementTestHelpers.emptyPage2;
 
   function waitForAllCallbacks() {
     if (!seenLoadStart || !seenLoadEnd || !seenLocationChange) {
       SimpleTest.executeSoon(waitForAllCallbacks);
       return;
     }
 
     SimpleTest.finish();
   }
 
   waitForAllCallbacks();
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Metachange.js
+++ b/dom/browser-element/mochitest/browserElement_Metachange.js
@@ -5,174 +5,161 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function createHtml(meta) {
-  return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace"><head>' + meta + '<body></body></html>';
+  return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace"><head>' + meta + "<body></body></html>";
 }
 
 function createHtmlWithLang(meta, lang) {
-  return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace" lang="' + lang + '"><head>' + meta + '<body></body></html>';
+  return 'data:text/html,<html xmlns:xml="http://www.w3.org/XML/1998/namespace" lang="' + lang + '"><head>' + meta + "<body></body></html>";
 }
 
 function createMeta(name, content) {
   return '<meta name="' + name + '" content="' + content + '">';
 }
 
 function createMetaWithLang(name, content, lang) {
   return '<meta name="' + name + '" content="' + content + '" lang="' + lang + '">';
 }
 
 function createMetaWithProperty(property, content) {
   return '<meta property="' + property + '" content="' + content + '">';
 }
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe1);
 
   // iframe2 is a red herring; we modify its meta elements but don't listen for
   // metachanges; we want to make sure that its metachange events aren't
   // picked up by the listener on iframe1.
-  var iframe2 = document.createElement('iframe');
-  iframe2.setAttribute('mozbrowser', 'true');
+  var iframe2 = document.createElement("iframe");
+  iframe2.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe2);
 
   // iframe3 is another red herring.  It's not a mozbrowser, so we shouldn't
   // get any metachange events on it.
-  var iframe3 = document.createElement('iframe');
+  var iframe3 = document.createElement("iframe");
   document.body.appendChild(iframe3);
 
   var numMetaChanges = 0;
 
-  iframe1.addEventListener('mozbrowsermetachange', function(e) {
-
+  iframe1.addEventListener("mozbrowsermetachange", function(e) {
     numMetaChanges++;
 
     if (numMetaChanges == 1) {
-      is(e.detail.name, 'application-name');
-      is(e.detail.content, 'foobar');
+      is(e.detail.name, "application-name");
+      is(e.detail.content, "foobar");
 
       // We should recieve metachange events when the user creates new metas
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.title='New title';",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<meta name=application-name content=new_foobar>')",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe2)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<meta name=application-name content=new_foobar>')",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numMetaChanges == 2) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'new_foobar', 'content matches');
-      ok(!("lang" in e.detail), 'lang not present');
+    } else if (numMetaChanges == 2) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "new_foobar", "content matches");
+      ok(!("lang" in e.detail), "lang not present");
 
       // Full new pages should trigger metachange events
-      iframe1.src = createHtml(createMeta('application-name', '3rd_foobar'));
-    }
-    else if (numMetaChanges == 3) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, '3rd_foobar', 'content matches');
-      ok(!("lang" in e.detail), 'lang not present');
+      iframe1.src = createHtml(createMeta("application-name", "3rd_foobar"));
+    } else if (numMetaChanges == 3) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "3rd_foobar", "content matches");
+      ok(!("lang" in e.detail), "lang not present");
 
       // Test setting a page with multiple meta elements
-      iframe1.src = createHtml(createMeta('application-name', 'foobar_1') + createMeta('application-name', 'foobar_2'));
-    }
-    else if (numMetaChanges == 4) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'foobar_1', 'content matches');
-      ok(!("lang" in e.detail), 'lang not present');
+      iframe1.src = createHtml(createMeta("application-name", "foobar_1") + createMeta("application-name", "foobar_2"));
+    } else if (numMetaChanges == 4) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "foobar_1", "content matches");
+      ok(!("lang" in e.detail), "lang not present");
       // 2 events will be triggered by previous test, wait for next
-    }
-    else if (numMetaChanges == 5) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'foobar_2', 'content matches');
-      ok(!("lang" in e.detail), 'lang not present');
+    } else if (numMetaChanges == 5) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "foobar_2", "content matches");
+      ok(!("lang" in e.detail), "lang not present");
 
       // Test the language
-      iframe1.src = createHtml(createMetaWithLang('application-name', 'foobar_lang_1', 'en'));
-    }
-    else if (numMetaChanges == 6) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'foobar_lang_1', 'content matches');
-      is(e.detail.lang, 'en', 'language matches');
+      iframe1.src = createHtml(createMetaWithLang("application-name", "foobar_lang_1", "en"));
+    } else if (numMetaChanges == 6) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "foobar_lang_1", "content matches");
+      is(e.detail.lang, "en", "language matches");
 
       // Test the language in the ancestor element
-      iframe1.src = createHtmlWithLang(createMeta('application-name', 'foobar_lang_2'), 'es');
-    }
-    else if (numMetaChanges == 7) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'foobar_lang_2', 'content matches');
-      is(e.detail.lang, 'es', 'language matches');
+      iframe1.src = createHtmlWithLang(createMeta("application-name", "foobar_lang_2"), "es");
+    } else if (numMetaChanges == 7) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "foobar_lang_2", "content matches");
+      is(e.detail.lang, "es", "language matches");
 
       // Test the language in the ancestor element
-      iframe1.src = createHtmlWithLang(createMetaWithLang('application-name', 'foobar_lang_3', 'it'), 'fi');
-    }
-    else if (numMetaChanges == 8) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'foobar_lang_3', 'content matches');
-      is(e.detail.lang, 'it', 'language matches');
+      iframe1.src = createHtmlWithLang(createMetaWithLang("application-name", "foobar_lang_3", "it"), "fi");
+    } else if (numMetaChanges == 8) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "foobar_lang_3", "content matches");
+      is(e.detail.lang, "it", "language matches");
 
       // Test the content-language
       iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_Metachange.sjs?ru";
-    }
-    else if (numMetaChanges == 9) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'sjs', 'content matches');
-      is(e.detail.lang, 'ru', 'language matches');
+    } else if (numMetaChanges == 9) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "sjs", "content matches");
+      is(e.detail.lang, "ru", "language matches");
 
       // Test the content-language
       iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_Metachange.sjs?ru|dk";
-    }
-    else if (numMetaChanges == 10) {
-      is(e.detail.name, 'application-name', 'name matches');
-      is(e.detail.content, 'sjs', 'content matches');
-      is(e.detail.lang, 'dk', 'language matches');
+    } else if (numMetaChanges == 10) {
+      is(e.detail.name, "application-name", "name matches");
+      is(e.detail.content, "sjs", "content matches");
+      is(e.detail.lang, "dk", "language matches");
 
       // Test Open Graph property
-      iframe1.src = createHtml(createMetaWithProperty('og:description', 'Fascinating article'));
+      iframe1.src = createHtml(createMetaWithProperty("og:description", "Fascinating article"));
 
       // We should not get event if property doesn't start with 'og:'
-      iframe3.src = createHtml(createMetaWithProperty('go:description', 'Fascinating article'));
-    }
-    else if (numMetaChanges == 11) {
-      is(e.detail.name, 'og:description', 'property name matches');
-      is(e.detail.content, 'Fascinating article', 'content matches');
+      iframe3.src = createHtml(createMetaWithProperty("go:description", "Fascinating article"));
+    } else if (numMetaChanges == 11) {
+      is(e.detail.name, "og:description", "property name matches");
+      is(e.detail.content, "Fascinating article", "content matches");
 
       // Sometimes 'name' is used instead of 'property'. Verify that works.
-      iframe1.src = createHtml(createMeta('og:title', 'One weird trick!'));
+      iframe1.src = createHtml(createMeta("og:title", "One weird trick!"));
 
       // We should not get event if property doesn't start with 'og:'
-      iframe3.src = createHtml(createMeta('go:title', 'One weird trick!'));
-    }
-    else if (numMetaChanges == 12) {
-      is(e.detail.name, 'og:title', 'property name matches');
-      is(e.detail.content, 'One weird trick!', 'content matches');
+      iframe3.src = createHtml(createMeta("go:title", "One weird trick!"));
+    } else if (numMetaChanges == 12) {
+      is(e.detail.name, "og:title", "property name matches");
+      is(e.detail.content, "One weird trick!", "content matches");
 
       // Test the language
       SimpleTest.finish();
     } else {
-      ok(false, 'Too many metachange events.');
+      ok(false, "Too many metachange events.");
     }
   });
 
-  iframe3.addEventListener('mozbrowsermetachange', function(e) {
-    ok(false, 'Should not get a metachange event for iframe3.');
+  iframe3.addEventListener("mozbrowsermetachange", function(e) {
+    ok(false, "Should not get a metachange event for iframe3.");
   });
 
 
-  iframe1.src = createHtml(createMeta('application-name', 'foobar'));
+  iframe1.src = createHtml(createMeta("application-name", "foobar"));
   // We should not recieve meta change events for either of the below iframes
-  iframe2.src = createHtml(createMeta('application-name', 'foobar'));
-  iframe3.src = createHtml(createMeta('application-name', 'foobar'));
-
+  iframe2.src = createHtml(createMeta("application-name", "foobar"));
+  iframe3.src = createHtml(createMeta("application-name", "foobar"));
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenNamed.js
+++ b/dom/browser-element/mochitest/browserElement_OpenNamed.js
@@ -7,49 +7,49 @@
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 var iframe;
 var popupFrame;
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotPopup = false;
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(gotPopup, false, 'Should get just one popup.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(gotPopup, false, "Should get just one popup.");
     gotPopup = true;
     popupFrame = e.detail.frameElement;
-    is(popupFrame.getAttribute('name'), 'OpenNamed');
+    is(popupFrame.getAttribute("name"), "OpenNamed");
 
     // Called when file_browserElement_OpenNamed2.html loads into popupFrame.
-    popupFrame.addEventListener('mozbrowsershowmodalprompt', function(e) {
-      ok(gotPopup, 'Got openwindow event before showmodalprompt event.');
-      is(e.detail.message, 'success: loaded');
+    popupFrame.addEventListener("mozbrowsershowmodalprompt", function(e) {
+      ok(gotPopup, "Got openwindow event before showmodalprompt event.");
+      is(e.detail.message, "success: loaded");
       SimpleTest.executeSoon(test2);
     }, {once: true});
 
     document.body.appendChild(popupFrame);
   });
 
   // OpenNamed.html will call
   //
   //    window.open('file_browserElement_OpenNamed2.html', 'OpenNamed').
   //
   // Once that popup loads, we reload OpenNamed.html.  That will call
   // window.open again, but we shouldn't get another openwindow event, because
   // we're opening into the same named window.
-  iframe.src = 'file_browserElement_OpenNamed.html';
+  iframe.src = "file_browserElement_OpenNamed.html";
   document.body.appendChild(iframe);
 }
 
 function test2() {
-  popupFrame.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    is(e.detail.message, 'success: loaded');
+  popupFrame.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    is(e.detail.message, "success: loaded");
     SimpleTest.finish();
   });
 
-  iframe.src = 'file_browserElement_OpenNamed.html?test2';
+  iframe.src = "file_browserElement_OpenNamed.html?test2";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenTab.js
+++ b/dom/browser-element/mochitest/browserElement_OpenTab.js
@@ -4,18 +4,18 @@
 // Bug 1144015 - test middle/ctrl/cmd-click on a link.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  let iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  let iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   let x = 2;
   let y = 2;
   // This test used to try to transform the coordinates from child
   // to parent coordinate space by first calling
   // iframe.getBoundingClientRect();
   // to refresh offsets and then calling
@@ -23,40 +23,40 @@ function runTest() {
   //                .frameLoader.tabParent;
   // and calling tabParent.getChildProcessOffset(offsetX, offsetY) if
   // tabParent was not null, but tabParent was always null.
 
   let sendCtrlClick = () => {
     let nsIDOMWindowUtils = SpecialPowers.Ci.nsIDOMWindowUtils;
     let mod = nsIDOMWindowUtils.MODIFIER_META |
               nsIDOMWindowUtils.MODIFIER_CONTROL;
-    iframe.sendMouseEvent('mousedown', x, y, 0, 1, mod);
-    iframe.sendMouseEvent('mouseup', x, y, 0, 1, mod);
-  }
+    iframe.sendMouseEvent("mousedown", x, y, 0, 1, mod);
+    iframe.sendMouseEvent("mouseup", x, y, 0, 1, mod);
+  };
 
   let onCtrlClick = e => {
-    is(e.detail.url, 'http://example.com/', 'URL matches');
-    iframe.removeEventListener('mozbrowseropentab', onCtrlClick);
-    iframe.addEventListener('mozbrowseropentab', onMiddleClick);
+    is(e.detail.url, "http://example.com/", "URL matches");
+    iframe.removeEventListener("mozbrowseropentab", onCtrlClick);
+    iframe.addEventListener("mozbrowseropentab", onMiddleClick);
     sendMiddleClick();
-  }
+  };
 
   let sendMiddleClick = () => {
-    iframe.sendMouseEvent('mousedown', x, y, 1, 1, 0);
-    iframe.sendMouseEvent('mouseup', x, y, 1, 1, 0);
-  }
+    iframe.sendMouseEvent("mousedown", x, y, 1, 1, 0);
+    iframe.sendMouseEvent("mouseup", x, y, 1, 1, 0);
+  };
 
   let onMiddleClick = e => {
-    is(e.detail.url, 'http://example.com/', 'URL matches');
-    iframe.removeEventListener('mozbrowseropentab', onMiddleClick);
+    is(e.detail.url, "http://example.com/", "URL matches");
+    iframe.removeEventListener("mozbrowseropentab", onMiddleClick);
     SimpleTest.finish();
-  }
+  };
 
-  iframe.addEventListener('mozbrowserloadend', e => {
-    iframe.addEventListener('mozbrowseropentab', onCtrlClick);
+  iframe.addEventListener("mozbrowserloadend", e => {
+    iframe.addEventListener("mozbrowseropentab", onCtrlClick);
     sendCtrlClick();
   });
 
 
   iframe.src = 'data:text/html,<body style="margin:0"><a href="http://example.com"><span>click here</span></a></body>';
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindow.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindow.js
@@ -4,55 +4,52 @@
 // Bug 742944 - Test that window.open works with <iframe mozbrowser>.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotPopup = false;
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(gotPopup, false, 'Should get just one popup.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(gotPopup, false, "Should get just one popup.");
     gotPopup = true;
 
     document.body.appendChild(e.detail.frameElement);
 
     ok(/file_browserElement_Open2\.html$/.test(e.detail.url),
        "Popup's URL (got " + e.detail.url + ")");
     is(e.detail.name, "name");
     is(e.detail.features, "dialog=1");
   });
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    ok(gotPopup, 'Got mozbrowseropenwindow event before showmodalprompt event.');
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    ok(gotPopup, "Got mozbrowseropenwindow event before showmodalprompt event.");
     if (e.detail.message.indexOf("success:") == 0) {
       ok(true, e.detail.message);
-    }
-    else if (e.detail.message.indexOf("failure:") == 0) {
+    } else if (e.detail.message.indexOf("failure:") == 0) {
       ok(false, e.detail.message);
-    }
-    else if (e.detail.message == "finish") {
+    } else if (e.detail.message == "finish") {
       SimpleTest.finish();
-    }
-    else {
+    } else {
       ok(false, "Got invalid message: " + e.detail.message);
     }
   });
 
   /**
    * file_browserElementOpen1 does
    *
    *   window.open('file_browserElement_Open2.html', 'name', 'dialog=1')
    *
    * then adds an event listener to the opened window and waits for onload.
    *
    * Onload, we fire a few alerts saying "success:REASON" or "failure:REASON".
    * Finally, we fire a "finish" alert, which ends the test.
    */
-  iframe.src = 'file_browserElement_Open1.html';
+  iframe.src = "file_browserElement_Open1.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindowDifferentOrigin.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindowDifferentOrigin.js
@@ -4,38 +4,38 @@
 // Bug 769182 - window.open to a different origin should load the page.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    ok(true, 'Got first window.open call');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    ok(true, "Got first window.open call");
 
-    e.detail.frameElement.addEventListener('mozbrowseropenwindow', function(e) {
-      ok(true, 'Got second window.open call');
+    e.detail.frameElement.addEventListener("mozbrowseropenwindow", function(e) {
+      ok(true, "Got second window.open call");
       document.body.appendChild(e.detail.frameElement);
     });
 
-    e.detail.frameElement.addEventListener('mozbrowsershowmodalprompt', function(e) {
-      ok(true, 'Got alert from second window.');
+    e.detail.frameElement.addEventListener("mozbrowsershowmodalprompt", function(e) {
+      ok(true, "Got alert from second window.");
       SimpleTest.finish();
     });
 
     document.body.appendChild(e.detail.frameElement);
   });
 
   // DifferentOrigin.html?1 calls
   //
   //   window.open('http://example.com/.../DifferentOrigin.html?2'),
   //
   // which calls alert().
 
-  iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html?1';
+  iframe.src = "http://example.org/tests/dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html?1";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindowEmpty.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindowEmpty.js
@@ -5,27 +5,27 @@
 // about:blank as default
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotPopup = false;
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(gotPopup, false, 'Should get just one popup.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(gotPopup, false, "Should get just one popup.");
     gotPopup = true;
 
-    is(e.detail.url, 'about:blank', "Popup's has correct URL");
+    is(e.detail.url, "about:blank", "Popup's has correct URL");
     e.preventDefault();
 
     SimpleTest.finish();
   });
 
-  iframe.src = 'file_browserElement_OpenWindowEmpty.html';
+  iframe.src = "file_browserElement_OpenWindowEmpty.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindowInFrame.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindowInFrame.js
@@ -10,56 +10,53 @@
 // an iframe.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var gotPopup = false;
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(gotPopup, false, 'Should get just one popup.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(gotPopup, false, "Should get just one popup.");
     gotPopup = true;
 
     document.body.appendChild(e.detail.frameElement);
 
     ok(/file_browserElement_Open2\.html$/.test(e.detail.url),
        "Popup's URL (got " + e.detail.url + ")");
     is(e.detail.name, "name");
     is(e.detail.features, "dialog=1");
   });
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    ok(gotPopup, 'Got mozbrowseropenwindow event before showmodalprompt event.');
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    ok(gotPopup, "Got mozbrowseropenwindow event before showmodalprompt event.");
     if (e.detail.message.indexOf("success:") == 0) {
       ok(true, e.detail.message);
-    }
-    else if (e.detail.message.indexOf("failure:") == 0) {
+    } else if (e.detail.message.indexOf("failure:") == 0) {
       ok(false, e.detail.message);
-    }
-    else if (e.detail.message == "finish") {
+    } else if (e.detail.message == "finish") {
       SimpleTest.finish();
-    }
-    else {
+    } else {
       ok(false, "Got invalid message: " + e.detail.message);
     }
   });
 
   /**
    * file_browserElement_OpenWindowInFrame.html loads
    * file_browserElement_Open1.html in an iframe.  Open1.html does
    *
    *   window.open('file_browserElement_Open2.html', 'name', 'dialog=1')
    *
    * then adds an event listener to the opened window and waits for onload.
    *
    * Onload, we fire a few alerts saying "success:REASON" or "failure:REASON".
    * Finally, we fire a "finish" alert, which ends the test.
    */
-  iframe.src = 'file_browserElement_OpenWindowInFrame.html';
+  iframe.src = "file_browserElement_OpenWindowInFrame.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindowRejected.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindowRejected.js
@@ -5,40 +5,38 @@
 // reject the call.  This shouldn't cause problems (crashes, leaks).
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    ok(e.detail.url.includes('does_not_exist.html'),
-       'Opened URL; got ' + e.detail.url);
-    is(e.detail.name, '');
-    is(e.detail.features, '');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    ok(e.detail.url.includes("does_not_exist.html"),
+       "Opened URL; got " + e.detail.url);
+    is(e.detail.name, "");
+    is(e.detail.features, "");
 
     // Don't add e.detail.frameElement to the DOM, so the window.open is
     // effectively blocked.
     e.preventDefault();
   });
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     var msg = e.detail.message;
-    if (msg.indexOf('success:') == 0) {
+    if (msg.indexOf("success:") == 0) {
       ok(true, msg);
-    }
-    else if (msg == 'finish') {
+    } else if (msg == "finish") {
       SimpleTest.finish();
-    }
-    else {
+    } else {
       ok(false, msg);
     }
   });
 
-  iframe.src = 'file_browserElement_OpenWindowRejected.html';
+  iframe.src = "file_browserElement_OpenWindowRejected.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_OpenWindowRejected2.js
+++ b/dom/browser-element/mochitest/browserElement_OpenWindowRejected2.js
@@ -9,39 +9,37 @@
 // preventDefault() on the event.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    ok(e.detail.url.includes('does_not_exist.html'),
-       'Opened URL; got ' + e.detail.url);
-    is(e.detail.name, '');
-    is(e.detail.features, '');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    ok(e.detail.url.includes("does_not_exist.html"),
+       "Opened URL; got " + e.detail.url);
+    is(e.detail.name, "");
+    is(e.detail.features, "");
 
     // Call preventDefault, but don't add the iframe to the DOM.  This still
     // amounts to rejecting the popup.
     e.preventDefault();
   });
 
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     var msg = e.detail.message;
-    if (msg.indexOf('success:') == 0) {
+    if (msg.indexOf("success:") == 0) {
       ok(true, msg);
-    }
-    else if (msg == 'finish') {
+    } else if (msg == "finish") {
       SimpleTest.finish();
-    }
-    else {
+    } else {
       ok(false, msg);
     }
   });
 
-  iframe.src = 'file_browserElement_OpenWindowRejected.html';
+  iframe.src = "file_browserElement_OpenWindowRejected.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Opensearch.js
+++ b/dom/browser-element/mochitest/browserElement_Opensearch.js
@@ -5,106 +5,99 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function createHtml(link) {
-  return 'data:text/html,<html><head>' + link + '<body></body></html>';
+  return "data:text/html,<html><head>" + link + "<body></body></html>";
 }
 
 function createLink(name) {
   return '<link rel="search" title="Test OpenSearch" type="application/opensearchdescription+xml" href="http://example.com/' + name + '.xml">';
 }
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe1);
 
   // iframe2 is a red herring; we modify its link but don't listen for
   // opensearch; we want to make sure that its opensearch events aren't
   // picked up by the listener on iframe1.
-  var iframe2 = document.createElement('iframe');
-  iframe2.setAttribute('mozbrowser', 'true');
+  var iframe2 = document.createElement("iframe");
+  iframe2.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe2);
 
   // iframe3 is another red herring.  It's not a mozbrowser, so we shouldn't
   // get any opensearch events on it.
-  var iframe3 = document.createElement('iframe');
+  var iframe3 = document.createElement("iframe");
   document.body.appendChild(iframe3);
 
   var numLinkChanges = 0;
 
-  iframe1.addEventListener('mozbrowseropensearch', function(e) {
-
+  iframe1.addEventListener("mozbrowseropensearch", function(e) {
     numLinkChanges++;
 
     if (numLinkChanges == 1) {
-      is(e.detail.title, 'Test OpenSearch');
-      is(e.detail.href, 'http://example.com/mysearch.xml');
+      is(e.detail.title, "Test OpenSearch");
+      is(e.detail.href, "http://example.com/mysearch.xml");
 
       // We should recieve opensearch events when the user creates new links
       // to a search engine, but only when we listen for them
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.title='New title';",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=SEARCH type=application/opensearchdescription+xml href=http://example.com/newsearch.xml>')",
                                     /* allowDelayedLoad = */ false);
 
       SpecialPowers.getBrowserFrameMessageManager(iframe2)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=SEARCH type=application/opensearchdescription+xml href=http://example.com/newsearch.xml>')",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numLinkChanges == 2) {
-      is(e.detail.href, 'http://example.com/newsearch.xml');
+    } else if (numLinkChanges == 2) {
+      is(e.detail.href, "http://example.com/newsearch.xml");
 
       // Full new pages should trigger opensearch events
-      iframe1.src = createHtml(createLink('3rdsearch'));
-    }
-    else if (numLinkChanges == 3) {
-      is(e.detail.href, 'http://example.com/3rdsearch.xml');
+      iframe1.src = createHtml(createLink("3rdsearch"));
+    } else if (numLinkChanges == 3) {
+      is(e.detail.href, "http://example.com/3rdsearch.xml");
 
       // the rel attribute can have various space seperated values, make
       // sure we only pick up correct values for 'opensearch'
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=someopensearch type=application/opensearchdescription+xml href=http://example.com/newsearch.xml>')",
                                     /* allowDelayedLoad = */ false);
       // Test setting a page with multiple links elements
-      iframe1.src = createHtml(createLink('another') + createLink('search'));
-    }
-    else if (numLinkChanges == 4) {
-      is(e.detail.href, 'http://example.com/another.xml');
+      iframe1.src = createHtml(createLink("another") + createLink("search"));
+    } else if (numLinkChanges == 4) {
+      is(e.detail.href, "http://example.com/another.xml");
       // 2 events will be triggered by previous test, wait for next
-    }
-    else if (numLinkChanges == 5) {
-      is(e.detail.href, 'http://example.com/search.xml');
+    } else if (numLinkChanges == 5) {
+      is(e.detail.href, "http://example.com/search.xml");
 
       // Make sure opensearch check is case insensitive
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.head.insertAdjacentHTML('beforeend', '<link rel=SEARCH type=application/opensearchdescription+xml href=http://example.com/ucasesearch.xml>')",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numLinkChanges == 6) {
-      is(e.detail.href, 'http://example.com/ucasesearch.xml');
+    } else if (numLinkChanges == 6) {
+      is(e.detail.href, "http://example.com/ucasesearch.xml");
       SimpleTest.finish();
     } else {
-      ok(false, 'Too many opensearch events.');
+      ok(false, "Too many opensearch events.");
     }
   });
 
-  iframe3.addEventListener('mozbrowseropensearch', function(e) {
-    ok(false, 'Should not get a opensearch event for iframe3.');
+  iframe3.addEventListener("mozbrowseropensearch", function(e) {
+    ok(false, "Should not get a opensearch event for iframe3.");
   });
 
 
-  iframe1.src = createHtml(createLink('mysearch'));
+  iframe1.src = createHtml(createLink("mysearch"));
   // We should not recieve opensearch change events for either of the below iframes
-  iframe2.src = createHtml(createLink('mysearch'));
-  iframe3.src = createHtml(createLink('mysearch'));
-
+  iframe2.src = createHtml(createLink("mysearch"));
+  iframe3.src = createHtml(createLink("mysearch"));
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_PrivateBrowsing.js
+++ b/dom/browser-element/mochitest/browserElement_PrivateBrowsing.js
@@ -5,17 +5,17 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function createFrame(aIsPrivate) {
   var iframe = document.createElement("iframe");
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe.setAttribute("mozbrowser", "true");
   if (aIsPrivate) {
     iframe.setAttribute("mozprivatebrowsing", "true");
   }
   return iframe;
 }
 
 function createTest(aIsPrivate, aExpected, aClearStorage) {
   info("createTest " + aIsPrivate + " " + aExpected);
@@ -25,17 +25,16 @@ function createTest(aIsPrivate, aExpecte
 
     iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
       is(e.detail.message, aExpected, "Checking localstorage");
       resolve();
     });
 
     var src = "file_browserElement_PrivateBrowsing.html";
     iframe.src = aClearStorage ? src + "?clear=true" : src;
-
   });
 }
 
 function runTest() {
   // We first create a iframe in non private browsing mode, set up some
   // localstorage, reopen it to check that we get the previously set value.
   // Finally, open it in private browsing mode and check that localstorage
   // is clear.
--- a/dom/browser-element/mochitest/browserElement_PromptCheck.js
+++ b/dom/browser-element/mochitest/browserElement_PromptCheck.js
@@ -10,33 +10,30 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
-function runTest()
-{
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+function runTest() {
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   var numPrompts = 0;
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     is(e.detail.message, String(numPrompts), "prompt message");
     if (numPrompts / 10 < 1) {
-      is(e.detail.promptType, 'alert');
-    }
-    else if (numPrompts / 10 < 2) {
-      is(e.detail.promptType, 'confirm');
-    }
-    else {
-      is(e.detail.promptType, 'prompt');
+      is(e.detail.promptType, "alert");
+    } else if (numPrompts / 10 < 2) {
+      is(e.detail.promptType, "confirm");
+    } else {
+      is(e.detail.promptType, "prompt");
     }
 
     numPrompts++;
     if (numPrompts == 30) {
       SimpleTest.finish();
     }
   });
 
@@ -45,16 +42,16 @@ function runTest()
       addEventListener("load", function() { \
        setTimeout(function() { \
         var i = 0; \
         for (; i < 10; i++) { alert(i); } \
         for (; i < 20; i++) { confirm(i); } \
         for (; i < 30; i++) { prompt(i); } \
        }); \
      }); \
-     </scr' + 'ipt></body></html>';
+     </scr' + "ipt></body></html>";
 }
 
 // The test harness sets dom.successive_dialog_time_limit to 0 for some bizarre
 // reason.  That's not normal usage, and it keeps us from testing alertCheck!
-addEventListener('testready', function() {
-  SpecialPowers.pushPrefEnv({'set': [['dom.successive_dialog_time_limit', 10]]}, runTest);
+addEventListener("testready", function() {
+  SpecialPowers.pushPrefEnv({"set": [["dom.successive_dialog_time_limit", 10]]}, runTest);
 });
--- a/dom/browser-element/mochitest/browserElement_PromptConfirm.js
+++ b/dom/browser-element/mochitest/browserElement_PromptConfirm.js
@@ -9,64 +9,62 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   var prompts = [
-    {msg: '1', type: 'alert', rv: 42, expected: 'undefined'},
-    {msg: '2', type: 'confirm', rv: true, expected: 'true'},
-    {msg: '3', type: 'confirm', rv: false, expected: 'false'},
+    {msg: "1", type: "alert", rv: 42, expected: "undefined"},
+    {msg: "2", type: "confirm", rv: true, expected: "true"},
+    {msg: "3", type: "confirm", rv: false, expected: "false"},
 
     // rv == 42 should be coerced to 'true' for confirm.
-    {msg: '4', type: 'confirm', rv: 42, expected: 'true'},
-    {msg: '5', type: 'prompt', rv: 'worked', expected: 'worked'},
-    {msg: '6', type: 'prompt', rv: null, expected: 'null'},
-    {msg: '7', type: 'prompt', rv: '', expected: ''}
+    {msg: "4", type: "confirm", rv: 42, expected: "true"},
+    {msg: "5", type: "prompt", rv: "worked", expected: "worked"},
+    {msg: "6", type: "prompt", rv: null, expected: "null"},
+    {msg: "7", type: "prompt", rv: "", expected: ""},
   ];
 
   iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     var curPrompt = prompts[0];
     if (!curPrompt.waitingForResponse) {
       curPrompt.waitingForResponse = true;
 
       is(e.detail.message, curPrompt.msg, "prompt message");
       is(e.detail.promptType, curPrompt.type, "prompt type");
 
-      if (e.detail.promptType == 'prompt') {
+      if (e.detail.promptType == "prompt") {
         ok(e.detail.returnValue === null, "prompt's returnValue should be null");
         is(e.detail.initialValue, "initial", "prompt's initial value.");
-      }
-      else {
+      } else {
         ok(e.detail.returnValue === undefined,
            "Other than for prompt, shouldn't have initial value.");
       }
 
       // Block the child until we call e.detail.unblock().
       e.preventDefault();
 
       SimpleTest.executeSoon(function() {
         e.detail.returnValue = curPrompt.rv;
         e.detail.unblock();
       });
-    }
-    else {
+    } else {
       prompts.shift();
 
       // |e| now corresponds to an alert() containing the return value we just
       // sent for this prompt.
 
-      is(e.detail.message, 'RESULT:' + curPrompt.expected,
+      is(e.detail.message, "RESULT:" + curPrompt.expected,
          "expected rv for msg " + curPrompt.msg);
 
       if (prompts.length == 0) {
         SimpleTest.finish();
       }
     }
   });
 
@@ -77,12 +75,12 @@ function runTest() {
       } \
       sendVal(alert("1")); \
       sendVal(confirm("2")); \
       sendVal(confirm("3")); \
       sendVal(confirm("4")); \
       sendVal(prompt("5", "initial")); \
       sendVal(prompt("6", "initial")); \
       sendVal(prompt("7", "initial")); \
-    </scr' + 'ipt></body></html>';
+    </scr' + "ipt></body></html>";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Reload.js
+++ b/dom/browser-element/mochitest/browserElement_Reload.js
@@ -4,56 +4,56 @@
 // Bug 741717 - Test the reload ability of <iframe mozbrowser>.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 var iframeScript = function() {
-  sendAsyncMessage('test:innerHTML', {
-    data: XPCNativeWrapper.unwrap(content).document.body.innerHTML
+  sendAsyncMessage("test:innerHTML", {
+    data: XPCNativeWrapper.unwrap(content).document.body.innerHTML,
   });
-}
+};
 
 var mm;
 var iframe;
 var loadedEvents = 0;
 var countAcc;
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowserloadend', mozbrowserLoaded);
+  iframe.addEventListener("mozbrowserloadend", mozbrowserLoaded);
 
-  iframe.src = 'file_bug741717.sjs';
+  iframe.src = "file_bug741717.sjs";
   document.body.appendChild(iframe);
 }
 
 function iframeBodyRecv(data) {
   data = SpecialPowers.wrap(data);
   var previousCount = countAcc;
   var currentCount = parseInt(data.json.data, 10);
   countAcc = currentCount;
   switch (loadedEvents) {
   case 1:
     iframe.reload();
     break;
   case 2:
-    ok(true, 'reload was triggered');
-    ok(previousCount === currentCount, 'reload was a soft reload');
+    ok(true, "reload was triggered");
+    ok(previousCount === currentCount, "reload was a soft reload");
     iframe.reload(true);
     break;
   case 3:
-    ok(currentCount > previousCount, 'reload was a hard reload');
+    ok(currentCount > previousCount, "reload was a hard reload");
     SimpleTest.finish();
   }
 }
 
 function mozbrowserLoaded() {
   loadedEvents++;
   mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
-  mm.addMessageListener('test:innerHTML', iframeBodyRecv);
-  mm.loadFrameScript('data:,(' + iframeScript.toString() + ')();', false);
+  mm.addMessageListener("test:innerHTML", iframeBodyRecv);
+  mm.loadFrameScript("data:,(" + iframeScript.toString() + ")();", false);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
+++ b/dom/browser-element/mochitest/browserElement_ReloadPostRequest.js
@@ -12,17 +12,17 @@ browserElementTestHelpers.setEnabledPref
 var iframe;
 var gotConfirmRepost = false;
 var doRepost = true;
 var timer;
 var isPostRequestSubmitted;
 
 function getExpectedStrings() {
   let result = {};
-  let bundleService = SpecialPowers.Cc['@mozilla.org/intl/stringbundle;1'].
+  let bundleService = SpecialPowers.Cc["@mozilla.org/intl/stringbundle;1"].
     getService(SpecialPowers.Ci.nsIStringBundleService);
   let appBundle = bundleService.createBundle("chrome://global/locale/appstrings.properties");
   let brandBundle = bundleService.createBundle("chrome://branding/locale/brand.properties");
   try {
     let brandName = brandBundle.GetStringFromName("brandShortName");
     result.message = appBundle.formatStringFromName("confirmRepostPrompt",
                                                     [brandName], 1);
   } catch (e) {
@@ -32,85 +32,85 @@ function getExpectedStrings() {
   result.resend = appBundle.GetStringFromName("resendButton.label");
 
   return result;
 }
 
 function failBecauseReloaded() {
   window.clearTimeout(timer);
   timer = null;
-  iframe.removeEventListener('mozbrowserloadend', failBecauseReloaded);
+  iframe.removeEventListener("mozbrowserloadend", failBecauseReloaded);
   ok(false, "We don't expect browser element to reload, but it did");
   SimpleTest.finish();
-};
+}
 
 function reloadDone() {
-  iframe.removeEventListener('mozbrowserloadend', reloadDone);
+  iframe.removeEventListener("mozbrowserloadend", reloadDone);
   ok(gotConfirmRepost, "Didn't get confirmEx prompt before reload");
 
   // Run again, with repost disallowed.
   doRepost = false;
   isPostRequestSubmitted = false;
-  iframe.src = 'file_post_request.html';
-  iframe.addEventListener('mozbrowserloadend', pageLoadDone);
+  iframe.src = "file_post_request.html";
+  iframe.addEventListener("mozbrowserloadend", pageLoadDone);
 }
 
 function pageLoadDone() {
   if (!isPostRequestSubmitted) {
     // This loadend is done by setting url in address bar, so we don't need to
     // do anything. The test page will submit a POST request.
     isPostRequestSubmitted = true;
     return;
   }
 
   gotConfirmRepost = false;
-  iframe.removeEventListener('mozbrowserloadend', pageLoadDone);
+  iframe.removeEventListener("mozbrowserloadend", pageLoadDone);
   if (doRepost) {
-    iframe.addEventListener('mozbrowserloadend', reloadDone);
+    iframe.addEventListener("mozbrowserloadend", reloadDone);
   } else {
     // We don't expect browserelement to reload; use a timer to make sure
     // it is not reloaded.
-    iframe.addEventListener('mozbrowserloadend', failBecauseReloaded);
+    iframe.addEventListener("mozbrowserloadend", failBecauseReloaded);
   }
   iframe.reload();
 }
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   isPostRequestSubmitted = false;
-  iframe.src = 'file_post_request.html';
+  iframe.src = "file_post_request.html";
   document.body.appendChild(iframe);
 
-  iframe.addEventListener('mozbrowserloadend', pageLoadDone);
+  iframe.addEventListener("mozbrowserloadend", pageLoadDone);
 
   let expectedMessage = getExpectedStrings();
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
-    if (e.detail.promptType == 'custom-prompt') {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
+    if (e.detail.promptType == "custom-prompt") {
       gotConfirmRepost = true;
       e.preventDefault();
       e.detail.returnValue = {
         selectedButton: doRepost ? 0 : 1,
       };
       is(e.detail.returnValue.checked, undefined);
-      is(e.detail.buttons[0].messageType, 'custom');
+      is(e.detail.buttons[0].messageType, "custom");
       is(e.detail.buttons[0].message, expectedMessage.resend);
-      is(e.detail.buttons[1].messageType, 'builtin');
-      is(e.detail.buttons[1].message, 'cancel');
+      is(e.detail.buttons[1].messageType, "builtin");
+      is(e.detail.buttons[1].message, "cancel");
       is(e.detail.message, expectedMessage.message);
       is(e.detail.buttons.length, 2);
       is(e.detail.showCheckbox, false);
       is(e.detail.checkboxMessage, null);
       e.detail.unblock();
 
       if (!doRepost) {
         // To make sure the page doesn't reload in 1 sec.
         timer = window.setTimeout(function() {
-          iframe.removeEventListener('mozbrowserloadend', failBecauseReloaded);
+          iframe.removeEventListener("mozbrowserloadend", failBecauseReloaded);
           SimpleTest.finish();
         }, 1000);
       }
     }
   });
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js
+++ b/dom/browser-element/mochitest/browserElement_RemoveBrowserElement.js
@@ -7,25 +7,25 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     document.body.removeChild(iframe);
     SimpleTest.executeSoon(function() {
       ok(true);
       SimpleTest.finish();
     });
   });
 
   iframe.src = "data:text/html,<html><body><script>alert(\"test\")</script>" +
                "</body></html>";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ScrollEvent.js
+++ b/dom/browser-element/mochitest/browserElement_ScrollEvent.js
@@ -5,24 +5,24 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
   iframe.addEventListener("mozbrowserscroll", function(e) {
     ok(true, "got mozbrowserscroll event.");
     ok(e.detail, "event.detail is not null.");
     ok(Math.round(e.detail.top) == 4000, "top position is correct.");
     ok(Math.round(e.detail.left) == 4000, "left position is correct.");
     SimpleTest.finish();
   });
 
   iframe.src = "data:text/html,<html><body style='min-height: 5000px; min-width: 5000px;'></body><script>window.scrollTo(4000, 4000);</script></html>";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_SecurityChange.js
+++ b/dom/browser-element/mochitest/browserElement_SecurityChange.js
@@ -5,54 +5,54 @@
 // mozbrowsersecuritychange events.
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   var lastSecurityState;
-  iframe.addEventListener('mozbrowsersecuritychange', function(e) {
+  iframe.addEventListener("mozbrowsersecuritychange", function(e) {
     lastSecurityState = e.detail;
   });
 
-  var filepath = 'tests/dom/browser-element/mochitest/file_browserElement_SecurityChange.html';
+  var filepath = "tests/dom/browser-element/mochitest/file_browserElement_SecurityChange.html";
 
   var count = 0;
-  iframe.addEventListener('mozbrowserloadend', function(e) {
+  iframe.addEventListener("mozbrowserloadend", function(e) {
     count++;
     switch (count) {
     case 1:
-      is(lastSecurityState.state, 'secure');
+      is(lastSecurityState.state, "secure");
       is(lastSecurityState.extendedValidation, false);
       is(lastSecurityState.mixedContent, false);
       iframe.src = "http://example.com/" + filepath;
       break;
     case 2:
-      is(lastSecurityState.state, 'insecure');
+      is(lastSecurityState.state, "insecure");
       is(lastSecurityState.extendedValidation, false);
       is(lastSecurityState.mixedContent, false);
-      iframe.src = 'https://example.com:443/' + filepath + '?broken';
+      iframe.src = "https://example.com:443/" + filepath + "?broken";
       break;
     case 3:
-      is(lastSecurityState.state, 'broken');
+      is(lastSecurityState.state, "broken");
       is(lastSecurityState.extendedValidation, false);
       is(lastSecurityState.mixedContent, true);
       SimpleTest.finish();
       break;
     }
   });
 
   iframe.src = "https://example.com/" + filepath;
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', function() {
-  SpecialPowers.pushPrefEnv({"set" : [
+addEventListener("testready", function() {
+  SpecialPowers.pushPrefEnv({"set": [
     ["browser.safebrowsing.phishing.enabled", false],
     ["browser.safebrowsing.malware.enabled", false],
   ]}, runTest);
 });
 
--- a/dom/browser-element/mochitest/browserElement_SendEvent.js
+++ b/dom/browser-element/mochitest/browserElement_SendEvent.js
@@ -4,17 +4,17 @@
 // Test that sendMouseEvent dispatch events.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 
 function runTest() {
   var iframe = document.createElement("iframe");
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
   var x = 10;
   var y = 10;
   // This test used to try to transform the coordinates from child
   // to parent coordinate space by first calling
   // iframe.getBoundingClientRect();
   // to refresh offsets and then calling
   // var tabParent = SpecialPowers.wrap(iframe)
@@ -39,19 +39,18 @@ function runTest() {
         ok(true, "Receive a mousemove event.");
         iframe.sendMouseEvent("mouseup", x, y, 0, 1, 0);
         break;
       case "#mouseup":
         ok(true, "Receive a mouseup event.");
         break;
       case "#click":
         ok(true, "Receive a click event.");
-        iframe.removeEventListener('mozbrowserlocationchange', onlocchange);
+        iframe.removeEventListener("mozbrowserlocationchange", onlocchange);
         SimpleTest.finish();
         break;
     }
   });
 
   iframe.src = "file_browserElement_SendEvent.html";
-
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Stop.js
+++ b/dom/browser-element/mochitest/browserElement_Stop.js
@@ -10,43 +10,43 @@
 
 "use strict";
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 browserElementTestHelpers.setEnabledPref(true);
 
 var iframe;
 var stopped = false;
-var imgSrc = 'http://test/tests/dom/browser-element/mochitest/file_bug709759.sjs';
+var imgSrc = "http://test/tests/dom/browser-element/mochitest/file_bug709759.sjs";
 
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   // FIXME: Bug 1270790
-  iframe.setAttribute('remote', 'true');
-  iframe.addEventListener('mozbrowserloadend', loadend);
-  iframe.src = 'data:text/html,<html>' +
+  iframe.setAttribute("remote", "true");
+  iframe.addEventListener("mozbrowserloadend", loadend);
+  iframe.src = "data:text/html,<html>" +
     '<body><img src="' + imgSrc + '" /></body></html>';
 
   document.body.appendChild(iframe);
 
   setTimeout(function() {
     stopped = true;
     iframe.stop();
   }, 200);
 }
 
 function loadend() {
-  ok(stopped, 'Iframes network connections were stopped');
+  ok(stopped, "Iframes network connections were stopped");
 
   // Wait 1 second and make sure there isn't a mozbrowsererror after stop();
-  iframe.addEventListener('mozbrowsererror', handleError);
+  iframe.addEventListener("mozbrowsererror", handleError);
   window.setTimeout(function() {
-    iframe.removeEventListener('mozbrowsererror', handleError);
+    iframe.removeEventListener("mozbrowsererror", handleError);
     SimpleTest.finish();
   }, 1000);
 }
 
 function handleError() {
   ok(false, "mozbrowsererror should not be fired");
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_TargetBlank.js
+++ b/dom/browser-element/mochitest/browserElement_TargetBlank.js
@@ -5,22 +5,22 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    is(e.detail.url, 'http://example.com/');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    is(e.detail.url, "http://example.com/");
     e.preventDefault();
     SimpleTest.finish();
   });
 
   iframe.src = "file_browserElement_TargetBlank.html";
   document.body.appendChild(iframe);
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_TargetTop.js
+++ b/dom/browser-element/mochitest/browserElement_TargetTop.js
@@ -5,27 +5,27 @@
 // mozbrowser>.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
-  iframe.addEventListener('mozbrowseropenwindow', function(e) {
-    ok(false, 'Not expecting an openwindow event.');
+  iframe.addEventListener("mozbrowseropenwindow", function(e) {
+    ok(false, "Not expecting an openwindow event.");
   });
 
-  iframe.addEventListener('mozbrowserlocationchange', function(e) {
+  iframe.addEventListener("mozbrowserlocationchange", function(e) {
     if (/file_browserElement_TargetTop.html\?2$/.test(e.detail.url)) {
-      ok(true, 'Got the locationchange we were looking for.');
+      ok(true, "Got the locationchange we were looking for.");
       SimpleTest.finish();
     }
   });
 
   document.body.appendChild(iframe);
-  iframe.src = 'file_browserElement_TargetTop.html';
+  iframe.src = "file_browserElement_TargetTop.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_ThemeColor.js
+++ b/dom/browser-element/mochitest/browserElement_ThemeColor.js
@@ -10,76 +10,76 @@ browserElementTestHelpers.addPermission(
 
 function runTest() {
   function loadFrameScript(script) {
     SpecialPowers.getBrowserFrameMessageManager(iframe1)
                  .loadFrameScript("data:," + script,
                                   /* allowDelayedLoad = */ false);
   }
 
-  let iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  let iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_ThemeColor.html";
-  iframe1.addEventListener('mozbrowsermetachange', tests);
+  iframe1.addEventListener("mozbrowsermetachange", tests);
   document.body.appendChild(iframe1);
 
   let numMetaChanges = 0;
   function tests(e) {
     let detail = e.detail;
 
     switch (numMetaChanges++) {
       case 0: {
-        is(detail.name, 'theme-color', 'name matches');
-        is(detail.content, 'pink', 'content matches');
-        is(detail.type, 'added', 'type matches');
+        is(detail.name, "theme-color", "name matches");
+        is(detail.content, "pink", "content matches");
+        is(detail.type, "added", "type matches");
 
         let script =
           "var meta = content.document.head.querySelector('meta');" +
           "meta.content = 'green';";
         loadFrameScript(script);
         break;
       }
 
       case 1: {
-        is(detail.name, 'theme-color', 'name matches');
-        is(detail.content, 'green', 'content matches');
-        is(detail.type, 'changed', 'type matches');
+        is(detail.name, "theme-color", "name matches");
+        is(detail.content, "green", "content matches");
+        is(detail.type, "changed", "type matches");
 
         let script =
           "var meta = content.document.createElement('meta');" +
           "meta.name = 'theme-group';" +
           "meta.content = 'theme-productivity';" +
           "content.document.head.appendChild(meta)";
         loadFrameScript(script);
         break;
       }
 
       case 2: {
-        is(detail.name, 'theme-group', 'name matches');
-        is(detail.content, 'theme-productivity', 'content matches');
-        is(detail.type, 'added', 'type matches');
+        is(detail.name, "theme-group", "name matches");
+        is(detail.content, "theme-productivity", "content matches");
+        is(detail.type, "added", "type matches");
 
         let script =
           "var meta = content.document.head.querySelector('meta');" +
           "meta.parentNode.removeChild(meta);";
         loadFrameScript(script);
         break;
       }
 
       case 3: {
-        is(detail.name, 'theme-color', 'name matches');
-        is(detail.content, 'green', 'content matches');
-        is(detail.type, 'removed', 'type matches');
+        is(detail.name, "theme-color", "name matches");
+        is(detail.content, "green", "content matches");
+        is(detail.type, "removed", "type matches");
 
         SimpleTest.finish();
         break;
       }
 
       default: {
-        ok(false, 'Too many metachange events.');
+        ok(false, "Too many metachange events.");
         break;
       }
     }
-  };
+  }
 }
 
-window.addEventListener('testready', runTest);
+window.addEventListener("testready", runTest);
 
--- a/dom/browser-element/mochitest/browserElement_Titlechange.js
+++ b/dom/browser-element/mochitest/browserElement_Titlechange.js
@@ -5,65 +5,62 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 function runTest() {
-  var iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  var iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe1);
 
   // iframe2 is a red herring; we modify its title but don't listen for
   // titlechanges; we want to make sure that its titlechange events aren't
   // picked up by the listener on iframe1.
-  var iframe2 = document.createElement('iframe');
-  iframe2.setAttribute('mozbrowser', 'true');
+  var iframe2 = document.createElement("iframe");
+  iframe2.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe2);
 
   // iframe3 is another red herring.  It's not a mozbrowser, so we shouldn't
   // get any titlechange events on it.
-  var iframe3 = document.createElement('iframe');
+  var iframe3 = document.createElement("iframe");
   document.body.appendChild(iframe3);
 
   var numTitleChanges = 0;
 
-  iframe1.addEventListener('mozbrowsertitlechange', function(e) {
+  iframe1.addEventListener("mozbrowsertitlechange", function(e) {
     // Ignore empty titles; these come from about:blank.
-    if (e.detail == '')
+    if (e.detail == "")
       return;
 
     numTitleChanges++;
 
     if (numTitleChanges == 1) {
-      is(e.detail, 'Title');
+      is(e.detail, "Title");
       SpecialPowers.getBrowserFrameMessageManager(iframe1)
                    .loadFrameScript("data:,content.document.title='New title';",
                                     /* allowDelayedLoad = */ false);
       SpecialPowers.getBrowserFrameMessageManager(iframe2)
                    .loadFrameScript("data:,content.document.title='BAD TITLE 2';",
                                     /* allowDelayedLoad = */ false);
-    }
-    else if (numTitleChanges == 2) {
-      is(e.detail, 'New title');
-      iframe1.src = 'data:text/html,<html><head><title>Title 3</title></head><body></body></html>';
-    }
-    else if (numTitleChanges == 3) {
-      is(e.detail, 'Title 3');
+    } else if (numTitleChanges == 2) {
+      is(e.detail, "New title");
+      iframe1.src = "data:text/html,<html><head><title>Title 3</title></head><body></body></html>";
+    } else if (numTitleChanges == 3) {
+      is(e.detail, "Title 3");
       SimpleTest.finish();
-    }
-    else {
-      ok(false, 'Too many titlechange events.');
+    } else {
+      ok(false, "Too many titlechange events.");
     }
   });
 
-  iframe3.addEventListener('mozbrowsertitlechange', function(e) {
-    ok(false, 'Should not get a titlechange event for iframe3.');
+  iframe3.addEventListener("mozbrowsertitlechange", function(e) {
+    ok(false, "Should not get a titlechange event for iframe3.");
   });
 
-  iframe1.src = 'data:text/html,<html><head><title>Title</title></head><body></body></html>';
-  iframe2.src = 'data:text/html,<html><head><title>BAD TITLE</title></head><body></body></html>';
-  iframe3.src = 'data:text/html,<html><head><title>SHOULD NOT GET EVENT</title></head><body></body></html>';
+  iframe1.src = "data:text/html,<html><head><title>Title</title></head><body></body></html>";
+  iframe2.src = "data:text/html,<html><head><title>BAD TITLE</title></head><body></body></html>";
+  iframe3.src = "data:text/html,<html><head><title>SHOULD NOT GET EVENT</title></head><body></body></html>";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_TopBarrier.js
+++ b/dom/browser-element/mochitest/browserElement_TopBarrier.js
@@ -6,29 +6,29 @@
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 browserElementTestHelpers.allowTopLevelDataURINavigation();
 
 var iframe;
 function runTest() {
-  iframe = document.createElement('iframe');
-  iframe.addEventListener('mozbrowserloadend', function() {
+  iframe = document.createElement("iframe");
+  iframe.addEventListener("mozbrowserloadend", function() {
     try {
       outerIframeLoaded();
-    } catch(e) {
-      dump("Got error: " + e + '\n');
+    } catch (e) {
+      dump("Got error: " + e + "\n");
     }
   });
-  iframe.setAttribute('mozbrowser', 'true');
+  iframe.setAttribute("mozbrowser", "true");
   iframe.src = 'data:text/html,Outer iframe <iframe id="inner-iframe"></iframe>';
   // For kicks, this test uses a display:none iframe.  This shouldn't make a
   // difference in anything.
-  iframe.style.display = 'none';
+  iframe.style.display = "none";
   document.body.appendChild(iframe);
 }
 
 var numMsgReceived = 0;
 function outerIframeLoaded() {
   // If you're changing the amount of is() calls in injectedScript,
   // also change the number in waitForMessages accordingly
   var injectedScript =
@@ -43,40 +43,40 @@ function outerIframeLoaded() {
     is(content.window.content, content.window, 'content');               \
     is(content.window.parent, content.window, 'parent');                 \
     is(content.window.frameElement, null, 'frameElement');               \
     var innerIframe = content.document.getElementById('inner-iframe');   \
     var innerWindow = innerIframe.contentWindow;                         \
     is(innerWindow.top, content.window, 'inner top');                    \
     is(innerWindow.content, content.window, 'inner content');            \
     is(innerWindow.parent, content.window, 'inner parent');              \
-    is(innerWindow.frameElement, innerIframe, 'inner frameElement');"
+    is(innerWindow.frameElement, innerIframe, 'inner frameElement');";
 
   var mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
 
   function onRecvTestPass(msg) {
     numMsgReceived++;
     ok(true, msg.json);
   }
-  mm.addMessageListener('test:test-pass', onRecvTestPass);
+  mm.addMessageListener("test:test-pass", onRecvTestPass);
 
   function onRecvTestFail(msg) {
     numMsgReceived++;
     ok(false, msg.json);
   }
-  mm.addMessageListener('test:test-fail', onRecvTestFail);
+  mm.addMessageListener("test:test-fail", onRecvTestFail);
 
   mm.loadFrameScript(injectedScript, /* allowDelayedLoad = */ false);
 
   // 8 is the number of is() calls in injectedScript
   waitForMessages(8);
 }
 
 function waitForMessages(num) {
   if (numMsgReceived < num) {
     SimpleTest.executeSoon(function() { waitForMessages(num); });
     return;
   }
 
   SimpleTest.finish();
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_Viewmode.js
+++ b/dom/browser-element/mochitest/browserElement_Viewmode.js
@@ -6,66 +6,66 @@
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
   function loadFrameScript(script) {
     SpecialPowers.getBrowserFrameMessageManager(iframe1)
-                 .loadFrameScript('data:,' + script,
+                 .loadFrameScript("data:," + script,
                                   /* allowDelayedLoad = */ false);
   }
 
-  let iframe1 = document.createElement('iframe');
-  iframe1.setAttribute('mozbrowser', 'true');
+  let iframe1 = document.createElement("iframe");
+  iframe1.setAttribute("mozbrowser", "true");
   iframe1.src = "http://test/tests/dom/browser-element/mochitest/file_browserElement_Viewmode.html";
-  iframe1.addEventListener('mozbrowsermetachange', tests);
+  iframe1.addEventListener("mozbrowsermetachange", tests);
   document.body.appendChild(iframe1);
 
   let numMetaChanges = 0;
   function tests(e) {
     let detail = e.detail;
 
     switch (numMetaChanges++) {
       case 0: {
-        is(detail.name, 'viewmode', 'name matches');
-        is(detail.content, 'projection=stereo', 'content matches');
-        is(detail.type, 'added', 'type matches');
+        is(detail.name, "viewmode", "name matches");
+        is(detail.content, "projection=stereo", "content matches");
+        is(detail.type, "added", "type matches");
 
         let script =
           "var meta = content.document.head.querySelector('meta');" +
           "meta.content = 'projection=mono';";
         loadFrameScript(script);
         break;
       }
 
       case 1: {
-        is(detail.name, 'viewmode', 'name matches');
-        is(detail.content, 'projection=mono', 'content matches');
-        is(detail.type, 'changed', 'type matches');
+        is(detail.name, "viewmode", "name matches");
+        is(detail.content, "projection=mono", "content matches");
+        is(detail.type, "changed", "type matches");
 
         let script =
           "var meta = content.document.head.querySelector('meta');" +
           "meta.parentNode.removeChild(meta);";
         loadFrameScript(script);
         break;
       }
 
       case 2: {
-        is(detail.name, 'viewmode', 'name matches');
-        is(detail.content, 'projection=mono', 'content matches');
-        is(detail.type, 'removed', 'type matches');
+        is(detail.name, "viewmode", "name matches");
+        is(detail.content, "projection=mono", "content matches");
+        is(detail.type, "removed", "type matches");
 
         SimpleTest.finish();
         break;
       }
 
       default: {
-        ok(false, 'Too many metachange events.');
+        ok(false, "Too many metachange events.");
         break;
       }
     }
-  };
+  }
 }
 
-window.addEventListener('testready', runTest);
+window.addEventListener("testready", runTest);
 
--- a/dom/browser-element/mochitest/browserElement_XFrameOptions.js
+++ b/dom/browser-element/mochitest/browserElement_XFrameOptions.js
@@ -5,22 +5,22 @@
 // <iframe mozbrowser>.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   // The page we load will fire an alert when it successfully loads.
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     ok(true, "Got alert");
     SimpleTest.finish();
   });
 
   document.body.appendChild(iframe);
-  iframe.src = 'file_browserElement_XFrameOptions.sjs?DENY';
+  iframe.src = "file_browserElement_XFrameOptions.sjs?DENY";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_XFrameOptionsAllowFrom.js
+++ b/dom/browser-element/mochitest/browserElement_XFrameOptionsAllowFrom.js
@@ -24,37 +24,37 @@ function arrayBuffersEqual(a, b) {
   }
 
   return true;
 }
 
 function runTest() {
   var count = 0;
 
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
-  iframe.height = '1000px';
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
+  iframe.height = "1000px";
 
   var step1, stepfinish;
   // The innermost page we load will fire an alert when it successfully loads.
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     switch (e.detail.message) {
-    case 'step 1':
+    case "step 1":
       step1 = SpecialPowers.snapshotWindow(iframe.contentWindow);
       break;
-    case 'step 2':
-      ok(false, 'cross origin page loaded');
+    case "step 2":
+      ok(false, "cross origin page loaded");
       break;
-    case 'finish':
+    case "finish":
       // The page has now attempted to load the X-Frame-Options page; take
       // another screenshot.
       stepfinish = SpecialPowers.snapshotWindow(iframe.contentWindow);
       ok(step1.toDataURL() == stepfinish.toDataURL(), "Screenshots should be identical");
       SimpleTest.finish();
     }
   });
 
   document.body.appendChild(iframe);
 
-  iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html';
+  iframe.src = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_XFrameOptionsDeny.js
+++ b/dom/browser-element/mochitest/browserElement_XFrameOptionsDeny.js
@@ -23,41 +23,41 @@ function arrayBuffersEqual(a, b) {
       return false;
     }
   }
 
   return true;
 }
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   // Our child will create two iframes, so make sure this iframe is big enough
   // to show both of them without scrolling, so taking a screenshot gets both
   // frames.
-  iframe.height = '1000px';
+  iframe.height = "1000px";
 
   var step1, stepfinish;
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     switch (e.detail.message) {
-    case 'step 1':
+    case "step 1":
       step1 = SpecialPowers.snapshotWindow(iframe.contentWindow);
       break;
-    case 'step 2':
+    case "step 2":
       // The page has now attempted to load the X-Frame-Options page; take
       // another screenshot.
       stepfinish = SpecialPowers.snapshotWindow(iframe.contentWindow);
       ok(step1.toDataURL() == stepfinish.toDataURL(), "Screenshots should be identical");
       SimpleTest.finish();
       break;
     }
   });
 
   document.body.appendChild(iframe);
 
   // Load this page from a different origin than ourselves.  This page will, in
   // turn, load a child from mochi.test:8888, our origin, with X-Frame-Options:
   // SAMEORIGIN.  That load should be denied.
-  iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsDeny.html';
+  iframe.src = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsDeny.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/browserElement_XFrameOptionsSameOrigin.js
+++ b/dom/browser-element/mochitest/browserElement_XFrameOptionsSameOrigin.js
@@ -7,22 +7,22 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
 
   // The innermost page we load will fire an alert when it successfully loads.
-  iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
+  iframe.addEventListener("mozbrowsershowmodalprompt", function(e) {
     ok(true, "Got alert");
     SimpleTest.finish();
   });
 
   document.body.appendChild(iframe);
-  iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsSameOrigin.html';
+  iframe.src = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsSameOrigin.html";
 }
 
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
--- a/dom/browser-element/mochitest/file_browserElement_AlertInFrame_Inner.html
+++ b/dom/browser-element/mochitest/file_browserElement_AlertInFrame_Inner.html
@@ -1,12 +1,12 @@
 <html>
 <body>
 I'm file_browserElement_AlertInFrame_Inner.html.
 
 <script>
-addEventListener('load', function() {
+addEventListener("load", function() {
   alert("Hello");
 });
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_BrowserWindowNamespace.html
+++ b/dom/browser-element/mochitest/file_browserElement_BrowserWindowNamespace.html
@@ -1,9 +1,9 @@
 <html>
 <body>
 <script>
-addEventListener('load', function() {
+addEventListener("load", function() {
   window.open("http://example.com/" + location.hash, "foo");
 });
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_CloseFromOpener.html
+++ b/dom/browser-element/mochitest/file_browserElement_CloseFromOpener.html
@@ -1,8 +1,8 @@
 <html>
 <body>
 <script>
-var win = window.open('file_empty.html');
+var win = window.open("file_empty.html");
 win.close();
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html
+++ b/dom/browser-element/mochitest/file_browserElement_CookiesNotThirdParty.html
@@ -1,25 +1,23 @@
 <html>
 <body>
 file_browserElement_CookiesNotThirdParty.html
 
 <script type='text/javascript'>
-if (location.search != '?step=2') {
+if (location.search != "?step=2") {
   // Step 1: Set a cookie.
-  document.cookie = 'file_browserElement_CookiesNotThirdParty';
-  alert('next');
-}
-else {
+  document.cookie = "file_browserElement_CookiesNotThirdParty";
+  alert("next");
+} else {
   // Step 2: Read the cookie.
-  if (document.cookie == 'file_browserElement_CookiesNotThirdParty') {
-    alert('success: got the correct cookie');
-  }
-  else {
+  if (document.cookie == "file_browserElement_CookiesNotThirdParty") {
+    alert("success: got the correct cookie");
+  } else {
     alert('failure: got unexpected cookie: "' + document.cookie + '"');
   }
 
-  alert('finish');
+  alert("finish");
 }
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_ForwardName.html
+++ b/dom/browser-element/mochitest/file_browserElement_ForwardName.html
@@ -1,15 +1,14 @@
 <html>
 <body>
 <script>
 
-if (window.name == 'foo') {
+if (window.name == "foo") {
   alert("success:window.name == 'foo'");
-}
-else {
+} else {
   alert("failure:window.name == '" + window.name + "', expected 'foo'");
 }
 
-window.open('file_browserElement_ForwardName.html#finish', 'foo');
+window.open("file_browserElement_ForwardName.html#finish", "foo");
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_LoadEvents.html
+++ b/dom/browser-element/mochitest/file_browserElement_LoadEvents.html
@@ -2,13 +2,13 @@
 <body style="background-color:green;">
 
 <!-- Tests rely on the fact that there's an element in here called 'url' and
      that there's visible text on the page. -->
 
 Aloha!  My URL is <span id='url'></span>.
 
 <script>
-document.getElementById('url').innerHTML = window.location;
+document.getElementById("url").innerHTML = window.location;
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_Open1.html
+++ b/dom/browser-element/mochitest/file_browserElement_Open1.html
@@ -3,32 +3,31 @@
 <script>
 
 // Because this file is inside <iframe mozbrowser>, the alert() calls below
 // don't trigger actual dialogs.  Instead, the document which contans the
 // iframe receives mozbrowsershowmodalprompt events, which the document uses
 // to determine test success/failure.
 
 function is(x, y, reason) {
-  if (x === y)  {
+  if (x === y) {
     alert("success: " + x + " === " + y + ", " + reason);
-  }
-  else {
+  } else {
     alert("failure: " + x + " !== " + y + ", " + reason);
   }
 }
 
 function ok(bool, reason) {
   alert((bool ? "success: " : "failure: ") + reason);
 }
 
 // Send "dialog=1" as a test for bug 783644.  It shouldn't have any effect.
 var w = window.open("file_browserElement_Open2.html", "name", "dialog=1");
 w.addEventListener("load", function() {
   ok(true, "got load");
-  is(w.opener, window, 'opener property');
-  is(w.location.href, location.href.replace('Open1', 'Open2'), 'correct location');
-  is(w.document.getElementById('testElem').innerHTML, 'test', 'elem innerHTML');
+  is(w.opener, window, "opener property");
+  is(w.location.href, location.href.replace("Open1", "Open2"), "correct location");
+  is(w.document.getElementById("testElem").innerHTML, "test", "elem innerHTML");
   alert("finish");
 });
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_OpenNamed.html
+++ b/dom/browser-element/mochitest/file_browserElement_OpenNamed.html
@@ -1,7 +1,7 @@
 <html>
 <body>
 <script>
-window.open('file_browserElement_OpenNamed2.html', 'OpenNamed');
+window.open("file_browserElement_OpenNamed2.html", "OpenNamed");
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_OpenNamed2.html
+++ b/dom/browser-element/mochitest/file_browserElement_OpenNamed2.html
@@ -1,7 +1,7 @@
 <html>
 <body>
 <script>
-alert('success: loaded');
+alert("success: loaded");
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html
+++ b/dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html
@@ -1,18 +1,17 @@
 <html>
 <body>
 
 <div id='name'></div>
 
 <script>
 if (location.search == "?1") {
   open("http://example.com/tests/dom/browser-element/mochitest/file_browserElement_OpenWindowDifferentOrigin.html?2");
-}
-else if (location.search == "?2") {
+} else if (location.search == "?2") {
   alert("finish");
 }
 
-document.getElementById('name').innerHTML = location.search;
+document.getElementById("name").innerHTML = location.search;
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_OpenWindowRejected.html
+++ b/dom/browser-element/mochitest/file_browserElement_OpenWindowRejected.html
@@ -1,16 +1,15 @@
 <html>
 <body>
 
 <script>
-var w = window.open('does_not_exist.html');
+var w = window.open("does_not_exist.html");
 if (!w) {
   alert("success:w is null");
-}
-else {
+} else {
   alert("failure:w is not null -- " + w);
 }
 alert("finish");
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_SecurityChange.html
+++ b/dom/browser-element/mochitest/file_browserElement_SecurityChange.html
@@ -1,16 +1,16 @@
 <html>
 <head>
 
 <script>
-if (location.search === '?broken') {
+if (location.search === "?broken") {
   // Load something non-https.
-  var s = document.createElement('script');
-  s.src = 'http://example.com/dom/browser-element/mochitest/file_empty_script.js';
+  var s = document.createElement("script");
+  s.src = "http://example.com/dom/browser-element/mochitest/file_empty_script.js";
   document.head.appendChild(s);
 }
 </script>
 </head>
 
 <body>
 file_browserElement_SecurityChange.html.
 </body>
--- a/dom/browser-element/mochitest/file_browserElement_SendEvent.html
+++ b/dom/browser-element/mochitest/file_browserElement_SendEvent.html
@@ -1,11 +1,11 @@
 <html><body>
 <button>sendMouseEvent</button>
 </body><script>
 function changeHash(e) {
   document.location.hash = e.type;
-};
-window.addEventListener('mousedown', changeHash);
-window.addEventListener('mousemove', changeHash);
-window.addEventListener('mouseup', changeHash);
-window.addEventListener('click', changeHash, true);
+}
+window.addEventListener("mousedown", changeHash);
+window.addEventListener("mousemove", changeHash);
+window.addEventListener("mouseup", changeHash);
+window.addEventListener("click", changeHash, true);
 </script></html>
--- a/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Inner.html
+++ b/dom/browser-element/mochitest/file_browserElement_SetVisibleFrames_Inner.html
@@ -1,18 +1,18 @@
 <html>
 <body>
 <script>
 
 var name = location.search.substring(1);
-addEventListener('load', function() {
+addEventListener("load", function() {
   setTimeout(function() {
-    alert(name + ':ready');
+    alert(name + ":ready");
   }, 0);
 });
 
-addEventListener('visibilitychange', function() {
-  alert(name + ':' + (document.hidden ? 'hidden' : 'visible'));
+addEventListener("visibilitychange", function() {
+  alert(name + ":" + (document.hidden ? "hidden" : "visible"));
 });
 
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_TargetBlank.html
+++ b/dom/browser-element/mochitest/file_browserElement_TargetBlank.html
@@ -3,16 +3,16 @@
 <a id='link' target='_blank' href="http://example.com" rel="opener">Click me</a>
 
 <script>
 function clickLink() {
   // See testcase in bug 666604.
   var e = document.createEvent("MouseEvent");
   e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0,
                    false, false, false, false, 0, null);
-  document.getElementById('link').dispatchEvent(e);
+  document.getElementById("link").dispatchEvent(e);
 }
 
-addEventListener('load', function() { setTimeout(clickLink, 0) });
+addEventListener("load", function() { setTimeout(clickLink, 0); });
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_TargetTop.html
+++ b/dom/browser-element/mochitest/file_browserElement_TargetTop.html
@@ -1,12 +1,12 @@
 <html>
 <body>
 <div id='url'></div>
 
 <script>
-if (location.search == '') {
-  window.open('file_browserElement_TargetTop.html?2', '_top');
+if (location.search == "") {
+  window.open("file_browserElement_TargetTop.html?2", "_top");
 }
-document.getElementById('url').innerHTML = document.location.href;
+document.getElementById("url").innerHTML = document.location.href;
 </script>
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
+++ b/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.html
@@ -7,35 +7,35 @@
      "X-Frame-Options: Allow-From http://example.com/". -->
 
 <script>
 
 // Make sure these iframes aren't too tall; they both need to fit inside the
 // iframe this page is contained in, without scrolling, in order for the test's
 // screenshots to work properly.
 
-var frame_src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs';
+var frame_src = "http://example.com/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptionsAllowFrom.sjs";
 
-var iframe1 = document.createElement('iframe');
-iframe1.height = '300px';
-var iframe2 = document.createElement('iframe');
-iframe2.height = '300px';
+var iframe1 = document.createElement("iframe");
+iframe1.height = "300px";
+var iframe2 = document.createElement("iframe");
+iframe2.height = "300px";
 document.body.appendChild(iframe1);
 
-iframe1.addEventListener('load', function() {
+iframe1.addEventListener("load", function() {
   // This causes our embedder to take a screenshot (and blocks until the
   // screenshot is completed).
   var iframe2Loaded = false;
-  iframe2.addEventListener('load', function() {
+  iframe2.addEventListener("load", function() {
     iframe2Loaded = true;
-    alert('finish');
+    alert("finish");
   }, {once: true});
 
   document.body.appendChild(iframe2);
   iframe2.src = frame_src;
 }, {once: true});
 
 
-iframe1.src = frame_src + '?iframe1';
+iframe1.src = frame_src + "?iframe1";
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_browserElement_XFrameOptionsDeny.html
+++ b/dom/browser-element/mochitest/file_browserElement_XFrameOptionsDeny.html
@@ -5,51 +5,51 @@
      cross-origin page which sends "X-Frame-Options: SAMEORIGIN". -->
 
 <script>
 
 // Make sure these iframes aren't too tall; they both need to fit inside the
 // iframe this page is contained in, without scrolling, in order for the test's
 // screenshots to work properly.
 
-var iframe1 = document.createElement('iframe');
-iframe1.height = '300px';
-var iframe2 = document.createElement('iframe');
-iframe2.height = '300px';
+var iframe1 = document.createElement("iframe");
+iframe1.height = "300px";
+var iframe2 = document.createElement("iframe");
+iframe2.height = "300px";
 document.body.appendChild(iframe1);
 document.body.appendChild(iframe2);
 
 // This causes our embedder to take a screenshot (and blocks until the
 // screenshot is completed).
-alert('step 1');
+alert("step 1");
 
 // Wait for both iframes to load.
 
 var iframe1Loaded = false;
-iframe1.addEventListener('load', function() {
+iframe1.addEventListener("load", function() {
   iframe1Loaded = true;
   waitForBothLoads();
 }, {once: true});
 
 var iframe2Loaded = false;
-iframe2.addEventListener('load', function() {
+iframe2.addEventListener("load", function() {
   iframe2Loaded = true;
   waitForBothLoads();
 }, {once: true});
 
 function waitForBothLoads() {
   if (iframe1Loaded && iframe2Loaded) {
     setTimeout(function() {
       // This causes our embedder to take another screenshot.
-      alert('step 2');
+      alert("step 2");
     }, 0);
   }
 }
 
-iframe1.src = 'file_browserElement_XFrameOptions.sjs?DENY';
+iframe1.src = "file_browserElement_XFrameOptions.sjs?DENY";
 
 // Load iframe2 with the origin of our parent.  Since we have a different
 // origin and are inside <iframe mozbrowser>, this should not load.
-iframe2.src = 'http://mochi.test:8888/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptions.sjs?SAMEORIGIN';
+iframe2.src = "http://mochi.test:8888/tests/dom/browser-element/mochitest/file_browserElement_XFrameOptions.sjs?SAMEORIGIN";
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_empty.html
+++ b/dom/browser-element/mochitest/file_empty.html
@@ -2,13 +2,13 @@
 <body>
 
 <!-- Tests rely on the fact that there's an element in here called 'url' and
      that there's visible text on the page. -->
 
 Aloha!  My URL is <span id='url'></span>.
 
 <script>
-document.getElementById('url').innerHTML = window.location;
+document.getElementById("url").innerHTML = window.location;
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/file_focus.html
+++ b/dom/browser-element/mochitest/file_focus.html
@@ -1,23 +1,23 @@
 <html>
 <body>
 
 Aloha!  My URL is <span id='url'></span>.
 <script>
-document.getElementById('url').innerHTML = window.location;
+document.getElementById("url").innerHTML = window.location;
 </script>
 
 <script>
   // The input element is getting synthesized key events and will prevent
   // default on the first ESC keydown event.
 
   var alreadyBlocked = false;
 
-  addEventListener('keydown', function(e) {
+  addEventListener("keydown", function(e) {
     if (e.keyCode == KeyboardEvent.DOM_VK_ESCAPE &&
         alreadyBlocked == false) {
       alreadyBlocked = true;
       e.preventDefault();
     }
   });
 </script>
 </body>
--- a/dom/browser-element/mochitest/file_post_request.html
+++ b/dom/browser-element/mochitest/file_post_request.html
@@ -1,13 +1,13 @@
 <html>
 <head>
   <script>
-  addEventListener('load', function() {
-    document.getElementsByTagName('form')[0].submit();
+  addEventListener("load", function() {
+    document.getElementsByTagName("form")[0].submit();
   });
   </script>
 </head>
 <body>
   <form action="file_empty.html" method="POST">
     <input type="text" name="postvalue" value="I am a test string!!" />
     <input type="submit" />
   </form>
--- a/dom/browser-element/mochitest/test_browserElement_NoAttr.html
+++ b/dom/browser-element/mochitest/test_browserElement_NoAttr.html
@@ -18,29 +18,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 
 <script type="application/javascript">
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 function runTest() {
-  var iframe = document.getElementById('iframe');
-  iframe.addEventListener('mozbrowserloadstart', function() {
-    ok(false, 'Should not send mozbrowserloadstart event.');
+  var iframe = document.getElementById("iframe");
+  iframe.addEventListener("mozbrowserloadstart", function() {
+    ok(false, "Should not send mozbrowserloadstart event.");
   });
 
-  iframe.addEventListener('load', function() {
-    ok(true, 'Got iframe load event.');
+  iframe.addEventListener("load", function() {
+    ok(true, "Got iframe load event.");
     SimpleTest.finish();
   });
 
   iframe.src = browserElementTestHelpers.emptyPage1;
 }
 
-addEventListener('load', function() { SimpleTest.executeSoon(runTest); });
+addEventListener("load", function() { SimpleTest.executeSoon(runTest); });
 
 </script>
 
 <iframe id='iframe'></iframe>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/test_browserElement_NoPermission.html
+++ b/dom/browser-element/mochitest/test_browserElement_NoPermission.html
@@ -18,32 +18,32 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 
 <script type="application/javascript">
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 function runTest() {
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
-  iframe.addEventListener('mozbrowserloadstart', function() {
-    ok(false, 'Should not send mozbrowserloadstart event.');
+  iframe.addEventListener("mozbrowserloadstart", function() {
+    ok(false, "Should not send mozbrowserloadstart event.");
   });
 
-  iframe.addEventListener('load', function() {
-    ok(true, 'Got iframe load event.');
+  iframe.addEventListener("load", function() {
+    ok(true, "Got iframe load event.");
     SimpleTest.finish();
   });
 
   iframe.src = browserElementTestHelpers.emptyPage1;
 }
 
 browserElementTestHelpers.setEnabledPref(true);
 SpecialPowers.removePermission("browser", document);
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
 
 </script>
 
 </body>
 </html>
--- a/dom/browser-element/mochitest/test_browserElement_NoPref.html
+++ b/dom/browser-element/mochitest/test_browserElement_NoPref.html
@@ -18,32 +18,31 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 
 <script type="application/javascript">
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 function runTest() {
-
-  var iframe = document.createElement('iframe');
-  iframe.setAttribute('mozbrowser', 'true');
+  var iframe = document.createElement("iframe");
+  iframe.setAttribute("mozbrowser", "true");
   document.body.appendChild(iframe);
 
-  iframe.addEventListener('mozbrowserloadstart', function() {
-    ok(false, 'Should not send mozbrowserloadstart event.');
+  iframe.addEventListener("mozbrowserloadstart", function() {
+    ok(false, "Should not send mozbrowserloadstart event.");
   });
 
-  iframe.addEventListener('load', function() {
-    ok(true, 'Got iframe load event.');
+  iframe.addEventListener("load", function() {
+    ok(true, "Got iframe load event.");
     SimpleTest.finish();
   });
 
   iframe.src = browserElementTestHelpers.emptyPage1;
 }
 
 browserElementTestHelpers.setEnabledPref(false);
-addEventListener('testready', runTest);
+addEventListener("testready", runTest);
 
 </script>
 
 </body>
 </html>