Merge mozilla-central to mozilla-inbound
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 18 Dec 2015 15:25:47 +0100
changeset 277012 34efffa32475625460d15ba93fa3c67ee3c8c486
parent 277011 5998e5f18e579167ccf86f068bd265e819f62f7f (current diff)
parent 276933 c5cb194cc9cb56d742fb3a7a826f0080b0404edc (diff)
child 277013 713801f5c62705f39cb1ff55cb7a67d9df8f3b40
push id16724
push usercbook@mozilla.com
push dateMon, 21 Dec 2015 11:00:52 +0000
treeherderfx-team@3f3f0361567c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone46.0a1
Merge mozilla-central to mozilla-inbound
toolkit/themes/windows/global/tree/twisty-clsd-XP.png
toolkit/themes/windows/global/tree/twisty-clsd-hover-rtl.png
toolkit/themes/windows/global/tree/twisty-clsd-hover.png
toolkit/themes/windows/global/tree/twisty-clsd-rtl.png
toolkit/themes/windows/global/tree/twisty-clsd.png
toolkit/themes/windows/global/tree/twisty-open-XP.png
toolkit/themes/windows/global/tree/twisty-open-hover-rtl.png
toolkit/themes/windows/global/tree/twisty-open-hover.png
toolkit/themes/windows/global/tree/twisty-open-rtl.png
toolkit/themes/windows/global/tree/twisty-open.png
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk-specific things and forks -->
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk-specific things and forks -->
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "2f093462969d2c5f65dced3908a7abff6b1913e8", 
+        "git_revision": "d069027f9af6f835ef869f1f01b52339e5a3f423", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "f0575fd3300ea98629d27aaa4ea0a11139867033", 
+    "revision": "87642662c7721f18575be17ae42c81782e5f040a", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -16,17 +16,17 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5192,35 +5192,40 @@ var TabletModeUpdater = {
     } else {
       document.documentElement.removeAttribute("tabletmode");
     }
     TabsInTitlebar.updateAppearance(true);
   },
 };
 
 var gTabletModePageCounter = {
+  enabled: false,
   inc() {
-    if (!AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
+    this.enabled = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
+    if (!this.enabled) {
       this.inc = () => {};
       return;
     }
     this.inc = this._realInc;
     this.inc();
   },
 
   _desktopCount: 0,
   _tabletCount: 0,
   _realInc() {
     let inTabletMode = document.documentElement.hasAttribute("tabletmode");
     this[inTabletMode ? "_tabletCount" : "_desktopCount"]++;
   },
 
   finish() {
-    Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD").add("tablet", this._tabletCount);
-    Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD").add("desktop", this._desktopCount);
+    if (this.enabled) {
+      let histogram = Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD");
+      histogram.add("tablet", this._tabletCount);
+      histogram.add("desktop", this._desktopCount);
+    }
   },
 };
 
 function displaySecurityInfo()
 {
   BrowserPageInfo(null, "securityTab");
 }
 
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4686,16 +4686,19 @@
           if (this._lastTab)
             this._lastTab.removeAttribute("last-visible-tab");
           this._lastTab = visibleTabs[lastVisible];
           this._lastTab.setAttribute("last-visible-tab", "true");
 
           let hoveredTab = this._hoveredTab;
           if (hoveredTab) {
             hoveredTab._mouseleave();
+          }
+          hoveredTab = this.querySelector("tab:hover");
+          if (hoveredTab) {
             hoveredTab._mouseenter();
           }
         ]]></body>
       </method>
 
       <field name="_blockDblClick">false</field>
 
       <field name="_tabDropIndicator">
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -25,16 +25,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
                                   "resource://gre/modules/TelemetryEnvironment.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog",
                                   "resource://gre/modules/TelemetryLog.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "TelemetryUtils",
+                                  "resource://gre/modules/TelemetryUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
                                   "resource://gre/modules/Metrics.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
                                    "@mozilla.org/xre/app-info;1",
                                    "nsICrashReporter");
@@ -155,20 +157,16 @@ function loadJSONAsync(file, options) {
     } catch (ex) {
       gLogger.error("Experiments: Could not parse JSON: " + file + " " + ex);
       throw ex;
     }
     return data;
   });
 }
 
-function telemetryEnabled() {
-  return gPrefsTelemetry.get(PREF_TELEMETRY_ENABLED, false);
-}
-
 // Returns a promise that is resolved with the AddonInstall for that URL.
 function addonInstallForURL(url, hash) {
   let deferred = Promise.defer();
   AddonManager.getInstallForURL(url, install => deferred.resolve(install),
                                 "application/x-xpinstall", hash);
   return deferred.promise;
 }
 
@@ -384,17 +382,17 @@ Experiments.Experiments.prototype = {
   get isReady() {
     return !this._shutdown;
   },
 
   init: function () {
     this._shutdown = false;
     configureLogging();
 
-    gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false);
+    gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false) && TelemetryUtils.isTelemetryEnabled;
     this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled);
 
     gPrefs.observe(PREF_LOGGING, configureLogging);
     gPrefs.observe(PREF_MANIFEST_URI, this.updateManifest, this);
     gPrefs.observe(PREF_ENABLED, this._toggleExperimentsEnabled, this);
 
     gPrefsTelemetry.observe(PREF_TELEMETRY_ENABLED, this._telemetryStatusChanged, this);
 
@@ -575,17 +573,17 @@ Experiments.Experiments.prototype = {
   set enabled(enabled) {
     this._log.trace("set enabled(" + enabled + ")");
     gPrefs.set(PREF_ENABLED, enabled);
   },
 
   _toggleExperimentsEnabled: Task.async(function* (enabled) {
     this._log.trace("_toggleExperimentsEnabled(" + enabled + ")");
     let wasEnabled = gExperimentsEnabled;
-    gExperimentsEnabled = enabled && telemetryEnabled();
+    gExperimentsEnabled = enabled && TelemetryUtils.isTelemetryEnabled;
 
     if (wasEnabled == gExperimentsEnabled) {
       return;
     }
 
     if (gExperimentsEnabled) {
       yield this.updateManifest();
     } else {
--- a/browser/experiments/test/xpcshell/head.js
+++ b/browser/experiments/test/xpcshell/head.js
@@ -228,8 +228,12 @@ function createAppInfo(optionsIn) {
 function replaceExperiments(experiment, list) {
   Object.defineProperty(experiment, "getExperiments", {
     writable: true,
     value: () => {
       return Promise.resolve(list);
     },
   });
 }
+
+// Experiments require Telemetry to be enabled, and that's not true for debug
+// builds. Let's just enable it here instead of going through each test.
+Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
new file mode 100644
--- /dev/null
+++ b/browser/experiments/test/xpcshell/test_telemetry_disabled.js
@@ -0,0 +1,21 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+Cu.import("resource:///modules/experiments/Experiments.jsm");
+
+add_test(function test_experiments_activation() {
+  do_get_profile();
+  loadAddonManager();
+
+  Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true);
+  Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, false);
+
+  let experiments = Experiments.instance();
+  Assert.ok(!experiments.enabled, "Experiments must be disabled if Telemetry is disabled.");
+
+  // TODO: Test that Experiments are turned back on when bug 1232648 lands.
+
+  run_next_test();
+});
--- a/browser/experiments/test/xpcshell/xpcshell.ini
+++ b/browser/experiments/test/xpcshell/xpcshell.ini
@@ -19,12 +19,13 @@ generated-files =
 [test_activate.js]
 [test_api.js]
 [test_cache.js]
 [test_cacherace.js]
 [test_conditions.js]
 [test_disableExperiments.js]
 [test_fetch.js]
 [test_telemetry.js]
+[test_telemetry_disabled.js]
 [test_healthreport.js]
 [test_previous_provider.js]
 [test_upgrade.js]
 [test_nethang_bug1012924.js]
--- a/browser/themes/windows/pageInfo.css
+++ b/browser/themes/windows/pageInfo.css
@@ -118,27 +118,27 @@ textbox[disabled] {
 /* General Tab */
 groupbox.collapsable caption .caption-icon {
   width: 9px;
   height: 9px;
   background-repeat: no-repeat;
   background-position: center;
   -moz-margin-start: 2px;
   -moz-margin-end: 2px;
-  background-image: url("chrome://global/skin/tree/twisty-open.png");
+  background-image: url("chrome://global/skin/tree/twisty.svg#open");
 }
 
 groupbox.collapsable[closed="true"] {
   border: none;
   margin-bottom: 9px;
   -moz-appearance: none;
 }
 
 groupbox.collapsable[closed="true"] caption .caption-icon {
-  background-image: url("chrome://global/skin/tree/twisty-clsd.png");
+  background-image: url("chrome://global/skin/tree/twisty.svg#clsd");
 }
 
 groupbox tree {
   margin: 0 3px;
   border: none;
 }
 
 #securityBox description {
--- a/devtools/client/framework/test/browser_toolbox_theme_registration.js
+++ b/devtools/client/framework/test/browser_toolbox_theme_registration.js
@@ -1,113 +1,89 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+// Test for dynamically registering and unregistering themes
 const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/framework/test/";
 
 var toolbox;
 
-function test()
-{
-  gBrowser.selectedTab = gBrowser.addTab();
-  let target = TargetFactory.forTab(gBrowser.selectedTab);
-
-  gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) {
-    gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true);
-    gDevTools.showToolbox(target).then(testRegister);
-  }, true);
-
-  content.location = "data:text/html,test for dynamically registering and unregistering themes";
-}
+add_task(function* themeRegistration() {
+  let tab = yield addTab("data:text/html,test");
+  let target = TargetFactory.forTab(tab);
+  toolbox = yield gDevTools.showToolbox(target);
 
-function testRegister(aToolbox)
-{
-  toolbox = aToolbox
-  gDevTools.once("theme-registered", themeRegistered);
+  let themeId = yield new Promise(resolve => {
+    gDevTools.once("theme-registered", (e, themeId) => {
+      resolve(themeId);
+    });
 
-  gDevTools.registerTheme({
-    id: "test-theme",
-    label: "Test theme",
-    stylesheets: [CHROME_URL + "doc_theme.css"],
-    classList: ["theme-test"],
+    gDevTools.registerTheme({
+      id: "test-theme",
+      label: "Test theme",
+      stylesheets: [CHROME_URL + "doc_theme.css"],
+      classList: ["theme-test"],
+    });
   });
-}
 
-function themeRegistered(event, themeId)
-{
   is(themeId, "test-theme", "theme-registered event handler sent theme id");
 
   ok(gDevTools.getThemeDefinitionMap().has(themeId), "theme added to map");
+});
 
-  // Test that new theme appears in the Options panel
-  let target = TargetFactory.forTab(gBrowser.selectedTab);
-  gDevTools.showToolbox(target, "options").then(() => {
-    let panel = toolbox.getCurrentPanel();
-    let doc = panel.panelWin.frameElement.contentDocument;
-    let themeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]");
+add_task(function* themeInOptionsPanel() {
 
-    ok(themeOption, "new theme exists in the Options panel");
+  yield toolbox.selectTool("options");
 
-    // Apply the new theme.
-    applyTheme();
-  });
-}
-
-function applyTheme()
-{
+  let panel = toolbox.getCurrentPanel();
   let panelWin = toolbox.getCurrentPanel().panelWin;
   let doc = panelWin.frameElement.contentDocument;
+  let themeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]");
+
+  ok(themeOption, "new theme exists in the Options panel");
+
   let testThemeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]");
   let lightThemeOption = doc.querySelector("#devtools-theme-box > radio[value=light]");
 
   let color = panelWin.getComputedStyle(testThemeOption).color;
   isnot(color, "rgb(255, 0, 0)", "style unapplied");
 
   // Select test theme.
   testThemeOption.click();
 
+  info("Waiting for theme to finish loading");
+  yield once(panelWin, "theme-switch-complete");
+
   color = panelWin.getComputedStyle(testThemeOption).color;
   is(color, "rgb(255, 0, 0)", "style applied");
 
   // Select light theme
   lightThemeOption.click();
 
+  info("Waiting for theme to finish loading");
+  yield once(panelWin, "theme-switch-complete");
+
   color = panelWin.getComputedStyle(testThemeOption).color;
   isnot(color, "rgb(255, 0, 0)", "style unapplied");
 
   // Select test theme again.
   testThemeOption.click();
+});
 
-  // Then unregister the test theme.
-  testUnregister();
-}
-
-function testUnregister()
-{
+add_task(function* themeUnregistration() {
   gDevTools.unregisterTheme("test-theme");
 
   ok(!gDevTools.getThemeDefinitionMap().has("test-theme"), "theme removed from map");
 
   let panelWin = toolbox.getCurrentPanel().panelWin;
   let doc = panelWin.frameElement.contentDocument;
   let themeBox = doc.querySelector("#devtools-theme-box");
 
   // The default light theme must be selected now.
   is(themeBox.selectedItem, themeBox.querySelector("[value=light]"),
     "theme light must be selected");
-
-  // Make sure the tab-attaching process is done before we destroy the toolbox.
-  let target = TargetFactory.forTab(gBrowser.selectedTab);
-  let actor = target.activeTab.actor;
-  target.client.attachTab(actor, (response) => {
-    cleanup();
-  });
-}
+});
 
-function cleanup()
-{
-  toolbox.destroy().then(function() {
-    toolbox = null;
-    gBrowser.removeCurrentTab();
-    finish();
-  });
-}
+add_task(function* cleanup() {
+  yield toolbox.destroy();
+  toolbox = null;
+});
--- a/devtools/client/jar.mn
+++ b/devtools/client/jar.mn
@@ -34,34 +34,34 @@ devtools.jar:
     content/layoutview/view.js (layoutview/view.js)
     content/layoutview/view.xhtml (layoutview/view.xhtml)
     content/fontinspector/font-inspector.js (fontinspector/font-inspector.js)
     content/fontinspector/font-inspector.xhtml (fontinspector/font-inspector.xhtml)
     content/fontinspector/font-inspector.css (fontinspector/font-inspector.css)
     content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)
     content/animationinspector/animation-panel.js (animationinspector/animation-panel.js)
     content/animationinspector/animation-inspector.xhtml (animationinspector/animation-inspector.xhtml)
-    content/sourceeditor/codemirror/comment/comment.js (sourceeditor/codemirror/addon/comment/comment.js)
-    content/sourceeditor/codemirror/edit/trailingspace.js (sourceeditor/codemirror/addon/edit/trailingspace.js)
-    content/sourceeditor/codemirror/edit/matchbrackets.js (sourceeditor/codemirror/addon/edit/matchbrackets.js)
-    content/sourceeditor/codemirror/edit/closebrackets.js (sourceeditor/codemirror/addon/edit/closebrackets.js)
-    content/sourceeditor/codemirror/dialog/dialog.js (sourceeditor/codemirror/addon/dialog/dialog.js)
-    content/sourceeditor/codemirror/dialog/dialog.css (sourceeditor/codemirror/addon/dialog/dialog.css)
-    content/sourceeditor/codemirror/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js)
-    content/sourceeditor/codemirror/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js)
-    content/sourceeditor/codemirror/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js)
-    content/sourceeditor/codemirror/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js)
-    content/sourceeditor/codemirror/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js)
-    content/sourceeditor/codemirror/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js)
-    content/sourceeditor/codemirror/search/search.js (sourceeditor/codemirror/addon/search/search.js)
-    content/sourceeditor/codemirror/search/searchcursor.js (sourceeditor/codemirror/addon/search/searchcursor.js)
-    content/sourceeditor/codemirror/selection/active-line.js (sourceeditor/codemirror/addon/selection/active-line.js)
-    content/sourceeditor/codemirror/tern/tern.js (sourceeditor/codemirror/addon/tern/tern.js)
-    content/sourceeditor/codemirror/codemirror.js (sourceeditor/codemirror/lib/codemirror.js)
-    content/sourceeditor/codemirror/codemirror.css (sourceeditor/codemirror/lib/codemirror.css)
+    content/sourceeditor/codemirror/addon/comment/comment.js (sourceeditor/codemirror/addon/comment/comment.js)
+    content/sourceeditor/codemirror/addon/edit/trailingspace.js (sourceeditor/codemirror/addon/edit/trailingspace.js)
+    content/sourceeditor/codemirror/addon/edit/matchbrackets.js (sourceeditor/codemirror/addon/edit/matchbrackets.js)
+    content/sourceeditor/codemirror/addon/edit/closebrackets.js (sourceeditor/codemirror/addon/edit/closebrackets.js)
+    content/sourceeditor/codemirror/addon/dialog/dialog.js (sourceeditor/codemirror/addon/dialog/dialog.js)
+    content/sourceeditor/codemirror/addon/dialog/dialog.css (sourceeditor/codemirror/addon/dialog/dialog.css)
+    content/sourceeditor/codemirror/addon/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js)
+    content/sourceeditor/codemirror/addon/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js)
+    content/sourceeditor/codemirror/addon/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js)
+    content/sourceeditor/codemirror/addon/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js)
+    content/sourceeditor/codemirror/addon/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js)
+    content/sourceeditor/codemirror/addon/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js)
+    content/sourceeditor/codemirror/addon/search/search.js (sourceeditor/codemirror/addon/search/search.js)
+    content/sourceeditor/codemirror/addon/search/searchcursor.js (sourceeditor/codemirror/addon/search/searchcursor.js)
+    content/sourceeditor/codemirror/addon/selection/active-line.js (sourceeditor/codemirror/addon/selection/active-line.js)
+    content/sourceeditor/codemirror/addon/tern/tern.js (sourceeditor/codemirror/addon/tern/tern.js)
+    content/sourceeditor/codemirror/lib/codemirror.js (sourceeditor/codemirror/lib/codemirror.js)
+    content/sourceeditor/codemirror/lib/codemirror.css (sourceeditor/codemirror/lib/codemirror.css)
     content/sourceeditor/codemirror/mode/javascript.js (sourceeditor/codemirror/mode/javascript.js)
     content/sourceeditor/codemirror/mode/xml.js (sourceeditor/codemirror/mode/xml.js)
     content/sourceeditor/codemirror/mode/css.js (sourceeditor/codemirror/mode/css.js)
     content/sourceeditor/codemirror/mode/htmlmixed.js (sourceeditor/codemirror/mode/htmlmixed.js)
     content/sourceeditor/codemirror/mode/clike.js (sourceeditor/codemirror/mode/clike.js)
     content/sourceeditor/codemirror/keymap/emacs.js (sourceeditor/codemirror/keymap/emacs.js)
     content/sourceeditor/codemirror/keymap/sublime.js (sourceeditor/codemirror/keymap/sublime.js)
     content/sourceeditor/codemirror/keymap/vim.js (sourceeditor/codemirror/keymap/vim.js)
--- a/devtools/client/shared/test/browser_theme_switching.js
+++ b/devtools/client/shared/test/browser_theme_switching.js
@@ -2,25 +2,43 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var toolbox;
 
 add_task(function*() {
   let target = TargetFactory.forTab(gBrowser.selectedTab);
   let toolbox = yield gDevTools.showToolbox(target);
-  let root = toolbox.frame.contentDocument.documentElement;
+  let doc = toolbox.frame.contentDocument;
+  let root = doc.documentElement;
 
   let platform = root.getAttribute("platform");
   let expectedPlatform = getPlatform();
   is(platform, expectedPlatform, ":root[platform] is correct");
 
   let theme = Services.prefs.getCharPref("devtools.theme");
   let className = "theme-" + theme;
-  ok(root.classList.contains(className), ":root has " + className + " class (current theme)");
+  ok(root.classList.contains(className),
+     ":root has " + className + " class (current theme)");
+
+  // Convert the xpath result into an array of strings
+  // like `href="{URL}" type="text/css"`
+  let sheetsIterator = doc.evaluate("processing-instruction('xml-stylesheet')",
+                       doc, null, XPathResult.ANY_TYPE, null);
+  let sheetsInDOM = [];
+  let sheet;
+  while (sheet = sheetsIterator.iterateNext()) {
+    sheetsInDOM.push(sheet.data);
+  }
+
+  let sheetsFromTheme = gDevTools.getThemeDefinition(theme).stylesheets;
+  info ("Checking for existence of " + sheetsInDOM.length + " sheets");
+  for (let sheet of sheetsFromTheme) {
+    ok(sheetsInDOM.some(s=>s.includes(sheet)), "There is a stylesheet for " + sheet);
+  }
 
   yield toolbox.destroy();
 });
 
 function getPlatform() {
   let {OS} = Services.appinfo;
   if (OS == "WINNT") {
     return "win";
--- a/devtools/client/shared/theme-switching.js
+++ b/devtools/client/shared/theme-switching.js
@@ -1,78 +1,116 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 (function() {
-  const DEVTOOLS_SKIN_URL = "chrome://devtools/skin/";
+  const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-light.css";
   let documentElement = document.documentElement;
+  let devtoolsStyleSheets = new WeakMap();
 
   function forceStyle() {
     let computedStyle = window.getComputedStyle(documentElement);
     if (!computedStyle) {
       // Null when documentElement is not ready. This method is anyways not
       // required then as scrollbars would be in their state without flushing.
       return;
     }
     let display = computedStyle.display; // Save display value
     documentElement.style.display = "none";
     window.getComputedStyle(documentElement).display; // Flush
     documentElement.style.display = display; // Restore
   }
 
+  /*
+   * Append a new processing instruction and return an object with
+   *  - styleSheet: DOMNode
+   *  - loadPromise: Promise that resolves once the sheets loads or errors
+   */
+  function appendStyleSheet(url) {
+    let styleSheetAttr = `href="${url}" type="text/css"`;
+    let styleSheet = document.createProcessingInstruction(
+      "xml-stylesheet", styleSheetAttr);
+    let loadPromise = new Promise((resolve, reject) => {
+      function onload() {
+        styleSheet.removeEventListener("load", onload);
+        styleSheet.removeEventListener("error", onerror);
+        resolve();
+      }
+      function onerror() {
+        styleSheet.removeEventListener("load", onload);
+        styleSheet.removeEventListener("error", onerror);
+        reject("Failed to load theme file " + url);
+      }
+
+      styleSheet.addEventListener("load", onload);
+      styleSheet.addEventListener("error", onerror);
+    });
+    document.insertBefore(styleSheet, documentElement);
+    return {styleSheet, loadPromise};
+  }
+
+  /*
+   * Notify the window that a theme switch finished so tests can check the DOM
+   */
+  function notifyWindow() {
+    window.dispatchEvent(new CustomEvent("theme-switch-complete", {}));
+  }
+
+  /*
+   * Apply all the sheets from `newTheme` and remove all of the sheets
+   * from `oldTheme`
+   */
   function switchTheme(newTheme, oldTheme) {
     if (newTheme === oldTheme) {
       return;
     }
 
     let oldThemeDef = gDevTools.getThemeDefinition(oldTheme);
 
     // Unload all theme stylesheets related to the old theme.
     if (oldThemeDef) {
-      for (let url of oldThemeDef.stylesheets) {
-        StylesheetUtils.removeSheet(window, url, "author");
+      for (let sheet of devtoolsStyleSheets.get(oldThemeDef) || []) {
+        sheet.remove();
       }
     }
 
     // Load all stylesheets associated with the new theme.
     let newThemeDef = gDevTools.getThemeDefinition(newTheme);
 
     // The theme might not be available anymore (e.g. uninstalled)
     // Use the default one.
     if (!newThemeDef) {
       newThemeDef = gDevTools.getThemeDefinition("light");
     }
 
+    // Store the sheets in a WeakMap for access later when the theme gets
+    // unapplied.  It's hard to query for processing instructions so this
+    // is an easy way to access them later without storing a property on
+    // the window
+    devtoolsStyleSheets.set(newThemeDef, []);
+
+    let loadEvents = [];
     for (let url of newThemeDef.stylesheets) {
-      StylesheetUtils.loadSheet(window, url, "author");
+      let {styleSheet,loadPromise} = appendStyleSheet(url);
+      devtoolsStyleSheets.get(newThemeDef).push(styleSheet);
+      loadEvents.push(loadPromise);
     }
 
     // Floating scroll-bars like in OSX
     let hiddenDOMWindow = Cc["@mozilla.org/appshell/appShellService;1"]
                  .getService(Ci.nsIAppShellService)
                  .hiddenDOMWindow;
 
     // TODO: extensions might want to customize scrollbar styles too.
     if (!hiddenDOMWindow.matchMedia("(-moz-overlay-scrollbars)").matches) {
-      let scrollbarsUrl = Services.io.newURI(
-        DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", null, null);
-
       if (newTheme == "dark") {
-        StylesheetUtils.loadSheet(
-          window,
-          scrollbarsUrl,
-          "agent"
-        );
+        StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent");
       } else if (oldTheme == "dark") {
-        StylesheetUtils.removeSheet(
-          window,
-          scrollbarsUrl,
-          "agent"
-        );
+        StylesheetUtils.removeSheet(window, SCROLLBARS_URL, "agent");
       }
       forceStyle();
     }
 
     if (oldThemeDef) {
       for (let name of oldThemeDef.classList) {
         documentElement.classList.remove(name);
       }
@@ -87,26 +125,27 @@
     }
 
     if (newThemeDef.onApply) {
       newThemeDef.onApply(window, oldTheme);
     }
 
     // Final notification for further theme-switching related logic.
     gDevTools.emit("theme-switched", window, newTheme, oldTheme);
+
+    Promise.all(loadEvents).then(notifyWindow, console.error.bind(console));
   }
 
   function handlePrefChange(event, data) {
     if (data.pref == "devtools.theme") {
       switchTheme(data.newValue, data.oldValue);
     }
   }
 
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
   Cu.import("resource://gre/modules/Services.jsm");
   Cu.import("resource://devtools/client/framework/gDevTools.jsm");
   const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
   const StylesheetUtils = require("sdk/stylesheet/utils");
 
   let os;
   let platform = navigator.platform;
   if (platform.startsWith("Win")) {
--- a/devtools/client/sourceeditor/autocomplete.js
+++ b/devtools/client/sourceeditor/autocomplete.js
@@ -3,18 +3,18 @@
  * 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/. */
 
 const { Cu } = require("chrome");
 const cssAutoCompleter = require("devtools/client/sourceeditor/css-autocompleter");
 const { AutocompletePopup } = require("devtools/client/shared/autocomplete-popup");
 
 const CM_TERN_SCRIPTS = [
-  "chrome://devtools/content/sourceeditor/codemirror/tern/tern.js",
-  "chrome://devtools/content/sourceeditor/codemirror/hint/show-hint.js"
+  "chrome://devtools/content/sourceeditor/codemirror/addon/tern/tern.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/hint/show-hint.js"
 ];
 
 const autocompleteMap = new WeakMap();
 
 // A simple way to give each popup its own panelId.
 var autocompleteCounter = 0;
 
 /**
--- a/devtools/client/sourceeditor/editor.js
+++ b/devtools/client/sourceeditor/editor.js
@@ -42,45 +42,45 @@ const L10N = Services.strings.createBund
 const { OS } = Services.appinfo;
 
 // CM_STYLES, CM_SCRIPTS and CM_IFRAME represent the HTML,
 // JavaScript and CSS that is injected into an iframe in
 // order to initialize a CodeMirror instance.
 
 const CM_STYLES   = [
   "chrome://devtools/skin/common.css",
-  "chrome://devtools/content/sourceeditor/codemirror/codemirror.css",
-  "chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.css",
+  "chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.css",
   "chrome://devtools/content/sourceeditor/codemirror/mozilla.css"
 ];
 
 const CM_SCRIPTS  = [
   "chrome://devtools/content/shared/theme-switching.js",
-  "chrome://devtools/content/sourceeditor/codemirror/codemirror.js",
-  "chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js",
-  "chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js",
-  "chrome://devtools/content/sourceeditor/codemirror/search/search.js",
-  "chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js",
-  "chrome://devtools/content/sourceeditor/codemirror/edit/closebrackets.js",
-  "chrome://devtools/content/sourceeditor/codemirror/comment/comment.js",
+  "chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/search/search.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/edit/closebrackets.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js",
   "chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js",
   "chrome://devtools/content/sourceeditor/codemirror/mode/xml.js",
   "chrome://devtools/content/sourceeditor/codemirror/mode/css.js",
   "chrome://devtools/content/sourceeditor/codemirror/mode/htmlmixed.js",
   "chrome://devtools/content/sourceeditor/codemirror/mode/clike.js",
-  "chrome://devtools/content/sourceeditor/codemirror/selection/active-line.js",
-  "chrome://devtools/content/sourceeditor/codemirror/edit/trailingspace.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/selection/active-line.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/edit/trailingspace.js",
   "chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js",
   "chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js",
   "chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js",
-  "chrome://devtools/content/sourceeditor/codemirror/fold/foldcode.js",
-  "chrome://devtools/content/sourceeditor/codemirror/fold/brace-fold.js",
-  "chrome://devtools/content/sourceeditor/codemirror/fold/comment-fold.js",
-  "chrome://devtools/content/sourceeditor/codemirror/fold/xml-fold.js",
-  "chrome://devtools/content/sourceeditor/codemirror/fold/foldgutter.js"
+  "chrome://devtools/content/sourceeditor/codemirror/addon/fold/foldcode.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/fold/brace-fold.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/fold/comment-fold.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/fold/xml-fold.js",
+  "chrome://devtools/content/sourceeditor/codemirror/addon/fold/foldgutter.js"
 ];
 
 const CM_IFRAME   =
   "data:text/html;charset=utf8,<!DOCTYPE html>" +
   "<html dir='ltr'>" +
   "  <head>" +
   "    <style>" +
   "      html, body { height: 100%; }" +
--- a/devtools/client/sourceeditor/test/codemirror/codemirror.html
+++ b/devtools/client/sourceeditor/test/codemirror/codemirror.html
@@ -1,22 +1,22 @@
 <!doctype html>
 <html>
   <head>
     <meta charset="utf-8">
     <title>CodeMirror: Basic Tests</title>
-    <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/codemirror.css">
+    <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css">
     <link rel="stylesheet" href="cm_mode_test.css">
     <!--<link rel="stylesheet" href="../doc/docs.css">-->
 
-    <script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js"></script>
 
     <!--<script src="../addon/mode/overlay.js"></script>
     <script src="../addon/mode/multiplex.js"></script>
     <script src="../mode/xml/xml.js"></script>-->
--- a/devtools/client/sourceeditor/test/codemirror/vimemacs.html
+++ b/devtools/client/sourceeditor/test/codemirror/vimemacs.html
@@ -1,22 +1,22 @@
 <!doctype html>
 <html>
   <head>
     <meta charset="utf-8">
     <title>CodeMirror: VIM/Emacs tests</title>
-    <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/codemirror.css">
+    <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css">
     <link rel="stylesheet" href="cm_mode_test.css">
     <!--<link rel="stylesheet" href="../doc/docs.css">-->
 
-    <script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script>
-    <script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js"></script>
+    <script src="chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js"></script>
     <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js"></script>
 
     <!--<script src="../addon/mode/overlay.js"></script>
     <script src="../addon/mode/multiplex.js"></script>
     <script src="../mode/xml/xml.js"></script>-->
--- a/devtools/client/themes/animationinspector.css
+++ b/devtools/client/themes/animationinspector.css
@@ -285,44 +285,44 @@ body {
 
 /* Animation iterations */
 
 .animation-timeline .animation .iterations {
   position: relative;
   height: 100%;
   box-sizing: border-box;
 
-  --timelime-border-color: var(--theme-body-color);
+  --timeline-border-color: var(--theme-body-color);
   --timeline-background-color: var(--theme-splitter-color);
 
   /* Iterations of the animation are displayed with a repeating linear-gradient
      which size is dynamically changed from JS. The gradient only draws 1px
      borders between each iteration. These borders must have the same color as
      the border of this element */
   background-image:
     linear-gradient(to right,
-                    var(--timelime-border-color) 0,
-                    var(--timelime-border-color) 1px,
+                    var(--timeline-border-color) 0,
+                    var(--timeline-border-color) 1px,
                     transparent 1px,
                     transparent 2px);
   background-repeat: repeat-x;
   background-position: -1px 0;
-  border: 1px solid var(--timelime-border-color);
+  border: 1px solid var(--timeline-border-color);
 
   /* The background color is set independently */
   background-color: var(--timeline-background-color);
 }
 
 .animation-timeline .animation .cssanimation {
-  --timelime-border-color: var(--theme-highlight-lightorange);
+  --timeline-border-color: var(--theme-highlight-lightorange);
   --timeline-background-color: var(--theme-contrast-background);
 }
 
 .animation-timeline .animation .csstransition {
-  --timelime-border-color: var(--theme-highlight-bluegrey);
+  --timeline-border-color: var(--theme-highlight-bluegrey);
   --timeline-background-color: var(--theme-highlight-blue);
 }
 
 .animation-timeline .animation .iterations.infinite {
   border-right-width: 0;
 }
 
 .animation-timeline .animation .iterations.infinite::before,
@@ -364,24 +364,24 @@ body {
 .animation-timeline .animation .delay {
   position: absolute;
   top: 0;
   /* Make sure the delay covers up the animation border */
   transform: translate(-1px, -1px);
   box-sizing: border-box;
   height: calc(100% + 2px);
 
-  border: 1px solid var(--timelime-border-color);
+  border: 1px solid var(--timeline-border-color);
   border-width: 1px 0 1px 1px;
   background-image: repeating-linear-gradient(45deg,
                                               transparent,
                                               transparent 1px,
                                               var(--theme-selection-color) 1px,
                                               var(--theme-selection-color) 4px);
-  background-color: var(--timelime-border-color);
+  background-color: var(--timeline-border-color);
 }
 
 .animation-timeline .animation .delay.negative {
   /* Negative delays are displayed on top of the animation, so they need a
      right border. Whereas normal delays are displayed just before the
      animation, so there's already the animation's left border that serves as
      a separation. */
   border-width: 1px;
--- a/devtools/client/themes/layoutview.css
+++ b/devtools/client/themes/layoutview.css
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/ */
 
 .theme-sidebar {
   box-sizing: border-box;
 }
 
-.theme-sidebar body {
+body.theme-sidebar {
   /* The view will grow bigger as the window gets resized, until 400px */
   max-width: 400px;
   margin: 0px auto;
   padding: 0;
   /* "Contain" the absolutely positioned #main element */
   position: relative;
 }
 
--- a/devtools/client/webconsole/webconsole.js
+++ b/devtools/client/webconsole/webconsole.js
@@ -189,22 +189,22 @@ const PREF_INPUT_HISTORY_COUNT = "devtoo
  * A WebConsoleFrame instance is an interactive console initialized *per target*
  * that displays console log data as well as provides an interactive terminal to
  * manipulate the target's document content.
  *
  * The WebConsoleFrame is responsible for the actual Web Console UI
  * implementation.
  *
  * @constructor
- * @param object aWebConsoleOwner
+ * @param object webConsoleOwner
  *        The WebConsole owner object.
  */
-function WebConsoleFrame(aWebConsoleOwner)
+function WebConsoleFrame(webConsoleOwner)
 {
-  this.owner = aWebConsoleOwner;
+  this.owner = webConsoleOwner;
   this.hudId = this.owner.hudId;
   this.window = this.owner.iframeWindow;
 
   this._repeatNodes = {};
   this._outputQueue = [];
   this._itemDestroyQueue = [];
   this._pruneCategoriesQueue = {};
   this.filterPrefs = {};
@@ -385,56 +385,56 @@ WebConsoleFrame.prototype = {
   getSaveRequestAndResponseBodies:
   function WCF_getSaveRequestAndResponseBodies() {
     let deferred = promise.defer();
     let toGet = [
       "NetworkMonitor.saveRequestAndResponseBodies"
     ];
 
     // Make sure the web console client connection is established first.
-    this.webConsoleClient.getPreferences(toGet, aResponse => {
-      if (!aResponse.error) {
-        this._saveRequestAndResponseBodies = aResponse.preferences[toGet[0]];
+    this.webConsoleClient.getPreferences(toGet, response => {
+      if (!response.error) {
+        this._saveRequestAndResponseBodies = response.preferences[toGet[0]];
         deferred.resolve(this._saveRequestAndResponseBodies);
       }
       else {
-        deferred.reject(aResponse.error);
+        deferred.reject(response.error);
       }
     });
 
     return deferred.promise;
   },
 
   /**
    * Setter for saving of network request and response bodies.
    *
-   * @param boolean aValue
+   * @param boolean value
    *        The new value you want to set.
    */
   setSaveRequestAndResponseBodies:
-  function WCF_setSaveRequestAndResponseBodies(aValue) {
+  function WCF_setSaveRequestAndResponseBodies(value) {
     if (!this.webConsoleClient) {
       // Don't continue if the webconsole disconnected.
       return promise.resolve(null);
     }
 
     let deferred = promise.defer();
-    let newValue = !!aValue;
+    let newValue = !!value;
     let toSet = {
       "NetworkMonitor.saveRequestAndResponseBodies": newValue,
     };
 
     // Make sure the web console client connection is established first.
-    this.webConsoleClient.setPreferences(toSet, aResponse => {
-      if (!aResponse.error) {
+    this.webConsoleClient.setPreferences(toSet, response => {
+      if (!response.error) {
         this._saveRequestAndResponseBodies = newValue;
-        deferred.resolve(aResponse);
+        deferred.resolve(response);
       }
       else {
-        deferred.reject(aResponse.error);
+        deferred.reject(response.error);
       }
     });
 
     return deferred.promise;
   },
 
   /**
    * Getter for the persistent logging preference.
@@ -490,21 +490,21 @@ WebConsoleFrame.prototype = {
       return this._initDefer.promise;
     }
 
     this._initDefer = promise.defer();
     this.proxy = new WebConsoleConnectionProxy(this, this.owner.target);
 
     this.proxy.connect().then(() => { // on success
       this._initDefer.resolve(this);
-    }, (aReason) => { // on failure
+    }, (reason) => { // on failure
       let node = this.createMessageNode(CATEGORY_JS, SEVERITY_ERROR,
-                                        aReason.error + ": " + aReason.message);
-      this.outputMessage(CATEGORY_JS, node, [aReason]);
-      this._initDefer.reject(aReason);
+                                        reason.error + ": " + reason.message);
+      this.outputMessage(CATEGORY_JS, node, [reason]);
+      this._initDefer.reject(reason);
     });
 
     return this._initDefer.promise;
   },
 
   /**
    * Find the Web Console UI elements and setup event listeners as needed.
    * @private
@@ -555,27 +555,27 @@ WebConsoleFrame.prototype = {
                      .removeAttribute("disabled");
       }
     }
 
     // Update the character width and height needed for the popup offset
     // calculations.
     this._updateCharSize();
 
-    let updateSaveBodiesPrefUI = (aElement) => {
-      this.getSaveRequestAndResponseBodies().then(aValue => {
-        aElement.setAttribute("checked", aValue);
+    let updateSaveBodiesPrefUI = (element) => {
+      this.getSaveRequestAndResponseBodies().then(value => {
+        element.setAttribute("checked", value);
         this.emit("save-bodies-ui-toggled");
       });
     }
 
-    let reverseSaveBodiesPref = ({ target: aElement }) => {
-      this.getSaveRequestAndResponseBodies().then(aValue => {
-        this.setSaveRequestAndResponseBodies(!aValue);
-        aElement.setAttribute("checked", aValue);
+    let reverseSaveBodiesPref = ({ target: element }) => {
+      this.getSaveRequestAndResponseBodies().then(value => {
+        this.setSaveRequestAndResponseBodies(!value);
+        element.setAttribute("checked", value);
         this.emit("save-bodies-pref-reversed");
       });
     }
 
     let saveBodiesDisabled = !this.getFilterState("networkinfo") &&
                              !this.getFilterState("netxhr") &&
                              !this.getFilterState("network");
 
@@ -665,62 +665,62 @@ WebConsoleFrame.prototype = {
         this._filterPrefsPrefix + pref);
     }
   },
 
   /**
    * Attach / detach reflow listeners depending on the checked status
    * of the `CSS > Log` menuitem.
    *
-   * @param function [aCallback=null]
+   * @param function [callback=null]
    *        Optional function to invoke when the listener has been
    *        added/removed.
    */
   _updateReflowActivityListener:
-    function WCF__updateReflowActivityListener(aCallback)
+    function WCF__updateReflowActivityListener(callback)
   {
     if (this.webConsoleClient) {
       let pref = this._filterPrefsPrefix + "csslog";
       if (Services.prefs.getBoolPref(pref)) {
-        this.webConsoleClient.startListeners(["ReflowActivity"], aCallback);
+        this.webConsoleClient.startListeners(["ReflowActivity"], callback);
       } else {
-        this.webConsoleClient.stopListeners(["ReflowActivity"], aCallback);
+        this.webConsoleClient.stopListeners(["ReflowActivity"], callback);
       }
     }
   },
 
   /**
    * Attach / detach server logging listener depending on the filter
    * preferences. If the user isn't interested in the server logs at
    * all the listener is not registered.
    *
-   * @param function [aCallback=null]
+   * @param function [callback=null]
    *        Optional function to invoke when the listener has been
    *        added/removed.
    */
   _updateServerLoggingListener:
-    function WCF__updateServerLoggingListener(aCallback)
+    function WCF__updateServerLoggingListener(callback)
   {
     if (!this.webConsoleClient) {
       return;
     }
 
     let startListener = false;
     let prefs = ["servererror", "serverwarn", "serverinfo", "serverlog"];
     for (let i = 0; i < prefs.length; i++) {
       if (this.filterPrefs[prefs[i]]) {
         startListener = true;
         break;
       }
     }
 
     if (startListener) {
-      this.webConsoleClient.startListeners(["ServerLogging"], aCallback);
+      this.webConsoleClient.startListeners(["ServerLogging"], callback);
     } else {
-      this.webConsoleClient.stopListeners(["ServerLogging"], aCallback);
+      this.webConsoleClient.stopListeners(["ServerLogging"], callback);
     }
   },
 
   /**
    * Sets the events for the filter input field.
    * @private
    */
   _setFilterTextBoxEvents: function WCF__setFilterTextBoxEvents()
@@ -750,35 +750,35 @@ WebConsoleFrame.prototype = {
    *        A descriptor that contains info about the button. Contains "name",
    *        "category", and "prefKey" properties, and optionally a "severities"
    *        property.
    */
   _initFilterButtons: function WCF__initFilterButtons()
   {
     let categories = this.document
                      .querySelectorAll(".webconsole-filter-button[category]");
-    Array.forEach(categories, function(aButton) {
-      aButton.addEventListener("contextmenu", (aEvent) => {
-        aButton.open = true;
+    Array.forEach(categories, function(button) {
+      button.addEventListener("contextmenu", (event) => {
+        button.open = true;
       }, false);
-      aButton.addEventListener("click", this._toggleFilter, false);
+      button.addEventListener("click", this._toggleFilter, false);
 
       let someChecked = false;
-      let severities = aButton.querySelectorAll("menuitem[prefKey]");
-      Array.forEach(severities, function(aMenuItem) {
-        aMenuItem.addEventListener("command", this._toggleFilter, false);
-
-        let prefKey = aMenuItem.getAttribute("prefKey");
+      let severities = button.querySelectorAll("menuitem[prefKey]");
+      Array.forEach(severities, function(menuItem) {
+        menuItem.addEventListener("command", this._toggleFilter, false);
+
+        let prefKey = menuItem.getAttribute("prefKey");
         let checked = this.filterPrefs[prefKey];
-        aMenuItem.setAttribute("checked", checked);
+        menuItem.setAttribute("checked", checked);
         someChecked = someChecked || checked;
       }, this);
 
-      aButton.setAttribute("checked", someChecked);
-      aButton.setAttribute("aria-pressed", someChecked);
+      button.setAttribute("checked", someChecked);
+      button.setAttribute("aria-pressed", someChecked);
     }, this);
 
     if (!this.owner._browserConsole) {
       // The Browser Console displays nsIConsoleMessages which are messages that
       // end up in the JS category, but they are not errors or warnings, they
       // are just log messages. The Web Console does not show such messages.
       let jslog = this.document.querySelector("menuitem[prefKey=jslog]");
       jslog.hidden = true;
@@ -799,30 +799,30 @@ WebConsoleFrame.prototype = {
 
   /**
    * Increase, decrease or reset the font size.
    *
    * @param string size
    *        The size of the font change. Accepted values are "+" and "-".
    *        An unmatched size assumes a font reset.
    */
-  changeFontSize: function WCF_changeFontSize(aSize)
+  changeFontSize: function WCF_changeFontSize(size)
   {
     let fontSize = this.window
                    .getComputedStyle(this.outputNode, null)
                    .getPropertyValue("font-size").replace("px", "");
 
     if (this.outputNode.style.fontSize) {
       fontSize = this.outputNode.style.fontSize.replace("px", "");
     }
 
-    if (aSize == "+" || aSize == "-") {
+    if (size == "+" || size == "-") {
       fontSize = parseInt(fontSize, 10);
 
-      if (aSize == "+") {
+      if (size == "+") {
         fontSize += 1;
       }
       else {
         fontSize -= 1;
       }
 
       if (fontSize < MIN_FONT_SIZE) {
         fontSize = MIN_FONT_SIZE;
@@ -871,32 +871,32 @@ WebConsoleFrame.prototype = {
                              .paddingLeft.replace(/[^0-9.]/g, "") - 4;
   },
 
   /**
    * The event handler that is called whenever a user switches a filter on or
    * off.
    *
    * @private
-   * @param nsIDOMEvent aEvent
+   * @param nsIDOMEvent event
    *        The event that triggered the filter change.
    */
-  _toggleFilter: function WCF__toggleFilter(aEvent)
+  _toggleFilter: function WCF__toggleFilter(event)
   {
-    let target = aEvent.target;
+    let target = event.target;
     let tagName = target.tagName;
     // Prevent toggle if generated from a contextmenu event (right click)
-    let isRightClick = (aEvent.button === 2); // right click is button 2;
-    if (tagName != aEvent.currentTarget.tagName || isRightClick) {
+    let isRightClick = (event.button === 2); // right click is button 2;
+    if (tagName != event.currentTarget.tagName || isRightClick) {
       return;
     }
 
     switch (tagName) {
       case "toolbarbutton": {
-        let originalTarget = aEvent.originalTarget;
+        let originalTarget = event.originalTarget;
         let classes = originalTarget.classList;
 
         if (originalTarget.localName !== "toolbarbutton") {
           // Oddly enough, the click event is sent to the menu button when
           // selecting a menu item with the mouse. Detect this case and bail
           // out.
           break;
         }
@@ -907,17 +907,17 @@ WebConsoleFrame.prototype = {
           // drop-down, so do nothing. (The menu will automatically appear
           // without our intervention.)
           break;
         }
 
         // Toggle on the targeted filter button, and if the user alt clicked,
         // toggle off all other filter buttons and their associated filters.
         let state = target.getAttribute("checked") !== "true";
-        if (aEvent.getModifierState("Alt")) {
+        if (event.getModifierState("Alt")) {
           let buttons = this.document
                         .querySelectorAll(".webconsole-filter-button");
           Array.forEach(buttons, (button) => {
             if (button !== target) {
               button.setAttribute("checked", false);
               button.setAttribute("aria-pressed", false);
               this._setMenuState(button, false);
             }
@@ -980,127 +980,127 @@ WebConsoleFrame.prototype = {
       }
     }
   },
 
   /**
    * Set the menu attributes for a specific toggle button.
    *
    * @private
-   * @param XULElement aTarget
+   * @param XULElement target
    *        Button with drop down items to be toggled.
-   * @param boolean aState
+   * @param boolean state
    *        True if the menu item is being toggled on, and false otherwise.
    */
-  _setMenuState: function WCF__setMenuState(aTarget, aState)
+  _setMenuState: function WCF__setMenuState(target, state)
   {
-    let menuItems = aTarget.querySelectorAll("menuitem");
+    let menuItems = target.querySelectorAll("menuitem");
     Array.forEach(menuItems, (item) => {
-      item.setAttribute("checked", aState);
+      item.setAttribute("checked", state);
       let prefKey = item.getAttribute("prefKey");
-      this.setFilterState(prefKey, aState);
+      this.setFilterState(prefKey, state);
     });
   },
 
   /**
    * Set the filter state for a specific toggle button.
    *
-   * @param string aToggleType
-   * @param boolean aState
+   * @param string toggleType
+   * @param boolean state
    * @returns void
    */
-  setFilterState: function WCF_setFilterState(aToggleType, aState)
+  setFilterState: function WCF_setFilterState(toggleType, state)
   {
-    this.filterPrefs[aToggleType] = aState;
-    this.adjustVisibilityForMessageType(aToggleType, aState);
-
-    Services.prefs.setBoolPref(this._filterPrefsPrefix + aToggleType, aState);
+    this.filterPrefs[toggleType] = state;
+    this.adjustVisibilityForMessageType(toggleType, state);
+
+    Services.prefs.setBoolPref(this._filterPrefsPrefix + toggleType, state);
 
     if (this._updateListenersTimeout) {
       Timers.clearTimeout(this._updateListenersTimeout);
     }
 
     this._updateListenersTimeout = Timers.setTimeout(
       this._onUpdateListeners, 200);
   },
 
   /**
    * Get the filter state for a specific toggle button.
    *
-   * @param string aToggleType
+   * @param string toggleType
    * @returns boolean
    */
-  getFilterState: function WCF_getFilterState(aToggleType)
+  getFilterState: function WCF_getFilterState(toggleType)
   {
-    return this.filterPrefs[aToggleType];
+    return this.filterPrefs[toggleType];
   },
 
   /**
    * Called when a logging filter changes. Allows to stop/start
    * listeners according to the current filter state.
    */
   _onUpdateListeners: function() {
     this._updateReflowActivityListener();
     this._updateServerLoggingListener();
   },
 
   /**
    * Check that the passed string matches the filter arguments.
    *
-   * @param String aString
+   * @param String str
    *        to search for filter words in.
-   * @param String aFilter
+   * @param String filter
    *        is a string containing all of the words to filter on.
    * @returns boolean
    */
-  stringMatchesFilters: function WCF_stringMatchesFilters(aString, aFilter)
+  stringMatchesFilters: function WCF_stringMatchesFilters(str, filter)
   {
-    if (!aFilter || !aString) {
+    if (!filter || !str) {
       return true;
     }
 
-    let searchStr = aString.toLowerCase();
-    let filterStrings = aFilter.toLowerCase().split(/\s+/);
+    let searchStr = str.toLowerCase();
+    let filterStrings = filter.toLowerCase().split(/\s+/);
     return !filterStrings.some(function (f) {
       return searchStr.indexOf(f) == -1;
     });
   },
 
   /**
    * Turns the display of log nodes on and off appropriately to reflect the
-   * adjustment of the message type filter named by @aPrefKey.
+   * adjustment of the message type filter named by @prefKey.
    *
-   * @param string aPrefKey
+   * @param string prefKey
    *        The preference key for the message type being filtered: one of the
    *        values in the MESSAGE_PREFERENCE_KEYS table.
-   * @param boolean aState
-   *        True if the filter named by @aMessageType is being turned on; false
+   * @param boolean state
+   *        True if the filter named by @messageType is being turned on; false
    *        otherwise.
    * @returns void
    */
   adjustVisibilityForMessageType:
-  function WCF_adjustVisibilityForMessageType(aPrefKey, aState)
+  function WCF_adjustVisibilityForMessageType(prefKey, state)
   {
     let outputNode = this.outputNode;
     let doc = this.document;
 
     // Look for message nodes (".message") with the given preference key
     // (filter="error", filter="cssparser", etc.) and add or remove the
     // "filtered-by-type" class, which turns on or off the display.
 
-    let attribute = WORKERTYPES_PREFKEYS.indexOf(aPrefKey) == -1
+    let attribute = WORKERTYPES_PREFKEYS.indexOf(prefKey) == -1
                       ? 'filter' : 'workerType';
 
     let xpath = ".//*[contains(@class, 'message') and " +
-      "@" + attribute + "='" + aPrefKey + "']";
+      "@" + attribute + "='" + prefKey + "']";
     let result = doc.evaluate(xpath, outputNode, null,
       Ci.nsIDOMXPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
     for (let i = 0; i < result.snapshotLength; i++) {
       let node = result.snapshotItem(i);
-      if (aState) {
+      if (state) {
         node.classList.remove("filtered-by-type");
       }
       else {
         node.classList.add("filtered-by-type");
       }
     }
   },
 
@@ -1129,277 +1129,277 @@ WebConsoleFrame.prototype = {
       }
     }
   },
 
   /**
    * Applies the user's filters to a newly-created message node via CSS
    * classes.
    *
-   * @param nsIDOMNode aNode
+   * @param nsIDOMNode node
    *        The newly-created message node.
    * @return boolean
    *         True if the message was filtered or false otherwise.
    */
-  filterMessageNode: function WCF_filterMessageNode(aNode)
+  filterMessageNode: function WCF_filterMessageNode(node)
   {
     let isFiltered = false;
 
     // Filter by the message type.
-    let prefKey = MESSAGE_PREFERENCE_KEYS[aNode.category][aNode.severity];
+    let prefKey = MESSAGE_PREFERENCE_KEYS[node.category][node.severity];
     if (prefKey && !this.getFilterState(prefKey)) {
       // The node is filtered by type.
-      aNode.classList.add("filtered-by-type");
+      node.classList.add("filtered-by-type");
       isFiltered = true;
     }
 
     // Filter by worker type
-    if ("workerType" in aNode && !this.getFilterState(aNode.workerType)) {
-      aNode.classList.add("filtered-by-type");
+    if ("workerType" in node && !this.getFilterState(node.workerType)) {
+      node.classList.add("filtered-by-type");
       isFiltered = true;
     }
 
     // Filter on the search string.
     let search = this.filterBox.value;
-    let text = aNode.clipboardText;
+    let text = node.clipboardText;
 
     // if string matches the filter text
     if (!this.stringMatchesFilters(text, search)) {
-      aNode.classList.add("filtered-by-string");
+      node.classList.add("filtered-by-string");
       isFiltered = true;
     }
 
-    if (isFiltered && aNode.classList.contains("inlined-variables-view")) {
-      aNode.classList.add("hidden-message");
+    if (isFiltered && node.classList.contains("inlined-variables-view")) {
+      node.classList.add("hidden-message");
     }
 
     return isFiltered;
   },
 
   /**
    * Merge the attributes of the two nodes that are about to be filtered.
-   * Increment the number of repeats of aOriginal.
+   * Increment the number of repeats of original.
    *
-   * @param nsIDOMNode aOriginal
+   * @param nsIDOMNode original
    *        The Original Node. The one being merged into.
-   * @param nsIDOMNode aFiltered
+   * @param nsIDOMNode filtered
    *        The node being filtered out because it is repeated.
    */
   mergeFilteredMessageNode:
-  function WCF_mergeFilteredMessageNode(aOriginal, aFiltered)
+  function WCF_mergeFilteredMessageNode(original, filtered)
   {
-    let repeatNode = aOriginal.getElementsByClassName("message-repeats")[0];
+    let repeatNode = original.getElementsByClassName("message-repeats")[0];
     if (!repeatNode) {
       return; // no repeat node, return early.
     }
 
     let occurrences = parseInt(repeatNode.getAttribute("value")) + 1;
     repeatNode.setAttribute("value", occurrences);
     repeatNode.textContent = occurrences;
     let str = l10n.getStr("messageRepeats.tooltip2");
     repeatNode.title = PluralForm.get(occurrences, str)
                        .replace("#1", occurrences);
   },
 
   /**
    * Filter the message node from the output if it is a repeat.
    *
    * @private
-   * @param nsIDOMNode aNode
+   * @param nsIDOMNode node
    *        The message node to be filtered or not.
    * @returns nsIDOMNode|null
    *          Returns the duplicate node if the message was filtered, null
    *          otherwise.
    */
-  _filterRepeatedMessage: function WCF__filterRepeatedMessage(aNode)
+  _filterRepeatedMessage: function WCF__filterRepeatedMessage(node)
   {
-    let repeatNode = aNode.getElementsByClassName("message-repeats")[0];
+    let repeatNode = node.getElementsByClassName("message-repeats")[0];
     if (!repeatNode) {
       return null;
     }
 
     let uid = repeatNode._uid;
     let dupeNode = null;
 
-    if (aNode.category == CATEGORY_CSS ||
-        aNode.category == CATEGORY_SECURITY) {
+    if (node.category == CATEGORY_CSS ||
+        node.category == CATEGORY_SECURITY) {
       dupeNode = this._repeatNodes[uid];
       if (!dupeNode) {
-        this._repeatNodes[uid] = aNode;
+        this._repeatNodes[uid] = node;
       }
     }
-    else if ((aNode.category == CATEGORY_WEBDEV ||
-              aNode.category == CATEGORY_JS) &&
-             aNode.category != CATEGORY_NETWORK &&
-             !aNode.classList.contains("inlined-variables-view")) {
+    else if ((node.category == CATEGORY_WEBDEV ||
+              node.category == CATEGORY_JS) &&
+             node.category != CATEGORY_NETWORK &&
+             !node.classList.contains("inlined-variables-view")) {
       let lastMessage = this.outputNode.lastChild;
       if (!lastMessage) {
         return null;
       }
 
       let lastRepeatNode = lastMessage.getElementsByClassName("message-repeats")[0];
       if (lastRepeatNode && lastRepeatNode._uid == uid) {
         dupeNode = lastMessage;
       }
     }
 
     if (dupeNode) {
-      this.mergeFilteredMessageNode(dupeNode, aNode);
+      this.mergeFilteredMessageNode(dupeNode, node);
       return dupeNode;
     }
 
     return null;
   },
 
   /**
    * Display cached messages that may have been collected before the UI is
    * displayed.
    *
-   * @param array aRemoteMessages
+   * @param array remoteMessages
    *        Array of cached messages coming from the remote Web Console
    *        content instance.
    */
-  displayCachedMessages: function WCF_displayCachedMessages(aRemoteMessages)
+  displayCachedMessages: function WCF_displayCachedMessages(remoteMessages)
   {
-    if (!aRemoteMessages.length) {
+    if (!remoteMessages.length) {
       return;
     }
 
-    aRemoteMessages.forEach(function(aMessage) {
-      switch (aMessage._type) {
+    remoteMessages.forEach(function(message) {
+      switch (message._type) {
         case "PageError": {
-          let category = Utils.categoryForScriptError(aMessage);
+          let category = Utils.categoryForScriptError(message);
           this.outputMessage(category, this.reportPageError,
-                             [category, aMessage]);
+                             [category, message]);
           break;
         }
         case "LogMessage":
-          this.handleLogMessage(aMessage);
+          this.handleLogMessage(message);
           break;
         case "ConsoleAPI":
           this.outputMessage(CATEGORY_WEBDEV, this.logConsoleAPIMessage,
-                             [aMessage]);
+                             [message]);
           break;
         case "NetworkEvent":
-          this.outputMessage(CATEGORY_NETWORK, this.logNetEvent, [aMessage]);
+          this.outputMessage(CATEGORY_NETWORK, this.logNetEvent, [message]);
           break;
       }
     }, this);
   },
 
   /**
    * Logs a message to the Web Console that originates from the Web Console
    * server.
    *
-   * @param object aMessage
+   * @param object message
    *        The message received from the server.
    * @return nsIDOMElement|null
    *         The message element to display in the Web Console output.
    */
-  logConsoleAPIMessage: function WCF_logConsoleAPIMessage(aMessage)
+  logConsoleAPIMessage: function WCF_logConsoleAPIMessage(message)
   {
     let body = null;
     let clipboardText = null;
-    let sourceURL = aMessage.filename;
-    let sourceLine = aMessage.lineNumber;
-    let level = aMessage.level;
-    let args = aMessage.arguments;
+    let sourceURL = message.filename;
+    let sourceLine = message.lineNumber;
+    let level = message.level;
+    let args = message.arguments;
     let objectActors = new Set();
     let node = null;
 
     // Gather the actor IDs.
-    args.forEach((aValue) => {
-      if (WebConsoleUtils.isActorGrip(aValue)) {
-        objectActors.add(aValue.actor);
+    args.forEach((value) => {
+      if (WebConsoleUtils.isActorGrip(value)) {
+        objectActors.add(value.actor);
       }
     });
 
     switch (level) {
       case "log":
       case "info":
       case "warn":
       case "error":
       case "exception":
       case "assert":
       case "debug": {
-        let msg = new Messages.ConsoleGeneric(aMessage);
+        let msg = new Messages.ConsoleGeneric(message);
         node = msg.init(this.output).render().element;
         break;
       }
       case "table": {
-        let msg = new Messages.ConsoleTable(aMessage);
+        let msg = new Messages.ConsoleTable(message);
         node = msg.init(this.output).render().element;
         break;
       }
       case "trace": {
-        let msg = new Messages.ConsoleTrace(aMessage);
+        let msg = new Messages.ConsoleTrace(message);
         node = msg.init(this.output).render().element;
         break;
       }
       case "dir": {
         body = { arguments: args };
         let clipboardArray = [];
-        args.forEach((aValue) => {
-          clipboardArray.push(VariablesView.getString(aValue));
+        args.forEach((value) => {
+          clipboardArray.push(VariablesView.getString(value));
         });
         clipboardText = clipboardArray.join(" ");
         break;
       }
       case "dirxml": {
         // We just alias console.dirxml() with console.log().
-        aMessage.level = "log";
-        return WCF_logConsoleAPIMessage.call(this, aMessage);
+        message.level = "log";
+        return WCF_logConsoleAPIMessage.call(this, message);
       }
       case "group":
       case "groupCollapsed":
-        clipboardText = body = aMessage.groupName;
+        clipboardText = body = message.groupName;
         this.groupDepth++;
         break;
 
       case "groupEnd":
         if (this.groupDepth > 0) {
           this.groupDepth--;
         }
         break;
 
       case "time": {
-        let timer = aMessage.timer;
+        let timer = message.timer;
         if (!timer) {
           return null;
         }
         if (timer.error) {
           Cu.reportError(l10n.getStr(timer.error));
           return null;
         }
         body = l10n.getFormatStr("timerStarted", [timer.name]);
         clipboardText = body;
         break;
       }
 
       case "timeEnd": {
-        let timer = aMessage.timer;
+        let timer = message.timer;
         if (!timer) {
           return null;
         }
         let duration = Math.round(timer.duration * 100) / 100;
         body = l10n.getFormatStr("timeEnd", [timer.name, duration]);
         clipboardText = body;
         break;
       }
 
       case "count": {
-        let counter = aMessage.counter;
+        let counter = message.counter;
         if (!counter) {
           return null;
         }
         if (counter.error) {
           Cu.reportError(l10n.getStr(counter.error));
           return null;
         }
-        let msg = new Messages.ConsoleGeneric(aMessage);
+        let msg = new Messages.ConsoleGeneric(message);
         node = msg.init(this.output).render().element;
         break;
       }
 
       case "timeStamp": {
         // console.timeStamp() doesn't need to display anything.
         return null;
       }
@@ -1426,181 +1426,183 @@ WebConsoleFrame.prototype = {
 
     if (level == "groupEnd") {
       return null; // no need to continue
     }
 
     if (!node) {
       node = this.createMessageNode(CATEGORY_WEBDEV, LEVELS[level], body,
                                     sourceURL, sourceLine, clipboardText,
-                                    level, aMessage.timeStamp);
-      if (aMessage.private) {
+                                    level, message.timeStamp);
+      if (message.private) {
         node.setAttribute("private", true);
       }
     }
 
     if (objectActors.size > 0) {
       node._objectActors = objectActors;
 
       if (!node._messageObject) {
         let repeatNode = node.getElementsByClassName("message-repeats")[0];
         repeatNode._uid += [...objectActors].join("-");
       }
     }
 
-    let workerTypeID = CONSOLE_WORKER_IDS.indexOf(aMessage.workerType);
+    let workerTypeID = CONSOLE_WORKER_IDS.indexOf(message.workerType);
     if (workerTypeID != -1) {
       node.workerType = WORKERTYPES_PREFKEYS[workerTypeID];
       node.setAttribute('workerType', WORKERTYPES_PREFKEYS[workerTypeID]);
     }
 
     return node;
   },
 
   /**
    * Handle ConsoleAPICall objects received from the server. This method outputs
    * the window.console API call.
    *
-   * @param object aMessage
+   * @param object message
    *        The console API message received from the server.
    */
-  handleConsoleAPICall: function WCF_handleConsoleAPICall(aMessage)
+  handleConsoleAPICall: function WCF_handleConsoleAPICall(message)
   {
-    this.outputMessage(CATEGORY_WEBDEV, this.logConsoleAPIMessage, [aMessage]);
+    this.outputMessage(CATEGORY_WEBDEV, this.logConsoleAPIMessage, [message]);
   },
 
   /**
    * Reports an error in the page source, either JavaScript or CSS.
    *
-   * @param nsIScriptError aScriptError
+   * @param nsIScriptError scriptError
    *        The error message to report.
    * @return nsIDOMElement|undefined
    *         The message element to display in the Web Console output.
    */
-  reportPageError: function WCF_reportPageError(aCategory, aScriptError)
+  reportPageError: function WCF_reportPageError(category, scriptError)
   {
     // Warnings and legacy strict errors become warnings; other types become
     // errors.
     let severity = 'error';
-    if (aScriptError.warning || aScriptError.strict) {
+    if (scriptError.warning || scriptError.strict) {
       severity = 'warning';
-    } else if (aScriptError.info) {
+    } else if (scriptError.info) {
       severity = 'log';
     }
 
-    let category = 'js';
-    switch(aCategory) {
+    switch(category) {
       case CATEGORY_CSS:
         category = 'css';
         break;
       case CATEGORY_SECURITY:
         category = 'security';
         break;
+      default:
+        category = "js";
+        break;
     }
 
     let objectActors = new Set();
 
     // Gather the actor IDs.
     for (let prop of ["errorMessage", "lineText"]) {
-      let grip = aScriptError[prop];
+      let grip = scriptError[prop];
       if (WebConsoleUtils.isActorGrip(grip)) {
         objectActors.add(grip.actor);
       }
     }
 
-    let errorMessage = aScriptError.errorMessage;
+    let errorMessage = scriptError.errorMessage;
     if (errorMessage.type && errorMessage.type == "longString") {
       errorMessage = errorMessage.initial;
     }
 
-    let displayOrigin = aScriptError.sourceName;
+    let displayOrigin = scriptError.sourceName;
 
     // TLS errors are related to the connection and not the resource; therefore
     // it makes sense to only display the protcol, host and port (prePath).
     // This also means messages are grouped for a single origin.
-    if (aScriptError.category && aScriptError.category == "SHA-1 Signature") {
-      let sourceURI = Services.io.newURI(aScriptError.sourceName, null, null).QueryInterface(Ci.nsIURL);
+    if (scriptError.category && scriptError.category == "SHA-1 Signature") {
+      let sourceURI = Services.io.newURI(scriptError.sourceName, null, null).QueryInterface(Ci.nsIURL);
       displayOrigin = sourceURI.prePath;
     }
 
     // Create a new message
     let msg = new Messages.Simple(errorMessage, {
       location: {
         url: displayOrigin,
-        line: aScriptError.lineNumber,
-        column: aScriptError.columnNumber
+        line: scriptError.lineNumber,
+        column: scriptError.columnNumber
       },
-      stack: aScriptError.stacktrace,
+      stack: scriptError.stacktrace,
       category: category,
       severity: severity,
-      timestamp: aScriptError.timeStamp,
-      private: aScriptError.private,
+      timestamp: scriptError.timeStamp,
+      private: scriptError.private,
       filterDuplicates: true
     });
 
     let node = msg.init(this.output).render().element;
 
     // Select the body of the message node that is displayed in the console
     let msgBody = node.getElementsByClassName("message-body")[0];
     // Add the more info link node to messages that belong to certain categories
-    this.addMoreInfoLink(msgBody, aScriptError);
+    this.addMoreInfoLink(msgBody, scriptError);
 
     if (objectActors.size > 0) {
       node._objectActors = objectActors;
     }
 
     return node;
   },
 
   /**
    * Handle PageError objects received from the server. This method outputs the
    * given error.
    *
-   * @param nsIScriptError aPageError
+   * @param nsIScriptError pageError
    *        The error received from the server.
    */
-  handlePageError: function WCF_handlePageError(aPageError)
+  handlePageError: function WCF_handlePageError(pageError)
   {
-    let category = Utils.categoryForScriptError(aPageError);
-    this.outputMessage(category, this.reportPageError, [category, aPageError]);
+    let category = Utils.categoryForScriptError(pageError);
+    this.outputMessage(category, this.reportPageError, [category, pageError]);
   },
 
   /**
    * Handle log messages received from the server. This method outputs the given
    * message.
    *
-   * @param object aPacket
+   * @param object packet
    *        The message packet received from the server.
    */
-  handleLogMessage: function WCF_handleLogMessage(aPacket)
+  handleLogMessage: function WCF_handleLogMessage(packet)
   {
-    if (aPacket.message) {
-      this.outputMessage(CATEGORY_JS, this._reportLogMessage, [aPacket]);
+    if (packet.message) {
+      this.outputMessage(CATEGORY_JS, this._reportLogMessage, [packet]);
     }
   },
 
   /**
    * Display log messages received from the server.
    *
    * @private
-   * @param object aPacket
+   * @param object packet
    *        The message packet received from the server.
    * @return nsIDOMElement
    *         The message element to render for the given log message.
    */
-  _reportLogMessage: function WCF__reportLogMessage(aPacket)
+  _reportLogMessage: function WCF__reportLogMessage(packet)
   {
-    let msg = aPacket.message;
+    let msg = packet.message;
     if (msg.type && msg.type == "longString") {
       msg = msg.initial;
     }
     let node = this.createMessageNode(CATEGORY_JS, SEVERITY_LOG, msg, null,
-                                      null, null, null, aPacket.timeStamp);
-    if (WebConsoleUtils.isActorGrip(aPacket.message)) {
-      node._objectActors = new Set([aPacket.message.actor]);
+                                      null, null, null, packet.timeStamp);
+    if (WebConsoleUtils.isActorGrip(packet.message)) {
+      node._objectActors = new Set([packet.message.actor]);
     }
     return node;
   },
 
   /**
    * Log network event.
    *
    * @param object networkInfo
@@ -1683,52 +1685,52 @@ WebConsoleFrame.prototype = {
     this._updateNetMessage(actorId);
 
     return messageNode;
   },
 
   /**
    * Create a mixed content warning Node.
    *
-   * @param aLinkNode
+   * @param linkNode
    *        Parent to the requested urlNode.
    */
-  makeMixedContentNode: function WCF_makeMixedContentNode(aLinkNode)
+  makeMixedContentNode: function WCF_makeMixedContentNode(linkNode)
   {
     let mixedContentWarning = "[" + l10n.getStr("webConsoleMixedContentWarning") + "]";
 
     // Mixed content warning message links to a Learn More page
     let mixedContentWarningNode = this.document.createElementNS(XHTML_NS, "a");
     mixedContentWarningNode.title = MIXED_CONTENT_LEARN_MORE;
     mixedContentWarningNode.href = MIXED_CONTENT_LEARN_MORE;
     mixedContentWarningNode.className = "learn-more-link";
     mixedContentWarningNode.textContent = mixedContentWarning;
     mixedContentWarningNode.draggable = false;
 
-    aLinkNode.appendChild(mixedContentWarningNode);
-
-    this._addMessageLinkCallback(mixedContentWarningNode, (aEvent) => {
-      aEvent.stopPropagation();
+    linkNode.appendChild(mixedContentWarningNode);
+
+    this._addMessageLinkCallback(mixedContentWarningNode, (event) => {
+      event.stopPropagation();
       this.owner.openLink(MIXED_CONTENT_LEARN_MORE);
     });
   },
 
   /**
    * Adds a more info link node to messages based on the nsIScriptError object
    * that we need to report to the console
    *
-   * @param aNode
+   * @param node
    *        The node to which we will be adding the more info link node
-   * @param aScriptError
+   * @param scriptError
    *        The script error object that we are reporting to the console
    */
-  addMoreInfoLink: function WCF_addMoreInfoLink(aNode, aScriptError)
+  addMoreInfoLink: function WCF_addMoreInfoLink(node, scriptError)
   {
     let url;
-    switch (aScriptError.category) {
+    switch (scriptError.category) {
       case "Insecure Password Field":
         url = INSECURE_PASSWORDS_LEARN_MORE;
         break;
       case "Mixed Content Message":
       case "Mixed Content Blocker":
         url = MIXED_CONTENT_LEARN_MORE;
         break;
       case "Invalid HPKP Headers":
@@ -1743,123 +1745,123 @@ WebConsoleFrame.prototype = {
       case "Tracking Protection":
         url = TRACKING_PROTECTION_LEARN_MORE;
         break;
       default:
         // Unknown category. Return without adding more info node.
         return;
     }
 
-    this.addLearnMoreWarningNode(aNode, url);
+    this.addLearnMoreWarningNode(node, url);
   },
 
   /*
    * Appends a clickable warning node to the node passed
    * as a parameter to the function. When a user clicks on the appended
    * warning node, the browser navigates to the provided url.
    *
-   * @param aNode
+   * @param node
    *        The node to which we will be adding a clickable warning node.
-   * @param aURL
+   * @param url
    *        The url which points to the page where the user can learn more
    *        about security issues associated with the specific message that's
    *        being logged.
    */
   addLearnMoreWarningNode:
-  function WCF_addLearnMoreWarningNode(aNode, aURL)
+  function WCF_addLearnMoreWarningNode(node, url)
   {
     let moreInfoLabel = "[" + l10n.getStr("webConsoleMoreInfoLabel") + "]";
 
     let warningNode = this.document.createElementNS(XHTML_NS, "a");
-    warningNode.title = aURL;
-    warningNode.href = aURL;
+    warningNode.title = url;
+    warningNode.href = url;
     warningNode.draggable = false;
     warningNode.textContent = moreInfoLabel;
     warningNode.className = "learn-more-link";
 
-    this._addMessageLinkCallback(warningNode, (aEvent) => {
-      aEvent.stopPropagation();
-      this.owner.openLink(aURL);
+    this._addMessageLinkCallback(warningNode, (event) => {
+      event.stopPropagation();
+      this.owner.openLink(url);
     });
 
-    aNode.appendChild(warningNode);
+    node.appendChild(warningNode);
   },
 
   /**
    * Log file activity.
    *
-   * @param string aFileURI
+   * @param string fileURI
    *        The file URI that was loaded.
    * @return nsIDOMElement|undefined
    *         The message element to display in the Web Console output.
    */
-  logFileActivity: function WCF_logFileActivity(aFileURI)
+  logFileActivity: function WCF_logFileActivity(fileURI)
   {
     let urlNode = this.document.createElementNS(XHTML_NS, "a");
-    urlNode.setAttribute("title", aFileURI);
+    urlNode.setAttribute("title", fileURI);
     urlNode.className = "url";
-    urlNode.textContent = aFileURI;
+    urlNode.textContent = fileURI;
     urlNode.draggable = false;
-    urlNode.href = aFileURI;
+    urlNode.href = fileURI;
 
     let outputNode = this.createMessageNode(CATEGORY_NETWORK, SEVERITY_LOG,
-                                            urlNode, null, null, aFileURI);
+                                            urlNode, null, null, fileURI);
 
     this._addMessageLinkCallback(urlNode, () => {
-      this.owner.viewSource(aFileURI);
+      this.owner.viewSource(fileURI);
     });
 
     return outputNode;
   },
 
   /**
    * Handle the file activity messages coming from the remote Web Console.
    *
-   * @param string aFileURI
+   * @param string fileURI
    *        The file URI that was requested.
    */
-  handleFileActivity: function WCF_handleFileActivity(aFileURI)
+  handleFileActivity: function WCF_handleFileActivity(fileURI)
   {
-    this.outputMessage(CATEGORY_NETWORK, this.logFileActivity, [aFileURI]);
+    this.outputMessage(CATEGORY_NETWORK, this.logFileActivity, [fileURI]);
   },
 
   /**
    * Handle the reflow activity messages coming from the remote Web Console.
    *
-   * @param object aMessage
+   * @param object msg
    *        An object holding information about a reflow batch.
    */
-  logReflowActivity: function WCF_logReflowActivity(aMessage)
+  logReflowActivity: function WCF_logReflowActivity(message)
   {
-    let {start, end, sourceURL, sourceLine} = aMessage;
+    let {start, end, sourceURL, sourceLine} = message;
     let duration = Math.round((end - start) * 100) / 100;
     let node = this.document.createElementNS(XHTML_NS, "span");
     if (sourceURL) {
       node.textContent = l10n.getFormatStr("reflow.messageWithLink", [duration]);
       let a = this.document.createElementNS(XHTML_NS, "a");
       a.href = "#";
       a.draggable = "false";
       let filename = WebConsoleUtils.abbreviateSourceURL(sourceURL);
-      let functionName = aMessage.functionName || l10n.getStr("stacktrace.anonymousFunction");
+      let functionName = message.functionName || l10n.getStr("stacktrace.anonymousFunction");
       a.textContent = l10n.getFormatStr("reflow.messageLinkText",
                          [functionName, filename, sourceLine]);
       this._addMessageLinkCallback(a, () => {
         this.owner.viewSourceInDebugger(sourceURL, sourceLine);
       });
       node.appendChild(a);
     } else {
       node.textContent = l10n.getFormatStr("reflow.messageWithNoLink", [duration]);
     }
     return this.createMessageNode(CATEGORY_CSS, SEVERITY_LOG, node);
   },
 
 
-  handleReflowActivity: function WCF_handleReflowActivity(aMessage)
+  handleReflowActivity: function WCF_handleReflowActivity(message)
   {
-    this.outputMessage(CATEGORY_CSS, this.logReflowActivity, [aMessage]);
+    this.outputMessage(CATEGORY_CSS, this.logReflowActivity, [message]);
   },
 
   /**
    * Inform user that the window.console API has been replaced by a script
    * in a content page.
    */
   logWarningAboutReplacedAPI: function WCF_logWarningAboutReplacedAPI()
   {
@@ -1906,24 +1908,24 @@ WebConsoleFrame.prototype = {
     }
   },
 
   /**
    * Update an output message to reflect the latest state of a network request,
    * given a network event actor ID.
    *
    * @private
-   * @param string aActorId
+   * @param string actorId
    *        The network event actor ID for which you want to update the message.
    * @return boolean
    *         |true| if the message node was updated, or |false| otherwise.
    */
-  _updateNetMessage: function WCF__updateNetMessage(aActorId)
+  _updateNetMessage: function WCF__updateNetMessage(actorId)
   {
-    let networkInfo = this.webConsoleClient.getNetworkRequest(aActorId);
+    let networkInfo = this.webConsoleClient.getNetworkRequest(actorId);
     if (!networkInfo || !networkInfo.node) {
       return;
     }
 
     let messageNode = networkInfo.node;
     let updates = networkInfo.updates;
     let hasEventTimings = updates.indexOf("eventTimings") > -1;
     let hasResponseStart = updates.indexOf("responseStart") > -1;
@@ -1980,87 +1982,87 @@ WebConsoleFrame.prototype = {
     return toolbox.selectTool("netmonitor").then(panel => {
       return panel.panelWin.NetMonitorController.inspectRequest(requestId);
     });
   },
 
   /**
    * Handler for page location changes.
    *
-   * @param string aURI
+   * @param string uri
    *        New page location.
-   * @param string aTitle
+   * @param string title
    *        New page title.
    */
-  onLocationChange: function WCF_onLocationChange(aURI, aTitle)
+  onLocationChange: function WCF_onLocationChange(uri, title)
   {
-    this.contentLocation = aURI;
+    this.contentLocation = uri;
     if (this.owner.onLocationChange) {
-      this.owner.onLocationChange(aURI, aTitle);
+      this.owner.onLocationChange(uri, title);
     }
   },
 
   /**
    * Handler for the tabNavigated notification.
    *
-   * @param string aEvent
+   * @param string event
    *        Event name.
-   * @param object aPacket
+   * @param object packet
    *        Notification packet received from the server.
    */
-  handleTabNavigated: function WCF_handleTabNavigated(aEvent, aPacket)
+  handleTabNavigated: function WCF_handleTabNavigated(event, packet)
   {
-    if (aEvent == "will-navigate") {
+    if (event == "will-navigate") {
       if (this.persistLog) {
-        let marker = new Messages.NavigationMarker(aPacket, Date.now());
+        let marker = new Messages.NavigationMarker(packet, Date.now());
         this.output.addMessage(marker);
       }
       else {
         this.jsterm.clearOutput();
       }
     }
 
-    if (aPacket.url) {
-      this.onLocationChange(aPacket.url, aPacket.title);
-    }
-
-    if (aEvent == "navigate" && !aPacket.nativeConsoleAPI) {
+    if (packet.url) {
+      this.onLocationChange(packet.url, packet.title);
+    }
+
+    if (event == "navigate" && !packet.nativeConsoleAPI) {
       this.logWarningAboutReplacedAPI();
     }
   },
 
   /**
    * Output a message node. This filters a node appropriately, then sends it to
    * the output, regrouping and pruning output as necessary.
    *
    * Note: this call is async - the given message node may not be displayed when
    * you call this method.
    *
-   * @param integer aCategory
+   * @param integer category
    *        The category of the message you want to output. See the CATEGORY_*
    *        constants.
-   * @param function|nsIDOMElement aMethodOrNode
+   * @param function|nsIDOMElement methodOrNode
    *        The method that creates the message element to send to the output or
    *        the actual element. If a method is given it will be bound to the HUD
-   *        object and the arguments will be |aArguments|.
-   * @param array [aArguments]
+   *        object and the arguments will be |args|.
+   * @param array [args]
    *        If a method is given to output the message element then the method
    *        will be invoked with the list of arguments given here. The last
    *        object in this array should be the packet received from the
    *        back end.
    */
-  outputMessage: function WCF_outputMessage(aCategory, aMethodOrNode, aArguments)
+  outputMessage: function WCF_outputMessage(category, methodOrNode, args)
   {
     if (!this._outputQueue.length) {
       // If the queue is empty we consider that now was the last output flush.
       // This avoid an immediate output flush when the timer executes.
       this._lastOutputFlush = Date.now();
     }
 
-    this._outputQueue.push([aCategory, aMethodOrNode, aArguments]);
+    this._outputQueue.push([category, methodOrNode, args]);
 
     this._initOutputTimer();
   },
 
   /**
    * Try to flush the output message queue. This takes the messages in the
    * output queue and displays them. Outputting stops at MESSAGES_IN_INTERVAL.
    * Further output is queued to happen later - see OUTPUT_INTERVAL.
@@ -2141,18 +2143,18 @@ WebConsoleFrame.prototype = {
     if (shouldPrune || !this._outputQueue.length) {
       // Only bother measuring the scrollHeight if not scrolled to bottom,
       // since the oldScrollHeight will not be used if it is.
       if (!scrolledToBottom) {
         oldScrollHeight = scrollNode.scrollHeight;
       }
 
       let categories = Object.keys(this._pruneCategoriesQueue);
-      categories.forEach(function _pruneOutput(aCategory) {
-        removedNodes += this.pruneOutputIfNecessary(aCategory);
+      categories.forEach(function _pruneOutput(category) {
+        removedNodes += this.pruneOutputIfNecessary(category);
       }, this);
       this._pruneCategoriesQueue = {};
     }
 
     let isInputOutput = lastVisibleNode &&
                         (lastVisibleNode.category == CATEGORY_INPUT ||
                          lastVisibleNode.category == CATEGORY_OUTPUT);
 
@@ -2206,31 +2208,31 @@ WebConsoleFrame.prototype = {
                                        OUTPUT_INTERVAL,
                                        Ci.nsITimer.TYPE_ONE_SHOT);
   },
 
   /**
    * Output a message from the queue.
    *
    * @private
-   * @param nsISupportsString aHudIdSupportsString
+   * @param nsISupportsString hudIdSupportsString
    *        The HUD ID as an nsISupportsString.
-   * @param array aItem
+   * @param array item
    *        An item from the output queue - this item represents a message.
    * @return object
    *         An object that holds the following properties:
    *         - node: the DOM element of the message.
    *         - isRepeated: the DOM element of the original message, if this is
    *         a repeated message, otherwise null.
    *         - visible: boolean that tells if the message is visible.
    */
   _outputMessageFromQueue:
-  function WCF__outputMessageFromQueue(aHudIdSupportsString, aItem)
+  function WCF__outputMessageFromQueue(hudIdSupportsString, item)
   {
-    let [category, methodOrNode, args] = aItem;
+    let [category, methodOrNode, args] = item;
 
     // The last object in the args array should be message
     // object or response packet received from the server.
     let message = (args && args.length) ? args[args.length-1] : null;
 
     let node = typeof methodOrNode == "function" ?
                methodOrNode.apply(this, args || []) :
                methodOrNode;
@@ -2249,17 +2251,17 @@ WebConsoleFrame.prototype = {
 
     let visible = !isRepeated && !isFiltered;
     if (!isRepeated) {
       this.outputNode.insertBefore(node,
                                    afterNode ? afterNode.nextSibling : null);
       this._pruneCategoriesQueue[node.category] = true;
 
       let nodeID = node.getAttribute("id");
-      Services.obs.notifyObservers(aHudIdSupportsString,
+      Services.obs.notifyObservers(hudIdSupportsString,
                                    "web-console-message-created", nodeID);
 
     }
 
     if (node._onOutput) {
       node._onOutput();
       delete node._onOutput;
     }
@@ -2277,22 +2279,22 @@ WebConsoleFrame.prototype = {
    * that will be removed at the end of the queue anyway.
    * @private
    */
   _pruneOutputQueue: function WCF__pruneOutputQueue()
   {
     let nodes = {};
 
     // Group the messages per category.
-    this._outputQueue.forEach(function(aItem, aIndex) {
-      let [category] = aItem;
+    this._outputQueue.forEach(function(item, index) {
+      let [category] = item;
       if (!(category in nodes)) {
         nodes[category] = [];
       }
-      nodes[category].push(aIndex);
+      nodes[category].push(index);
     }, this);
 
     let pruned = 0;
 
     // Loop through the categories we found and prune if needed.
     for (let category in nodes) {
       let limit = Utils.logLimitForCategory(category);
       let indexes = nodes[category];
@@ -2309,25 +2311,25 @@ WebConsoleFrame.prototype = {
     return pruned;
   },
 
   /**
    * Destroy an item that was once in the outputQueue but isn't needed
    * after all.
    *
    * @private
-   * @param array aItem
+   * @param array item
    *        The item you want to destroy.  Does not remove it from the output
    *        queue.
    */
-  _destroyItem: function WCF__destroyItem(aItem)
+  _destroyItem: function WCF__destroyItem(item)
   {
     // TODO: handle object releasing in a more elegant way once all console
     // messages use the new API - bug 778766.
-    let [category, methodOrNode, args] = aItem;
+    let [category, methodOrNode, args] = item;
     if (typeof methodOrNode != "function" && methodOrNode._objectActors) {
       for (let actor of methodOrNode._objectActors) {
         this._releaseObject(actor);
       }
       methodOrNode._objectActors.clear();
     }
 
     if (methodOrNode == this.output._flushMessageQueue &&
@@ -2353,19 +2355,19 @@ WebConsoleFrame.prototype = {
       }
       if (connectionId && this.webConsoleClient.hasNetworkRequest(connectionId)) {
         this.webConsoleClient.removeNetworkRequest(connectionId);
         this._releaseObject(connectionId);
       }
     }
     else if (category == CATEGORY_WEBDEV &&
              methodOrNode == this.logConsoleAPIMessage) {
-      args[0].arguments.forEach((aValue) => {
-        if (WebConsoleUtils.isActorGrip(aValue)) {
-          this._releaseObject(aValue.actor);
+      args[0].arguments.forEach((value) => {
+        if (WebConsoleUtils.isActorGrip(value)) {
+          this._releaseObject(value.actor);
         }
       });
     }
     else if (category == CATEGORY_JS &&
              methodOrNode == this.reportPageError) {
       let pageError = args[1];
       for (let prop of ["errorMessage", "lineText"]) {
         let grip = pageError[prop];
@@ -2378,110 +2380,110 @@ WebConsoleFrame.prototype = {
              methodOrNode == this._reportLogMessage) {
       if (WebConsoleUtils.isActorGrip(args[0].message)) {
         this._releaseObject(args[0].message.actor);
       }
     }
   },
 
   /**
-   * Ensures that the number of message nodes of type aCategory don't exceed that
+   * Ensures that the number of message nodes of type category don't exceed that
    * category's line limit by removing old messages as needed.
    *
-   * @param integer aCategory
+   * @param integer category
    *        The category of message nodes to prune if needed.
    * @return number
    *         The number of removed nodes.
    */
-  pruneOutputIfNecessary: function WCF_pruneOutputIfNecessary(aCategory)
+  pruneOutputIfNecessary: function WCF_pruneOutputIfNecessary(category)
   {
-    let logLimit = Utils.logLimitForCategory(aCategory);
+    let logLimit = Utils.logLimitForCategory(category);
     let messageNodes = this.outputNode.querySelectorAll(".message[category=" +
-                       CATEGORY_CLASS_FRAGMENTS[aCategory] + "]");
+                       CATEGORY_CLASS_FRAGMENTS[category] + "]");
     let n = Math.max(0, messageNodes.length - logLimit);
     [...messageNodes].slice(0, n).forEach(this.removeOutputMessage, this);
     return n;
   },
 
   /**
    * Remove a given message from the output.
    *
-   * @param nsIDOMNode aNode
+   * @param nsIDOMNode node
    *        The message node you want to remove.
    */
-  removeOutputMessage: function WCF_removeOutputMessage(aNode)
+  removeOutputMessage: function WCF_removeOutputMessage(node)
   {
-    if (aNode._messageObject) {
-      aNode._messageObject.destroy();
-    }
-
-    if (aNode._objectActors) {
-      for (let actor of aNode._objectActors) {
+    if (node._messageObject) {
+      node._messageObject.destroy();
+    }
+
+    if (node._objectActors) {
+      for (let actor of node._objectActors) {
         this._releaseObject(actor);
       }
-      aNode._objectActors.clear();
-    }
-
-    if (aNode.category == CATEGORY_CSS ||
-        aNode.category == CATEGORY_SECURITY) {
-      let repeatNode = aNode.getElementsByClassName("message-repeats")[0];
+      node._objectActors.clear();
+    }
+
+    if (node.category == CATEGORY_CSS ||
+        node.category == CATEGORY_SECURITY) {
+      let repeatNode = node.getElementsByClassName("message-repeats")[0];
       if (repeatNode && repeatNode._uid) {
         delete this._repeatNodes[repeatNode._uid];
       }
     }
-    else if (aNode._connectionId &&
-             aNode.category == CATEGORY_NETWORK) {
-      this.webConsoleClient.removeNetworkRequest(aNode._connectionId);
-      this._releaseObject(aNode._connectionId);
-    }
-    else if (aNode.classList.contains("inlined-variables-view")) {
-      let view = aNode._variablesView;
+    else if (node._connectionId &&
+             node.category == CATEGORY_NETWORK) {
+      this.webConsoleClient.removeNetworkRequest(node._connectionId);
+      this._releaseObject(node._connectionId);
+    }
+    else if (node.classList.contains("inlined-variables-view")) {
+      let view = node._variablesView;
       if (view) {
         view.controller.releaseActors();
       }
-      aNode._variablesView = null;
-    }
-
-    aNode.remove();
+      node._variablesView = null;
+    }
+
+    node.remove();
   },
 
   /**
    * Given a category and message body, creates a DOM node to represent an
    * incoming message. The timestamp is automatically added.
    *
-   * @param number aCategory
+   * @param number category
    *        The category of the message: one of the CATEGORY_* constants.
-   * @param number aSeverity
+   * @param number severity
    *        The severity of the message: one of the SEVERITY_* constants;
-   * @param string|nsIDOMNode aBody
+   * @param string|nsIDOMNode body
    *        The body of the message, either a simple string or a DOM node.
-   * @param string aSourceURL [optional]
+   * @param string sourceURL [optional]
    *        The URL of the source file that emitted the error.
-   * @param number aSourceLine [optional]
+   * @param number sourceLine [optional]
    *        The line number on which the error occurred. If zero or omitted,
    *        there is no line number associated with this message.
-   * @param string aClipboardText [optional]
+   * @param string clipboardText [optional]
    *        The text that should be copied to the clipboard when this node is
-   *        copied. If omitted, defaults to the body text. If `aBody` is not
+   *        copied. If omitted, defaults to the body text. If `body` is not
    *        a string, then the clipboard text must be supplied.
-   * @param number aLevel [optional]
+   * @param number level [optional]
    *        The level of the console API message.
-   * @param number aTimeStamp [optional]
+   * @param number timestamp [optional]
    *        The timestamp to use for this message node. If omitted, the current
    *        date and time is used.
    * @return nsIDOMNode
    *         The message node: a DIV ready to be inserted into the Web Console
    *         output node.
    */
   createMessageNode:
-  function WCF_createMessageNode(aCategory, aSeverity, aBody, aSourceURL,
-                                 aSourceLine, aClipboardText, aLevel, aTimeStamp)
+  function WCF_createMessageNode(category, severity, body, sourceURL,
+                                 sourceLine, clipboardText, level, timestamp)
   {
-    if (typeof aBody != "string" && aClipboardText == null && aBody.innerText) {
-      aClipboardText = aBody.innerText;
+    if (typeof body != "string" && clipboardText == null && body.innerText) {
+      clipboardText = body.innerText;
     }
 
     let indentNode = this.document.createElementNS(XHTML_NS, "span");
     indentNode.className = "indent";
 
     // Apply the current group by indenting appropriately.
     let indent = this.groupDepth * GROUP_INDENT;
     indentNode.style.width = indent + "px";
@@ -2492,93 +2494,93 @@ WebConsoleFrame.prototype = {
     let iconContainer = this.document.createElementNS(XHTML_NS, "span");
     iconContainer.className = "icon";
 
     // Create the message body, which contains the actual text of the message.
     let bodyNode = this.document.createElementNS(XHTML_NS, "span");
     bodyNode.className = "message-body-wrapper message-body devtools-monospace";
 
     // Store the body text, since it is needed later for the variables view.
-    let body = aBody;
+    let storedBody = body;
     // If a string was supplied for the body, turn it into a DOM node and an
     // associated clipboard string now.
-    aClipboardText = aClipboardText ||
-                     (aBody + (aSourceURL ? " @ " + aSourceURL : "") +
-                              (aSourceLine ? ":" + aSourceLine : ""));
-
-    let timestamp = aTimeStamp || Date.now();
+    clipboardText = clipboardText ||
+                     (body + (sourceURL ? " @ " + sourceURL : "") +
+                              (sourceLine ? ":" + sourceLine : ""));
+
+    timestamp = timestamp || Date.now();
 
     // Create the containing node and append all its elements to it.
     let node = this.document.createElementNS(XHTML_NS, "div");
     node.id = "console-msg-" + gSequenceId();
     node.className = "message";
-    node.clipboardText = aClipboardText;
+    node.clipboardText = clipboardText;
     node.timestamp = timestamp;
-    this.setMessageType(node, aCategory, aSeverity);
-
-    if (aBody instanceof Ci.nsIDOMNode) {
-      bodyNode.appendChild(aBody);
+    this.setMessageType(node, category, severity);
+
+    if (body instanceof Ci.nsIDOMNode) {
+      bodyNode.appendChild(body);
     }
     else {
       let str = undefined;
-      if (aLevel == "dir") {
-        str = VariablesView.getString(aBody.arguments[0]);
+      if (level == "dir") {
+        str = VariablesView.getString(body.arguments[0]);
       }
       else {
-        str = aBody;
+        str = body;
       }
 
       if (str !== undefined) {
-        aBody = this.document.createTextNode(str);
-        bodyNode.appendChild(aBody);
+        body = this.document.createTextNode(str);
+        bodyNode.appendChild(body);
       }
     }
 
     // Add the message repeats node only when needed.
     let repeatNode = null;
-    if (aCategory != CATEGORY_INPUT &&
-        aCategory != CATEGORY_OUTPUT &&
-        aCategory != CATEGORY_NETWORK &&
-        !(aCategory == CATEGORY_CSS && aSeverity == SEVERITY_LOG)) {
+    if (category != CATEGORY_INPUT &&
+        category != CATEGORY_OUTPUT &&
+        category != CATEGORY_NETWORK &&
+        !(category == CATEGORY_CSS && severity == SEVERITY_LOG)) {
       repeatNode = this.document.createElementNS(XHTML_NS, "span");
       repeatNode.setAttribute("value", "1");
       repeatNode.className = "message-repeats";
       repeatNode.textContent = 1;
-      repeatNode._uid = [bodyNode.textContent, aCategory, aSeverity, aLevel,
-                         aSourceURL, aSourceLine].join(":");
+      repeatNode._uid = [bodyNode.textContent, category, severity, level,
+                         sourceURL, sourceLine].join(":");
     }
 
     // Create the timestamp.
     let timestampNode = this.document.createElementNS(XHTML_NS, "span");
     timestampNode.className = "timestamp devtools-monospace";
 
     let timestampString = l10n.timestampString(timestamp);
     timestampNode.textContent = timestampString + " ";
 
     // Create the source location (e.g. www.example.com:6) that sits on the
     // right side of the message, if applicable.
     let locationNode;
-    if (aSourceURL && IGNORED_SOURCE_URLS.indexOf(aSourceURL) == -1) {
-      locationNode = this.createLocationNode({url: aSourceURL,
-                                              line: aSourceLine});
+    if (sourceURL && IGNORED_SOURCE_URLS.indexOf(sourceURL) == -1) {
+      locationNode = this.createLocationNode({url: sourceURL,
+                                              line: sourceLine});
     }
 
     node.appendChild(timestampNode);
     node.appendChild(indentNode);
     node.appendChild(iconContainer);
 
     // Display the variables view after the message node.
-    if (aLevel == "dir") {
+    if (level == "dir") {
       let options = {
-        objectActor: body.arguments[0],
+        objectActor: storedBody.arguments[0],
         targetElement: bodyNode,
         hideFilterInput: true,
       };
-      this.jsterm.openVariablesView(options).then((aView) => {
-        node._variablesView = aView;
+      this.jsterm.openVariablesView(options).then((view) => {
+        node._variablesView = view;
         if (node.classList.contains("hidden-message")) {
           node.classList.remove("hidden-message");
         }
       });
 
       node.classList.add("inlined-variables-view");
     }
 
@@ -2595,24 +2597,24 @@ WebConsoleFrame.prototype = {
   },
 
   /**
    * Creates the anchor that displays the textual location of an incoming
    * message.
    *
    * @param object aLocation
    *        An object containing url, line and column number of the message source (destructured).
-   * @param string aTarget [optional]
+   * @param string target [optional]
    *        Tells which tool to open the link with, on click. Supported tools:
    *        jsdebugger, styleeditor, scratchpad.
    * @return nsIDOMNode
    *         The new anchor element, ready to be added to the message node.
    */
   createLocationNode:
-  function WCF_createLocationNode({url, line, column}, aTarget)
+  function WCF_createLocationNode({url, line, column}, target)
   {
     if (!url) {
       url = "";
     }
     let locationNode = this.document.createElementNS(XHTML_NS, "a");
     let filenameNode = this.document.createElementNS(XHTML_NS, "span");
 
     // Create the text, which consists of an abbreviated version of the URL
@@ -2632,18 +2634,18 @@ WebConsoleFrame.prototype = {
     }
 
     filenameNode.className = "filename";
     filenameNode.textContent = " " + (filename || l10n.getStr("unknownLocation"));
     locationNode.appendChild(filenameNode);
 
     locationNode.href = isScratchpad || !fullURL ? "#" : fullURL;
     locationNode.draggable = false;
-    if (aTarget) {
-      locationNode.target = aTarget;
+    if (target) {
+      locationNode.target = target;
     }
     locationNode.setAttribute("title", url);
     locationNode.className = "message-location theme-link devtools-monospace";
 
     // Make the location clickable.
     let onClick = () => {
       let target = locationNode.target;
       if (target == "scratchpad" || isScratchpad) {
@@ -2677,210 +2679,210 @@ WebConsoleFrame.prototype = {
     }
 
     return locationNode;
   },
 
   /**
    * Adjusts the category and severity of the given message.
    *
-   * @param nsIDOMNode aMessageNode
+   * @param nsIDOMNode messageNode
    *        The message node to alter.
-   * @param number aCategory
+   * @param number category
    *        The category for the message; one of the CATEGORY_ constants.
-   * @param number aSeverity
+   * @param number severity
    *        The severity for the message; one of the SEVERITY_ constants.
    * @return void
    */
   setMessageType:
-  function WCF_setMessageType(aMessageNode, aCategory, aSeverity)
+  function WCF_setMessageType(messageNode, category, severity)
   {
-    aMessageNode.category = aCategory;
-    aMessageNode.severity = aSeverity;
-    aMessageNode.setAttribute("category", CATEGORY_CLASS_FRAGMENTS[aCategory]);
-    aMessageNode.setAttribute("severity", SEVERITY_CLASS_FRAGMENTS[aSeverity]);
-    aMessageNode.setAttribute("filter", MESSAGE_PREFERENCE_KEYS[aCategory][aSeverity]);
+    messageNode.category = category;
+    messageNode.severity = severity;
+    messageNode.setAttribute("category", CATEGORY_CLASS_FRAGMENTS[category]);
+    messageNode.setAttribute("severity", SEVERITY_CLASS_FRAGMENTS[severity]);
+    messageNode.setAttribute("filter", MESSAGE_PREFERENCE_KEYS[category][severity]);
   },
 
   /**
    * Add the mouse event handlers needed to make a link.
    *
    * @private
-   * @param nsIDOMNode aNode
+   * @param nsIDOMNode node
    *        The node for which you want to add the event handlers.
-   * @param function aCallback
+   * @param function callback
    *        The function you want to invoke on click.
    */
-  _addMessageLinkCallback: function WCF__addMessageLinkCallback(aNode, aCallback)
+  _addMessageLinkCallback: function WCF__addMessageLinkCallback(node, callback)
   {
-    aNode.addEventListener("mousedown", (aEvent) => {
+    node.addEventListener("mousedown", (event) => {
       this._mousedown = true;
-      this._startX = aEvent.clientX;
-      this._startY = aEvent.clientY;
+      this._startX = event.clientX;
+      this._startY = event.clientY;
     }, false);
 
-    aNode.addEventListener("click", (aEvent) => {
+    node.addEventListener("click", (event) => {
       let mousedown = this._mousedown;
       this._mousedown = false;
 
-      aEvent.preventDefault();
+      event.preventDefault();
 
       // Do not allow middle/right-click or 2+ clicks.
-      if (aEvent.detail != 1 || aEvent.button != 0) {
+      if (event.detail != 1 || event.button != 0) {
         return;
       }
 
       // If this event started with a mousedown event and it ends at a different
       // location, we consider this text selection.
       if (mousedown &&
-          (this._startX != aEvent.clientX) &&
-          (this._startY != aEvent.clientY))
+          (this._startX != event.clientX) &&
+          (this._startY != event.clientY))
       {
         this._startX = this._startY = undefined;
         return;
       }
 
       this._startX = this._startY = undefined;
 
-      aCallback.call(this, aEvent);
+      callback.call(this, event);
     }, false);
   },
 
-  _addFocusCallback: function WCF__addFocusCallback(aNode, aCallback)
+  _addFocusCallback: function WCF__addFocusCallback(node, callback)
   {
-    aNode.addEventListener("mousedown", (aEvent) => {
+    node.addEventListener("mousedown", (event) => {
       this._mousedown = true;
-      this._startX = aEvent.clientX;
-      this._startY = aEvent.clientY;
+      this._startX = event.clientX;
+      this._startY = event.clientY;
     }, false);
 
-    aNode.addEventListener("click", (aEvent) => {
+    node.addEventListener("click", (event) => {
       let mousedown = this._mousedown;
       this._mousedown = false;
 
       // Do not allow middle/right-click or 2+ clicks.
-      if (aEvent.detail != 1 || aEvent.button != 0) {
+      if (event.detail != 1 || event.button != 0) {
         return;
       }
 
       // If this event started with a mousedown event and it ends at a different
       // location, we consider this text selection.
       // Add a fuzz modifier of two pixels in any direction to account for sloppy
       // clicking.
       if (mousedown &&
-          (Math.abs(aEvent.clientX - this._startX) >= 2) &&
-          (Math.abs(aEvent.clientY - this._startY) >= 1))
+          (Math.abs(event.clientX - this._startX) >= 2) &&
+          (Math.abs(event.clientY - this._startY) >= 1))
       {
         this._startX = this._startY = undefined;
         return;
       }
 
       this._startX = this._startY = undefined;
 
-      aCallback.call(this, aEvent);
+      callback.call(this, event);
     }, false);
   },
 
   /**
    * Handler for the pref-changed event coming from the toolbox.
    * Currently this function only handles the timestamps preferences.
    *
    * @private
-   * @param object aEvent
+   * @param object event
    *        This parameter is a string that holds the event name
    *        pref-changed in this case.
-   * @param object aData
+   * @param object data
    *        This is the pref-changed data object.
   */
-  _onToolboxPrefChanged: function WCF__onToolboxPrefChanged(aEvent, aData)
+  _onToolboxPrefChanged: function WCF__onToolboxPrefChanged(event, data)
   {
-    if (aData.pref == PREF_MESSAGE_TIMESTAMP) {
-      if (aData.newValue) {
+    if (data.pref == PREF_MESSAGE_TIMESTAMP) {
+      if (data.newValue) {
         this.outputNode.classList.remove("hideTimestamps");
       }
       else {
         this.outputNode.classList.add("hideTimestamps");
       }
     }
   },
 
   /**
    * Copies the selected items to the system clipboard.
    *
-   * @param object aOptions
+   * @param object options
    *        - linkOnly:
    *        An optional flag to copy only URL without timestamp and
    *        other meta-information. Default is false.
    *        - contextmenu:
    *        An optional flag to copy the last clicked item which brought
    *        up the context menu if nothing is selected. Default is false.
    */
-  copySelectedItems: function WCF_copySelectedItems(aOptions)
+  copySelectedItems: function WCF_copySelectedItems(options)
   {
-    aOptions = aOptions || { linkOnly: false, contextmenu: false };
+    options = options || { linkOnly: false, contextmenu: false };
 
     // Gather up the selected items and concatenate their clipboard text.
     let strings = [];
 
     let children = this.output.getSelectedMessages();
-    if (!children.length && aOptions.contextmenu) {
+    if (!children.length && options.contextmenu) {
       children = [this._contextMenuHandler.lastClickedMessage];
     }
 
     for (let item of children) {
       // Ensure the selected item hasn't been filtered by type or string.
       if (!item.classList.contains("filtered-by-type") &&
           !item.classList.contains("filtered-by-string")) {
         let timestampString = l10n.timestampString(item.timestamp);
-        if (aOptions.linkOnly) {
+        if (options.linkOnly) {
           strings.push(item.url);
         }
         else {
           strings.push(item.clipboardText);
         }
       }
     }
 
     clipboardHelper.copyString(strings.join("\n"));
   },
 
   /**
    * Object properties provider. This function gives you the properties of the
    * remote object you want.
    *
-   * @param string aActor
+   * @param string actor
    *        The object actor ID from which you want the properties.
-   * @param function aCallback
+   * @param function callback
    *        Function you want invoked once the properties are received.
    */
   objectPropertiesProvider:
-  function WCF_objectPropertiesProvider(aActor, aCallback)
+  function WCF_objectPropertiesProvider(actor, callback)
   {
-    this.webConsoleClient.inspectObjectProperties(aActor,
-      function(aResponse) {
-        if (aResponse.error) {
+    this.webConsoleClient.inspectObjectProperties(actor,
+      function(response) {
+        if (response.error) {
           Cu.reportError("Failed to retrieve the object properties from the " +
-                         "server. Error: " + aResponse.error);
+                         "server. Error: " + response.error);
           return;
         }
-        aCallback(aResponse.properties);
+        callback(response.properties);
       });
   },
 
   /**
    * Release an actor.
    *
    * @private
-   * @param string aActor
+   * @param string actor
    *        The actor ID you want to release.
    */
-  _releaseObject: function WCF__releaseObject(aActor)
+  _releaseObject: function WCF__releaseObject(actor)
   {
     if (this.proxy) {
-      this.proxy.releaseActor(aActor);
+      this.proxy.releaseActor(actor);
     }
   },
 
   /**
    * Open the selected item's URL in a new tab.
    */
   openSelectedItemInTab: function WCF_openSelectedItemInTab()
   {
@@ -2959,53 +2961,53 @@ WebConsoleFrame.prototype = {
     return this._destroyer.promise;
   },
 };
 
 
 /**
  * @see VariablesView.simpleValueEvalMacro
  */
-function simpleValueEvalMacro(aItem, aCurrentString)
+function simpleValueEvalMacro(item, currentString)
 {
-  return VariablesView.simpleValueEvalMacro(aItem, aCurrentString, "_self");
+  return VariablesView.simpleValueEvalMacro(item, currentString, "_self");
 };
 
 
 /**
  * @see VariablesView.overrideValueEvalMacro
  */
-function overrideValueEvalMacro(aItem, aCurrentString)
+function overrideValueEvalMacro(item, currentString)
 {
-  return VariablesView.overrideValueEvalMacro(aItem, aCurrentString, "_self");
+  return VariablesView.overrideValueEvalMacro(item, currentString, "_self");
 };
 
 
 /**
  * @see VariablesView.getterOrSetterEvalMacro
  */
-function getterOrSetterEvalMacro(aItem, aCurrentString)
+function getterOrSetterEvalMacro(item, currentString)
 {
-  return VariablesView.getterOrSetterEvalMacro(aItem, aCurrentString, "_self");
+  return VariablesView.getterOrSetterEvalMacro(item, currentString, "_self");
 }
 
 
 
 /**
  * Create a JSTerminal (a JavaScript command line). This is attached to an
  * existing HeadsUpDisplay (a Web Console instance). This code is responsible
  * with handling command line input, code evaluation and result output.
  *
  * @constructor
- * @param object aWebConsoleFrame
+ * @param object webConsoleFrame
  *        The WebConsoleFrame object that owns this JSTerm instance.
  */
-function JSTerm(aWebConsoleFrame)
+function JSTerm(webConsoleFrame)
 {
-  this.hud = aWebConsoleFrame;
+  this.hud = webConsoleFrame;
   this.hudId = this.hud.hudId;
   this.inputHistoryCount = Services.prefs.getIntPref(PREF_INPUT_HISTORY_COUNT);
 
   this.lastCompletion = { value: null };
   this._loadHistory();
 
   this._objectActorsInVariablesViews = new Map();
 
@@ -3236,55 +3238,55 @@ JSTerm.prototype = {
       inputNode.focus();
     }
   },
 
   /**
    * The JavaScript evaluation response handler.
    *
    * @private
-   * @param object [aAfterMessage]
+   * @param object [afterMessage]
    *        Optional message after which the evaluation result will be
    *        inserted.
-   * @param function [aCallback]
+   * @param function [callback]
    *        Optional function to invoke when the evaluation result is added to
    *        the output.
-   * @param object aResponse
+   * @param object response
    *        The message received from the server.
    */
   _executeResultCallback:
-  function JST__executeResultCallback(aAfterMessage, aCallback, aResponse)
+  function JST__executeResultCallback(afterMessage, callback, response)
   {
     if (!this.hud) {
       return;
     }
-    if (aResponse.error) {
-      Cu.reportError("Evaluation error " + aResponse.error + ": " +
-                     aResponse.message);
+    if (response.error) {
+      Cu.reportError("Evaluation error " + response.error + ": " +
+                     response.message);
       return;
     }
-    let errorMessage = aResponse.exceptionMessage;
-    let result = aResponse.result;
-    let helperResult = aResponse.helperResult;
+    let errorMessage = response.exceptionMessage;
+    let result = response.result;
+    let helperResult = response.helperResult;
     let helperHasRawOutput = !!(helperResult || {}).rawOutput;
 
     if (helperResult && helperResult.type) {
       switch (helperResult.type) {
         case "clearOutput":
           this.clearOutput();
           break;
         case "clearHistory":
           this.clearHistory();
           break;
         case "inspectObject":
-          if (aAfterMessage) {
-            if (!aAfterMessage._objectActors) {
-              aAfterMessage._objectActors = new Set();
+          if (afterMessage) {
+            if (!afterMessage._objectActors) {
+              afterMessage._objectActors = new Set();
             }
-            aAfterMessage._objectActors.add(helperResult.object.actor);
+            afterMessage._objectActors.add(helperResult.object.actor);
           }
           this.openVariablesView({
             label: VariablesView.getString(helperResult.object, { concise: true }),
             objectActor: helperResult.object,
           });
           break;
         case "error":
           try {
@@ -3302,120 +3304,120 @@ JSTerm.prototype = {
           break;
       }
     }
 
     // Hide undefined results coming from JSTerm helper functions.
     if (!errorMessage && result && typeof result == "object" &&
         result.type == "undefined" &&
         helperResult && !helperHasRawOutput) {
-      aCallback && aCallback();
+      callback && callback();
       return;
     }
 
-    let msg = new Messages.JavaScriptEvalOutput(aResponse, errorMessage);
+    let msg = new Messages.JavaScriptEvalOutput(response, errorMessage);
     this.hud.output.addMessage(msg);
 
-    if (aCallback) {
+    if (callback) {
       let oldFlushCallback = this.hud._flushCallback;
       this.hud._flushCallback = () => {
-        aCallback(msg.element);
+        callback(msg.element);
         if (oldFlushCallback) {
           oldFlushCallback();
           this.hud._flushCallback = oldFlushCallback;
           return true;
         }
 
         return false;
       };
     }
 
-    msg._afterMessage = aAfterMessage;
+    msg._afterMessage = afterMessage;
     msg._objectActors = new Set();
 
-    if (WebConsoleUtils.isActorGrip(aResponse.exception)) {
-      msg._objectActors.add(aResponse.exception.actor);
+    if (WebConsoleUtils.isActorGrip(response.exception)) {
+      msg._objectActors.add(response.exception.actor);
     }
 
     if (WebConsoleUtils.isActorGrip(result)) {
       msg._objectActors.add(result.actor);
     }
   },
 
   /**
    * Execute a string. Execution happens asynchronously in the content process.
    *
-   * @param string [aExecuteString]
+   * @param string [executeString]
    *        The string you want to execute. If this is not provided, the current
    *        user input is used - taken from |this.inputNode.value|.
-   * @param function [aCallback]
+   * @param function [callback]
    *        Optional function to invoke when the result is displayed.
    *        This is deprecated - please use the promise return value instead.
    * @returns Promise
    *          Resolves with the message once the result is displayed.
    */
-  execute: function JST_execute(aExecuteString, aCallback)
+  execute: function JST_execute(executeString, callback)
   {
     let deferred = promise.defer();
-    let callback = function(msg) {
+    let resultCallback = function(msg) {
       deferred.resolve(msg);
-      if (aCallback) {
-        aCallback(msg);
+      if (callback) {
+        callback(msg);
       }
     }
 
     // attempt to execute the content of the inputNode
-    aExecuteString = aExecuteString || this.inputNode.value;
-    if (!aExecuteString) {
+    executeString = executeString || this.inputNode.value;
+    if (!executeString) {
       return;
     }
 
     let selectedNodeActor = null;
     let inspectorSelection = this.hud.owner.getInspectorSelection();
     if (inspectorSelection && inspectorSelection.nodeFront) {
       selectedNodeActor = inspectorSelection.nodeFront.actorID;
     }
 
-    let message = new Messages.Simple(aExecuteString, {
+    let message = new Messages.Simple(executeString, {
       category: "input",
       severity: "log",
     });
     this.hud.output.addMessage(message);
-    let onResult = this._executeResultCallback.bind(this, message, callback);
+    let onResult = this._executeResultCallback.bind(this, message, resultCallback);
 
     let options = {
       frame: this.SELECTED_FRAME,
       selectedNodeActor: selectedNodeActor,
     };
 
-    this.requestEvaluation(aExecuteString, options).then(onResult, onResult);
+    this.requestEvaluation(executeString, options).then(onResult, onResult);
 
     // Append a new value in the history of executed code, or overwrite the most
     // recent entry. The most recent entry may contain the last edited input
     // value that was not evaluated yet.
-    this.history[this.historyIndex++] = aExecuteString;
+    this.history[this.historyIndex++] = executeString;
     this.historyPlaceHolder = this.history.length;
 
     if (this.history.length > this.inputHistoryCount) {
       this.history.splice(0, this.history.length - this.inputHistoryCount);
       this.historyIndex = this.historyPlaceHolder = this.history.length;
     }
     this.storeHistory();
     WebConsoleUtils.usageCount++;
     this.setInputValue("");
     this.clearCompletion();
     return deferred.promise;
   },
 
   /**
    * Request a JavaScript string evaluation from the server.
    *
-   * @param string aString
+   * @param string str
    *        String to execute.
-   * @param object [aOptions]
+   * @param object [options]
    *        Options for evaluation:
    *        - bindObjectActor: tells the ObjectActor ID for which you want to do
    *        the evaluation. The Debugger.Object of the OA will be bound to
    *        |_self| during evaluation, such that it's usable in the string you
    *        execute.
    *        - frame: tells the stackframe depth to evaluate the string in. If
    *        the jsdebugger is paused, you can pick the stackframe to be used for
    *        evaluation. Use |this.SELECTED_FRAME| to always pick the
@@ -3424,75 +3426,75 @@ JSTerm.prototype = {
    *        global content window.
    *        - selectedNodeActor: tells the NodeActor ID of the current selection in
    *        the Inspector, if such a selection exists. This is used by helper
    *        functions that can evaluate on the current selection.
    * @return object
    *         A promise object that is resolved when the server response is
    *         received.
    */
-  requestEvaluation: function JST_requestEvaluation(aString, aOptions = {})
+  requestEvaluation: function JST_requestEvaluation(str, options = {})
   {
     let deferred = promise.defer();
 
-    function onResult(aResponse) {
-      if (!aResponse.error) {
-        deferred.resolve(aResponse);
+    function onResult(response) {
+      if (!response.error) {
+        deferred.resolve(response);
       }
       else {
-        deferred.reject(aResponse);
+        deferred.reject(response);
       }
     }
 
     let frameActor = null;
-    if ("frame" in aOptions) {
-      frameActor = this.getFrameActor(aOptions.frame);
+    if ("frame" in options) {
+      frameActor = this.getFrameActor(options.frame);
     }
 
     let evalOptions = {
-      bindObjectActor: aOptions.bindObjectActor,
+      bindObjectActor: options.bindObjectActor,
       frameActor: frameActor,
-      selectedNodeActor: aOptions.selectedNodeActor,
-      selectedObjectActor: aOptions.selectedObjectActor,
+      selectedNodeActor: options.selectedNodeActor,
+      selectedObjectActor: options.selectedObjectActor,
     };
 
-    this.webConsoleClient.evaluateJSAsync(aString, onResult, evalOptions);
+    this.webConsoleClient.evaluateJSAsync(str, onResult, evalOptions);
     return deferred.promise;
   },
 
   /**
    * Retrieve the FrameActor ID given a frame depth.
    *
-   * @param number aFrame
+   * @param number frame
    *        Frame depth.
    * @return string|null
    *         The FrameActor ID for the given frame depth.
    */
-  getFrameActor: function JST_getFrameActor(aFrame)
+  getFrameActor: function JST_getFrameActor(frame)
   {
     let state = this.hud.owner.getDebuggerFrames();
     if (!state) {
       return null;
     }
 
     let grip;
-    if (aFrame == this.SELECTED_FRAME) {
+    if (frame == this.SELECTED_FRAME) {
       grip = state.frames[state.selected];
     }
     else {
-      grip = state.frames[aFrame];
+      grip = state.frames[frame];
     }
 
     return grip ? grip.actor : null;
   },
 
   /**
    * Opens a new variables view that allows the inspection of the given object.
    *
-   * @param object aOptions
+   * @param object options
    *        Options for the variables view:
    *        - objectActor: grip of the ObjectActor you want to show in the
    *        variables view.
    *        - rawObject: the raw object you want to show in the variables view.
    *        - label: label to display in the variables view for inspected
    *        object.
    *        - hideFilterInput: optional boolean, |true| if you want to hide the
    *        variables view filter input.
@@ -3500,60 +3502,60 @@ JSTerm.prototype = {
    *        to. An iframe element is used as a container for the view. If this
    *        option is not used, then the variables view opens in the sidebar.
    *        - autofocus: optional boolean, |true| if you want to give focus to
    *        the variables view window after open, |false| otherwise.
    * @return object
    *         A promise object that is resolved when the variables view has
    *         opened. The new variables view instance is given to the callbacks.
    */
-  openVariablesView: function JST_openVariablesView(aOptions)
+  openVariablesView: function JST_openVariablesView(options)
   {
-    let onContainerReady = (aWindow) => {
-      let container = aWindow.document.querySelector("#variables");
+    let onContainerReady = (window) => {
+      let container = window.document.querySelector("#variables");
       let view = this._variablesView;
-      if (!view || aOptions.targetElement) {
+      if (!view || options.targetElement) {
         let viewOptions = {
           container: container,
-          hideFilterInput: aOptions.hideFilterInput,
+          hideFilterInput: options.hideFilterInput,
         };
         view = this._createVariablesView(viewOptions);
-        if (!aOptions.targetElement) {
+        if (!options.targetElement) {
           this._variablesView = view;
-          aWindow.addEventListener("keypress", this._onKeypressInVariablesView);
+          window.addEventListener("keypress", this._onKeypressInVariablesView);
         }
       }
-      aOptions.view = view;
-      this._updateVariablesView(aOptions);
-
-      if (!aOptions.targetElement && aOptions.autofocus) {
-        aWindow.focus();
+      options.view = view;
+      this._updateVariablesView(options);
+
+      if (!options.targetElement && options.autofocus) {
+        window.focus();
       }
 
-      this.emit("variablesview-open", view, aOptions);
+      this.emit("variablesview-open", view, options);
       return view;
     };
 
     let openPromise;
-    if (aOptions.targetElement) {
+    if (options.targetElement) {
       let deferred = promise.defer();
       openPromise = deferred.promise;
-      let document = aOptions.targetElement.ownerDocument;
+      let document = options.targetElement.ownerDocument;
       let iframe = document.createElementNS(XHTML_NS, "iframe");
 
-      iframe.addEventListener("load", function onIframeLoad(aEvent) {
+      iframe.addEventListener("load", function onIframeLoad(event) {
         iframe.removeEventListener("load", onIframeLoad, true);
         iframe.style.visibility = "visible";
         deferred.resolve(iframe.contentWindow);
       }, true);
 
       iframe.flex = 1;
       iframe.style.visibility = "hidden";
       iframe.setAttribute("src", VARIABLES_VIEW_URL);
-      aOptions.targetElement.appendChild(iframe);
+      options.targetElement.appendChild(iframe);
     }
     else {
       if (!this.sidebar) {
         this._createSidebar();
       }
       openPromise = this._addVariablesViewSidebarTab();
     }
 
@@ -3607,299 +3609,299 @@ JSTerm.prototype = {
     return deferred.promise;
   },
 
   /**
    * The keypress event handler for the Variables View sidebar. Currently this
    * is used for removing the sidebar when Escape is pressed.
    *
    * @private
-   * @param nsIDOMEvent aEvent
+   * @param nsIDOMEvent event
    *        The keypress DOM event object.
    */
-  _onKeypressInVariablesView: function JST__onKeypressInVariablesView(aEvent)
+  _onKeypressInVariablesView: function JST__onKeypressInVariablesView(event)
   {
-    let tag = aEvent.target.nodeName;
-    if (aEvent.keyCode != Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE || aEvent.shiftKey ||
-        aEvent.altKey || aEvent.ctrlKey || aEvent.metaKey ||
+    let tag = event.target.nodeName;
+    if (event.keyCode != Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE || event.shiftKey ||
+        event.altKey || event.ctrlKey || event.metaKey ||
         ["input", "textarea", "select", "textbox"].indexOf(tag) > -1) {
         return;
     }
 
     this._sidebarDestroy();
     this.inputNode.focus();
-    aEvent.stopPropagation();
+    event.stopPropagation();
   },
 
   /**
    * Create a variables view instance.
    *
    * @private
-   * @param object aOptions
+   * @param object options
    *        Options for the new Variables View instance:
    *        - container: the DOM element where the variables view is inserted.
    *        - hideFilterInput: boolean, if true the variables filter input is
    *        hidden.
    * @return object
    *         The new Variables View instance.
    */
-  _createVariablesView: function JST__createVariablesView(aOptions)
+  _createVariablesView: function JST__createVariablesView(options)
   {
-    let view = new VariablesView(aOptions.container);
+    let view = new VariablesView(options.container);
     view.toolbox = gDevTools.getToolbox(this.hud.owner.target);
     view.searchPlaceholder = l10n.getStr("propertiesFilterPlaceholder");
     view.emptyText = l10n.getStr("emptyPropertiesList");
-    view.searchEnabled = !aOptions.hideFilterInput;
+    view.searchEnabled = !options.hideFilterInput;
     view.lazyEmpty = this._lazyVariablesView;
 
     VariablesViewController.attach(view, {
-      getEnvironmentClient: aGrip => {
-        return new EnvironmentClient(this.hud.proxy.client, aGrip);
+      getEnvironmentClient: grip => {
+        return new EnvironmentClient(this.hud.proxy.client, grip);
       },
-      getObjectClient: aGrip => {
-        return new ObjectClient(this.hud.proxy.client, aGrip);
+      getObjectClient: grip => {
+        return new ObjectClient(this.hud.proxy.client, grip);
       },
-      getLongStringClient: aGrip => {
-        return this.webConsoleClient.longString(aGrip);
+      getLongStringClient: grip => {
+        return this.webConsoleClient.longString(grip);
       },
-      releaseActor: aActor => {
-        this.hud._releaseObject(aActor);
+      releaseActor: actor => {
+        this.hud._releaseObject(actor);
       },
       simpleValueEvalMacro: simpleValueEvalMacro,
       overrideValueEvalMacro: overrideValueEvalMacro,
       getterOrSetterEvalMacro: getterOrSetterEvalMacro,
     });
 
     // Relay events from the VariablesView.
-    view.on("fetched", (aEvent, aType, aVar) => {
-      this.emit("variablesview-fetched", aVar);
+    view.on("fetched", (event, type, variableObject) => {
+      this.emit("variablesview-fetched", variableObject);
     });
 
     return view;
   },
 
   /**
    * Update the variables view.
    *
    * @private
-   * @param object aOptions
+   * @param object options
    *        Options for updating the variables view:
    *        - view: the view you want to update.
    *        - objectActor: the grip of the new ObjectActor you want to show in
    *        the view.
    *        - rawObject: the new raw object you want to show.
    *        - label: the new label for the inspected object.
    */
-  _updateVariablesView: function JST__updateVariablesView(aOptions)
+  _updateVariablesView: function JST__updateVariablesView(options)
   {
-    let view = aOptions.view;
+    let view = options.view;
     view.empty();
 
     // We need to avoid pruning the object inspection starting point.
     // That one is pruned when the console message is removed.
-    view.controller.releaseActors(aActor => {
-      return view._consoleLastObjectActor != aActor;
+    view.controller.releaseActors(actor => {
+      return view._consoleLastObjectActor != actor;
     });
 
-    if (aOptions.objectActor &&
+    if (options.objectActor &&
         (!this.hud.owner._browserConsole ||
          Services.prefs.getBoolPref("devtools.chrome.enabled"))) {
       // Make sure eval works in the correct context.
-      view.eval = this._variablesViewEvaluate.bind(this, aOptions);
-      view.switch = this._variablesViewSwitch.bind(this, aOptions);
-      view.delete = this._variablesViewDelete.bind(this, aOptions);
+      view.eval = this._variablesViewEvaluate.bind(this, options);
+      view.switch = this._variablesViewSwitch.bind(this, options);
+      view.delete = this._variablesViewDelete.bind(this, options);
     }
     else {
       view.eval = null;
       view.switch = null;
       view.delete = null;
     }
 
-    let { variable, expanded } = view.controller.setSingleVariable(aOptions);
+    let { variable, expanded } = view.controller.setSingleVariable(options);
     variable.evaluationMacro = simpleValueEvalMacro;
 
-    if (aOptions.objectActor) {
-      view._consoleLastObjectActor = aOptions.objectActor.actor;
-    }
-    else if (aOptions.rawObject) {
+    if (options.objectActor) {
+      view._consoleLastObjectActor = options.objectActor.actor;
+    }
+    else if (options.rawObject) {
       view._consoleLastObjectActor = null;
     }
     else {
       throw new Error("Variables View cannot open without giving it an object " +
                       "display.");
     }
 
     expanded.then(() => {
-      this.emit("variablesview-updated", view, aOptions);
+      this.emit("variablesview-updated", view, options);
     });
   },
 
   /**
    * The evaluation function used by the variables view when editing a property
    * value.
    *
    * @private
-   * @param object aOptions
+   * @param object options
    *        The options used for |this._updateVariablesView()|.
-   * @param object aVar
+   * @param object variableObject
    *        The Variable object instance for the edited property.
-   * @param string aValue
+   * @param string value
    *        The value the edited property was changed to.
    */
   _variablesViewEvaluate:
-  function JST__variablesViewEvaluate(aOptions, aVar, aValue)
+  function JST__variablesViewEvaluate(options, variableObject, value)
   {
-    let updater = this._updateVariablesView.bind(this, aOptions);
+    let updater = this._updateVariablesView.bind(this, options);
     let onEval = this._silentEvalCallback.bind(this, updater);
-    let string = aVar.evaluationMacro(aVar, aValue);
+    let string = variableObject.evaluationMacro(variableObject, value);
 
     let evalOptions = {
       frame: this.SELECTED_FRAME,
-      bindObjectActor: aOptions.objectActor.actor,
+      bindObjectActor: options.objectActor.actor,
     };
 
     this.requestEvaluation(string, evalOptions).then(onEval, onEval);
   },
 
   /**
    * The property deletion function used by the variables view when a property
    * is deleted.
    *
    * @private
-   * @param object aOptions
+   * @param object options
    *        The options used for |this._updateVariablesView()|.
-   * @param object aVar
+   * @param object variableObject
    *        The Variable object instance for the deleted property.
    */
-  _variablesViewDelete: function JST__variablesViewDelete(aOptions, aVar)
+  _variablesViewDelete: function JST__variablesViewDelete(options, variableObject)
   {
     let onEval = this._silentEvalCallback.bind(this, null);
 
     let evalOptions = {
       frame: this.SELECTED_FRAME,
-      bindObjectActor: aOptions.objectActor.actor,
+      bindObjectActor: options.objectActor.actor,
     };
 
-    this.requestEvaluation("delete _self" + aVar.symbolicName, evalOptions)
+    this.requestEvaluation("delete _self" + variableObject.symbolicName, evalOptions)
         .then(onEval, onEval);
   },
 
   /**
    * The property rename function used by the variables view when a property
    * is renamed.
    *
    * @private
-   * @param object aOptions
+   * @param object options
    *        The options used for |this._updateVariablesView()|.
-   * @param object aVar
+   * @param object variableObject
    *        The Variable object instance for the renamed property.
-   * @param string aNewName
+   * @param string newName
    *        The new name for the property.
    */
   _variablesViewSwitch:
-  function JST__variablesViewSwitch(aOptions, aVar, aNewName)
+  function JST__variablesViewSwitch(options, variableObject, newName)
   {
-    let updater = this._updateVariablesView.bind(this, aOptions);
+    let updater = this._updateVariablesView.bind(this, options);
     let onEval = this._silentEvalCallback.bind(this, updater);
 
     let evalOptions = {
       frame: this.SELECTED_FRAME,
-      bindObjectActor: aOptions.objectActor.actor,
+      bindObjectActor: options.objectActor.actor,
     };
 
-    let newSymbolicName = aVar.ownerView.symbolicName + '["' + aNewName + '"]';
-    if (newSymbolicName == aVar.symbolicName) {
+    let newSymbolicName = variableObject.ownerView.symbolicName + '["' + newName + '"]';
+    if (newSymbolicName == variableObject.symbolicName) {
       return;
     }
 
-    let code = "_self" + newSymbolicName + " = _self" + aVar.symbolicName + ";" +
-               "delete _self" + aVar.symbolicName;
+    let code = "_self" + newSymbolicName + " = _self" + variableObject.symbolicName + ";" +
+               "delete _self" + variableObject.symbolicName;
 
     this.requestEvaluation(code, evalOptions).then(onEval, onEval);
   },
 
   /**
    * A noop callback for JavaScript evaluation. This method releases any
    * result ObjectActors that come from the server for evaluation requests. This
    * is used for editing, renaming and deleting properties in the variables
    * view.
    *
    * Exceptions are displayed in the output.
    *
    * @private
-   * @param function aCallback
+   * @param function callback
    *        Function to invoke once the response is received.
-   * @param object aResponse
+   * @param object response
    *        The response packet received from the server.
    */
-  _silentEvalCallback: function JST__silentEvalCallback(aCallback, aResponse)
+  _silentEvalCallback: function JST__silentEvalCallback(callback, response)
   {
-    if (aResponse.error) {
-      Cu.reportError("Web Console evaluation failed. " + aResponse.error + ":" +
-                     aResponse.message);
-
-      aCallback && aCallback(aResponse);
+    if (response.error) {
+      Cu.reportError("Web Console evaluation failed. " + response.error + ":" +
+                     response.message);
+
+      callback && callback(response);
       return;
     }
 
-    if (aResponse.exceptionMessage) {
-      let message = new Messages.Simple(aResponse.exceptionMessage, {
+    if (response.exceptionMessage) {
+      let message = new Messages.Simple(response.exceptionMessage, {
         category: "output",
         severity: "error",
-        timestamp: aResponse.timestamp,
+        timestamp: response.timestamp,
       });
       this.hud.output.addMessage(message);
       message._objectActors = new Set();
-      if (WebConsoleUtils.isActorGrip(aResponse.exception)) {
-        message._objectActors.add(aResponse.exception.actor);
+      if (WebConsoleUtils.isActorGrip(response.exception)) {
+        message._objectActors.add(response.exception.actor);
       }
     }
 
-    let helper = aResponse.helperResult || { type: null };
+    let helper = response.helperResult || { type: null };
     let helperGrip = null;
     if (helper.type == "inspectObject") {
       helperGrip = helper.object;
     }
 
-    let grips = [aResponse.result, helperGrip];
+    let grips = [response.result, helperGrip];
     for (let grip of grips) {
       if (WebConsoleUtils.isActorGrip(grip)) {
         this.hud._releaseObject(grip.actor);
       }
     }
 
-    aCallback && aCallback(aResponse);
+    callback && callback(response);
   },
 
 
   /**
    * Clear the Web Console output.
    *
    * This method emits the "messages-cleared" notification.
    *
-   * @param boolean aClearStorage
+   * @param boolean clearStorage
    *        True if you want to clear the console messages storage associated to
    *        this Web Console.
    */
-  clearOutput: function JST_clearOutput(aClearStorage)
+  clearOutput: function JST_clearOutput(clearStorage)
   {
     let hud = this.hud;
     let outputNode = hud.outputNode;
     let node;
     while ((node = outputNode.firstChild)) {
       hud.removeOutputMessage(node);
     }
 
     hud.groupDepth = 0;
     hud._outputQueue.forEach(hud._destroyItem, hud);
     hud._outputQueue = [];
     this.webConsoleClient.clearNetworkRequests();
     hud._repeatNodes = {};
 
-    if (aClearStorage) {
+    if (clearStorage) {
       this.webConsoleClient.clearMessagesCache();
     }
 
     this._sidebarDestroy();
 
     this.emit("messages-cleared");
   },
 
@@ -3937,24 +3939,24 @@ JSTerm.prototype = {
     }
   },
 
   /**
    * Sets the value of the input field (command line), and resizes the field to
    * fit its contents. This method is preferred over setting "inputNode.value"
    * directly, because it correctly resizes the field.
    *
-   * @param string aNewValue
+   * @param string newValue
    *        The new value to set.
    * @returns void
    */
-  setInputValue: function JST_setInputValue(aNewValue)
+  setInputValue: function JST_setInputValue(newValue)
   {
-    this.inputNode.value = aNewValue;
-    this.lastInputValue = aNewValue;
+    this.inputNode.value = newValue;
+    this.lastInputValue = newValue;
     this.completeNode.value = "";
     this.resizeInput();
     this._inputChanged = true;
     this.emit("set-input-value");
   },
 
   /**
    * The inputNode "input" and "keyup" event handler.
@@ -3980,25 +3982,25 @@ JSTerm.prototype = {
       this.clearCompletion();
     }
   },
 
   /**
    * The inputNode "keypress" event handler.
    *
    * @private
-   * @param nsIDOMEvent aEvent
+   * @param nsIDOMEvent event
    */
-  _keyPress: function JST__keyPress(aEvent)
+  _keyPress: function JST__keyPress(event)
   {
     let inputNode = this.inputNode;
     let inputUpdated = false;
 
-    if (aEvent.ctrlKey) {
-      switch (aEvent.charCode) {
+    if (event.ctrlKey) {
+      switch (event.charCode) {
         case 101:
           // control-e
           if (Services.appinfo.OS == "WINNT") {
             break;
           }
           let lineEndPos = inputNode.value.length;
           if (this.hasMultilineInput()) {
             // find index of closest newline >= cursor
@@ -4006,117 +4008,117 @@ JSTerm.prototype = {
               if (inputNode.value.charAt(i) == "\r" ||
                   inputNode.value.charAt(i) == "\n") {
                 lineEndPos = i;
                 break;
               }
             }
           }
           inputNode.setSelectionRange(lineEndPos, lineEndPos);
-          aEvent.preventDefault();
+          event.preventDefault();
           this.clearCompletion();
           break;
 
         case 110:
           // Control-N differs from down arrow: it ignores autocomplete state.
           // Note that we preserve the default 'down' navigation within
           // multiline text.
           if (Services.appinfo.OS == "Darwin" &&
               this.canCaretGoNext() &&
               this.historyPeruse(HISTORY_FORWARD)) {
-            aEvent.preventDefault();
+            event.preventDefault();
             // Ctrl-N is also used to focus the Network category button on MacOSX.
             // The preventDefault() call doesn't prevent the focus from moving
             // away from the input.
             inputNode.focus();
           }
           this.clearCompletion();
           break;
 
         case 112:
           // Control-P differs from up arrow: it ignores autocomplete state.
           // Note that we preserve the default 'up' navigation within
           // multiline text.
           if (Services.appinfo.OS == "Darwin" &&
               this.canCaretGoPrevious() &&
               this.historyPeruse(HISTORY_BACK)) {
-            aEvent.preventDefault();
+            event.preventDefault();
             // Ctrl-P may also be used to focus some category button on MacOSX.
             // The preventDefault() call doesn't prevent the focus from moving
             // away from the input.
             inputNode.focus();
           }
           this.clearCompletion();
           break;
         default:
           break;
       }
       return;
     }
-    else if (aEvent.shiftKey &&
-        aEvent.keyCode == Ci.nsIDOMKeyEvent.DOM_VK_RETURN) {
+    else if (event.shiftKey &&
+        event.keyCode == Ci.nsIDOMKeyEvent.DOM_VK_RETURN) {
       // shift return
       // TODO: expand the inputNode height by one line
       return;
     }
 
-    switch (aEvent.keyCode) {
+    switch (event.keyCode) {
       case Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE:
         if (this.autocompletePopup.isOpen) {
           this.clearCompletion();
-          aEvent.preventDefault();
-          aEvent.stopPropagation();
+          event.preventDefault();
+          event.stopPropagation();
         }
         else if (this.sidebar) {
           this._sidebarDestroy();
-          aEvent.preventDefault();
-          aEvent.stopPropagation();
+          event.preventDefault();
+          event.stopPropagation();
         }
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_RETURN:
         if (this._autocompletePopupNavigated &&
             this.autocompletePopup.isOpen &&
             this.autocompletePopup.selectedIndex > -1) {
           this.acceptProposedCompletion();
         }
         else {
           this.execute();
           this._inputChanged = false;
         }
-        aEvent.preventDefault();
+        event.preventDefault();
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_UP:
         if (this.autocompletePopup.isOpen) {
           inputUpdated = this.complete(this.COMPLETE_BACKWARD);
           if (inputUpdated) {
             this._autocompletePopupNavigated = true;
           }
         }
         else if (this.canCaretGoPrevious()) {
           inputUpdated = this.historyPeruse(HISTORY_BACK);
         }
         if (inputUpdated) {
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_DOWN:
         if (this.autocompletePopup.isOpen) {
           inputUpdated = this.complete(this.COMPLETE_FORWARD);
           if (inputUpdated) {
             this._autocompletePopupNavigated = true;
           }
         }
         else if (this.canCaretGoNext()) {
           inputUpdated = this.historyPeruse(HISTORY_FORWARD);
         }
         if (inputUpdated) {
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_PAGE_UP:
         if (this.autocompletePopup.isOpen) {
           inputUpdated = this.complete(this.COMPLETE_PAGEUP);
           if (inputUpdated) {
             this._autocompletePopupNavigated = true;
@@ -4124,53 +4126,53 @@ JSTerm.prototype = {
         }
         else {
           this.hud.outputNode.parentNode.scrollTop =
             Math.max(0,
               this.hud.outputNode.parentNode.scrollTop -
               this.hud.outputNode.parentNode.clientHeight
             );
         }
-        aEvent.preventDefault();
+        event.preventDefault();
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_PAGE_DOWN:
         if (this.autocompletePopup.isOpen) {
           inputUpdated = this.complete(this.COMPLETE_PAGEDOWN);
           if (inputUpdated) {
             this._autocompletePopupNavigated = true;
           }
         }
         else {
           this.hud.outputNode.parentNode.scrollTop =
             Math.min(this.hud.outputNode.parentNode.scrollHeight,
               this.hud.outputNode.parentNode.scrollTop +
               this.hud.outputNode.parentNode.clientHeight
             );
         }
-        aEvent.preventDefault();
+        event.preventDefault();
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_HOME:
         if (this.autocompletePopup.isOpen) {
           this.autocompletePopup.selectedIndex = 0;
-          aEvent.preventDefault();
+          event.preventDefault();
         } else if (this.inputNode.value.length <= 0) {
           this.hud.outputNode.parentNode.scrollTop = 0;
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_END:
         if (this.autocompletePopup.isOpen) {
           this.autocompletePopup.selectedIndex = this.autocompletePopup.itemCount - 1;
-          aEvent.preventDefault();
+          event.preventDefault();
         } else if (this.inputNode.value.length <= 0) {
           this.hud.outputNode.parentNode.scrollTop = this.hud.outputNode.parentNode.scrollHeight;
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         break;
 
       case Ci.nsIDOMKeyEvent.DOM_VK_LEFT:
         if (this.autocompletePopup.isOpen || this.lastCompletion.value) {
           this.clearCompletion();
         }
         break;
@@ -4182,33 +4184,33 @@ JSTerm.prototype = {
                              this.inputNode.value.length;
         let haveSuggestion = this.autocompletePopup.isOpen ||
                              this.lastCompletion.value;
         let useCompletion = cursorAtTheEnd || this._autocompletePopupNavigated;
         if (haveSuggestion && useCompletion &&
             this.complete(this.COMPLETE_HINT_ONLY) &&
             this.lastCompletion.value &&
             this.acceptProposedCompletion()) {
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         if (this.autocompletePopup.isOpen) {
           this.clearCompletion();
         }
         break;
       }
       case Ci.nsIDOMKeyEvent.DOM_VK_TAB:
         // Generate a completion and accept the first proposed value.
         if (this.complete(this.COMPLETE_HINT_ONLY) &&
             this.lastCompletion &&
             this.acceptProposedCompletion()) {
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         else if (this._inputChanged) {
           this.updateCompleteNode(l10n.getStr("Autocomplete.blank"));
-          aEvent.preventDefault();
+          event.preventDefault();
         }
         break;
       default:
         break;
     }
   },
 
   /**
@@ -4218,47 +4220,47 @@ JSTerm.prototype = {
   _focusEventHandler: function JST__focusEventHandler()
   {
     this._inputChanged = false;
   },
 
   /**
    * Go up/down the history stack of input values.
    *
-   * @param number aDirection
+   * @param number direction
    *        History navigation direction: HISTORY_BACK or HISTORY_FORWARD.
    *
    * @returns boolean
    *          True if the input value changed, false otherwise.
    */
-  historyPeruse: function JST_historyPeruse(aDirection)
+  historyPeruse: function JST_historyPeruse(direction)
   {
     if (!this.history.length) {
       return false;
     }
 
     // Up Arrow key
-    if (aDirection == HISTORY_BACK) {
+    if (direction == HISTORY_BACK) {
       if (this.historyPlaceHolder <= 0) {
         return false;
       }
       let inputVal = this.history[--this.historyPlaceHolder];
 
       // Save the current input value as the latest entry in history, only if
       // the user is already at the last entry.
       // Note: this code does not store changes to items that are already in
       // history.
       if (this.historyPlaceHolder+1 == this.historyIndex) {
         this.history[this.historyIndex] = this.inputNode.value || "";
       }
 
       this.setInputValue(inputVal);
     }
     // Down Arrow key
-    else if (aDirection == HISTORY_FORWARD) {
+    else if (direction == HISTORY_FORWARD) {
       if (this.historyPlaceHolder >= (this.history.length-1)) {
         return false;
       }
 
       let inputVal = this.history[++this.historyPlaceHolder];
       this.setInputValue(inputVal);
     }
     else {
@@ -4321,17 +4323,17 @@ JSTerm.prototype = {
            node.selectionStart == 0 && !multiline;
   },
 
   /**
    * Completes the current typed text in the inputNode. Completion is performed
    * only if the selection/cursor is at the end of the string. If no completion
    * is found, the current inputNode value and cursor/selection stay.
    *
-   * @param int aType possible values are
+   * @param int type possible values are
    *    - this.COMPLETE_FORWARD: If there is more than one possible completion
    *          and the input value stayed the same compared to the last time this
    *          function was called, then the next completion of all possible
    *          completions is used. If the value changed, then the first possible
    *          completion is used and the selection is set from the current
    *          cursor position to the end of the completed text.
    *          If there is only one possible completion, then this completion
    *          value is used and the cursor is put at the end of the completion.
@@ -4343,87 +4345,87 @@ JSTerm.prototype = {
    *    - this.COMPLETE_PAGEDOWN: Scroll down one page if available or select the
    *          last item.
    *    - this.COMPLETE_HINT_ONLY: If there is more than one possible
    *          completion and the input value stayed the same compared to the
    *          last time this function was called, then the same completion is
    *          used again. If there is only one possible completion, then
    *          the inputNode.value is set to this value and the selection is set
    *          from the current cursor position to the end of the completed text.
-   * @param function aCallback
+   * @param function callback
    *        Optional function invoked when the autocomplete properties are
    *        updated.
    * @returns boolean true if there existed a completion for the current input,
    *          or false otherwise.
    */
-  complete: function JSTF_complete(aType, aCallback)
+  complete: function JSTF_complete(type, callback)
   {
     let inputNode = this.inputNode;
     let inputValue = inputNode.value;
     let frameActor = this.getFrameActor(this.SELECTED_FRAME);
 
     // If the inputNode has no value, then don't try to complete on it.
     if (!inputValue) {
       this.clearCompletion();
-      aCallback && aCallback(this);
+      callback && callback(this);
       this.emit("autocomplete-updated");
       return false;
     }
 
     // Only complete if the selection is empty.
     if (inputNode.selectionStart != inputNode.selectionEnd) {
       this.clearCompletion();
-      aCallback && aCallback(this);
+      callback && callback(this);
       this.emit("autocomplete-updated");
       return false;
     }
 
     // Update the completion results.
     if (this.lastCompletion.value != inputValue || frameActor != this._lastFrameActorId) {
-      this._updateCompletionResult(aType, aCallback);
+      this._updateCompletionResult(type, callback);
       return false;
     }
 
     let popup = this.autocompletePopup;
     let accepted = false;
 
-    if (aType != this.COMPLETE_HINT_ONLY && popup.itemCount == 1) {
+    if (type != this.COMPLETE_HINT_ONLY && popup.itemCount == 1) {
       this.acceptProposedCompletion();
       accepted = true;
     }
-    else if (aType == this.COMPLETE_BACKWARD) {
+    else if (type == this.COMPLETE_BACKWARD) {
       popup.selectPreviousItem();
     }
-    else if (aType == this.COMPLETE_FORWARD) {
+    else if (type == this.COMPLETE_FORWARD) {
       popup.selectNextItem();
     }
-    else if (aType == this.COMPLETE_PAGEUP) {
+    else if (type == this.COMPLETE_PAGEUP) {
       popup.selectPreviousPageItem();
     }
-    else if (aType == this.COMPLETE_PAGEDOWN) {
+    else if (type == this.COMPLETE_PAGEDOWN) {
       popup.selectNextPageItem();
     }
 
-    aCallback && aCallback(this);
+    callback && callback(this);
     this.emit("autocomplete-updated");
     return accepted || popup.itemCount > 0;
   },
 
   /**
    * Update the completion result. This operation is performed asynchronously by
    * fetching updated results from the content process.
    *
    * @private
-   * @param int aType
+   * @param int type
    *        Completion type. See this.complete() for details.
-   * @param function [aCallback]
+   * @param function [callback]
    *        Optional, function to invoke when completion results are received.
    */
   _updateCompletionResult:
-  function JST__updateCompletionResult(aType, aCallback)
+  function JST__updateCompletionResult(type, callback)
   {
     let frameActor = this.getFrameActor(this.SELECTED_FRAME);
     if (this.lastCompletion.value == this.inputNode.value && frameActor == this._lastFrameActorId) {
       return;
     }
 
     let requestId = gSequenceId();
     let cursor = this.inputNode.selectionStart;
@@ -4452,81 +4454,81 @@ JSTerm.prototype = {
       }
 
       let newList = cache.sort().filter(function(l) {
         return l.startsWith(filterBy);
       });
 
       this.lastCompletion = {
         requestId: null,
-        completionType: aType,
+        completionType: type,
         value: null,
       };
 
       let response = { matches: newList, matchProp: filterBy };
-      this._receiveAutocompleteProperties(null, aCallback, response);
+      this._receiveAutocompleteProperties(null, callback, response);
       return;
     }
 
     this._lastFrameActorId = frameActor;
 
     this.lastCompletion = {
       requestId: requestId,
-      completionType: aType,
+      completionType: type,
       value: null,
     };
 
-    let callback = this._receiveAutocompleteProperties.bind(this, requestId,
-                                                            aCallback);
-
-    this.webConsoleClient.autocomplete(input, cursor, callback, frameActor);
+    let autocompleteCallback = this._receiveAutocompleteProperties.bind(this, requestId,
+                                                            callback);
+
+    this.webConsoleClient.autocomplete(input, cursor, autocompleteCallback, frameActor);
   },
 
   /**
    * Handler for the autocompletion results. This method takes
    * the completion result received from the server and updates the UI
    * accordingly.
    *
-   * @param number aRequestId
+   * @param number requestId
    *        Request ID.
-   * @param function [aCallback=null]
+   * @param function [callback=null]
    *        Optional, function to invoke when the completion result is received.
-   * @param object aMessage
+   * @param object message
    *        The JSON message which holds the completion results received from
    *        the content process.
    */
   _receiveAutocompleteProperties:
-  function JST__receiveAutocompleteProperties(aRequestId, aCallback, aMessage)
+  function JST__receiveAutocompleteProperties(requestId, callback, message)
   {
     let inputNode = this.inputNode;
     let inputValue = inputNode.value;
     if (this.lastCompletion.value == inputValue ||
-        aRequestId != this.lastCompletion.requestId) {
+        requestId != this.lastCompletion.requestId) {
       return;
     }
     // Cache whatever came from the server if the last char is alphanumeric or '.'
     let cursor = inputNode.selectionStart;
     let inputUntilCursor = inputValue.substring(0, cursor);
 
-    if (aRequestId != null && /[a-zA-Z0-9.]$/.test(inputUntilCursor)) {
-      this._autocompleteCache = aMessage.matches;
+    if (requestId != null && /[a-zA-Z0-9.]$/.test(inputUntilCursor)) {
+      this._autocompleteCache = message.matches;
       this._autocompleteQuery = inputUntilCursor;
     }
 
-    let matches = aMessage.matches;
-    let lastPart = aMessage.matchProp;
+    let matches = message.matches;
+    let lastPart = message.matchProp;
     if (!matches.length) {
       this.clearCompletion();
-      aCallback && aCallback(this);
+      callback && callback(this);
       this.emit("autocomplete-updated");
       return;
     }
 
-    let items = matches.reverse().map(function(aMatch) {
-      return { preLabel: lastPart, label: aMatch };
+    let items = matches.reverse().map(function(match) {
+      return { preLabel: lastPart, label: match };
     });
 
     let popup = this.autocompletePopup;
     popup.setItems(items);
 
     let completionType = this.lastCompletion.completionType;
     this.lastCompletion = {
       value: inputValue,
@@ -4556,17 +4558,17 @@ JSTerm.prototype = {
     }
     else if (completionType == this.COMPLETE_BACKWARD) {
       popup.selectPreviousItem();
     }
     else if (completionType == this.COMPLETE_FORWARD) {
       popup.selectNextItem();
     }
 
-    aCallback && aCallback(this);
+    callback && callback(this);
     this.emit("autocomplete-updated");
   },
 
   onAutocompleteSelect: function JSTF_onAutocompleteSelect()
   {
     // Render the suggestion only if the cursor is at the end of the input.
     if (this.inputNode.selectionStart != this.inputNode.value.length) {
       return;
@@ -4624,24 +4626,24 @@ JSTerm.prototype = {
     this.clearCompletion();
 
     return updated;
   },
 
   /**
    * Update the node that displays the currently selected autocomplete proposal.
    *
-   * @param string aSuffix
+   * @param string suffix
    *        The proposed suffix for the inputNode value.
    */
-  updateCompleteNode: function JSTF_updateCompleteNode(aSuffix)
+  updateCompleteNode: function JSTF_updateCompleteNode(suffix)
   {
     // completion prefix = input, with non-control chars replaced by spaces
-    let prefix = aSuffix ? this.inputNode.value.replace(/[\S]/g, " ") : "";
-    this.completeNode.value = prefix + aSuffix;
+    let prefix = suffix ? this.inputNode.value.replace(/[\S]/g, " ") : "";
+    this.completeNode.value = prefix + suffix;
   },
 
 
   /**
    * Destroy the sidebar.
    * @private
    */
   _sidebarDestroy: function JST__sidebarDestroy()
@@ -4697,54 +4699,54 @@ JSTerm.prototype = {
 
 /**
  * Utils: a collection of globally used functions.
  */
 var Utils = {
   /**
    * Scrolls a node so that it's visible in its containing element.
    *
-   * @param nsIDOMNode aNode
+   * @param nsIDOMNode node
    *        The node to make visible.
    * @returns void
    */
-  scrollToVisible: function Utils_scrollToVisible(aNode)
+  scrollToVisible: function Utils_scrollToVisible(node)
   {
-    aNode.scrollIntoView(false);
+    node.scrollIntoView(false);
   },
 
   /**
    * Check if the given output node is scrolled to the bottom.
    *
-   * @param nsIDOMNode aOutputNode
+   * @param nsIDOMNode outputNode
    * @return boolean
    *         True if the output node is scrolled to the bottom, or false
    *         otherwise.
    */
-  isOutputScrolledToBottom: function Utils_isOutputScrolledToBottom(aOutputNode)
+  isOutputScrolledToBottom: function Utils_isOutputScrolledToBottom(outputNode)
   {
-    let lastNodeHeight = aOutputNode.lastChild ?
-                         aOutputNode.lastChild.clientHeight : 0;
-    let scrollNode = aOutputNode.parentNode;
+    let lastNodeHeight = outputNode.lastChild ?
+                         outputNode.lastChild.clientHeight : 0;
+    let scrollNode = outputNode.parentNode;
     return scrollNode.scrollTop + scrollNode.clientHeight >=
            scrollNode.scrollHeight - lastNodeHeight / 2;
   },
 
   /**
    * Determine the category of a given nsIScriptError.
    *
-   * @param nsIScriptError aScriptError
+   * @param nsIScriptError scriptError
    *        The script error you want to determine the category for.
    * @return CATEGORY_JS|CATEGORY_CSS|CATEGORY_SECURITY
    *         Depending on the script error CATEGORY_JS, CATEGORY_CSS, or
    *         CATEGORY_SECURITY can be returned.
    */
-  categoryForScriptError: function Utils_categoryForScriptError(aScriptError)
+  categoryForScriptError: function Utils_categoryForScriptError(scriptError)
   {
-    let category = aScriptError.category;
+    let category = scriptError.category;
 
     if (/^(?:CSS|Layout)\b/.test(category)) {
       return CATEGORY_CSS;
     }
 
     switch (category) {
       case "Mixed Content Blocker":
       case "Mixed Content Message":
@@ -4763,28 +4765,28 @@ var Utils = {
       default:
         return CATEGORY_JS;
     }
   },
 
   /**
    * Retrieve the limit of messages for a specific category.
    *
-   * @param number aCategory
+   * @param number category
    *        The category of messages you want to retrieve the limit for. See the
    *        CATEGORY_* constants.
    * @return number
    *         The number of messages allowed for the specific category.
    */
-  logLimitForCategory: function Utils_logLimitForCategory(aCategory)
+  logLimitForCategory: function Utils_logLimitForCategory(category)
   {
     let logLimit = DEFAULT_LOG_LIMIT;
 
     try {
-      let prefName = CATEGORY_CLASS_FRAGMENTS[aCategory];
+      let prefName = CATEGORY_CLASS_FRAGMENTS[category];
       logLimit = Services.prefs.getIntPref("devtools.hud.loglimit." + prefName);
       logLimit = Math.max(logLimit, 1);
     }
     catch (e) { }
 
     return logLimit;
   },
 };
@@ -4792,19 +4794,19 @@ var Utils = {
 ///////////////////////////////////////////////////////////////////////////////
 // CommandController
 ///////////////////////////////////////////////////////////////////////////////
 
 /**
  * A controller (an instance of nsIController) that makes editing actions
  * behave appropriately in the context of the Web Console.
  */
-function CommandController(aWebConsole)
+function CommandController(webConsole)
 {
-  this.owner = aWebConsole;
+  this.owner = webConsole;
 }
 
 CommandController.prototype = {
   /**
    * Selects all the text in the HUD output.
    */
   selectAll: function CommandController_selectAll()
   {
@@ -4827,27 +4829,27 @@ CommandController.prototype = {
   /**
    * Copies the last clicked message.
    */
   copyLastClicked: function CommandController_copy()
   {
     this.owner.copySelectedItems({ linkOnly: false, contextmenu: true });
   },
 
-  supportsCommand: function CommandController_supportsCommand(aCommand)
+  supportsCommand: function CommandController_supportsCommand(command)
   {
     if (!this.owner || !this.owner.output) {
       return false;
     }
-    return this.isCommandEnabled(aCommand);
+    return this.isCommandEnabled(command);
   },
 
-  isCommandEnabled: function CommandController_isCommandEnabled(aCommand)
+  isCommandEnabled: function CommandController_isCommandEnabled(command)
   {
-    switch (aCommand) {
+    switch (command) {
       case "consoleCmd_openURL":
       case "consoleCmd_copyURL": {
         // Only enable URL-related actions if node is Net Activity.
         let selectedItem = this.owner.output.getSelectedMessages(1)[0] ||
                            this.owner._contextMenuHandler.lastClickedMessage;
         return selectedItem && "url" in selectedItem;
       }
       case "cmd_copy": {
@@ -4864,19 +4866,19 @@ CommandController.prototype = {
       case "cmd_fontSizeReduce":
       case "cmd_fontSizeReset":
       case "cmd_close":
         return this.owner.owner._browserConsole;
     }
     return false;
   },
 
-  doCommand: function CommandController_doCommand(aCommand)
+  doCommand: function CommandController_doCommand(command)
   {
-    switch (aCommand) {
+    switch (command) {
       case "consoleCmd_openURL":
         this.openURL();
         break;
       case "consoleCmd_copyURL":
         this.copyURL();
         break;
       case "consoleCmd_clearOutput":
         this.owner.jsterm.clearOutput(true);
@@ -4910,25 +4912,25 @@ CommandController.prototype = {
 // Web Console connection proxy
 ///////////////////////////////////////////////////////////////////////////////
 
 /**
  * The WebConsoleConnectionProxy handles the connection between the Web Console
  * and the application we connect to through the remote debug protocol.
  *
  * @constructor
- * @param object aWebConsole
- *        The Web Console instance that owns this connection proxy.
- * @param RemoteTarget aTarget
+ * @param object webConsoleFrame
+ *        The WebConsoleFrame object that owns this connection proxy.
+ * @param RemoteTarget target
  *        The target that the console will connect to.
  */
-function WebConsoleConnectionProxy(aWebConsole, aTarget)
+function WebConsoleConnectionProxy(webConsoleFrame, target)
 {
-  this.owner = aWebConsole;
-  this.target = aTarget;
+  this.webConsoleFrame = webConsoleFrame;
+  this.target = target;
 
   this._onPageError = this._onPageError.bind(this);
   this._onLogMessage = this._onLogMessage.bind(this);
   this._onConsoleAPICall = this._onConsoleAPICall.bind(this);
   this._onNetworkEvent = this._onNetworkEvent.bind(this);
   this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
   this._onFileActivity = this._onFileActivity.bind(this);
   this._onReflowActivity = this._onReflowActivity.bind(this);
@@ -4937,22 +4939,22 @@ function WebConsoleConnectionProxy(aWebC
   this._onAttachConsole = this._onAttachConsole.bind(this);
   this._onCachedMessages = this._onCachedMessages.bind(this);
   this._connectionTimeout = this._connectionTimeout.bind(this);
   this._onLastPrivateContextExited = this._onLastPrivateContextExited.bind(this);
 }
 
 WebConsoleConnectionProxy.prototype = {
   /**
-   * The owning Web Console instance.
+   * The owning Web Console Frame instance.
    *
    * @see WebConsoleFrame
    * @type object
    */
-  owner: null,
+  webConsoleFrame: null,
 
   /**
    * The target that the console connects to.
    * @type RemoteTarget
    */
   target: null,
 
   /**
@@ -5045,17 +5047,17 @@ WebConsoleConnectionProxy.prototype = {
       client.addListener("lastPrivateContextExited", this._onLastPrivateContextExited);
     }
     this.target.on("will-navigate", this._onTabNavigated);
     this.target.on("navigate", this._onTabNavigated);
 
     this._consoleActor = this.target.form.consoleActor;
     if (this.target.isTabActor) {
       let tab = this.target.form;
-      this.owner.onLocationChange(tab.url, tab.title);
+      this.webConsoleFrame.onLocationChange(tab.url, tab.title);
     }
     this._attachConsole();
 
     return connPromise;
   },
 
   /**
    * Connection timeout handler.
@@ -5082,143 +5084,143 @@ WebConsoleConnectionProxy.prototype = {
     this.client.attachConsole(this._consoleActor, listeners,
                               this._onAttachConsole);
   },
 
   /**
    * The "attachConsole" response handler.
    *
    * @private
-   * @param object aResponse
+   * @param object response
    *        The JSON response object received from the server.
-   * @param object aWebConsoleClient
+   * @param object webConsoleClient
    *        The WebConsoleClient instance for the attached console, for the
    *        specific tab we work with.
    */
-  _onAttachConsole: function WCCP__onAttachConsole(aResponse, aWebConsoleClient)
+  _onAttachConsole: function WCCP__onAttachConsole(response, webConsoleClient)
   {
-    if (aResponse.error) {
-      Cu.reportError("attachConsole failed: " + aResponse.error + " " +
-                     aResponse.message);
-      this._connectDefer.reject(aResponse);
+    if (response.error) {
+      Cu.reportError("attachConsole failed: " + response.error + " " +
+                     response.message);
+      this._connectDefer.reject(response);
       return;
     }
 
-    this.webConsoleClient = aWebConsoleClient;
-
-    this._hasNativeConsoleAPI = aResponse.nativeConsoleAPI;
+    this.webConsoleClient = webConsoleClient;
+
+    this._hasNativeConsoleAPI = response.nativeConsoleAPI;
     this.webConsoleClient.on("networkEvent", this._onNetworkEvent);
     this.webConsoleClient.on("networkEventUpdate", this._onNetworkEventUpdate);
 
     let msgs = ["PageError", "ConsoleAPI"];
     this.webConsoleClient.getCachedMessages(msgs, this._onCachedMessages);
 
-    this.owner._onUpdateListeners();
+    this.webConsoleFrame._onUpdateListeners();
   },
 
   /**
    * The "cachedMessages" response handler.
    *
    * @private
-   * @param object aResponse
+   * @param object response
    *        The JSON response object received from the server.
    */
-  _onCachedMessages: function WCCP__onCachedMessages(aResponse)
+  _onCachedMessages: function WCCP__onCachedMessages(response)
   {
-    if (aResponse.error) {
-      Cu.reportError("Web Console getCachedMessages error: " + aResponse.error +
-                     " " + aResponse.message);
-      this._connectDefer.reject(aResponse);
+    if (response.error) {
+      Cu.reportError("Web Console getCachedMessages error: " + response.error +
+                     " " + response.message);
+      this._connectDefer.reject(response);
       return;
     }
 
     if (!this._connectTimer) {
       // This happens if the promise is rejected (eg. a timeout), but the
       // connection attempt is successful, nonetheless.
       Cu.reportError("Web Console getCachedMessages error: invalid state.");
     }
 
-    let messages = aResponse.messages.concat(...this.webConsoleClient.getNetworkEvents());
+    let messages = response.messages.concat(...this.webConsoleClient.getNetworkEvents());
     messages.sort((a, b) => a.timeStamp - b.timeStamp);
 
-    this.owner.displayCachedMessages(messages);
+    this.webConsoleFrame.displayCachedMessages(messages);
 
     if (!this._hasNativeConsoleAPI) {
-      this.owner.logWarningAboutReplacedAPI();
+      this.webConsoleFrame.logWarningAboutReplacedAPI();
     }
 
     this.connected = true;
     this._connectDefer.resolve(this);
   },
 
   /**
    * The "pageError" message type handler. We redirect any page errors to the UI
    * for displaying.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onPageError: function WCCP__onPageError(aType, aPacket)
+  _onPageError: function WCCP__onPageError(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handlePageError(aPacket.pageError);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handlePageError(packet.pageError);
     }
   },
 
   /**
    * The "logMessage" message type handler. We redirect any message to the UI
    * for displaying.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onLogMessage: function WCCP__onLogMessage(aType, aPacket)
+  _onLogMessage: function WCCP__onLogMessage(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handleLogMessage(aPacket);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handleLogMessage(packet);
     }
   },
 
   /**
    * The "consoleAPICall" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onConsoleAPICall: function WCCP__onConsoleAPICall(aType, aPacket)
+  _onConsoleAPICall: function WCCP__onConsoleAPICall(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handleConsoleAPICall(aPacket.message);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handleConsoleAPICall(packet.message);
     }
   },
 
   /**
    * The "networkEvent" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
    * @param string type
    *        Message type.
    * @param object networkInfo
    *        The network request information.
    */
   _onNetworkEvent: function(type, networkInfo)
   {
-    if (this.owner) {
-      this.owner.handleNetworkEvent(networkInfo);
+    if (this.webConsoleFrame) {
+      this.webConsoleFrame.handleNetworkEvent(networkInfo);
     }
   },
 
   /**
    * The "networkEventUpdate" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
@@ -5226,109 +5228,109 @@ WebConsoleConnectionProxy.prototype = {
    *        Message type.
    * @param object packet
    *        The message received from the server.
    * @param object networkInfo
    *        The network request information.
    */
   _onNetworkEventUpdate: function(type, { packet, networkInfo })
   {
-    if (this.owner) {
-      this.owner.handleNetworkEventUpdate(networkInfo, packet);
+    if (this.webConsoleFrame) {
+      this.webConsoleFrame.handleNetworkEventUpdate(networkInfo, packet);
     }
   },
 
   /**
    * The "fileActivity" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onFileActivity: function WCCP__onFileActivity(aType, aPacket)
+  _onFileActivity: function WCCP__onFileActivity(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handleFileActivity(aPacket.uri);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handleFileActivity(packet.uri);
     }
   },
 
-  _onReflowActivity: function WCCP__onReflowActivity(aType, aPacket)
+  _onReflowActivity: function WCCP__onReflowActivity(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handleReflowActivity(aPacket);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handleReflowActivity(packet);
     }
   },
 
   /**
    * The "serverLogCall" message type handler. We redirect any message to
    * the UI for displaying.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onServerLogCall: function WCCP__onServerLogCall(aType, aPacket)
+  _onServerLogCall: function WCCP__onServerLogCall(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.handleConsoleAPICall(aPacket.message);
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.handleConsoleAPICall(packet.message);
     }
   },
 
   /**
    * The "lastPrivateContextExited" message type handler. When this message is
    * received the Web Console UI is cleared.
    *
    * @private
-   * @param string aType
+   * @param string type
    *        Message type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
   _onLastPrivateContextExited:
-  function WCCP__onLastPrivateContextExited(aType, aPacket)
+  function WCCP__onLastPrivateContextExited(type, packet)
   {
-    if (this.owner && aPacket.from == this._consoleActor) {
-      this.owner.jsterm.clearPrivateMessages();
+    if (this.webConsoleFrame && packet.from == this._consoleActor) {
+      this.webConsoleFrame.jsterm.clearPrivateMessages();
     }
   },
 
   /**
    * The "will-navigate" and "navigate" event handlers. We redirect any message
    * to the UI for displaying.
    *
    * @private
-   * @param string aEvent
+   * @param string event
    *        Event type.
-   * @param object aPacket
+   * @param object packet
    *        The message received from the server.
    */
-  _onTabNavigated: function WCCP__onTabNavigated(aEvent, aPacket)
+  _onTabNavigated: function WCCP__onTabNavigated(event, packet)
   {
-    if (!this.owner) {
+    if (!this.webConsoleFrame) {
       return;
     }
 
-    this.owner.handleTabNavigated(aEvent, aPacket);
+    this.webConsoleFrame.handleTabNavigated(event, packet);
   },
 
   /**
    * Release an object actor.
    *
-   * @param string aActor
+   * @param string actor
    *        The actor ID to send the request to.
    */
-  releaseActor: function WCCP_releaseActor(aActor)
+  releaseActor: function WCCP_releaseActor(actor)
   {
     if (this.client) {
-      this.client.release(aActor);
+      this.client.release(actor);
     }
   },
 
   /**
    * Disconnect the Web Console from the remote server.
    *
    * @return object
    *         A promise object that is resolved when disconnect completes.
@@ -5357,17 +5359,17 @@ WebConsoleConnectionProxy.prototype = {
     this.webConsoleClient.off("networkEventUpdate", this._onNetworkEventUpdate);
     this.target.off("will-navigate", this._onTabNavigated);
     this.target.off("navigate", this._onTabNavigated);
 
     this.client = null;
     this.webConsoleClient = null;
     this.target = null;
     this.connected = false;
-    this.owner = null;
+    this.webConsoleFrame = null;
     this._disconnecter.resolve(null);
 
     return this._disconnecter.promise;
   },
 };
 
 function gSequenceId()
 {
@@ -5378,58 +5380,58 @@ gSequenceId.n = 0;
 ///////////////////////////////////////////////////////////////////////////////
 // Context Menu
 ///////////////////////////////////////////////////////////////////////////////
 
 /*
  * ConsoleContextMenu this used to handle the visibility of context menu items.
  *
  * @constructor
- * @param object aOwner
+ * @param object owner
  *        The WebConsoleFrame instance that owns this object.
  */
-function ConsoleContextMenu(aOwner)
+function ConsoleContextMenu(owner)
 {
-  this.owner = aOwner;
+  this.owner = owner;
   this.popup = this.owner.document.getElementById("output-contextmenu");
   this.build = this.build.bind(this);
   this.popup.addEventListener("popupshowing", this.build);
 }
 
 ConsoleContextMenu.prototype = {
   lastClickedMessage: null,
 
   /*
    * Handle to show/hide context menu item.
    */
-  build: function CCM_build(aEvent)
+  build: function CCM_build(event)
   {
-    let metadata = this.getSelectionMetadata(aEvent.rangeParent);
+    let metadata = this.getSelectionMetadata(event.rangeParent);
     for (let element of this.popup.children) {
       element.hidden = this.shouldHideMenuItem(element, metadata);
     }
   },
 
   /*
    * Get selection information from the view.
    *
-   * @param nsIDOMElement aClickElement
+   * @param nsIDOMElement clickElement
    *        The DOM element the user clicked on.
    * @return object
    *         Selection metadata.
    */
-  getSelectionMetadata: function CCM_getSelectionMetadata(aClickElement)
+  getSelectionMetadata: function CCM_getSelectionMetadata(clickElement)
   {
     let metadata = {
       selectionType: "",
       selection: new Set(),
     };
     let selectedItems = this.owner.output.getSelectedMessages();
     if (!selectedItems.length) {
-      let clickedItem = this.owner.output.getMessageForElement(aClickElement);
+      let clickedItem = this.owner.output.getMessageForElement(clickElement);
       if (clickedItem) {
         this.lastClickedMessage = clickedItem;
         selectedItems = [clickedItem];
       }
     }
 
     metadata.selectionType = selectedItems.length > 1 ? "multiple" : "single";
 
@@ -5455,36 +5457,36 @@ ConsoleContextMenu.prototype = {
     }
 
     return metadata;
   },
 
   /*
    * Determine if an item should be hidden.
    *
-   * @param nsIDOMElement aMenuItem
-   * @param object aMetadata
+   * @param nsIDOMElement menuItem
+   * @param object metadata
    * @return boolean
    *         Whether the given item should be hidden or not.
    */
-  shouldHideMenuItem: function CCM_shouldHideMenuItem(aMenuItem, aMetadata)
+  shouldHideMenuItem: function CCM_shouldHideMenuItem(menuItem, metadata)
   {
-    let selectionType = aMenuItem.getAttribute("selectiontype");
-    if (selectionType && !aMetadata.selectionType == selectionType) {
+    let selectionType = menuItem.getAttribute("selectiontype");
+    if (selectionType && !metadata.selectionType == selectionType) {
       return true;
     }
 
-    let selection = aMenuItem.getAttribute("selection");
+    let selection = menuItem.getAttribute("selection");
     if (!selection) {
       return false;
     }
 
     let shouldHide = true;
     let itemData = selection.split("|");
-    for (let type of aMetadata.selection) {
+    for (let type of metadata.selection) {
       // check whether this menu item should show or not.
       if (itemData.indexOf(type) !== -1) {
         shouldHide = false;
         break;
       }
     }
 
     return shouldHide;
--- a/dom/cellbroadcast/tests/marionette/manifest.ini
+++ b/dom/cellbroadcast/tests/marionette/manifest.ini
@@ -1,11 +1,13 @@
 [DEFAULT]
 b2g = true
 browser = false
 qemu = true
 
 [test_cellbroadcast_etws.js]
 [test_cellbroadcast_gsm.js]
 [test_cellbroadcast_gsm_language_and_body.js]
+disabled = Bug 1231462
 [test_cellbroadcast_multi_sim.js]
 [test_cellbroadcast_umts.js]
-[test_cellbroadcast_umts_language_and_body.js]
\ No newline at end of file
+[test_cellbroadcast_umts_language_and_body.js]
+disabled = Bug 1224992
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -1297,31 +1297,28 @@ struct StorageDirectoryHelper::OriginPro
   enum Type
   {
     eChrome,
     eContent
   };
 
   nsCOMPtr<nsIFile> mDirectory;
   nsCString mSpec;
-  uint32_t mAppId;
+  PrincipalOriginAttributes mAttrs;
   int64_t mTimestamp;
   nsCString mGroup;
   nsCString mOrigin;
 
   Type mType;
-  bool mInMozBrowser;
   bool mIsApp;
 
 public:
   explicit OriginProps()
-    : mAppId(kNoAppId)
-    , mTimestamp(0)
+    : mTimestamp(0)
     , mType(eContent)
-    , mInMozBrowser(false)
     , mIsApp(false)
   { }
 };
 
 class MOZ_STACK_CLASS OriginParser final
 {
   static bool
   IgnoreWhitespace(char16_t /* aChar */)
@@ -1378,24 +1375,21 @@ public:
     , mState(eExpectingAppIdOrSchema)
     , mInMozBrowser(false)
     , mMaybeDriveLetter(false)
     , mError(false)
   { }
 
   static bool
   ParseOrigin(const nsACString& aOrigin,
-              uint32_t* aAppId,
-              bool* aInMozBrowser,
-              nsCString& aSpec);
+              nsCString& aSpec,
+              PrincipalOriginAttributes* aAttrs);
 
   bool
-  Parse(uint32_t* aAppId,
-        bool* aInMozBrowser,
-        nsACString& aSpec);
+  Parse(nsACString& aSpec, PrincipalOriginAttributes* aAttrs);
 
 private:
   void
   HandleSchema(const nsDependentCSubstring& aSchema);
 
   void
   HandlePathnameComponent(const nsDependentCSubstring& aSchema);
 
@@ -5987,29 +5981,28 @@ StorageDirectoryHelper::AddOriginDirecto
 
   if (leafName.EqualsLiteral(kChromeOrigin)) {
     OriginProps* originProps = mOriginProps.AppendElement();
     originProps->mDirectory = aDirectory;
     originProps->mSpec = kChromeOrigin;
     originProps->mType = OriginProps::eChrome;
   } else {
     nsCString spec;
-    uint32_t appId;
-    bool inMozBrowser;
-    if (NS_WARN_IF(!OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName),
-                                              &appId, &inMozBrowser, spec))) {
+    PrincipalOriginAttributes attrs;
+    bool result = OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName),
+                                            spec, &attrs);
+    if (NS_WARN_IF(!result)) {
       return NS_ERROR_FAILURE;
     }
 
     OriginProps* originProps = mOriginProps.AppendElement();
     originProps->mDirectory = aDirectory;
     originProps->mSpec = spec;
-    originProps->mAppId = appId;
+    originProps->mAttrs = attrs;
     originProps->mType = OriginProps::eContent;
-    originProps->mInMozBrowser = inMozBrowser;
 
     if (mCreate) {
       int64_t timestamp = INT64_MIN;
       rv = GetLastModifiedTime(aDirectory, &timestamp);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
@@ -6173,27 +6166,20 @@ StorageDirectoryHelper::RunOnMainThread(
 
       case OriginProps::eContent: {
         nsCOMPtr<nsIURI> uri;
         rv = NS_NewURI(getter_AddRefs(uri), originProps.mSpec);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
 
-        nsCOMPtr<nsIPrincipal> principal;
-        if (originProps.mAppId == kUnknownAppId) {
-          rv = secMan->GetSimpleCodebasePrincipal(uri,
-                                                  getter_AddRefs(principal));
-        } else {
-          PrincipalOriginAttributes attrs(originProps.mAppId, originProps.mInMozBrowser);
-          principal = BasePrincipal::CreateCodebasePrincipal(uri, attrs);
-          rv = principal ? NS_OK : NS_ERROR_FAILURE;
-        }
-        if (NS_WARN_IF(NS_FAILED(rv))) {
-          return rv;
+        nsCOMPtr<nsIPrincipal> principal =
+          BasePrincipal::CreateCodebasePrincipal(uri, originProps.mAttrs);
+        if (NS_WARN_IF(!principal)) {
+          return NS_ERROR_FAILURE;
         }
 
         if (mCreate) {
           rv = QuotaManager::GetInfoFromPrincipal(principal,
                                                   &originProps.mGroup,
                                                   &originProps.mOrigin,
                                                   &originProps.mIsApp);
         } else {
@@ -6234,40 +6220,30 @@ StorageDirectoryHelper::Run()
   mCondVar.Notify();
 
   return NS_OK;
 }
 
 // static
 bool
 OriginParser::ParseOrigin(const nsACString& aOrigin,
-                          uint32_t* aAppId,
-                          bool* aInMozBrowser,
-                          nsCString& aSpec)
+                          nsCString& aSpec,
+                          PrincipalOriginAttributes* aAttrs)
 {
   MOZ_ASSERT(!aOrigin.IsEmpty());
-  MOZ_ASSERT(aAppId);
-  MOZ_ASSERT(aInMozBrowser);
+  MOZ_ASSERT(aAttrs);
 
   OriginParser parser(aOrigin);
-
-  if (!parser.Parse(aAppId, aInMozBrowser, aSpec)) {
-    return false;
-  }
-
-  return true;
+  return parser.Parse(aSpec, aAttrs);
 }
 
 bool
-OriginParser::Parse(uint32_t* aAppId,
-                    bool* aInMozBrowser,
-                    nsACString& aSpec)
-{
-  MOZ_ASSERT(aAppId);
-  MOZ_ASSERT(aInMozBrowser);
+OriginParser::Parse(nsACString& aSpec, PrincipalOriginAttributes* aAttrs)
+{
+  MOZ_ASSERT(aAttrs);
 
   while (mTokenizer.hasMoreTokens()) {
     const nsDependentCSubstring& token = mTokenizer.nextToken();
 
     HandleToken(token);
 
     if (mError) {
       break;
@@ -6289,18 +6265,17 @@ OriginParser::Parse(uint32_t* aAppId,
     QM_WARNING("Origin '%s' failed to parse, handled tokens: %s", mOrigin.get(),
                mHandledTokens.get());
 
     return false;
   }
 
   MOZ_ASSERT(mState == eComplete || mState == eHandledTrailingSeparator);
 
-  *aAppId = mAppId;
-  *aInMozBrowser = mInMozBrowser;
+  *aAttrs = PrincipalOriginAttributes(mAppId, mInMozBrowser);
 
   nsAutoCString spec(mSchema);
 
   if (mSchemaType == eFile) {
     spec.AppendLiteral("://");
 
     for (uint32_t count = mPathnameComponents.Length(), index = 0;
          index < count;
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -70,29 +70,31 @@ import org.mozilla.gecko.util.EventCallb
 import org.mozilla.gecko.util.FloatUtils;
 import org.mozilla.gecko.util.GamepadUtils;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.MenuUtils;
 import org.mozilla.gecko.util.NativeEventListener;
 import org.mozilla.gecko.util.NativeJSObject;
 import org.mozilla.gecko.util.PrefUtils;
+import org.mozilla.gecko.util.ScreenshotObserver;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.util.UIAsyncTask;
 import org.mozilla.gecko.widget.AnchoredPopup;
 import org.mozilla.gecko.widget.ButtonToast;
 import org.mozilla.gecko.widget.GeckoActionProvider;
 
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.ContentResolver;
+import android.content.ContentValues;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.database.Cursor;
@@ -102,16 +104,17 @@ import android.graphics.drawable.BitmapD
 import android.net.Uri;
 import android.nfc.NdefMessage;
 import android.nfc.NdefRecord;
 import android.nfc.NfcAdapter;
 import android.nfc.NfcEvent;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.StrictMode;
+import android.provider.MediaStore;
 import android.support.design.widget.Snackbar;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.NotificationCompat;
 import android.support.v4.view.MenuItemCompat;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.util.Base64;
@@ -263,16 +266,17 @@ public class BrowserApp extends GeckoApp
 
     // The animator used to toggle HomePager visibility has a race where if the HomePager is shown
     // (starting the animation), the HomePager is hidden, and the HomePager animation completes,
     // both the web content and the HomePager will be hidden. This flag is used to prevent the
     // race by determining if the web content should be hidden at the animation's end.
     private boolean mHideWebContentOnAnimationEnd;
 
     private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
+    private final ScreenshotObserver mScreenshotObserver = new ScreenshotObserver();
 
     @Override
     public View onCreateView(final String name, final Context context, final AttributeSet attrs) {
         final View view;
         if (BrowserToolbar.class.getName().equals(name)) {
             view = BrowserToolbar.create(context, attrs);
         } else if (TabsPanel.TabsLayout.class.getName().equals(name)) {
             view = TabsPanel.createTabsLayout(context, attrs);
@@ -721,16 +725,25 @@ public class BrowserApp extends GeckoApp
 
         mDynamicToolbar.setEnabledChangedListener(new DynamicToolbar.OnEnabledChangedListener() {
             @Override
             public void onEnabledChanged(boolean enabled) {
                 setDynamicToolbarEnabled(enabled);
             }
         });
 
+        // Watch for screenshots while browser is in foreground.
+        mScreenshotObserver.setListener(getContext(), new ScreenshotObserver.OnScreenshotListener() {
+            @Override
+            public void onScreenshotTaken(String data, String title) {
+                // Treat screenshots as a sharing method.
+                Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.BUTTON, "screenshot");
+            }
+        });
+
         // Set the maximum bits-per-pixel the favicon system cares about.
         IconDirectoryEntry.setMaxBPP(GeckoAppShell.getScreenDepth());
     }
 
     private void conditionallyNotifyHCEOL() {
         final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
         try {
             final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this);
@@ -900,28 +913,32 @@ public class BrowserApp extends GeckoApp
             doRestart(getIntent());
             return;
         }
 
         EventDispatcher.getInstance().unregisterGeckoThreadListener((GeckoEventListener) this,
             "Prompt:ShowTop");
 
         processTabQueue();
+
+        mScreenshotObserver.start();
     }
 
     @Override
     public void onPause() {
         super.onPause();
 
         // Needed for Adjust to get accurate session measurements
         AdjustConstants.getAdjustHelper().onPause(this);
 
         // Register for Prompt:ShowTop so we can foreground this activity even if it's hidden.
         EventDispatcher.getInstance().registerGeckoThreadListener((GeckoEventListener) this,
             "Prompt:ShowTop");
+
+        mScreenshotObserver.stop();
     }
 
     @Override
     public void onStart() {
         super.onStart();
 
         // Queue this work so that the first launch of the activity doesn't
         // trigger profile init too early.
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/java/org/mozilla/gecko/util/ScreenshotObserver.java
@@ -0,0 +1,129 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+package org.mozilla.gecko.util;
+
+import org.mozilla.gecko.AppConstants.Versions;
+import org.mozilla.gecko.util.ThreadUtils;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.ContentObserver;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.MediaStore;
+import android.util.Log;
+
+public class ScreenshotObserver {
+    private static final String LOGTAG = "GeckoScreenshotObserver";
+    public Context context;
+
+    /**
+     * Listener for screenshot changes.
+     */
+    public interface OnScreenshotListener {
+        /**
+         * This callback is executed on the UI thread.
+         */
+        public void onScreenshotTaken(String data, String title);
+    }
+
+    private OnScreenshotListener listener;
+
+    public ScreenshotObserver() {
+    }
+
+    public void setListener(Context context, OnScreenshotListener listener) {
+        this.context = context;
+        this.listener = listener;
+    }
+
+    private MediaObserver mediaObserver;
+    private String[] mediaProjections = new String[] {
+                    MediaStore.Images.ImageColumns.DATA,
+                    MediaStore.Images.ImageColumns.DISPLAY_NAME,
+                    MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
+                    MediaStore.Images.ImageColumns.DATE_TAKEN,
+                    MediaStore.Images.ImageColumns.TITLE
+    };
+
+    public void start() {
+        if (!Versions.feature14Plus) {
+            return;
+        }
+
+        try {
+            if (mediaObserver == null) {
+                mediaObserver = new MediaObserver();
+                context.getContentResolver().registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, false, mediaObserver);
+            }
+        } catch (Exception e) {
+            Log.e(LOGTAG, "Failure to start watching media: ", e);
+        }
+    }
+
+    public void stop() {
+        if (!Versions.feature14Plus) {
+            return;
+        }
+
+        try {
+            context.getContentResolver().unregisterContentObserver(mediaObserver);
+            mediaObserver = null;
+        } catch (Exception e) {
+            Log.e(LOGTAG, "Failure to stop watching media: ", e);
+        }
+    }
+
+    public void onMediaChange(final Uri uri) {
+        // Make sure we are on not on the main thread.
+        final ContentResolver cr = context.getContentResolver();
+        ThreadUtils.postToBackgroundThread(new Runnable() {
+            @Override
+            public void run() {
+                // Find the most recent image added to the MediaStore and see if it's a screenshot.
+                try {
+                    Cursor cursor = cr.query(uri, mediaProjections, null, null, MediaStore.Images.ImageColumns.DATE_ADDED + " DESC LIMIT 1");
+                    if (cursor == null) {
+                        return;
+                    }
+
+                    while (cursor.moveToNext()) {
+                        String data = cursor.getString(0);
+                        Log.i(LOGTAG, "data: " + data);
+                        String display = cursor.getString(1);
+                        Log.i(LOGTAG, "display: " + display);
+                        String album = cursor.getString(2);
+                        Log.i(LOGTAG, "album: " + album);
+                        long date = cursor.getLong(3);
+                        String title = cursor.getString(4);
+                        Log.i(LOGTAG, "title: " + title);
+                        if (album != null && album.toLowerCase().contains("screenshot")) {
+                            if (listener != null) {
+                                listener.onScreenshotTaken(data, title);
+                                break;
+                            }
+                        }
+                    }
+                    cursor.close();
+                } catch (Exception e) {
+                    Log.e(LOGTAG, "Failure to process media change: ", e);
+                }
+            }
+        });
+    }
+
+    private class MediaObserver extends ContentObserver {
+        public MediaObserver() {
+            super(null);
+        }
+
+        @Override
+        public void onChange(boolean selfChange) {
+            super.onChange(selfChange);
+            onMediaChange(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
+        }
+    }
+}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -113,16 +113,17 @@ gujar.sources += ['java/org/mozilla/geck
     'util/MenuUtils.java',
     'util/NativeEventListener.java',
     'util/NativeJSContainer.java',
     'util/NativeJSObject.java',
     'util/NonEvictingLruCache.java',
     'util/PrefUtils.java',
     'util/ProxySelector.java',
     'util/RawResource.java',
+    'util/ScreenshotObserver.java',
     'util/StringUtils.java',
     'util/ThreadUtils.java',
     'util/UIAsyncTask.java',
     'util/WeakReferenceHandler.java',
     'util/WebActivityMapper.java',
     'util/WindowUtils.java',
 ]]
 gujar.extra_jars = [
--- a/mobile/android/components/HelperAppDialog.js
+++ b/mobile/android/components/HelperAppDialog.js
@@ -3,16 +3,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/. */
 
 /*globals ContentAreaUtils */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 const APK_MIME_TYPE = "application/vnd.android.package-archive";
+const OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE = "application/vnd.oma.dd+xml";
 const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir";
 const URI_GENERIC_ICON_DOWNLOAD = "drawable://alert_download";
 
 Cu.import("resource://gre/modules/Downloads.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/HelperApps.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
@@ -89,58 +90,64 @@ HelperAppLauncherDialog.prototype = {
   /**
    * Returns true if `launcher` represents a download for which we wish
    * to prompt.
    */
   _shouldPrompt: function (launcher) {
     let mimeType = this._getMimeTypeFromLauncher(launcher);
 
     // Straight equality: nsIMIMEInfo normalizes.
-    return APK_MIME_TYPE == mimeType;
+    return APK_MIME_TYPE == mimeType || OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE == mimeType;
+  },
+
+  /**
+   * Returns true if `launcher` represents a download for which we wish to
+   * offer a "Save to disk" option.
+   */
+  _shouldAddSaveToDiskIntent: function(launcher) {
+      let mimeType = this._getMimeTypeFromLauncher(launcher);
+
+      // We can't handle OMA downloads. So don't even try. (Bug 1219078)
+      return mimeType != OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE;
   },
 
   show: function hald_show(aLauncher, aContext, aReason) {
     if (!this._canDownload(aLauncher.source)) {
-      aLauncher.cancel(Cr.NS_BINDING_ABORTED);
-
-      let win = this.getNativeWindow();
-      if (!win) {
-        // Oops.
-        Services.console.logStringMessage("Refusing download, but can't show a toast.");
-        return;
-      }
-
-      Services.console.logStringMessage("Refusing download of non-downloadable file.");
-      let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
-      let failedText = bundle.GetStringFromName("download.blocked");
-      win.toast.show(failedText, "long");
-
+      this._refuseDownload(aLauncher);
       return;
     }
 
     let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
 
     let defaultHandler = new Object();
     let apps = HelperApps.getAppsForUri(aLauncher.source, {
       mimeType: aLauncher.MIMEInfo.MIMEType,
     });
 
-    // Add a fake intent for save to disk at the top of the list.
-    apps.unshift({
-      name: bundle.GetStringFromName("helperapps.saveToDisk"),
-      packageName: "org.mozilla.gecko.Download",
-      iconUri: "drawable://icon",
-      selected: true, // Default to download for files
-      launch: function() {
-        // Reset the preferredAction here.
-        aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
-        aLauncher.saveToDisk(null, false);
-        return true;
-      }
-    });
+    if (this._shouldAddSaveToDiskIntent(aLauncher)) {
+      // Add a fake intent for save to disk at the top of the list.
+      apps.unshift({
+        name: bundle.GetStringFromName("helperapps.saveToDisk"),
+        packageName: "org.mozilla.gecko.Download",
+        iconUri: "drawable://icon",
+        selected: true, // Default to download for files
+        launch: function() {
+          // Reset the preferredAction here.
+          aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
+          aLauncher.saveToDisk(null, false);
+          return true;
+        }
+      });
+    }
+
+    // We do not handle this download and there are no apps that want to do it
+    if (apps.length === 0) {
+      this._refuseDownload(aLauncher);
+      return;
+    }
 
     let callback = function(app) {
       aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
       if (!app.launch(aLauncher.source)) {
         // Once the app is done we need to get rid of the temp file. This shouldn't
         // get run in the saveToDisk case.
         aLauncher.cancel(Cr.NS_BINDING_ABORTED);
       }
@@ -182,16 +189,32 @@ HelperAppLauncherDialog.prototype = {
       callback(apps[data.icongrid0]);
 
       if (data.button === 0) {
         this._setPreferredApp(aLauncher, apps[data.icongrid0]);
       }
     });
   },
 
+  _refuseDownload: function(aLauncher) {
+    aLauncher.cancel(Cr.NS_BINDING_ABORTED);
+
+    let win = this.getNativeWindow();
+    if (!win) {
+      // Oops.
+      Services.console.logStringMessage("Refusing download, but can't show a toast.");
+      return;
+    }
+
+    Services.console.logStringMessage("Refusing download of non-downloadable file.");
+    let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
+    let failedText = bundle.GetStringFromName("download.blocked");
+    win.toast.show(failedText, "long");
+  },
+
   _getPrefName: function getPrefName(mimetype) {
     return "browser.download.preferred." + mimetype.replace("\\", ".");
   },
 
   _getMimeTypeFromLauncher: function (launcher) {
     let mime = launcher.MIMEInfo.MIMEType;
     if (!mime)
       mime = ContentAreaUtils.getMIMETypeForURI(launcher.source) || "";
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -223,17 +223,28 @@ this.ReaderMode = {
                 return;
               }
               // Otherwise, pass an object indicating our new URL:
               reject({newURL: url});
               return;
             }
           }
         }
-        if (xhr.responseURL != url) {
+        let responseURL = xhr.responseURL;
+        let givenURL = url;
+        // Convert these to real URIs to make sure the escaping (or lack
+        // thereof) is identical:
+        try {
+          responseURL = Services.io.newURI(responseURL, null, null).spec;
+        } catch (ex) { /* Ignore errors - we'll use what we had before */ }
+        try {
+          givenURL = Services.io.newURI(givenURL, null, null).spec;
+        } catch (ex) { /* Ignore errors - we'll use what we had before */ }
+
+        if (responseURL != givenURL) {
           // We were redirected without a meta refresh tag.
           // Force redirect to the correct place:
           reject({newURL: xhr.responseURL});
           return;
         }
         resolve(doc);
         histogram.add(DOWNLOAD_SUCCESS);
       }
--- a/toolkit/mozapps/extensions/test/browser/browser_experiments.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_experiments.js
@@ -93,16 +93,17 @@ function clickUndoButton(addonElement) {
 }
 
 add_task(function* initializeState() {
   gManagerWindow = yield open_manager();
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref("experiments.enabled");
+    Services.prefs.clearUserPref("toolkit.telemetry.enabled");
     if (gHttpServer) {
       gHttpServer.stop(() => {});
       if (gSavedManifestURI !== undefined) {
         Services.prefs.setCharPref("experments.manifest.uri", gSavedManifestURI);
       }
     }
     if (gExperiments) {
       let tmp = {};
@@ -289,16 +290,17 @@ add_task(function* testActivateExperimen
   });
 
   gSavedManifestURI = Services.prefs.getCharPref("experiments.manifest.uri");
   Services.prefs.setCharPref("experiments.manifest.uri", root + "manifest");
 
   // We need to remove the cache file to help ensure consistent state.
   yield OS.File.remove(gExperiments._cacheFilePath);
 
+  Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
   Services.prefs.setBoolPref("experiments.enabled", true);
 
   info("Initializing experiments service.");
   yield gExperiments.init();
   info("Experiments service finished first run.");
 
   // Check conditions, just to be sure.
   let experiments = yield gExperiments.getExperiments();
@@ -630,16 +632,18 @@ add_task(function* testCleanup() {
   if (gExperiments) {
     Services.prefs.clearUserPref("experiments.enabled");
     Services.prefs.setCharPref("experiments.manifest.uri", gSavedManifestURI);
 
     // We perform the uninit/init cycle to purge any leftover state.
     yield OS.File.remove(gExperiments._cacheFilePath);
     yield gExperiments.uninit();
     yield gExperiments.init();
+
+    Services.prefs.clearUserPref("toolkit.telemetry.enabled");
   }
 
   // Check post-conditions.
   let addons = yield getExperimentAddons();
   Assert.equal(addons.length, 0, "No experiment add-ons are installed.");
 
   yield close_manager(gManagerWindow);
 });
--- a/toolkit/themes/linux/global/jar.mn
+++ b/toolkit/themes/linux/global/jar.mn
@@ -52,8 +52,10 @@ toolkit.jar:
    skin/classic/global/icons/resizer.png                       (icons/resizer.png)
    skin/classic/global/icons/sslWarning.png                    (icons/sslWarning.png)
    skin/classic/global/icons/webapps-16.png                    (icons/webapps-16.png)
    skin/classic/global/icons/webapps-64.png                    (icons/webapps-64.png)
 
 *  skin/classic/global/in-content/common.css                   (in-content/common.css)
 *  skin/classic/global/in-content/info-pages.css               (in-content/info-pages.css)
    skin/classic/global/toolbar/spring.png                      (toolbar/spring.png)
+   skin/classic/global/tree/twisty-clsd.png                    (tree/twisty-clsd.png)
+   skin/classic/global/tree/twisty-open.png                    (tree/twisty-open.png)
rename from toolkit/themes/windows/global/tree/twisty-clsd.png
rename to toolkit/themes/linux/global/tree/twisty-clsd.png
rename from toolkit/themes/windows/global/tree/twisty-open.png
rename to toolkit/themes/linux/global/tree/twisty-open.png
--- a/toolkit/themes/shared/alert-common.css
+++ b/toolkit/themes/shared/alert-common.css
@@ -5,21 +5,16 @@
 /* ===== alert.css =====================================================
   == Shared styles specific to the alerts dialog.
   ======================================================================= */
 
 @import url("chrome://global/skin/");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-#alertBox[hasBodyText] > #alertTextBox,
-#alertBox[hasOrigin] > #alertTitleBox {
-  border-bottom: 1px solid ThreeDShadow;
-}
-
 #alertBox[animate] {
   animation-timing-function: cubic-bezier(.12,1.23,.48,1.09);
 }
 
 #alertBox[animate][clicked] {
   animation-duration: .6s;
   animation-name: alert-clicked-animation;
 }
@@ -54,61 +49,73 @@
 
 @keyframes alert-closing-animation {
   to {
     opacity: 0;
   }
 }
 
 #alertImage {
-  width: 64px;
+  width: 80px;
+  height: 80px;
+  max-width: 80px;
+  max-height: 80px;
+  object-fit: scale-down;
+  margin: 0 7px 7px;
 }
 
 .alertTextBox {
-  padding-top: 8px;
-  padding-inline-start: 8px;
+  padding-top: 4px;
   /* The text box width is increased to make up for the lack of image when one
-     is not provided. 319px is the text box width when a picture is present,
-     255px, plus the width of the image, 64px. */
-  width: 319px;
+     is not provided. 349px is the text box width when a picture is present,
+     255px, plus the width of the image, 80px, and the margins, 7px each. */
+  width: 349px;
 }
 
 #alertBox[hasImage] > box > #alertTextBox {
   width: 255px;
 }
 
+#alertBox:not([hasImage]) > box > #alertTextBox {
+  padding-inline-start: 8px;
+}
+
 #alertTextLabel {
   padding-inline-end: 8px;
 }
 
 .alertTitle {
   -moz-box-flex: 1;
   font-weight: bold;
-  padding: 6px 8px;
+  padding: 6px 8px 0;
   width: 255px;
 }
 
 #alertFooter {
-  -moz-box-align: end;
-  padding-bottom: 2px;
+  -moz-box-align: start;
+}
+
+#alertBox:not([hasOrigin]) > box > #alertTextBox,
+#alertFooter {
+  padding-bottom: 5px;
 }
 
 #alertSourceLabel {
   -moz-box-flex: 1;
   font-size: 83.334%;
   color: GrayText;
 }
 
 #alertSettings {
   -moz-appearance: none;
   background-color: transparent;
   border-width: 0;
   border-radius: 20px;
   min-width: 0;
-  list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities");
+  list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities-grayscale");
   margin-inline-end: 0;
   margin-bottom: 0;
 }
 
 #alertSettings > .button-box {
   padding: 0;
 }
 
--- a/toolkit/themes/shared/extensions/utilities.svg
+++ b/toolkit/themes/shared/extensions/utilities.svg
@@ -8,19 +8,23 @@
       display: none;
     }
     use {
       fill: #424f5a;
     }
     use[id$="-native"] {
       fill: GrayText;
     }
+    use[id$="-grayscale"] {
+      fill: #4d4d4d;
+    }
     use[id$="-inverted"] {
       fill: #ddd;
     }
   </style>
   <defs>
     <path id="utilities-shape" d="m11.5,13.9l-.6-1.5c.3-.2 .5-.4 .8-.6 .2-.2 .4-.5 .6-.7l1.5,.6c.3,.1 .6,0 .7-.3l.4-1c.1-.3 0-.6-.3-.7l-1.5-.6c.1-.6 .1-1.3 0-2l1.5-.6c.3-.1 .4-.4 .3-.7l-.4-1c-.1-.3-.4-.4-.7-.3l-1.5,.6c-.2-.3-.4-.5-.6-.8-.2-.1-.5-.3-.7-.5l.6-1.5c.1-.3 0-.6-.3-.7l-.9-.4c-.3-.1-.6,0-.7,.3l-.6,1.5c-.6-.1-1.3-.1-2,0l-.6-1.5c-.1-.3-.4-.4-.7-.3l-1,.4c-.2,.1-.3,.4-.2,.6l.6,1.5c-.3,.3-.5,.5-.8,.7-.2,.3-.4,.5-.6,.8l-1.5-.7c-.3-.1-.6,0-.7,.3l-.4,.9c-.1,.3 0,.6 .3,.7l1.5,.7c-.1,.6-.1,1.3 0,1.9l-1.5,.6c-.3,.1-.4,.4-.3,.7l.4,1c.1,.3 .4,.4 .7,.3l1.5-.6c.2,.3 .4,.5 .6,.8 .2,.2 .5,.4 .7,.6l-.6,1.5c-.1,.3 0,.6 .3,.7l1,.4c.3,.1 .6,0 .7-.3l.6-1.5c.6,.1 1.3,.1 2,0l.6,1.5c.1,.3 .4,.4 .7,.3l1-.4c.1-.1 .3-.4 .1-.7zm-5.1-4.2c-.9-.9-.9-2.4 0-3.3 .9-.9 2.4-.9 3.3,0 .9,.9 .9,2.4 0,3.3-.9,.9-2.4,.9-3.3,0z"/>
   </defs>
   <use id="utilities" xlink:href="#utilities-shape"/>
   <use id="utilities-native" xlink:href="#utilities-shape"/>
+  <use id="utilities-grayscale" xlink:href="#utilities-shape"/>
   <use id="utilities-inverted" xlink:href="#utilities-shape"/>
 </svg>
--- a/toolkit/themes/shared/non-mac.jar.inc.mn
+++ b/toolkit/themes/shared/non-mac.jar.inc.mn
@@ -126,24 +126,16 @@
   skin/classic/global/splitter/grip-right.gif              (../../windows/global/splitter/grip-right.gif)
   skin/classic/global/toolbar/chevron.gif                  (../../windows/global/toolbar/chevron.gif)
   skin/classic/global/toolbar/chevron-inverted.png         (../../windows/global/toolbar/chevron-inverted.png)
   skin/classic/global/tree/columnpicker.gif                (../../windows/global/tree/columnpicker.gif)
   skin/classic/global/tree/sort-asc.png                    (../../windows/global/tree/sort-asc.png)
   skin/classic/global/tree/sort-dsc.png                    (../../windows/global/tree/sort-dsc.png)
   skin/classic/global/tree/sort-asc-classic.png            (../../windows/global/tree/sort-asc-classic.png)
   skin/classic/global/tree/sort-dsc-classic.png            (../../windows/global/tree/sort-dsc-classic.png)
-  skin/classic/global/tree/twisty-clsd.png                 (../../windows/global/tree/twisty-clsd.png)
-  skin/classic/global/tree/twisty-clsd-rtl.png             (../../windows/global/tree/twisty-clsd-rtl.png)
-  skin/classic/global/tree/twisty-clsd-hover.png           (../../windows/global/tree/twisty-clsd-hover.png)
-  skin/classic/global/tree/twisty-clsd-hover-rtl.png       (../../windows/global/tree/twisty-clsd-hover-rtl.png)
-  skin/classic/global/tree/twisty-open.png                 (../../windows/global/tree/twisty-open.png)
-  skin/classic/global/tree/twisty-open-rtl.png             (../../windows/global/tree/twisty-open-rtl.png)
-  skin/classic/global/tree/twisty-open-hover.png           (../../windows/global/tree/twisty-open-hover.png)
-  skin/classic/global/tree/twisty-open-hover-rtl.png       (../../windows/global/tree/twisty-open-hover-rtl.png)
 
   skin/classic/help/Toolbar.png                            (../../windows/help/Toolbar.png)
   skin/classic/help/Toolbar-rtl.png                        (../../windows/help/Toolbar-rtl.png)
   skin/classic/help/helpFileLayout.css                     (../../windows/help/helpFileLayout.css)
   skin/classic/help/Weblink.png                            (../../windows/help/Weblink.png)
   skin/classic/help/Weblink-rtl.png                        (../../windows/help/Weblink-rtl.png)
 
   skin/classic/mozapps/downloads/downloadButtons.png         (../../windows/mozapps/downloads/downloadButtons.png)
--- a/toolkit/themes/windows/global/alerts/alert.css
+++ b/toolkit/themes/windows/global/alerts/alert.css
@@ -25,27 +25,29 @@
 }
 
 .alertCloseButton {
   -moz-appearance: none;
   padding: 4px 2px;
   border: none !important;
 }
 
+.alertCloseBox {
+  /* The close button is larger on Windows and has a large
+     circle around it, so we add more space between the close
+     button and the edge of the window. */
+  margin-inline-end: 2px;
+}
+
 #alertSettings {
   /* The close button is larger on Windows, so the
      gear button is moved over to accomodate it and
      keep the two buttons horizontally aligned together. */
-  margin-inline-end: 3px;
+  margin-inline-end: 5px;
 }
 
 @media (-moz-windows-default-theme) {
-  #alertBox[hasBodyText] > #alertTextBox,
-  #alertBox[hasOrigin] > #alertTitleBox {
-    border-bottom-color: rgba(107,107,107,.4);
-  }
-
   #alertBox {
-    border-color: rgba(107,107,107,.4);
+    border-color: rgba(107,107,107,.3);
     background-color: rgba(255,255,255,.9);
     color: rgba(0,0,0,.9);
   }
 }
--- a/toolkit/themes/windows/global/button.css
+++ b/toolkit/themes/windows/global/button.css
@@ -133,16 +133,16 @@ button.plain {
   padding: 0px !important;
 }
 
 button[type="disclosure"] {
   border: 0px !important;
   margin: 0px !important;
   padding: 0px !important;
   -moz-appearance: none;
-  list-style-image: url("chrome://global/skin/tree/twisty-clsd.png");
+  list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd");
   min-width: 0px !important;
   background-color: transparent;
 }
 
 button[type="disclosure"][open="true"] {
-  list-style-image: url("chrome://global/skin/tree/twisty-open.png");
+  list-style-image: url("chrome://global/skin/tree/twisty.svg#open");
 }
--- a/toolkit/themes/windows/global/jar.mn
+++ b/toolkit/themes/windows/global/jar.mn
@@ -88,18 +88,19 @@ toolkit.jar:
   skin/classic/global/icons/windowControls-XP.png                (icons/windowControls-XP.png)
   skin/classic/global/printpreview/arrow-left-XP.png             (printpreview/arrow-left-XP.png)
   skin/classic/global/printpreview/arrow-left-end-XP.png         (printpreview/arrow-left-end-XP.png)
   skin/classic/global/printpreview/arrow-right-XP.png            (printpreview/arrow-right-XP.png)
   skin/classic/global/printpreview/arrow-right-end-XP.png        (printpreview/arrow-right-end-XP.png)
   skin/classic/global/toolbar/spring-XP.png                      (toolbar/spring-XP.png)
   skin/classic/global/tree/sort-asc-XP.png                       (tree/sort-asc-XP.png)
   skin/classic/global/tree/sort-dsc-XP.png                       (tree/sort-dsc-XP.png)
-  skin/classic/global/tree/twisty-clsd-XP.png                    (tree/twisty-clsd-XP.png)
-  skin/classic/global/tree/twisty-open-XP.png                    (tree/twisty-open-XP.png)
+  skin/classic/global/tree/twisty.svg                            (tree/twisty.svg)
+  skin/classic/global/tree/twisty-XP.svg                         (tree/twisty-XP.svg)
+  skin/classic/global/tree/twisty-Vista78.svg                    (tree/twisty-Vista78.svg)
 
 #if MOZ_BUILD_APP == browser
 [browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
 #elif MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES
 [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
 #endif
 % override chrome://global/skin/console/console-toolbar.png       chrome://global/skin/console/console-toolbar-XP.png      osversion<6
 % override chrome://global/skin/dirListing/folder.png             chrome://global/skin/dirListing/folder-XP.png            osversion<6
@@ -132,15 +133,25 @@ toolkit.jar:
 % override chrome://global/skin/icons/windowControls.png          chrome://global/skin/icons/windowControls-XP.png         osversion<6
 % override chrome://global/skin/printpreview/arrow-left.png       chrome://global/skin/printpreview/arrow-left-XP.png      osversion<6
 % override chrome://global/skin/printpreview/arrow-left-end.png   chrome://global/skin/printpreview/arrow-left-end-XP.png  osversion<6
 % override chrome://global/skin/printpreview/arrow-right.png      chrome://global/skin/printpreview/arrow-right-XP.png     osversion<6
 % override chrome://global/skin/printpreview/arrow-right-end.png  chrome://global/skin/printpreview/arrow-right-end-XP.png osversion<6
 % override chrome://global/skin/toolbar/spring.png                chrome://global/skin/toolbar/spring-XP.png               osversion<6
 % override chrome://global/skin/tree/sort-asc.png                 chrome://global/skin/tree/sort-asc-XP.png                osversion<6
 % override chrome://global/skin/tree/sort-dsc.png                 chrome://global/skin/tree/sort-dsc-XP.png                osversion<6
-% override chrome://global/skin/tree/twisty-clsd.png              chrome://global/skin/tree/twisty-clsd-XP.png             osversion<6
-% override chrome://global/skin/tree/twisty-open.png              chrome://global/skin/tree/twisty-open-XP.png             osversion<6
 
 % override chrome://global/skin/icons/close.png                   chrome://global/skin/icons/close-XPVista7.png            osversion<=6.1
 % override chrome://global/skin/icons/close@2x.png                chrome://global/skin/icons/close-XPVista7@2x.png         osversion<=6.1
 % override chrome://global/skin/icons/close-inverted.png          chrome://global/skin/icons/close-inverted-XPVista7.png   osversion<=6.1
 % override chrome://global/skin/icons/close-inverted@2x.png       chrome://global/skin/icons/close-inverted-XPVista7@2x.png osversion<=6.1
+
+% override chrome://global/skin/tree/twisty.svg#clsd              chrome://global/skin/tree/twisty-Vista78.svg#clsd           osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#clsd-rtl          chrome://global/skin/tree/twisty-Vista78.svg#clsd-rtl       osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#clsd-hover        chrome://global/skin/tree/twisty-Vista78.svg#clsd-hover     osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#clsd-hover-rtl    chrome://global/skin/tree/twisty-Vista78.svg#clsd-hover-rtl osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#open              chrome://global/skin/tree/twisty-Vista78.svg#open           osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#open-rtl          chrome://global/skin/tree/twisty-Vista78.svg#open-rtl       osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#open-hover        chrome://global/skin/tree/twisty-Vista78.svg#open-hover     osversion<=6.3
+% override chrome://global/skin/tree/twisty.svg#open-hover-rtl    chrome://global/skin/tree/twisty-Vista78.svg#open-hover-rtl osversion<=6.3
+# to be sure osversion<6 has always higher precedence than osversion<=6.3 we override twisty-Vista78.svg instead of twisty.svg
+% override chrome://global/skin/tree/twisty-Vista78.svg#clsd      chrome://global/skin/tree/twisty-XP.svg#clsd                osversion<6
+% override chrome://global/skin/tree/twisty-Vista78.svg#open      chrome://global/skin/tree/twisty-XP.svg#open                osversion<6
--- a/toolkit/themes/windows/global/tree.css
+++ b/toolkit/themes/windows/global/tree.css
@@ -312,22 +312,21 @@ treecol:not([hideheader="true"]) > .tree
 }
 
 /* ::::: twisty :::::  */
 
 treechildren::-moz-tree-twisty {
   -moz-padding-end: 4px;
   padding-top: 1px;
   width: 9px; /* The image's width is 9 pixels */
-  list-style-image: url("chrome://global/skin/tree/twisty-clsd.png");
+  list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd");
 }
 
 treechildren::-moz-tree-twisty(open) {
-  width: 9px; /* The image's width is 9 pixels */
-  list-style-image: url("chrome://global/skin/tree/twisty-open.png");
+  list-style-image: url("chrome://global/skin/tree/twisty.svg#open");
 }
 
 treechildren::-moz-tree-indentation {
   width: 18px;
 }
 
 /* ::::: gridline style ::::: */
 
@@ -368,41 +367,40 @@ treechildren::-moz-tree-cell-text(select
   /* ::::: twisty :::::  */
 
   treechildren::-moz-tree-indentation {
     width: 12px;
   }
 
   treechildren::-moz-tree-twisty {
     -moz-padding-end: 1px;
-    width: 9px;
   }
 
   treechildren::-moz-tree-twisty(hover) {
-    list-style-image: url("chrome://global/skin/tree/twisty-clsd-hover.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover");
   }
 
   treechildren::-moz-tree-twisty(hover, open) {
-    list-style-image: url("chrome://global/skin/tree/twisty-open-hover.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#open-hover");
   }
 
   treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty {
-    list-style-image: url("chrome://global/skin/tree/twisty-clsd-rtl.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-rtl");
   }
 
   treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(open) {
-    list-style-image: url("chrome://global/skin/tree/twisty-open-rtl.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#open-rtl");
   }
 
   treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover) {
-    list-style-image: url("chrome://global/skin/tree/twisty-clsd-hover-rtl.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover-rtl");
   }
 
   treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) {
-    list-style-image: url("chrome://global/skin/tree/twisty-open-hover-rtl.png");
+    list-style-image: url("chrome://global/skin/tree/twisty.svg#open-hover-rtl");
   }
 
   @media (-moz-windows-default-theme) {
     treechildren {
       --treechildren-outline: none;
       --treechildren-2ndBorderColor: rgba(255,255,255,.4);
       --treechildren-selectedColor: rgb(217,217,217);
       --treechildren-focusColor: rgb(123,195,255);
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/windows/global/tree/twisty-Vista78.svg
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
+  <style>
+    use:not(:target) {
+      display: none;
+    }
+    use {
+      stroke: #74747b;
+      stroke-opacity: 0.85;
+      fill: none;
+    }
+    use[id^="open"] {
+      stroke: #636363;
+      stroke-opacity: 1;
+    }
+    use[id*="-hover"] {
+      stroke: #1cc4f7;
+      stroke-opacity: 1;
+      fill: #c0e8f9;
+    }
+  </style>
+  <defs>
+    <path id="clsd-shape" d="m 2.5,0.5 4,4 -4,4 z"/>
+    <path id="open-shape" d="M 7.5,3 7.5,7.5 3,7.5 3,6.5 6.5,3 Z"/>
+    <path id="clsd-rtl-shape" d="m 6.5,0.5 -4,4 4,4 z"/>
+    <path id="open-rtl-shape" d="m 1.5,3 0,4.5 4.5,0 0,-1 L 2.5,3 Z"/>
+  </defs>
+  <use id="clsd" xlink:href="#clsd-shape"/>
+  <use id="clsd-hover" xlink:href="#clsd-shape"/>
+  <use id="open" xlink:href="#open-shape"/>
+  <use id="open-hover" xlink:href="#open-shape"/>
+  <use id="clsd-rtl" xlink:href="#clsd-rtl-shape"/>
+  <use id="clsd-hover-rtl" xlink:href="#clsd-rtl-shape"/>
+  <use id="open-rtl" xlink:href="#open-rtl-shape"/>
+  <use id="open-hover-rtl" xlink:href="#open-rtl-shape"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/windows/global/tree/twisty-XP.svg
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
+  <style>
+    use:not(:target) {
+      display: none;
+    }
+    use {
+      stroke: #000000;
+      stroke-width: 1;
+    }
+  </style>
+  <defs>
+    <linearGradient id="linearGradient1">
+      <stop style="stop-color: #ffffff;" offset="0"/>
+      <stop style="stop-color: #e0e0e0;" offset="1"/>
+    </linearGradient>
+    <linearGradient id="linearGradient2">
+      <stop style="stop-color: #c9c9c9;" offset="0"/>
+      <stop style="stop-color: #f8f8f8;" offset="1"/>
+    </linearGradient>
+    <linearGradient id="gradient1" xlink:href="#linearGradient1" gradientUnits="userSpaceOnUse" x1="4.5" y1="2" x2="4.5" y2="7"/>
+    <linearGradient id="gradient2" xlink:href="#linearGradient2" gradientUnits="userSpaceOnUse" x1="4.5" y1="6" x2="4.5" y2="3"/>
+    <path id="clsd-shape" d="m 2,4.5 5,0 M 4.5,2 l 0,5"/>
+    <path id="open-shape" d="m 2,4.5 5,0"/>
+  </defs>
+  <rect style="fill: url(#gradient1); stroke: #5d5cc2; stroke-linejoin: round; stroke-opacity: 0.8" width="8" height="8" x="0.5" y="0.5"/>
+  <rect style="fill: url(#gradient2);" width="5" height="5" x="2" y="2"/>
+  <use id="clsd" xlink:href="#clsd-shape"/>
+  <use id="open" xlink:href="#open-shape"/>
+</svg>
deleted file mode 100644
index 7fe7fb542f47344bf71b319f326f617b43fc56b0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1b651975884eca0dfecfa1a2fca628c77411233c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 763c1da1c187d7cc1e1e0c83d0402a0731826882..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 02f4e32c375e3013aee9859859c67cd140ce847c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index df66d771c347df2fa658659e0c0882ba2fe0d39d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a0157cc3a929bdf282be0644e421b79dc0d7eadb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 31c9478a4dafcb7359a34be516c74c728a89ac78..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 4e606d22ed9f2ccbdc5315cec8d39c0c568e0765..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/windows/global/tree/twisty.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
+  <style>
+    use:not(:target) {
+      display: none;
+    }
+    use {
+      stroke: #b6b6b6;
+      stroke-width: 1.6;
+      fill: none;
+    }
+    use[id^="open"] {
+      stroke: #636363;
+    }
+    use[id*="-hover"] {
+      stroke: #4ed0f9;
+    }
+  </style>
+  <defs>
+    <path id="clsd-shape" d="m 2.5,0.5 4,4 -4,4"/>
+    <path id="open-shape" d="m 8.5,2.5 -4,4 -4,-4"/>
+    <path id="clsd-rtl-shape" d="m 6.5,0.5 -4,4 4,4"/>
+  </defs>
+  <use id="clsd" xlink:href="#clsd-shape"/>
+  <use id="clsd-hover" xlink:href="#clsd-shape"/>
+  <use id="open" xlink:href="#open-shape"/>
+  <use id="open-hover" xlink:href="#open-shape"/>
+  <use id="clsd-rtl" xlink:href="#clsd-rtl-shape"/>
+  <use id="clsd-hover-rtl" xlink:href="#clsd-rtl-shape"/>
+  <use id="open-rtl" xlink:href="#open-shape"/>
+  <use id="open-hover-rtl" xlink:href="#open-shape"/>
+</svg>
new file mode 100644
--- /dev/null
+++ b/tools/mercurial/eslintvalidate.py
@@ -0,0 +1,45 @@
+# This software may be used and distributed according to the terms of the
+# GNU General Public License version 2 or any later version.
+
+import os
+import sys
+import re
+import json
+from subprocess import check_output, CalledProcessError
+
+lintable = re.compile(r'.+\.(?:js|jsm|jsx|xml)$')
+ignored = "File ignored because of your .eslintignore file. Use --no-ignore to override."
+
+def is_lintable(filename):
+    return lintable.match(filename)
+
+def display(ui, output):
+    results = json.loads(output)
+    for file in results:
+        path = os.path.relpath(file["filePath"])
+        for message in file["messages"]:
+            if message["message"] == ignored:
+                continue
+
+            ui.warn("%s:%d:%d %s\n" % (path, message["line"], message["column"], message["message"]))
+
+def eslinthook(ui, repo, node=None, **opts):
+    ctx = repo[node]
+    if len(ctx.parents()) > 1:
+        return 0
+
+    deleted = repo.status(ctx.p1().node(), ctx.node()).deleted
+    files = [f for f in ctx.files() if f not in deleted and is_lintable(f)]
+
+    if len(files) == 0:
+        return
+
+    try:
+        output = check_output(["eslint", "--format", "json"] + files)
+        display(ui, output)
+    except CalledProcessError as ex:
+        display(ui, ex.output)
+        ui.warn("ESLint found problems in your changes, please correct them.\n")
+
+def reposetup(ui, repo):
+    ui.setconfig('hooks', 'commit.eslint', eslinthook)