merge m-c to cedar
authorMike de Boer <mdeboer@mozilla.com>
Thu, 17 Nov 2016 12:46:03 +0100
changeset 440554 76094c82d70cebcf7e596a43a96585cf3100d64b
parent 440553 5b53bda4e10d2cf2a4983cfe1114eda05540584e (current diff)
parent 440252 13f49da109ea460665ad27c8497cb1489548450c (diff)
child 440555 0317989ddb7500327728087bdb87343419affa64
child 441126 c8d39a6ce4255f6431c182c37952e541c0a34cb9
child 441134 4faf584a1be9ac695ea79b92c772519dcdcc7722
push id36260
push userjwein@mozilla.com
push dateThu, 17 Nov 2016 19:58:19 +0000
milestone53.0a1
merge m-c to cedar MozReview-Commit-ID: 6QW2yalKQiM
browser/themes/shared/tabs.inc.css
caps/tests/mochitest/test_app_principal_equality.html
devtools/client/netmonitor/actions/sidebar.js
devtools/client/netmonitor/reducers/sidebar.js
dom/browser-element/BrowserElementProxy.js
dom/browser-element/BrowserElementProxy.manifest
dom/browser-element/mochitest/browserElement_Proxy.js
dom/browser-element/mochitest/priority/test_Preallocated.html
dom/browser-element/mochitest/test_browserElement_inproc_Proxy.html
dom/browser-element/mochitest/test_browserElement_oop_Proxy.html
dom/html/test/test_img_complete.html
dom/imptests/failures/webapps/WebStorage/tests/submissions/Infraware/mochitest.ini
dom/imptests/failures/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html.json
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_constructor.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_url.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_url.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_clear.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_length.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_length.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/storage_builtins.js
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html
dom/indexedDB/test/file_app_isolation.html
dom/indexedDB/test/file_app_isolation.js
dom/indexedDB/test/test_app_isolation_inproc.html
dom/indexedDB/test/test_app_isolation_oop.html
dom/ipc/AppProcessChecker.cpp
dom/ipc/AppProcessChecker.h
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/PreallocatedProcessManager.h
dom/ipc/extensions.js
dom/ipc/preload.js
dom/permission/tests/test_embed-apps.html
dom/permission/tests/test_wifi-manage.html
dom/plugins/ipc/PluginModuleParent.cpp
dom/webidl/BrowserElementProxy.webidl
dom/webidl/MozWifiCapabilities.webidl
dom/webidl/MozWifiConnectionInfoEvent.webidl
dom/webidl/MozWifiManager.webidl
dom/webidl/MozWifiP2pManager.webidl
dom/webidl/MozWifiP2pStatusChangeEvent.webidl
dom/webidl/MozWifiStationInfoEvent.webidl
dom/webidl/MozWifiStatusChangeEvent.webidl
dom/webidl/WifiOptions.webidl
dom/wifi/DOMWifiManager.js
dom/wifi/DOMWifiManager.manifest
dom/wifi/DOMWifiP2pManager.js
dom/wifi/DOMWifiP2pManager.manifest
dom/wifi/StateMachine.jsm
dom/wifi/WifiCertService.cpp
dom/wifi/WifiCertService.h
dom/wifi/WifiCommand.jsm
dom/wifi/WifiHotspotUtils.cpp
dom/wifi/WifiHotspotUtils.h
dom/wifi/WifiNetUtil.jsm
dom/wifi/WifiP2pManager.jsm
dom/wifi/WifiP2pWorkerObserver.jsm
dom/wifi/WifiProxyService.cpp
dom/wifi/WifiProxyService.h
dom/wifi/WifiUtils.cpp
dom/wifi/WifiUtils.h
dom/wifi/WifiWorker.h
dom/wifi/WifiWorker.js
dom/wifi/WifiWorker.manifest
dom/wifi/moz.build
dom/wifi/nsIWifi.idl
dom/wifi/nsIWifiCertService.idl
dom/wifi/nsIWifiService.idl
dom/wifi/test/marionette/head.js
dom/wifi/test/marionette/manifest.ini
dom/wifi/test/marionette/test_wifi_associate.js
dom/wifi/test/marionette/test_wifi_associate_WPA_EAP_PEAP.js
dom/wifi/test/marionette/test_wifi_associate_WPA_EAP_TLS.js
dom/wifi/test/marionette/test_wifi_associate_WPA_EAP_TTLS.js
dom/wifi/test/marionette/test_wifi_associate_wo_connect.js
dom/wifi/test/marionette/test_wifi_auto_connect.js
dom/wifi/test/marionette/test_wifi_enable.js
dom/wifi/test/marionette/test_wifi_enable_api.js
dom/wifi/test/marionette/test_wifi_manage_pkcs12_certificate.js
dom/wifi/test/marionette/test_wifi_manage_server_certificate.js
dom/wifi/test/marionette/test_wifi_manage_user_certificate.js
dom/wifi/test/marionette/test_wifi_scan.js
dom/wifi/test/marionette/test_wifi_static_ip.js
dom/wifi/test/marionette/test_wifi_tethering_wifi_active.js
dom/wifi/test/marionette/test_wifi_tethering_wifi_disabled.js
dom/wifi/test/marionette/test_wifi_tethering_wifi_inactive.js
dom/workers/test/script_bug1301094.js
dom/xbl/test/file_bug946815.xhtml
gfx/layers/ipc/GonkNativeHandle.cpp
gfx/layers/ipc/GonkNativeHandle.h
gfx/layers/ipc/GonkNativeHandleUtils.cpp
gfx/layers/ipc/GonkNativeHandleUtils.h
image/test/reftest/blob/blob-uri-with-ref-param-notref.html
image/test/reftest/blob/blob-uri-with-ref-param.html
image/test/reftest/blob/image.png
image/test/reftest/blob/reftest-stylo.list
image/test/reftest/blob/reftest.list
media/libcubeb/tests/common.h
media/libcubeb/tests/moz.build
media/libcubeb/tests/test_audio.cpp
media/libcubeb/tests/test_devices.cpp
media/libcubeb/tests/test_duplex.cpp
media/libcubeb/tests/test_latency.cpp
media/libcubeb/tests/test_record.cpp
media/libcubeb/tests/test_resampler.cpp
media/libcubeb/tests/test_sanity.cpp
media/libcubeb/tests/test_tone.cpp
media/libcubeb/tests/test_utils.cpp
media/webrtc/signaling/test/sdp_unittests.cpp
netwerk/test/unit_ipc/child_app_offline_notifications.js
security/nss/cmd/pk11ectest/testvecs.h
security/nss/coreconf/pkg_config.py
security/nss/fuzz/Makefile
security/nss/fuzz/common.mk
security/nss/fuzz/libFuzzer/Makefile
security/nss/fuzz/libFuzzer/config.mk
security/nss/fuzz/libFuzzer/manifest.mn
security/nss/fuzz/manifest.mn
security/nss/fuzz/nssfuzz/Makefile
security/nss/fuzz/nssfuzz/cert_target.cc
security/nss/fuzz/nssfuzz/manifest.mn
security/nss/fuzz/nssfuzz/nssfuzz.cc
security/nss/fuzz/nssfuzz/pkcs8_target.cc
security/nss/fuzz/nssfuzz/registry.h
security/nss/fuzz/nssfuzz/shared.h
security/nss/fuzz/nssfuzz/spki_target.cc
security/nss/lib/freebl/mpi/mpi-test.c
security/nss/lib/freebl/mpi/test-info.c
security/nss/tests/run.sh
startupcache/test/TestStartupCacheTelemetry.js
startupcache/test/TestStartupCacheTelemetry.manifest
taskcluster/scripts/misc/build-clang-windows.sh
testing/web-platform/meta/dom/events/Event-subclasses-constructors.html.ini
toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
toolkit/modules/LightweightThemeConsumer.jsm
xpcom/components/nsNativeModuleLoader.cpp
xpcom/components/nsNativeModuleLoader.h
xpcom/tests/bug656331_component/TestComponent.cpp
xpcom/tests/bug656331_component/bug656331.manifest
xpcom/tests/bug656331_component/moz.build
xpcom/tests/component/TestComponent.cpp
xpcom/tests/component/moz.build
xpcom/tests/component/testcomponent.manifest
xpcom/tests/component_no_aslr/Makefile.in
xpcom/tests/component_no_aslr/TestComponent.cpp
xpcom/tests/component_no_aslr/moz.build
xpcom/tests/component_no_aslr/testcompnoaslr.manifest
xpcom/tests/unit/test_comp_no_aslr.js
xpcom/tests/unit/test_compmgr_warnings.js
--- a/.gdbinit
+++ b/.gdbinit
@@ -11,16 +11,17 @@ handle SIG32 noprint nostop pass
 handle SIG33 noprint nostop pass
 handle SIGPIPE noprint nostop pass
 
 # Don't stop for certain other signals where it's not useful,
 # such as the SIG64 signals triggered by the Linux
 # sandboxing code on older kernels.
 handle SIG38 noprint nostop pass
 handle SIG64 noprint nostop pass
+handle SIGSYS noprint nostop pass
 
 # Show the concrete types behind nsIFoo
 set print object on
 
 # run when using the auto-solib-add trick
 def prun
         tbreak main
         run
--- a/.hgignore
+++ b/.hgignore
@@ -110,25 +110,27 @@ GPATH
 # Ignore tox generated dir
 .tox/
 
 # Ignore node_modules
 ^tools/lint/eslint/node_modules/
 
 # Ignore talos virtualenv and tp5n files.
 # The tp5n set is supposed to be decompressed at
-# testing/talos/talos/page_load_test/tp5n in order to run tests like tps
+# testing/talos/talos/tests/tp5n in order to run tests like tps
 # locally. Similarly, running talos requires a Python package virtual
 # environment. Both the virtual environment and tp5n files end up littering
 # the status command, so we ignore them.
 ^testing/talos/.Python
 ^testing/talos/bin/
 ^testing/talos/include/
 ^testing/talos/lib/
 ^testing/talos/talos/tests/tp5n.zip
+^testing/talos/talos/tests/tp5n.tar.gz
 ^testing/talos/talos/tests/tp5n
 ^testing/talos/talos/tests/devtools/damp.manifest.develop
+^talos-venv
 
 # Ignore files created when running a reftest.
 ^lextab.py$
 
 # tup database
 ^\.tup
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -46,20 +46,16 @@ public:
     //    This event will always be emitted. This flag is used for events that
     //    don't support coalescence.
     eAllowDupes,
 
      // eCoalesceReorder : For reorder events from the same subtree or the same
      //    node, only the umbrella event on the ancestor will be emitted.
     eCoalesceReorder,
 
-     // eCoalesceMutationTextChange : coalesce text change events caused by
-     // tree mutations of the same tree level.
-    eCoalesceMutationTextChange,
-
     // eCoalesceOfSameType : For events of the same type, only the newest event
     // will be processed.
     eCoalesceOfSameType,
 
     // eCoalesceSelectionChange: coalescence of selection change events.
     eCoalesceSelectionChange,
 
     // eCoalesceStateChange: coalesce state change events.
@@ -209,17 +205,17 @@ private:
 
 /**
  * Base class for show and hide accessible events.
  */
 class AccMutationEvent: public AccEvent
 {
 public:
   AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
-    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceMutationTextChange)
+    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
   {
     // Don't coalesce these since they are coalesced by reorder event. Coalesce
     // contained text change events.
     mParent = mAccessible->Parent();
   }
   virtual ~AccMutationEvent() { }
 
   // Event
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -85,21 +85,25 @@ void
 EventQueue::CoalesceEvents()
 {
   NS_ASSERTION(mEvents.Length(), "There should be at least one pending event!");
   uint32_t tail = mEvents.Length() - 1;
   AccEvent* tailEvent = mEvents[tail];
 
   switch(tailEvent->mEventRule) {
     case AccEvent::eCoalesceReorder:
-      MOZ_ASSERT(tailEvent->mAccessible->IsApplication() ||
-                 tailEvent->mAccessible->IsOuterDoc() ||
-                 tailEvent->mAccessible->IsXULTree(),
+    {
+      DebugOnly<Accessible*> target = tailEvent->mAccessible.get();
+      MOZ_ASSERT(target->IsApplication() ||
+                 target->IsOuterDoc() ||
+                 target->IsXULTree(),
                  "Only app or outerdoc accessible reorder events are in the queue");
+      MOZ_ASSERT(tailEvent->GetEventType() == nsIAccessibleEvent::EVENT_REORDER, "only reorder events should be queued");
       break; // case eCoalesceReorder
+    }
 
     case AccEvent::eCoalesceOfSameType:
     {
       // Coalesce old events by newer event.
       for (uint32_t index = tail - 1; index < tail; index--) {
         AccEvent* accEvent = mEvents[index];
         if (accEvent->mEventType == tailEvent->mEventType &&
           accEvent->mEventRule == tailEvent->mEventRule) {
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -2268,18 +2268,25 @@ DocAccessible::CacheChildrenInSubtree(Ac
 
 void
 DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
 {
   aRoot->mStateFlags |= eIsNotInDocument;
   RemoveDependentIDsFor(aRoot);
 
   uint32_t count = aRoot->ContentChildCount();
-  for (uint32_t idx = 0; idx < count; idx++)
-    UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
+  for (uint32_t idx = 0; idx < count; idx++) {
+    Accessible* child = aRoot->ContentChildAt(idx);
+
+    // Removing this accessible from the document doesn't mean anything about
+    // accessibles for subdocuments, so skip removing those from the tree.
+    if (!child->IsDoc()) {
+      UncacheChildrenInSubtree(child);
+    }
+  }
 
   if (aRoot->IsNodeMapEntry() &&
       mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
     mNodeToAccessibleMap.Remove(aRoot->GetNode());
 }
 
 void
 DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -346,18 +346,21 @@ HTMLTextFieldAccessible::Value(nsString&
 
   nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
   if (textArea) {
     textArea->GetValue(aValue);
     return;
   }
 
   HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
-  if (input)
-    input->GetValue(aValue);
+  if (input) {
+    // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+    // file input here.
+    input->GetValue(aValue, CallerType::NonSystem);
+  }
 }
 
 void
 HTMLTextFieldAccessible::ApplyARIAState(uint64_t* aState) const
 {
   HyperTextAccessibleWrap::ApplyARIAState(aState);
   aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
 
@@ -547,17 +550,20 @@ HTMLSpinnerAccessible::NativeRole()
 
 void
 HTMLSpinnerAccessible::Value(nsString& aValue)
 {
   AccessibleWrap::Value(aValue);
   if (!aValue.IsEmpty())
     return;
 
-  HTMLInputElement::FromContent(mContent)->GetValue(aValue);
+  // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+  // file input here.
+  HTMLInputElement::FromContent(mContent)->GetValue(aValue,
+                                                    CallerType::NonSystem);
 }
 
 double
 HTMLSpinnerAccessible::MaxValue() const
 {
   double value = AccessibleWrap::MaxValue();
   if (!IsNaN(value))
     return value;
@@ -623,17 +629,20 @@ HTMLRangeAccessible::IsWidget() const
 
 void
 HTMLRangeAccessible::Value(nsString& aValue)
 {
   LeafAccessible::Value(aValue);
   if (!aValue.IsEmpty())
     return;
 
-  HTMLInputElement::FromContent(mContent)->GetValue(aValue);
+  // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+  // file input here.
+  HTMLInputElement::FromContent(mContent)->GetValue(aValue,
+                                                    CallerType::NonSystem);
 }
 
 double
 HTMLRangeAccessible::MaxValue() const
 {
   double value = LeafAccessible::MaxValue();
   if (!IsNaN(value))
     return value;
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -10,79 +10,79 @@
 #include "xpcAccessibleDocument.h"
 #include "xpcAccEvents.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 
 namespace mozilla {
 namespace a11y {
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvShowEvent(const ShowEventData& aData,
                                    const bool& aFromUser)
 {
   if (mShutdown)
-    return true;
+    return IPC_OK();
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   if (aData.NewTree().IsEmpty()) {
     NS_ERROR("no children being added");
-    return false;
+    return IPC_FAIL_NO_REASON(this);
   }
 
   ProxyAccessible* parent = GetAccessible(aData.ID());
 
   // XXX This should really never happen, but sometimes we fail to fire the
   // required show events.
   if (!parent) {
     NS_ERROR("adding child to unknown accessible");
-    return true;
+    return IPC_OK();
   }
 
   uint32_t newChildIdx = aData.Idx();
   if (newChildIdx > parent->ChildrenCount()) {
     NS_ERROR("invalid index to add child at");
-    return true;
+    return IPC_OK();
   }
 
   uint32_t consumed = AddSubtree(parent, aData.NewTree(), 0, newChildIdx);
   MOZ_ASSERT(consumed == aData.NewTree().Length());
 
   // XXX This shouldn't happen, but if we failed to add children then the below
   // is pointless and can crash.
   if (!consumed) {
-    return true;
+    return IPC_OK();
   }
 
 #ifdef DEBUG
   for (uint32_t i = 0; i < consumed; i++) {
     uint64_t id = aData.NewTree()[i].ID();
     MOZ_ASSERT(mAccessibles.GetEntry(id));
   }
 #endif
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   ProxyAccessible* target = parent->ChildAt(newChildIdx);
   ProxyShowHideEvent(target, parent, true, aFromUser);
 
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
 
   uint32_t type = nsIAccessibleEvent::EVENT_SHOW;
   xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(target);
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   nsIDOMNode* node = nullptr;
   RefPtr<xpcAccEvent> event = new xpcAccEvent(type, xpcAcc, doc, node,
                                               aFromUser);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
 uint32_t
 DocAccessibleParent::AddSubtree(ProxyAccessible* aParent,
                                 const nsTArray<a11y::AccessibleData>& aNewTree,
                                 uint32_t aIdx, uint32_t aIdxInParent)
 {
   if (aNewTree.Length() <= aIdx) {
@@ -125,42 +125,42 @@ DocAccessibleParent::AddSubtree(ProxyAcc
     accessibles += consumed;
   }
 
   MOZ_ASSERT(newProxy->ChildrenCount() == kids);
 
   return accessibles;
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID,
                                    const bool& aFromUser)
 {
   if (mShutdown)
-    return true;
+    return IPC_OK();
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   // We shouldn't actually need this because mAccessibles shouldn't have an
   // entry for the document itself, but it doesn't hurt to be explicit.
   if (!aRootID) {
     NS_ERROR("trying to hide entire document?");
-    return false;
+    return IPC_FAIL_NO_REASON(this);
   }
 
   ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID);
   if (!rootEntry) {
     NS_ERROR("invalid root being removed!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyAccessible* root = rootEntry->mProxy;
   if (!root) {
     NS_ERROR("invalid root being removed!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyAccessible* parent = root->Parent();
   ProxyShowHideEvent(root, parent, false, aFromUser);
 
   RefPtr<xpcAccHideEvent> event = nullptr;
   if (nsCoreUtils::AccEventObserversExist()) {
     uint32_t type = nsIAccessibleEvent::EVENT_HIDE;
@@ -180,191 +180,194 @@ DocAccessibleParent::RecvHideEvent(const
   root->Shutdown();
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   if (event) {
     nsCoreUtils::DispatchAccEvent(Move(event));
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvEvent(const uint64_t& aID, const uint32_t& aEventType)
 {
   ProxyAccessible* proxy = GetAccessible(aID);
   if (!proxy) {
     NS_ERROR("no proxy for event!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyEvent(proxy, aEventType);
 
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
 
   xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(proxy);
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   nsIDOMNode* node = nullptr;
   bool fromUser = true; // XXX fix me
   RefPtr<xpcAccEvent> event = new xpcAccEvent(aEventType, xpcAcc, doc, node,
                                               fromUser);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvStateChangeEvent(const uint64_t& aID,
                                           const uint64_t& aState,
                                           const bool& aEnabled)
 {
   ProxyAccessible* target = GetAccessible(aID);
   if (!target) {
     NS_ERROR("we don't know about the target of a state change event!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyStateChangeEvent(target, aState, aEnabled);
 
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
 
   xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(target);
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   uint32_t type = nsIAccessibleEvent::EVENT_STATE_CHANGE;
   bool extra;
   uint32_t state = nsAccUtils::To32States(aState, &extra);
   bool fromUser = true; // XXX fix this
   nsIDOMNode* node = nullptr; // XXX can we do better?
   RefPtr<xpcAccStateChangeEvent> event =
     new xpcAccStateChangeEvent(type, xpcAcc, doc, node, fromUser, state, extra,
                                aEnabled);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
 {
   ProxyAccessible* proxy = GetAccessible(aID);
   if (!proxy) {
     NS_ERROR("unknown caret move event target!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyCaretMoveEvent(proxy, aOffset);
 
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
 
   xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(proxy);
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   nsIDOMNode* node = nullptr;
   bool fromUser = true; // XXX fix me
   uint32_t type = nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED;
   RefPtr<xpcAccCaretMoveEvent> event =
     new xpcAccCaretMoveEvent(type, xpcAcc, doc, node, fromUser, aOffset);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvTextChangeEvent(const uint64_t& aID,
                                          const nsString& aStr,
                                          const int32_t& aStart,
                                          const uint32_t& aLen,
                                          const bool& aIsInsert,
                                          const bool& aFromUser)
 {
   ProxyAccessible* target = GetAccessible(aID);
   if (!target) {
     NS_ERROR("text change event target is unknown!");
-    return true;
+    return IPC_OK();
   }
 
   ProxyTextChangeEvent(target, aStr, aStart, aLen, aIsInsert, aFromUser);
 
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
 
   xpcAccessibleGeneric* xpcAcc = GetXPCAccessible(target);
   xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
   uint32_t type = aIsInsert ? nsIAccessibleEvent::EVENT_TEXT_INSERTED :
                               nsIAccessibleEvent::EVENT_TEXT_REMOVED;
   nsIDOMNode* node = nullptr;
   RefPtr<xpcAccTextChangeEvent> event =
     new xpcAccTextChangeEvent(type, xpcAcc, doc, node, aFromUser, aStart, aLen,
                               aIsInsert, aStr);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvSelectionEvent(const uint64_t& aID,
                                         const uint64_t& aWidgetID,
                                         const uint32_t& aType)
 {
   ProxyAccessible* target = GetAccessible(aID);
   ProxyAccessible* widget = GetAccessible(aWidgetID);
   if (!target || !widget) {
     NS_ERROR("invalid id in selection event");
-    return true;
+    return IPC_OK();
   }
 
   ProxySelectionEvent(target, widget, aType);
   if (!nsCoreUtils::AccEventObserversExist()) {
-    return true;
+    return IPC_OK();
   }
   xpcAccessibleGeneric* xpcTarget = GetXPCAccessible(target);
   xpcAccessibleDocument* xpcDoc = GetAccService()->GetXPCDocument(this);
   RefPtr<xpcAccEvent> event = new xpcAccEvent(aType, xpcTarget, xpcDoc,
                                               nullptr, false);
   nsCoreUtils::DispatchAccEvent(Move(event));
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvRoleChangedEvent(const uint32_t& aRole)
 {
  if (aRole >= roles::LAST_ROLE) {
    NS_ERROR("child sent bad role in RoleChangedEvent");
-   return false;
+   return IPC_FAIL_NO_REASON(this);
  }
 
  mRole = static_cast<a11y::role>(aRole);
- return true;
+ return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
 {
   // One document should never directly be the child of another.
   // We should always have at least an outer doc accessible in between.
   MOZ_ASSERT(aID);
   if (!aID)
-    return false;
+    return IPC_FAIL_NO_REASON(this);
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
   childDoc->Unbind();
   bool result = AddChildDoc(childDoc, aID, false);
   MOZ_ASSERT(result);
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
-  return result;
+  if (!result) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+  return IPC_OK();
 }
 
 bool
 DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
                                  uint64_t aParentID, bool aCreating)
 {
   // We do not use GetAccessible here because we want to be sure to not get the
   // document it self.
@@ -390,26 +393,28 @@ DocAccessibleParent::AddChildDoc(DocAcce
 
   if (aCreating) {
     ProxyCreated(aChildDoc, Interfaces::DOCUMENT | Interfaces::HYPERTEXT);
   }
 
   return true;
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvShutdown()
 {
   Destroy();
 
   if (!static_cast<dom::TabParent*>(Manager())->IsDestroyed()) {
-  return PDocAccessibleParent::Send__delete__(this);
+    if (!PDocAccessibleParent::Send__delete__(this)) {
+      return IPC_FAIL_NO_REASON(this);
+    }
   }
 
-  return true;
+  return IPC_OK();
 }
 
 void
 DocAccessibleParent::Destroy()
 {
   NS_ASSERTION(mChildDocs.IsEmpty(),
                "why weren't the child docs destroyed already?");
   MOZ_ASSERT(!mShutdown);
@@ -460,28 +465,28 @@ DocAccessibleParent::GetXPCAccessible(Pr
 
 #if defined(XP_WIN)
 /**
  * @param aCOMProxy COM Proxy to the document in the content process.
  * @param aParentCOMProxy COM Proxy to the OuterDocAccessible that is
  *        the parent of the document. The content process will use this
  *        proxy when traversing up across the content/chrome boundary.
  */
-bool
+mozilla::ipc::IPCResult
 DocAccessibleParent::RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
                                   IAccessibleHolder* aParentCOMProxy)
 {
   RefPtr<IAccessible> ptr(aCOMProxy.Get());
   SetCOMInterface(ptr);
 
   Accessible* outerDoc = OuterDocOfRemoteBrowser();
   IAccessible* rawNative = nullptr;
   if (outerDoc) {
     outerDoc->GetNativeInterface((void**) &rawNative);
   }
 
   aParentCOMProxy->Set(IAccessibleHolder::COMPtrType(rawNative));
-  return true;
+  return IPC_OK();
 }
 #endif // defined(XP_WIN)
 
 } // a11y
 } // mozilla
--- a/accessible/ipc/DocAccessibleParent.h
+++ b/accessible/ipc/DocAccessibleParent.h
@@ -42,54 +42,54 @@ public:
   bool IsTopLevel() const { return mTopLevel; }
 
   bool IsShutdown() const { return mShutdown; }
 
   /*
    * Called when a message from a document in a child process notifies the main
    * process it is firing an event.
    */
-  virtual bool RecvEvent(const uint64_t& aID, const uint32_t& aType)
+  virtual mozilla::ipc::IPCResult RecvEvent(const uint64_t& aID, const uint32_t& aType)
     override;
 
-  virtual bool RecvShowEvent(const ShowEventData& aData, const bool& aFromUser)
+  virtual mozilla::ipc::IPCResult RecvShowEvent(const ShowEventData& aData, const bool& aFromUser)
     override;
-  virtual bool RecvHideEvent(const uint64_t& aRootID, const bool& aFromUser)
+  virtual mozilla::ipc::IPCResult RecvHideEvent(const uint64_t& aRootID, const bool& aFromUser)
     override;
-  virtual bool RecvStateChangeEvent(const uint64_t& aID,
-                                    const uint64_t& aState,
-                                    const bool& aEnabled) override final;
+  virtual mozilla::ipc::IPCResult RecvStateChangeEvent(const uint64_t& aID,
+                                                       const uint64_t& aState,
+                                                       const bool& aEnabled) override final;
 
-  virtual bool RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
+  virtual mozilla::ipc::IPCResult RecvCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset)
     override final;
 
-  virtual bool RecvTextChangeEvent(const uint64_t& aID, const nsString& aStr,
-                                   const int32_t& aStart, const uint32_t& aLen,
-                                   const bool& aIsInsert,
-                                   const bool& aFromUser) override;
+  virtual mozilla::ipc::IPCResult RecvTextChangeEvent(const uint64_t& aID, const nsString& aStr,
+                                                      const int32_t& aStart, const uint32_t& aLen,
+                                                      const bool& aIsInsert,
+                                                      const bool& aFromUser) override;
 
-  virtual bool RecvSelectionEvent(const uint64_t& aID,
-                                  const uint64_t& aWidgetID,
-                                  const uint32_t& aType) override;
+  virtual mozilla::ipc::IPCResult RecvSelectionEvent(const uint64_t& aID,
+                                                     const uint64_t& aWidgetID,
+                                                     const uint32_t& aType) override;
 
-  virtual bool RecvRoleChangedEvent(const uint32_t& aRole) override final;
+  virtual mozilla::ipc::IPCResult RecvRoleChangedEvent(const uint32_t& aRole) override final;
 
-  virtual bool RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
+  virtual mozilla::ipc::IPCResult RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
 
   void Unbind()
   {
     mParent = nullptr;
     if (DocAccessibleParent* parent = ParentDoc()) {
       parent->mChildDocs.RemoveElement(this);
     }
 
     mParentDoc = nullptr;
   }
 
-  virtual bool RecvShutdown() override;
+  virtual mozilla::ipc::IPCResult RecvShutdown() override;
   void Destroy();
   virtual void ActorDestroy(ActorDestroyReason aWhy) override
   {
     MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
     if (!mShutdown)
       Destroy();
   }
 
@@ -139,18 +139,18 @@ public:
   const ProxyAccessible* GetAccessible(uintptr_t aID) const
     { return const_cast<DocAccessibleParent*>(this)->GetAccessible(aID); }
 
   size_t ChildDocCount() const { return mChildDocs.Length(); }
   const DocAccessibleParent* ChildDocAt(size_t aIdx) const
     { return mChildDocs[aIdx]; }
 
 #if defined(XP_WIN)
-  virtual bool RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
-                            IAccessibleHolder* aParentCOMProxy) override;
+  virtual mozilla::ipc::IPCResult RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
+                                               IAccessibleHolder* aParentCOMProxy) override;
 #endif
 
 private:
 
   class ProxyEntry : public PLDHashEntryHdr
   {
   public:
     explicit ProxyEntry(const void*) : mProxy(nullptr) {}
--- a/accessible/ipc/other/DocAccessibleChild.cpp
+++ b/accessible/ipc/other/DocAccessibleChild.cpp
@@ -80,99 +80,102 @@ DocAccessibleChild::IdToTableCellAccessi
 
 TableAccessible*
 DocAccessibleChild::IdToTableAccessible(const uint64_t& aID) const
 {
   Accessible* acc = IdToAccessible(aID);
   return (acc && acc->IsTable()) ? acc->AsTable() : nullptr;
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvState(const uint64_t& aID, uint64_t* aState)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
     *aState = states::DEFUNCT;
-    return true;
+    return IPC_OK();
   }
 
   *aState = acc->State();
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvNativeState(const uint64_t& aID, uint64_t* aState)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
     *aState = states::DEFUNCT;
-    return true;
+    return IPC_OK();
   }
 
   *aState = acc->NativeState();
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvName(const uint64_t& aID, nsString* aName)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
   acc->Name(*aName);
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvValue(const uint64_t& aID, nsString* aValue)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   acc->Value(*aValue);
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvHelp(const uint64_t& aID, nsString* aHelp)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   acc->Help(*aHelp);
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDescription(const uint64_t& aID, nsString* aDesc)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
   acc->Description(*aDesc);
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAttributes(const uint64_t& aID, nsTArray<Attribute>* aAttributes)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
   nsCOMPtr<nsIPersistentProperties> props = acc->Attributes();
-  return PersistentPropertiesToArray(props, aAttributes);
+  if (!PersistentPropertiesToArray(props, aAttributes)) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+  return IPC_OK();
 }
 
 bool
 DocAccessibleChild::PersistentPropertiesToArray(nsIPersistentProperties* aProps,
                                                 nsTArray<Attribute>* aAttributes)
 {
   if (!aProps) {
     return true;
@@ -199,31 +202,31 @@ DocAccessibleChild::PersistentProperties
     NS_ENSURE_SUCCESS(rv, false);
 
     aAttributes->AppendElement(Attribute(name, value));
     }
 
   return true;
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRelationByType(const uint64_t& aID,
                                        const uint32_t& aType,
                                        nsTArray<uint64_t>* aTargets)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
   auto type = static_cast<RelationType>(aType);
   Relation rel = acc->RelationByType(type);
   while (Accessible* target = rel.Next())
     aTargets->AppendElement(reinterpret_cast<uintptr_t>(target));
 
-  return true;
+  return IPC_OK();
 }
 
 static void
 AddRelation(Accessible* aAcc, RelationType aType,
             nsTArray<RelationTargets>* aTargets)
 {
   Relation rel = aAcc->RelationByType(aType);
   nsTArray<uint64_t> targets;
@@ -233,309 +236,315 @@ AddRelation(Accessible* aAcc, RelationTy
   if (!targets.IsEmpty()) {
     RelationTargets* newRelation =
       aTargets->AppendElement(RelationTargets(static_cast<uint32_t>(aType),
                                               nsTArray<uint64_t>()));
     newRelation->Targets().SwapElements(targets);
   }
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRelations(const uint64_t& aID,
                                   nsTArray<RelationTargets>* aRelations)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
 #define RELATIONTYPE(gecko, s, a, m, i) AddRelation(acc, RelationType::gecko, aRelations);
 
 #include "RelationTypeMap.h"
 #undef RELATIONTYPE
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvIsSearchbox(const uint64_t& aID, bool* aRetVal)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc)
-    return true;
+    return IPC_OK();
 
   *aRetVal = acc->IsSearchbox();
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLandmarkRole(const uint64_t& aID, nsString* aLandmark)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   if (nsIAtom* roleAtom = acc->LandmarkRole()) {
     roleAtom->ToString(*aLandmark);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvARIARoleAtom(const uint64_t& aID, nsString* aRole)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   if (const nsRoleMapEntry* roleMap = acc->ARIARoleMap()) {
     if (nsIAtom* roleAtom = *(roleMap->roleAtom)) {
       roleAtom->ToString(*aRole);
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetLevelInternal(const uint64_t& aID, int32_t* aLevel)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aLevel = acc->GetLevelInternal();
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvScrollTo(const uint64_t& aID,
                                  const uint32_t& aScrollType)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     nsCoreUtils::ScrollTo(acc->Document()->PresShell(), acc->GetContent(),
                           aScrollType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvScrollToPoint(const uint64_t& aID, const uint32_t& aScrollType, const int32_t& aX, const int32_t& aY)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->ScrollToPoint(aScrollType, aX, aY);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCaretLineNumber(const uint64_t& aID, int32_t* aLineNumber)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aLineNumber = acc && acc->IsTextRole() ? acc->CaretLineNumber() : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aOffset = acc && acc->IsTextRole() ? acc->CaretOffset() : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSetCaretOffset(const uint64_t& aID,
                                        const int32_t& aOffset)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole() && acc->IsValidOffset(aOffset)) {
     acc->SetCaretOffset(aOffset);
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aCount = acc ? acc->CharacterCount() : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSelectionCount(const uint64_t& aID, int32_t* aCount)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aCount = acc ? acc->SelectionCount() : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTextSubstring(const uint64_t& aID,
                                       const int32_t& aStartOffset,
                                       const int32_t& aEndOffset,
                                       nsString* aText, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   *aValid = acc->IsValidRange(aStartOffset, aEndOffset);
   acc->TextSubstring(aStartOffset, aEndOffset, *aText);
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetTextAfterOffset(const uint64_t& aID,
                                            const int32_t& aOffset,
                                            const int32_t& aBoundaryType,
                                            nsString* aText,
                                            int32_t* aStartOffset,
                                            int32_t* aEndOffset)
 {
   *aStartOffset = 0;
   *aEndOffset = 0;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     acc->TextAfterOffset(aOffset, aBoundaryType,
                          aStartOffset, aEndOffset, *aText);
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetTextAtOffset(const uint64_t& aID,
                                         const int32_t& aOffset,
                                         const int32_t& aBoundaryType,
                                         nsString* aText,
                                         int32_t* aStartOffset,
                                         int32_t* aEndOffset)
 {
   *aStartOffset = 0;
   *aEndOffset = 0;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     acc->TextAtOffset(aOffset, aBoundaryType,
                       aStartOffset, aEndOffset, *aText);
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetTextBeforeOffset(const uint64_t& aID,
                                             const int32_t& aOffset,
                                             const int32_t& aBoundaryType,
                                             nsString* aText,
                                             int32_t* aStartOffset,
                                             int32_t* aEndOffset)
 {
   *aStartOffset = 0;
   *aEndOffset = 0;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     acc->TextBeforeOffset(aOffset, aBoundaryType,
                           aStartOffset, aEndOffset, *aText);
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCharAt(const uint64_t& aID,
                                const int32_t& aOffset,
                                uint16_t* aChar)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aChar = acc && acc->IsTextRole() ?
     static_cast<uint16_t>(acc->CharAt(aOffset)) : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTextAttributes(const uint64_t& aID,
                                        const bool& aIncludeDefAttrs,
                                        const int32_t& aOffset,
                                        nsTArray<Attribute>* aAttributes,
                                        int32_t* aStartOffset,
                                        int32_t* aEndOffset)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (!acc || !acc->IsTextRole()) {
-    return true;
+    return IPC_OK();
   }
 
   nsCOMPtr<nsIPersistentProperties> props =
     acc->TextAttributes(aIncludeDefAttrs, aOffset, aStartOffset, aEndOffset);
-  return PersistentPropertiesToArray(props, aAttributes);
+  if (!PersistentPropertiesToArray(props, aAttributes)) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDefaultTextAttributes(const uint64_t& aID,
                                               nsTArray<Attribute> *aAttributes)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (!acc || !acc->IsTextRole()) {
-    return true;
+    return IPC_OK();
   }
 
   nsCOMPtr<nsIPersistentProperties> props = acc->DefaultTextAttributes();
-  return PersistentPropertiesToArray(props, aAttributes);
+  if (!PersistentPropertiesToArray(props, aAttributes)) {
+    return IPC_FAIL_NO_REASON(this);
+  }
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTextBounds(const uint64_t& aID,
                                    const int32_t& aStartOffset,
                                    const int32_t& aEndOffset,
                                    const uint32_t& aCoordType,
                                    nsIntRect* aRetVal)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aRetVal = acc->TextBounds(aStartOffset, aEndOffset, aCoordType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCharBounds(const uint64_t& aID,
                                    const int32_t& aOffset,
                                    const uint32_t& aCoordType,
                                    nsIntRect* aRetVal)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aRetVal = acc->CharBounds(aOffset, aCoordType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvOffsetAtPoint(const uint64_t& aID,
                                       const int32_t& aX,
                                       const int32_t& aY,
                                       const uint32_t& aCoordType,
                                       int32_t* aRetVal)
 {
   *aRetVal = -1;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aRetVal = acc->OffsetAtPoint(aX, aY, aCoordType);
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSelectionBoundsAt(const uint64_t& aID,
                                           const int32_t& aSelectionNum,
                                           bool* aSucceeded,
                                           nsString* aData,
                                           int32_t* aStartOffset,
                                           int32_t* aEndOffset)
 {
   *aSucceeded = false;
@@ -545,581 +554,581 @@ DocAccessibleChild::RecvSelectionBoundsA
   if (acc && acc->IsTextRole()) {
     *aSucceeded =
       acc->SelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
     if (*aSucceeded) {
       acc->TextSubstring(*aStartOffset, *aEndOffset, *aData);
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSetSelectionBoundsAt(const uint64_t& aID,
                                              const int32_t& aSelectionNum,
                                              const int32_t& aStartOffset,
                                              const int32_t& aEndOffset,
                                              bool* aSucceeded)
 {
   *aSucceeded = false;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aSucceeded =
       acc->SetSelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAddToSelection(const uint64_t& aID,
                                        const int32_t& aStartOffset,
                                        const int32_t& aEndOffset,
                                        bool* aSucceeded)
 {
   *aSucceeded = false;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aSucceeded = acc->AddToSelection(aStartOffset, aEndOffset);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRemoveFromSelection(const uint64_t& aID,
                                             const int32_t& aSelectionNum,
                                             bool* aSucceeded)
 {
   *aSucceeded = false;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aSucceeded = acc->RemoveFromSelection(aSelectionNum);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvScrollSubstringTo(const uint64_t& aID,
                                           const int32_t& aStartOffset,
                                           const int32_t& aEndOffset,
                                           const uint32_t& aScrollType)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     acc->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvScrollSubstringToPoint(const uint64_t& aID,
                                                const int32_t& aStartOffset,
                                                const int32_t& aEndOffset,
                                                const uint32_t& aCoordinateType,
                                                const int32_t& aX,
                                                const int32_t& aY)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     acc->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoordinateType,
                                 aX, aY);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvText(const uint64_t& aID,
                              nsString* aText)
 {
   TextLeafAccessible* acc = IdToTextLeafAccessible(aID);
   if (acc) {
     *aText = acc->Text();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvReplaceText(const uint64_t& aID,
                                     const nsString& aText)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     acc->ReplaceText(aText);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvInsertText(const uint64_t& aID,
                                    const nsString& aText,
                                    const int32_t& aPosition, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aValid = acc->IsValidOffset(aPosition);
     acc->InsertText(aText, aPosition);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCopyText(const uint64_t& aID,
                                  const int32_t& aStartPos,
                                  const int32_t& aEndPos, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     acc->CopyText(aStartPos, aEndPos);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCutText(const uint64_t& aID,
                                 const int32_t& aStartPos,
                                 const int32_t& aEndPos, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aValid = acc->IsValidRange(aStartPos, aEndPos);
     acc->CutText(aStartPos, aEndPos);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDeleteText(const uint64_t& aID,
                                    const int32_t& aStartPos,
                                    const int32_t& aEndPos, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aValid = acc->IsValidRange(aStartPos, aEndPos);
     acc->DeleteText(aStartPos, aEndPos);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvPasteText(const uint64_t& aID,
                                   const int32_t& aPosition, bool* aValid)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc && acc->IsTextRole()) {
     *aValid = acc->IsValidOffset(aPosition);
     acc->PasteText(aPosition);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvImagePosition(const uint64_t& aID,
                                       const uint32_t& aCoordType,
                                       nsIntPoint* aRetVal)
 {
   ImageAccessible* acc = IdToImageAccessible(aID);
   if (acc) {
     *aRetVal = acc->Position(aCoordType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvImageSize(const uint64_t& aID,
                                   nsIntSize* aRetVal)
 {
 
   ImageAccessible* acc = IdToImageAccessible(aID);
   if (acc) {
     *aRetVal = acc->Size();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvStartOffset(const uint64_t& aID,
                                     uint32_t* aRetVal,
                                     bool* aOk)
 {
   Accessible* acc = IdToAccessibleLink(aID);
   if (acc) {
     *aRetVal = acc->StartOffset();
     *aOk = true;
   } else {
     *aRetVal = 0;
     *aOk = false;
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvEndOffset(const uint64_t& aID,
                                   uint32_t* aRetVal,
                                   bool* aOk)
 {
   Accessible* acc = IdToAccessibleLink(aID);
   if (acc) {
     *aRetVal = acc->EndOffset();
     *aOk = true;
   } else {
     *aRetVal = 0;
     *aOk = false;
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvIsLinkValid(const uint64_t& aID,
                                     bool* aRetVal)
 {
   Accessible* acc = IdToAccessibleLink(aID);
   if (acc) {
     *aRetVal = acc->IsLinkValid();
   } else {
     *aRetVal = false;
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAnchorCount(const uint64_t& aID,
                                     uint32_t* aRetVal,
                                     bool* aOk)
 {
   Accessible* acc = IdToAccessibleLink(aID);
   if (acc) {
     *aRetVal = acc->AnchorCount();
     *aOk = true;
   } else {
     *aRetVal = 0;
     *aOk = false;
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAnchorURIAt(const uint64_t& aID,
                                     const uint32_t& aIndex,
                                     nsCString* aURI,
                                     bool* aOk)
 {
   Accessible* acc = IdToAccessibleLink(aID);
   *aOk = false;
   if (acc) {
     nsCOMPtr<nsIURI> uri = acc->AnchorURIAt(aIndex);
     if (uri) {
       uri->GetSpec(*aURI);
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAnchorAt(const uint64_t& aID,
                                  const uint32_t& aIndex,
                                  uint64_t* aIDOfAnchor,
                                  bool* aOk)
 {
   *aIDOfAnchor = 0;
   *aOk = false;
   Accessible* acc = IdToAccessibleLink(aID);
   if (acc) {
     Accessible* anchor = acc->AnchorAt(aIndex);
     if (anchor) {
       *aIDOfAnchor = reinterpret_cast<uint64_t>(anchor->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLinkCount(const uint64_t& aID,
                                   uint32_t* aCount)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aCount = acc ? acc->LinkCount() : 0;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLinkAt(const uint64_t& aID,
                                const uint32_t& aIndex,
                                uint64_t* aIDOfLink,
                                bool* aOk)
 {
   *aIDOfLink = 0;
   *aOk = false;
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   if (acc) {
     Accessible* link = acc->LinkAt(aIndex);
     if (link) {
       *aIDOfLink = reinterpret_cast<uint64_t>(link->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLinkIndexOf(const uint64_t& aID,
                                     const uint64_t& aLinkID,
                                     int32_t* aIndex)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   Accessible* link = IdToAccessible(aLinkID);
   *aIndex = -1;
   if (acc && link) {
     *aIndex = acc->LinkIndexOf(link);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLinkIndexAtOffset(const uint64_t& aID,
                                           const uint32_t& aOffset,
                                           int32_t* aIndex)
 {
   HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
   *aIndex = acc ? acc->LinkIndexAtOffset(aOffset) : -1;
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableOfACell(const uint64_t& aID,
                                      uint64_t* aTableID,
                                      bool* aOk)
 {
   *aTableID = 0;
   *aOk = false;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     TableAccessible* table = acc->Table();
     if (table) {
       *aTableID = reinterpret_cast<uint64_t>(table->AsAccessible()->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvColIdx(const uint64_t& aID,
                                uint32_t* aIndex)
 {
   *aIndex = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aIndex = acc->ColIdx();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRowIdx(const uint64_t& aID,
                                uint32_t* aIndex)
 {
   *aIndex = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aIndex = acc->RowIdx();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetPosition(const uint64_t& aID,
                                uint32_t* aColIdx, uint32_t* aRowIdx)
 {
   *aColIdx = 0;
   *aRowIdx = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aColIdx = acc->ColIdx();
     *aRowIdx = acc->RowIdx();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetColRowExtents(const uint64_t& aID,
                                          uint32_t* aColIdx, uint32_t* aRowIdx,
                                          uint32_t* aColExtent, uint32_t* aRowExtent)
 {
   *aColIdx = 0;
   *aRowIdx = 0;
   *aColExtent = 0;
   *aRowExtent = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aColIdx = acc->ColIdx();
     *aRowIdx = acc->RowIdx();
     *aColExtent = acc->ColExtent();
     *aRowExtent = acc->RowExtent();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvColExtent(const uint64_t& aID,
                                   uint32_t* aExtent)
 {
   *aExtent = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aExtent = acc->ColExtent();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRowExtent(const uint64_t& aID,
                                   uint32_t* aExtent)
 {
   *aExtent = 0;
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     *aExtent = acc->RowExtent();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
                                        nsTArray<uint64_t>* aCells)
 {
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     AutoTArray<Accessible*, 10> headerCells;
     acc->ColHeaderCells(&headerCells);
     aCells->SetCapacity(headerCells.Length());
     for (uint32_t i = 0; i < headerCells.Length(); ++i) {
       aCells->AppendElement(
         reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
                                        nsTArray<uint64_t>* aCells)
 {
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   if (acc) {
     AutoTArray<Accessible*, 10> headerCells;
     acc->RowHeaderCells(&headerCells);
     aCells->SetCapacity(headerCells.Length());
     for (uint32_t i = 0; i < headerCells.Length(); ++i) {
       aCells->AppendElement(
         reinterpret_cast<uint64_t>(headerCells[i]->UniqueID()));
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvIsCellSelected(const uint64_t& aID,
                                        bool* aSelected)
 {
   TableCellAccessible* acc = IdToTableCellAccessible(aID);
   *aSelected = acc && acc->Selected();
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableCaption(const uint64_t& aID,
                                      uint64_t* aCaptionID,
                                      bool* aOk)
 {
   *aCaptionID = 0;
   *aOk = false;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     Accessible* caption = acc->Caption();
     if (caption) {
       *aCaptionID = reinterpret_cast<uint64_t>(caption->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSummary(const uint64_t& aID,
                                      nsString* aSummary)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->Summary(*aSummary);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableColumnCount(const uint64_t& aID,
                                          uint32_t* aColCount)
 {
   *aColCount = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aColCount = acc->ColCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowCount(const uint64_t& aID,
                                       uint32_t* aRowCount)
 {
   *aRowCount = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aRowCount = acc->RowCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableCellAt(const uint64_t& aID,
                                     const uint32_t& aRow,
                                     const uint32_t& aCol,
                                     uint64_t* aCellID,
                                     bool* aOk)
 {
   *aCellID = 0;
   *aOk = false;
@@ -1127,332 +1136,332 @@ DocAccessibleChild::RecvTableCellAt(cons
   if (acc) {
     Accessible* cell = acc->CellAt(aRow, aCol);
     if (cell) {
       *aCellID = reinterpret_cast<uint64_t>(cell->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableCellIndexAt(const uint64_t& aID,
                                          const uint32_t& aRow,
                                          const uint32_t& aCol,
                                          int32_t* aIndex)
 {
   *aIndex = -1;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aIndex = acc->CellIndexAt(aRow, aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableColumnIndexAt(const uint64_t& aID,
                                            const uint32_t& aCellIndex,
                                            int32_t* aCol)
 {
   *aCol = -1;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aCol = acc->ColIndexAt(aCellIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowIndexAt(const uint64_t& aID,
                                         const uint32_t& aCellIndex,
                                         int32_t* aRow)
 {
   *aRow = -1;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aRow = acc->RowIndexAt(aCellIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowAndColumnIndicesAt(const uint64_t& aID,
                                                   const uint32_t& aCellIndex,
                                                   int32_t* aRow,
                                                   int32_t* aCol)
 {
   *aRow = -1;
   *aCol = -1;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->RowAndColIndicesAt(aCellIndex, aRow, aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableColumnExtentAt(const uint64_t& aID,
                                             const uint32_t& aRow,
                                             const uint32_t& aCol,
                                             uint32_t* aExtent)
 {
   *aExtent = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aExtent = acc->ColExtentAt(aRow, aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowExtentAt(const uint64_t& aID,
                                          const uint32_t& aRow,
                                          const uint32_t& aCol,
                                          uint32_t* aExtent)
 {
   *aExtent = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aExtent = acc->RowExtentAt(aRow, aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableColumnDescription(const uint64_t& aID,
                                                const uint32_t& aCol,
                                                nsString* aDescription)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->ColDescription(aCol, *aDescription);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowDescription(const uint64_t& aID,
                                             const uint32_t& aRow,
                                             nsString* aDescription)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->RowDescription(aRow, *aDescription);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableColumnSelected(const uint64_t& aID,
                                             const uint32_t& aCol,
                                             bool* aSelected)
 {
   *aSelected = false;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelected = acc->IsColSelected(aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableRowSelected(const uint64_t& aID,
                                          const uint32_t& aRow,
                                          bool* aSelected)
 {
   *aSelected = false;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelected = acc->IsRowSelected(aRow);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableCellSelected(const uint64_t& aID,
                                           const uint32_t& aRow,
                                           const uint32_t& aCol,
                                           bool* aSelected)
 {
   *aSelected = false;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelected = acc->IsCellSelected(aRow, aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedCellCount(const uint64_t& aID,
                                                uint32_t* aSelectedCells)
 {
   *aSelectedCells = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelectedCells = acc->SelectedCellCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedColumnCount(const uint64_t& aID,
                                                  uint32_t* aSelectedColumns)
 {
   *aSelectedColumns = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelectedColumns = acc->SelectedColCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedRowCount(const uint64_t& aID,
                                               uint32_t* aSelectedRows)
 {
   *aSelectedRows = 0;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aSelectedRows = acc->SelectedRowCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
                                            nsTArray<uint64_t>* aCellIDs)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     AutoTArray<Accessible*, 30> cells;
     acc->SelectedCells(&cells);
     aCellIDs->SetCapacity(cells.Length());
     for (uint32_t i = 0; i < cells.Length(); ++i) {
       aCellIDs->AppendElement(
         reinterpret_cast<uint64_t>(cells[i]->UniqueID()));
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedCellIndices(const uint64_t& aID,
                                                  nsTArray<uint32_t>* aCellIndices)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->SelectedCellIndices(aCellIndices);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedColumnIndices(const uint64_t& aID,
                                                    nsTArray<uint32_t>* aColumnIndices)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->SelectedColIndices(aColumnIndices);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectedRowIndices(const uint64_t& aID,
                                                 nsTArray<uint32_t>* aRowIndices)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->SelectedRowIndices(aRowIndices);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectColumn(const uint64_t& aID,
                                           const uint32_t& aCol)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->SelectCol(aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableSelectRow(const uint64_t& aID,
                                        const uint32_t& aRow)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->SelectRow(aRow);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableUnselectColumn(const uint64_t& aID,
                                             const uint32_t& aCol)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->UnselectCol(aCol);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableUnselectRow(const uint64_t& aID,
                                          const uint32_t& aRow)
 {
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     acc->UnselectRow(aRow);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTableIsProbablyForLayout(const uint64_t& aID,
                                                  bool* aForLayout)
 {
   *aForLayout = false;
   TableAccessible* acc = IdToTableAccessible(aID);
   if (acc) {
     *aForLayout = acc->IsProbablyLayoutTable();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAtkTableColumnHeader(const uint64_t& aID,
                                              const int32_t& aCol,
                                              uint64_t* aHeader,
                                              bool* aOk)
 {
   *aHeader = 0;
   *aOk = false;
 
@@ -1462,20 +1471,20 @@ DocAccessibleChild::RecvAtkTableColumnHe
     Accessible* header = AccessibleWrap::GetColumnHeader(acc, aCol);
     if (header) {
       *aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
       *aOk = true;
     }
   }
 #endif
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAtkTableRowHeader(const uint64_t& aID,
                                           const int32_t& aRow,
                                           uint64_t* aHeader,
                                           bool* aOk)
 {
   *aHeader = 0;
   *aOk = false;
 
@@ -1485,434 +1494,434 @@ DocAccessibleChild::RecvAtkTableRowHeade
     Accessible* header = AccessibleWrap::GetRowHeader(acc, aRow);
     if (header) {
       *aHeader = reinterpret_cast<uint64_t>(header->UniqueID());
       *aOk = true;
     }
   }
 #endif
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
                                       nsTArray<uint64_t>* aSelectedItemIDs)
 {
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     AutoTArray<Accessible*, 10> selectedItems;
     acc->SelectedItems(&selectedItems);
     aSelectedItemIDs->SetCapacity(selectedItems.Length());
     for (size_t i = 0; i < selectedItems.Length(); ++i) {
       aSelectedItemIDs->AppendElement(
         reinterpret_cast<uint64_t>(selectedItems[i]->UniqueID()));
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSelectedItemCount(const uint64_t& aID,
                                           uint32_t* aCount)
 {
   *aCount = 0;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aCount = acc->SelectedItemCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvGetSelectedItem(const uint64_t& aID,
                                         const uint32_t& aIndex,
                                         uint64_t* aSelected,
                                         bool* aOk)
 {
   *aSelected = 0;
   *aOk = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     Accessible* item = acc->GetSelectedItem(aIndex);
     if (item) {
       *aSelected = reinterpret_cast<uint64_t>(item->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvIsItemSelected(const uint64_t& aID,
                                        const uint32_t& aIndex,
                                        bool* aSelected)
 {
   *aSelected = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aSelected = acc->IsItemSelected(aIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAddItemToSelection(const uint64_t& aID,
                                            const uint32_t& aIndex,
                                            bool* aSuccess)
 {
   *aSuccess = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aSuccess = acc->AddItemToSelection(aIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvRemoveItemFromSelection(const uint64_t& aID,
                                                 const uint32_t& aIndex,
                                                 bool* aSuccess)
 {
   *aSuccess = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aSuccess = acc->RemoveItemFromSelection(aIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSelectAll(const uint64_t& aID,
                                   bool* aSuccess)
 {
   *aSuccess = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aSuccess = acc->SelectAll();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvUnselectAll(const uint64_t& aID,
                                     bool* aSuccess)
 {
   *aSuccess = false;
   Accessible* acc = IdToAccessibleSelect(aID);
   if (acc) {
     *aSuccess = acc->UnselectAll();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTakeSelection(const uint64_t& aID)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->TakeSelection();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSetSelected(const uint64_t& aID, const bool& aSelect)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->SetSelected(aSelect);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDoAction(const uint64_t& aID,
                                  const uint8_t& aIndex,
                                  bool* aSuccess)
 {
   *aSuccess = false;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aSuccess = acc->DoAction(aIndex);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvActionCount(const uint64_t& aID,
                                     uint8_t* aCount)
 {
   *aCount = 0;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aCount = acc->ActionCount();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvActionDescriptionAt(const uint64_t& aID,
                                             const uint8_t& aIndex,
                                             nsString* aDescription)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->ActionDescriptionAt(aIndex, *aDescription);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvActionNameAt(const uint64_t& aID,
                                      const uint8_t& aIndex,
                                      nsString* aName)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->ActionNameAt(aIndex, *aName);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAccessKey(const uint64_t& aID,
                                   uint32_t* aKey,
                                   uint32_t* aModifierMask)
 {
   *aKey = 0;
   *aModifierMask = 0;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     KeyBinding kb = acc->AccessKey();
     *aKey = kb.Key();
     *aModifierMask = kb.ModifierMask();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvKeyboardShortcut(const uint64_t& aID,
                                          uint32_t* aKey,
                                          uint32_t* aModifierMask)
 {
   *aKey = 0;
   *aModifierMask = 0;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     KeyBinding kb = acc->KeyboardShortcut();
     *aKey = kb.Key();
     *aModifierMask = kb.ModifierMask();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAtkKeyBinding(const uint64_t& aID,
                                       nsString* aResult)
 {
 #ifdef MOZ_ACCESSIBILITY_ATK
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     AccessibleWrap::GetKeyBinding(acc, *aResult);
   }
 #endif
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvCurValue(const uint64_t& aID,
                                  double* aValue)
 {
   *aValue = UnspecifiedNaN<double>();
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aValue = acc->CurValue();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvSetCurValue(const uint64_t& aID,
                                     const double& aValue,
                                     bool* aRetVal)
 {
   *aRetVal = false;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aRetVal = acc->SetCurValue(aValue);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvMinValue(const uint64_t& aID,
                                  double* aValue)
 {
   *aValue = UnspecifiedNaN<double>();
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aValue = acc->MinValue();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvMaxValue(const uint64_t& aID,
                                  double* aValue)
 {
   *aValue = UnspecifiedNaN<double>();
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aValue = acc->MaxValue();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvStep(const uint64_t& aID,
                              double* aStep)
 {
   *aStep = UnspecifiedNaN<double>();
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     *aStep = acc->Step();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTakeFocus(const uint64_t& aID)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->TakeFocus();
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvFocusedChild(const uint64_t& aID,
                                        uint64_t* aChild,
                                        bool* aOk)
 {
   *aChild = 0;
   *aOk = false;
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     Accessible* child = acc->FocusedChild();
     if (child) {
       *aChild = reinterpret_cast<uint64_t>(child->UniqueID());
       *aOk = true;
     }
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvLanguage(const uint64_t& aID,
                                  nsString* aLocale)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     acc->Language(*aLocale);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDocType(const uint64_t& aID,
                                 nsString* aType)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc && acc->IsDoc()) {
     acc->AsDoc()->DocType(*aType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvTitle(const uint64_t& aID,
                             nsString* aTitle)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc) {
     mozilla::ErrorResult rv;
     acc->GetContent()->GetTextContent(*aTitle, rv);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvURL(const uint64_t& aID,
                             nsString* aURL)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc && acc->IsDoc()) {
     acc->AsDoc()->URL(*aURL);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvMimeType(const uint64_t& aID,
                                  nsString* aMime)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc && acc->IsDoc()) {
     acc->AsDoc()->MimeType(*aMime);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvURLDocTypeMimeType(const uint64_t& aID,
                                            nsString* aURL,
                                            nsString* aDocType,
                                            nsString* aMimeType)
 {
   Accessible* acc = IdToAccessible(aID);
   if (acc && acc->IsDoc()) {
     DocAccessible* doc = acc->AsDoc();
     doc->URL(*aURL);
     doc->DocType(*aDocType);
     doc->MimeType(*aMimeType);
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvAccessibleAtPoint(const uint64_t& aID,
                                           const int32_t& aX,
                                           const int32_t& aY,
                                           const bool& aNeedsScreenCoords,
                                           const uint32_t& aWhich,
                                           uint64_t* aResult,
                                           bool* aOk)
 {
@@ -1933,20 +1942,20 @@ DocAccessibleChild::RecvAccessibleAtPoin
       acc->ChildAtPoint(x, y,
                         static_cast<Accessible::EWhichChildAtPoint>(aWhich));
     if (result) {
       *aResult = reinterpret_cast<uint64_t>(result->UniqueID());
       *aOk = true;
     }
   }
 
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvExtents(const uint64_t& aID,
                                 const bool& aNeedsScreenCoords,
                                 int32_t* aX,
                                 int32_t* aY,
                                 int32_t* aWidth,
                                 int32_t* aHeight)
 {
   *aX = 0;
@@ -1965,34 +1974,34 @@ DocAccessibleChild::RecvExtents(const ui
       }
 
       *aX = screenRect.x;
       *aY = screenRect.y;
       *aWidth = screenRect.width;
       *aHeight = screenRect.height;
     }
   }
-  return true;
+  return IPC_OK();
 }
 
-bool
+mozilla::ipc::IPCResult
 DocAccessibleChild::RecvDOMNodeID(const uint64_t& aID, nsString* aDOMNodeID)
 {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) {
-    return true;
+    return IPC_OK();
   }
 
   nsIContent* content = acc->GetContent();
   if (!content) {
-    return true;
+    return IPC_OK();
   }
 
   nsIAtom* id = content->GetID();
   if (id) {
     id->ToString(*aDOMNodeID);
   }
 
-  return true;
+  return IPC_OK();
 }
 
 }
 }
--- a/accessible/ipc/other/DocAccessibleChild.h
+++ b/accessible/ipc/other/DocAccessibleChild.h
@@ -35,444 +35,444 @@ public:
   ~DocAccessibleChild()
   {
     MOZ_COUNT_DTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
   }
 
   /*
    * Return the state for the accessible with given ID.
    */
-  virtual bool RecvState(const uint64_t& aID, uint64_t* aState) override;
+  virtual mozilla::ipc::IPCResult RecvState(const uint64_t& aID, uint64_t* aState) override;
 
   /*
    * Return the native state for the accessible with given ID.
    */
-  virtual bool RecvNativeState(const uint64_t& aID, uint64_t* aState) override;
+  virtual mozilla::ipc::IPCResult RecvNativeState(const uint64_t& aID, uint64_t* aState) override;
 
   /*
    * Get the name for the accessible with given id.
    */
-  virtual bool RecvName(const uint64_t& aID, nsString* aName) override;
+  virtual mozilla::ipc::IPCResult RecvName(const uint64_t& aID, nsString* aName) override;
 
-  virtual bool RecvValue(const uint64_t& aID, nsString* aValue) override;
+  virtual mozilla::ipc::IPCResult RecvValue(const uint64_t& aID, nsString* aValue) override;
 
-  virtual bool RecvHelp(const uint64_t& aID, nsString* aHelp) override;
+  virtual mozilla::ipc::IPCResult RecvHelp(const uint64_t& aID, nsString* aHelp) override;
 
   /*
    * Get the description for the accessible with given id.
    */
-  virtual bool RecvDescription(const uint64_t& aID, nsString* aDesc) override;
-  virtual bool RecvRelationByType(const uint64_t& aID, const uint32_t& aType,
-                                  nsTArray<uint64_t>* aTargets) override;
-  virtual bool RecvRelations(const uint64_t& aID,
-                             nsTArray<RelationTargets>* aRelations)
+  virtual mozilla::ipc::IPCResult RecvDescription(const uint64_t& aID, nsString* aDesc) override;
+  virtual mozilla::ipc::IPCResult RecvRelationByType(const uint64_t& aID, const uint32_t& aType,
+                                                     nsTArray<uint64_t>* aTargets) override;
+  virtual mozilla::ipc::IPCResult RecvRelations(const uint64_t& aID,
+                                                nsTArray<RelationTargets>* aRelations)
     override;
 
-  virtual bool RecvIsSearchbox(const uint64_t& aID, bool* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvIsSearchbox(const uint64_t& aID, bool* aRetVal) override;
 
-  virtual bool RecvLandmarkRole(const uint64_t& aID, nsString* aLandmark) override;
+  virtual mozilla::ipc::IPCResult RecvLandmarkRole(const uint64_t& aID, nsString* aLandmark) override;
 
-  virtual bool RecvARIARoleAtom(const uint64_t& aID, nsString* aRole) override;
+  virtual mozilla::ipc::IPCResult RecvARIARoleAtom(const uint64_t& aID, nsString* aRole) override;
 
-  virtual bool RecvGetLevelInternal(const uint64_t& aID, int32_t* aLevel) override;
+  virtual mozilla::ipc::IPCResult RecvGetLevelInternal(const uint64_t& aID, int32_t* aLevel) override;
 
-  virtual bool RecvAttributes(const uint64_t& aID,
-                              nsTArray<Attribute> *aAttributes) override;
-  virtual bool RecvScrollTo(const uint64_t& aID, const uint32_t& aScrollType)
+  virtual mozilla::ipc::IPCResult RecvAttributes(const uint64_t& aID,
+                                                 nsTArray<Attribute> *aAttributes) override;
+  virtual mozilla::ipc::IPCResult RecvScrollTo(const uint64_t& aID, const uint32_t& aScrollType)
     override;
-  virtual bool RecvScrollToPoint(const uint64_t& aID,
-                                 const uint32_t& aScrollType,
-                                 const int32_t& aX, const int32_t& aY) override;
+  virtual mozilla::ipc::IPCResult RecvScrollToPoint(const uint64_t& aID,
+                                                    const uint32_t& aScrollType,
+                                                    const int32_t& aX, const int32_t& aY) override;
 
-  virtual bool RecvCaretLineNumber(const uint64_t& aID, int32_t* aLineNumber)
+  virtual mozilla::ipc::IPCResult RecvCaretLineNumber(const uint64_t& aID, int32_t* aLineNumber)
     override;
-  virtual bool RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
+  virtual mozilla::ipc::IPCResult RecvCaretOffset(const uint64_t& aID, int32_t* aOffset)
     override;
-  virtual bool RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset)
+  virtual mozilla::ipc::IPCResult RecvSetCaretOffset(const uint64_t& aID, const int32_t& aOffset)
     override;
 
-  virtual bool RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
+  virtual mozilla::ipc::IPCResult RecvCharacterCount(const uint64_t& aID, int32_t* aCount)
      override;
-  virtual bool RecvSelectionCount(const uint64_t& aID, int32_t* aCount)
+  virtual mozilla::ipc::IPCResult RecvSelectionCount(const uint64_t& aID, int32_t* aCount)
      override;
 
-  virtual bool RecvTextSubstring(const uint64_t& aID,
-                                 const int32_t& aStartOffset,
-                                 const int32_t& aEndOffset, nsString* aText,
-                                 bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvTextSubstring(const uint64_t& aID,
+                                                    const int32_t& aStartOffset,
+                                                    const int32_t& aEndOffset, nsString* aText,
+                                                    bool* aValid) override;
 
-  virtual bool RecvGetTextAfterOffset(const uint64_t& aID,
-                                      const int32_t& aOffset,
-                                      const int32_t& aBoundaryType,
-                                      nsString* aText, int32_t* aStartOffset,
-                                      int32_t* aEndOffset) override;
-  virtual bool RecvGetTextAtOffset(const uint64_t& aID,
-                                   const int32_t& aOffset,
-                                   const int32_t& aBoundaryType,
-                                   nsString* aText, int32_t* aStartOffset,
-                                   int32_t* aEndOffset) override;
-  virtual bool RecvGetTextBeforeOffset(const uint64_t& aID,
-                                       const int32_t& aOffset,
-                                       const int32_t& aBoundaryType,
-                                       nsString* aText, int32_t* aStartOffset,
-                                       int32_t* aEndOffset) override;
+  virtual mozilla::ipc::IPCResult RecvGetTextAfterOffset(const uint64_t& aID,
+                                                         const int32_t& aOffset,
+                                                         const int32_t& aBoundaryType,
+                                                         nsString* aText, int32_t* aStartOffset,
+                                                         int32_t* aEndOffset) override;
+  virtual mozilla::ipc::IPCResult RecvGetTextAtOffset(const uint64_t& aID,
+                                                      const int32_t& aOffset,
+                                                      const int32_t& aBoundaryType,
+                                                      nsString* aText, int32_t* aStartOffset,
+                                                      int32_t* aEndOffset) override;
+  virtual mozilla::ipc::IPCResult RecvGetTextBeforeOffset(const uint64_t& aID,
+                                                          const int32_t& aOffset,
+                                                          const int32_t& aBoundaryType,
+                                                          nsString* aText, int32_t* aStartOffset,
+                                                          int32_t* aEndOffset) override;
 
-  virtual bool RecvCharAt(const uint64_t& aID,
-                          const int32_t& aOffset,
-                          uint16_t* aChar) override;
+  virtual mozilla::ipc::IPCResult RecvCharAt(const uint64_t& aID,
+                                             const int32_t& aOffset,
+                                             uint16_t* aChar) override;
 
-  virtual bool RecvTextAttributes(const uint64_t& aID,
-                                  const bool& aIncludeDefAttrs,
-                                  const int32_t& aOffset,
-                                  nsTArray<Attribute>* aAttributes,
-                                  int32_t* aStartOffset,
-                                  int32_t* aEndOffset)
+  virtual mozilla::ipc::IPCResult RecvTextAttributes(const uint64_t& aID,
+                                                     const bool& aIncludeDefAttrs,
+                                                     const int32_t& aOffset,
+                                                     nsTArray<Attribute>* aAttributes,
+                                                     int32_t* aStartOffset,
+                                                     int32_t* aEndOffset)
     override;
 
-  virtual bool RecvDefaultTextAttributes(const uint64_t& aID,
-                                         nsTArray<Attribute>* aAttributes)
+  virtual mozilla::ipc::IPCResult RecvDefaultTextAttributes(const uint64_t& aID,
+                                                            nsTArray<Attribute>* aAttributes)
     override;
 
-  virtual bool RecvTextBounds(const uint64_t& aID,
-                              const int32_t& aStartOffset,
-                              const int32_t& aEndOffset,
-                              const uint32_t& aCoordType,
-                              nsIntRect* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvTextBounds(const uint64_t& aID,
+                                                 const int32_t& aStartOffset,
+                                                 const int32_t& aEndOffset,
+                                                 const uint32_t& aCoordType,
+                                                 nsIntRect* aRetVal) override;
 
-  virtual bool RecvCharBounds(const uint64_t& aID,
-                              const int32_t& aOffset,
-                              const uint32_t& aCoordType,
-                              nsIntRect* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvCharBounds(const uint64_t& aID,
+                                                 const int32_t& aOffset,
+                                                 const uint32_t& aCoordType,
+                                                 nsIntRect* aRetVal) override;
 
-  virtual bool RecvOffsetAtPoint(const uint64_t& aID,
-                                 const int32_t& aX,
-                                 const int32_t& aY,
-                                 const uint32_t& aCoordType,
-                                 int32_t* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvOffsetAtPoint(const uint64_t& aID,
+                                                    const int32_t& aX,
+                                                    const int32_t& aY,
+                                                    const uint32_t& aCoordType,
+                                                    int32_t* aRetVal) override;
 
-  virtual bool RecvSelectionBoundsAt(const uint64_t& aID,
-                                     const int32_t& aSelectionNum,
-                                     bool* aSucceeded,
-                                     nsString* aData,
-                                     int32_t* aStartOffset,
-                                     int32_t* aEndOffset) override;
+  virtual mozilla::ipc::IPCResult RecvSelectionBoundsAt(const uint64_t& aID,
+                                                        const int32_t& aSelectionNum,
+                                                        bool* aSucceeded,
+                                                        nsString* aData,
+                                                        int32_t* aStartOffset,
+                                                        int32_t* aEndOffset) override;
 
-  virtual bool RecvSetSelectionBoundsAt(const uint64_t& aID,
-                                        const int32_t& aSelectionNum,
-                                        const int32_t& aStartOffset,
-                                        const int32_t& aEndOffset,
-                                        bool* aSucceeded) override;
+  virtual mozilla::ipc::IPCResult RecvSetSelectionBoundsAt(const uint64_t& aID,
+                                                           const int32_t& aSelectionNum,
+                                                           const int32_t& aStartOffset,
+                                                           const int32_t& aEndOffset,
+                                                           bool* aSucceeded) override;
 
-  virtual bool RecvAddToSelection(const uint64_t& aID,
-                                  const int32_t& aStartOffset,
-                                  const int32_t& aEndOffset,
-                                  bool* aSucceeded) override;
+  virtual mozilla::ipc::IPCResult RecvAddToSelection(const uint64_t& aID,
+                                                     const int32_t& aStartOffset,
+                                                     const int32_t& aEndOffset,
+                                                     bool* aSucceeded) override;
 
-  virtual bool RecvRemoveFromSelection(const uint64_t& aID,
-                                       const int32_t& aSelectionNum,
-                                       bool* aSucceeded) override;
+  virtual mozilla::ipc::IPCResult RecvRemoveFromSelection(const uint64_t& aID,
+                                                          const int32_t& aSelectionNum,
+                                                          bool* aSucceeded) override;
 
-  virtual bool RecvScrollSubstringTo(const uint64_t& aID,
-                                     const int32_t& aStartOffset,
-                                     const int32_t& aEndOffset,
-                                     const uint32_t& aScrollType) override;
+  virtual mozilla::ipc::IPCResult RecvScrollSubstringTo(const uint64_t& aID,
+                                                        const int32_t& aStartOffset,
+                                                        const int32_t& aEndOffset,
+                                                        const uint32_t& aScrollType) override;
 
-  virtual bool RecvScrollSubstringToPoint(const uint64_t& aID,
-                                          const int32_t& aStartOffset,
-                                          const int32_t& aEndOffset,
-                                          const uint32_t& aCoordinateType,
-                                          const int32_t& aX,
-                                          const int32_t& aY) override;
+  virtual mozilla::ipc::IPCResult RecvScrollSubstringToPoint(const uint64_t& aID,
+                                                             const int32_t& aStartOffset,
+                                                             const int32_t& aEndOffset,
+                                                             const uint32_t& aCoordinateType,
+                                                             const int32_t& aX,
+                                                             const int32_t& aY) override;
 
-  virtual bool RecvText(const uint64_t& aID,
-                        nsString* aText) override;
+  virtual mozilla::ipc::IPCResult RecvText(const uint64_t& aID,
+                                           nsString* aText) override;
 
-  virtual bool RecvReplaceText(const uint64_t& aID,
-                               const nsString& aText) override;
+  virtual mozilla::ipc::IPCResult RecvReplaceText(const uint64_t& aID,
+                                                  const nsString& aText) override;
 
-  virtual bool RecvInsertText(const uint64_t& aID,
-                              const nsString& aText,
-                              const int32_t& aPosition, bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvInsertText(const uint64_t& aID,
+                                                 const nsString& aText,
+                                                 const int32_t& aPosition, bool* aValid) override;
 
-  virtual bool RecvCopyText(const uint64_t& aID,
-                            const int32_t& aStartPos,
-                            const int32_t& aEndPos, bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvCopyText(const uint64_t& aID,
+                                               const int32_t& aStartPos,
+                                               const int32_t& aEndPos, bool* aValid) override;
 
-  virtual bool RecvCutText(const uint64_t& aID,
-                           const int32_t& aStartPos,
-                           const int32_t& aEndPos, bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvCutText(const uint64_t& aID,
+                                              const int32_t& aStartPos,
+                                              const int32_t& aEndPos, bool* aValid) override;
 
-  virtual bool RecvDeleteText(const uint64_t& aID,
-                              const int32_t& aStartPos,
-                              const int32_t& aEndPos, bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvDeleteText(const uint64_t& aID,
+                                                 const int32_t& aStartPos,
+                                                 const int32_t& aEndPos, bool* aValid) override;
 
-  virtual bool RecvPasteText(const uint64_t& aID,
-                             const int32_t& aPosition, bool* aValid) override;
+  virtual mozilla::ipc::IPCResult RecvPasteText(const uint64_t& aID,
+                                                const int32_t& aPosition, bool* aValid) override;
 
-  virtual bool RecvImagePosition(const uint64_t& aID,
-                                 const uint32_t& aCoordType,
-                                 nsIntPoint* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvImagePosition(const uint64_t& aID,
+                                                    const uint32_t& aCoordType,
+                                                    nsIntPoint* aRetVal) override;
 
-  virtual bool RecvImageSize(const uint64_t& aID,
-                             nsIntSize* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvImageSize(const uint64_t& aID,
+                                                nsIntSize* aRetVal) override;
 
-  virtual bool RecvStartOffset(const uint64_t& aID,
-                               uint32_t* aRetVal,
-                               bool* aOk) override;
-  virtual bool RecvEndOffset(const uint64_t& aID,
-                             uint32_t* aRetVal,
-                             bool* aOk) override;
-  virtual bool RecvIsLinkValid(const uint64_t& aID,
-                               bool* aRetVal) override;
-  virtual bool RecvAnchorCount(const uint64_t& aID,
-                               uint32_t* aRetVal, bool* aOk) override;
-  virtual bool RecvAnchorURIAt(const uint64_t& aID,
-                               const uint32_t& aIndex,
-                               nsCString* aURI,
-                               bool* aOk) override;
-  virtual bool RecvAnchorAt(const uint64_t& aID,
-                            const uint32_t& aIndex,
-                            uint64_t* aIDOfAnchor,
-                            bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvStartOffset(const uint64_t& aID,
+                                                  uint32_t* aRetVal,
+                                                  bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvEndOffset(const uint64_t& aID,
+                                                uint32_t* aRetVal,
+                                                bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvIsLinkValid(const uint64_t& aID,
+                                                  bool* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvAnchorCount(const uint64_t& aID,
+                                                  uint32_t* aRetVal, bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvAnchorURIAt(const uint64_t& aID,
+                                                  const uint32_t& aIndex,
+                                                  nsCString* aURI,
+                                                  bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvAnchorAt(const uint64_t& aID,
+                                               const uint32_t& aIndex,
+                                               uint64_t* aIDOfAnchor,
+                                               bool* aOk) override;
 
-  virtual bool RecvLinkCount(const uint64_t& aID,
-                             uint32_t* aCount) override;
+  virtual mozilla::ipc::IPCResult RecvLinkCount(const uint64_t& aID,
+                                                uint32_t* aCount) override;
 
-  virtual bool RecvLinkAt(const uint64_t& aID,
-                          const uint32_t& aIndex,
-                          uint64_t* aIDOfLink,
-                          bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvLinkAt(const uint64_t& aID,
+                                             const uint32_t& aIndex,
+                                             uint64_t* aIDOfLink,
+                                             bool* aOk) override;
 
-  virtual bool RecvLinkIndexOf(const uint64_t& aID,
-                               const uint64_t& aLinkID,
-                               int32_t* aIndex) override;
+  virtual mozilla::ipc::IPCResult RecvLinkIndexOf(const uint64_t& aID,
+                                                  const uint64_t& aLinkID,
+                                                  int32_t* aIndex) override;
 
-  virtual bool RecvLinkIndexAtOffset(const uint64_t& aID,
-                                     const uint32_t& aOffset,
-                                     int32_t* aIndex) override;
+  virtual mozilla::ipc::IPCResult RecvLinkIndexAtOffset(const uint64_t& aID,
+                                                        const uint32_t& aOffset,
+                                                        int32_t* aIndex) override;
 
-  virtual bool RecvTableOfACell(const uint64_t& aID,
-                                uint64_t* aTableID,
-                                bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvTableOfACell(const uint64_t& aID,
+                                                   uint64_t* aTableID,
+                                                   bool* aOk) override;
 
-  virtual bool RecvColIdx(const uint64_t& aID, uint32_t* aIndex) override;
+  virtual mozilla::ipc::IPCResult RecvColIdx(const uint64_t& aID, uint32_t* aIndex) override;
 
-  virtual bool RecvRowIdx(const uint64_t& aID, uint32_t* aIndex) override;
+  virtual mozilla::ipc::IPCResult RecvRowIdx(const uint64_t& aID, uint32_t* aIndex) override;
 
-  virtual bool RecvColExtent(const uint64_t& aID, uint32_t* aExtent) override;
+  virtual mozilla::ipc::IPCResult RecvColExtent(const uint64_t& aID, uint32_t* aExtent) override;
 
-  virtual bool RecvGetPosition(const uint64_t& aID,
-                               uint32_t* aColIdx, uint32_t* aRowIdx) override;
+  virtual mozilla::ipc::IPCResult RecvGetPosition(const uint64_t& aID,
+                                                  uint32_t* aColIdx, uint32_t* aRowIdx) override;
 
-  virtual bool RecvGetColRowExtents(const uint64_t& aID,
-                                  uint32_t* aColIdx, uint32_t* aRowIdx,
-                                  uint32_t* aColExtent, uint32_t* aRowExtent) override;
+  virtual mozilla::ipc::IPCResult RecvGetColRowExtents(const uint64_t& aID,
+                                                       uint32_t* aColIdx, uint32_t* aRowIdx,
+                                                       uint32_t* aColExtent, uint32_t* aRowExtent) override;
 
-  virtual bool RecvRowExtent(const uint64_t& aID, uint32_t* aExtent) override;
+  virtual mozilla::ipc::IPCResult RecvRowExtent(const uint64_t& aID, uint32_t* aExtent) override;
 
-  virtual bool RecvColHeaderCells(const uint64_t& aID,
-                                  nsTArray<uint64_t>* aCells) override;
+  virtual mozilla::ipc::IPCResult RecvColHeaderCells(const uint64_t& aID,
+                                                     nsTArray<uint64_t>* aCells) override;
 
-  virtual bool RecvRowHeaderCells(const uint64_t& aID,
-                                  nsTArray<uint64_t>* aCells) override;
+  virtual mozilla::ipc::IPCResult RecvRowHeaderCells(const uint64_t& aID,
+                                                     nsTArray<uint64_t>* aCells) override;
 
-  virtual bool RecvIsCellSelected(const uint64_t& aID,
-                                  bool* aSelected) override;
+  virtual mozilla::ipc::IPCResult RecvIsCellSelected(const uint64_t& aID,
+                                                     bool* aSelected) override;
 
-  virtual bool RecvTableCaption(const uint64_t& aID,
-                                uint64_t* aCaptionID,
-                                bool* aOk) override;
-  virtual bool RecvTableSummary(const uint64_t& aID,
-                                nsString* aSummary) override;
-  virtual bool RecvTableColumnCount(const uint64_t& aID,
-                                    uint32_t* aColCount) override;
-  virtual bool RecvTableRowCount(const uint64_t& aID,
-                                 uint32_t* aRowCount) override;
-  virtual bool RecvTableCellAt(const uint64_t& aID,
-                               const uint32_t& aRow,
-                               const uint32_t& aCol,
-                               uint64_t* aCellID,
-                               bool* aOk) override;
-  virtual bool RecvTableCellIndexAt(const uint64_t& aID,
-                                    const uint32_t& aRow,
-                                    const uint32_t& aCol,
-                                    int32_t* aIndex) override;
-  virtual bool RecvTableColumnIndexAt(const uint64_t& aID,
-                                      const uint32_t& aCellIndex,
-                                      int32_t* aCol) override;
-  virtual bool RecvTableRowIndexAt(const uint64_t& aID,
-                                   const uint32_t& aCellIndex,
-                                   int32_t* aRow) override;
-  virtual bool RecvTableRowAndColumnIndicesAt(const uint64_t& aID,
-                                             const uint32_t& aCellIndex,
-                                             int32_t* aRow,
-                                             int32_t* aCol) override;
-  virtual bool RecvTableColumnExtentAt(const uint64_t& aID,
-                                       const uint32_t& aRow,
-                                       const uint32_t& aCol,
-                                       uint32_t* aExtent) override;
-  virtual bool RecvTableRowExtentAt(const uint64_t& aID,
-                                    const uint32_t& aRow,
-                                    const uint32_t& aCol,
-                                    uint32_t* aExtent) override;
-  virtual bool RecvTableColumnDescription(const uint64_t& aID,
-                                          const uint32_t& aCol,
-                                          nsString* aDescription) override;
-  virtual bool RecvTableRowDescription(const uint64_t& aID,
-                                       const uint32_t& aRow,
-                                       nsString* aDescription) override;
-  virtual bool RecvTableColumnSelected(const uint64_t& aID,
-                                       const uint32_t& aCol,
-                                       bool* aSelected) override;
-  virtual bool RecvTableRowSelected(const uint64_t& aID,
-                                    const uint32_t& aRow,
-                                    bool* aSelected) override;
-  virtual bool RecvTableCellSelected(const uint64_t& aID,
-                                     const uint32_t& aRow,
-                                     const uint32_t& aCol,
-                                     bool* aSelected) override;
-  virtual bool RecvTableSelectedCellCount(const uint64_t& aID,
-                                          uint32_t* aSelectedCells) override;
-  virtual bool RecvTableSelectedColumnCount(const uint64_t& aID,
-                                            uint32_t* aSelectedColumns) override;
-  virtual bool RecvTableSelectedRowCount(const uint64_t& aID,
-                                         uint32_t* aSelectedRows) override;
-  virtual bool RecvTableSelectedCells(const uint64_t& aID,
-                                      nsTArray<uint64_t>* aCellIDs) override;
-  virtual bool RecvTableSelectedCellIndices(const uint64_t& aID,
-                                            nsTArray<uint32_t>* aCellIndices) override;
-  virtual bool RecvTableSelectedColumnIndices(const uint64_t& aID,
-                                              nsTArray<uint32_t>* aColumnIndices) override;
-  virtual bool RecvTableSelectedRowIndices(const uint64_t& aID,
-                                           nsTArray<uint32_t>* aRowIndices) override;
-  virtual bool RecvTableSelectColumn(const uint64_t& aID,
-                                     const uint32_t& aCol) override;
-  virtual bool RecvTableSelectRow(const uint64_t& aID,
-                                  const uint32_t& aRow) override;
-  virtual bool RecvTableUnselectColumn(const uint64_t& aID,
-                                       const uint32_t& aCol) override;
-  virtual bool RecvTableUnselectRow(const uint64_t& aID,
-                                    const uint32_t& aRow) override;
-  virtual bool RecvTableIsProbablyForLayout(const uint64_t& aID,
-                                            bool* aForLayout) override;
-  virtual bool RecvAtkTableColumnHeader(const uint64_t& aID,
-                                        const int32_t& aCol,
-                                        uint64_t* aHeader,
-                                        bool* aOk) override;
-  virtual bool RecvAtkTableRowHeader(const uint64_t& aID,
-                                     const int32_t& aRow,
-                                     uint64_t* aHeader,
-                                     bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvTableCaption(const uint64_t& aID,
+                                                   uint64_t* aCaptionID,
+                                                   bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvTableSummary(const uint64_t& aID,
+                                                   nsString* aSummary) override;
+  virtual mozilla::ipc::IPCResult RecvTableColumnCount(const uint64_t& aID,
+                                                       uint32_t* aColCount) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowCount(const uint64_t& aID,
+                                                    uint32_t* aRowCount) override;
+  virtual mozilla::ipc::IPCResult RecvTableCellAt(const uint64_t& aID,
+                                                  const uint32_t& aRow,
+                                                  const uint32_t& aCol,
+                                                  uint64_t* aCellID,
+                                                  bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvTableCellIndexAt(const uint64_t& aID,
+                                                       const uint32_t& aRow,
+                                                       const uint32_t& aCol,
+                                                       int32_t* aIndex) override;
+  virtual mozilla::ipc::IPCResult RecvTableColumnIndexAt(const uint64_t& aID,
+                                                         const uint32_t& aCellIndex,
+                                                         int32_t* aCol) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowIndexAt(const uint64_t& aID,
+                                                      const uint32_t& aCellIndex,
+                                                      int32_t* aRow) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowAndColumnIndicesAt(const uint64_t& aID,
+                                                                 const uint32_t& aCellIndex,
+                                                                 int32_t* aRow,
+                                                                 int32_t* aCol) override;
+  virtual mozilla::ipc::IPCResult RecvTableColumnExtentAt(const uint64_t& aID,
+                                                          const uint32_t& aRow,
+                                                          const uint32_t& aCol,
+                                                          uint32_t* aExtent) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowExtentAt(const uint64_t& aID,
+                                                       const uint32_t& aRow,
+                                                       const uint32_t& aCol,
+                                                       uint32_t* aExtent) override;
+  virtual mozilla::ipc::IPCResult RecvTableColumnDescription(const uint64_t& aID,
+                                                             const uint32_t& aCol,
+                                                             nsString* aDescription) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowDescription(const uint64_t& aID,
+                                                          const uint32_t& aRow,
+                                                          nsString* aDescription) override;
+  virtual mozilla::ipc::IPCResult RecvTableColumnSelected(const uint64_t& aID,
+                                                          const uint32_t& aCol,
+                                                          bool* aSelected) override;
+  virtual mozilla::ipc::IPCResult RecvTableRowSelected(const uint64_t& aID,
+                                                       const uint32_t& aRow,
+                                                       bool* aSelected) override;
+  virtual mozilla::ipc::IPCResult RecvTableCellSelected(const uint64_t& aID,
+                                                        const uint32_t& aRow,
+                                                        const uint32_t& aCol,
+                                                        bool* aSelected) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedCellCount(const uint64_t& aID,
+                                                             uint32_t* aSelectedCells) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedColumnCount(const uint64_t& aID,
+                                                               uint32_t* aSelectedColumns) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedRowCount(const uint64_t& aID,
+                                                            uint32_t* aSelectedRows) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedCells(const uint64_t& aID,
+                                                         nsTArray<uint64_t>* aCellIDs) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedCellIndices(const uint64_t& aID,
+                                                               nsTArray<uint32_t>* aCellIndices) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedColumnIndices(const uint64_t& aID,
+                                                                 nsTArray<uint32_t>* aColumnIndices) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectedRowIndices(const uint64_t& aID,
+                                                              nsTArray<uint32_t>* aRowIndices) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectColumn(const uint64_t& aID,
+                                                        const uint32_t& aCol) override;
+  virtual mozilla::ipc::IPCResult RecvTableSelectRow(const uint64_t& aID,
+                                                     const uint32_t& aRow) override;
+  virtual mozilla::ipc::IPCResult RecvTableUnselectColumn(const uint64_t& aID,
+                                                          const uint32_t& aCol) override;
+  virtual mozilla::ipc::IPCResult RecvTableUnselectRow(const uint64_t& aID,
+                                                       const uint32_t& aRow) override;
+  virtual mozilla::ipc::IPCResult RecvTableIsProbablyForLayout(const uint64_t& aID,
+                                                               bool* aForLayout) override;
+  virtual mozilla::ipc::IPCResult RecvAtkTableColumnHeader(const uint64_t& aID,
+                                                           const int32_t& aCol,
+                                                           uint64_t* aHeader,
+                                                           bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvAtkTableRowHeader(const uint64_t& aID,
+                                                        const int32_t& aRow,
+                                                        uint64_t* aHeader,
+                                                        bool* aOk) override;
 
-  virtual bool RecvSelectedItems(const uint64_t& aID,
-                                 nsTArray<uint64_t>* aSelectedItemIDs) override;
+  virtual mozilla::ipc::IPCResult RecvSelectedItems(const uint64_t& aID,
+                                                    nsTArray<uint64_t>* aSelectedItemIDs) override;
 
-  virtual bool RecvSelectedItemCount(const uint64_t& aID,
-                                     uint32_t* aCount) override;
+  virtual mozilla::ipc::IPCResult RecvSelectedItemCount(const uint64_t& aID,
+                                                        uint32_t* aCount) override;
 
-  virtual bool RecvGetSelectedItem(const uint64_t& aID,
-                                   const uint32_t& aIndex,
-                                   uint64_t* aSelected,
-                                   bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvGetSelectedItem(const uint64_t& aID,
+                                                      const uint32_t& aIndex,
+                                                      uint64_t* aSelected,
+                                                      bool* aOk) override;
 
-  virtual bool RecvIsItemSelected(const uint64_t& aID,
-                                  const uint32_t& aIndex,
-                                  bool* aSelected) override;
+  virtual mozilla::ipc::IPCResult RecvIsItemSelected(const uint64_t& aID,
+                                                     const uint32_t& aIndex,
+                                                     bool* aSelected) override;
 
-  virtual bool RecvAddItemToSelection(const uint64_t& aID,
-                                      const uint32_t& aIndex,
-                                      bool* aSuccess) override;
+  virtual mozilla::ipc::IPCResult RecvAddItemToSelection(const uint64_t& aID,
+                                                         const uint32_t& aIndex,
+                                                         bool* aSuccess) override;
 
-  virtual bool RecvRemoveItemFromSelection(const uint64_t& aID,
-                                           const uint32_t& aIndex,
-                                           bool* aSuccess) override;
+  virtual mozilla::ipc::IPCResult RecvRemoveItemFromSelection(const uint64_t& aID,
+                                                              const uint32_t& aIndex,
+                                                              bool* aSuccess) override;
 
-  virtual bool RecvSelectAll(const uint64_t& aID,
-                             bool* aSuccess) override;
+  virtual mozilla::ipc::IPCResult RecvSelectAll(const uint64_t& aID,
+                                                bool* aSuccess) override;
 
-  virtual bool RecvUnselectAll(const uint64_t& aID,
-                               bool* aSuccess) override;
+  virtual mozilla::ipc::IPCResult RecvUnselectAll(const uint64_t& aID,
+                                                  bool* aSuccess) override;
 
-  virtual bool RecvTakeSelection(const uint64_t& aID) override;
-  virtual bool RecvSetSelected(const uint64_t& aID,
-                               const bool& aSelect) override;
+  virtual mozilla::ipc::IPCResult RecvTakeSelection(const uint64_t& aID) override;
+  virtual mozilla::ipc::IPCResult RecvSetSelected(const uint64_t& aID,
+                                                  const bool& aSelect) override;
 
-  virtual bool RecvDoAction(const uint64_t& aID,
-                            const uint8_t& aIndex,
-                            bool* aSuccess) override;
+  virtual mozilla::ipc::IPCResult RecvDoAction(const uint64_t& aID,
+                                               const uint8_t& aIndex,
+                                               bool* aSuccess) override;
 
-  virtual bool RecvActionCount(const uint64_t& aID,
-                               uint8_t* aCount) override;
+  virtual mozilla::ipc::IPCResult RecvActionCount(const uint64_t& aID,
+                                                  uint8_t* aCount) override;
 
-  virtual bool RecvActionDescriptionAt(const uint64_t& aID,
-                                       const uint8_t& aIndex,
-                                       nsString* aDescription) override;
+  virtual mozilla::ipc::IPCResult RecvActionDescriptionAt(const uint64_t& aID,
+                                                          const uint8_t& aIndex,
+                                                          nsString* aDescription) override;
 
-  virtual bool RecvActionNameAt(const uint64_t& aID,
-                                const uint8_t& aIndex,
-                                nsString* aName) override;
+  virtual mozilla::ipc::IPCResult RecvActionNameAt(const uint64_t& aID,
+                                                   const uint8_t& aIndex,
+                                                   nsString* aName) override;
 
-  virtual bool RecvAccessKey(const uint64_t& aID,
-                             uint32_t* aKey,
-                             uint32_t* aModifierMask) override;
+  virtual mozilla::ipc::IPCResult RecvAccessKey(const uint64_t& aID,
+                                                uint32_t* aKey,
+                                                uint32_t* aModifierMask) override;
 
-  virtual bool RecvKeyboardShortcut(const uint64_t& aID,
-                                    uint32_t* aKey,
-                                    uint32_t* aModifierMask) override;
+  virtual mozilla::ipc::IPCResult RecvKeyboardShortcut(const uint64_t& aID,
+                                                       uint32_t* aKey,
+                                                       uint32_t* aModifierMask) override;
 
-  virtual bool RecvAtkKeyBinding(const uint64_t& aID,
-                                 nsString* aResult) override;
+  virtual mozilla::ipc::IPCResult RecvAtkKeyBinding(const uint64_t& aID,
+                                                    nsString* aResult) override;
 
-  virtual bool RecvCurValue(const uint64_t& aID,
-                            double* aValue) override;
+  virtual mozilla::ipc::IPCResult RecvCurValue(const uint64_t& aID,
+                                               double* aValue) override;
 
-  virtual bool RecvSetCurValue(const uint64_t& aID,
-                               const double& aValue,
-                               bool* aRetVal) override;
+  virtual mozilla::ipc::IPCResult RecvSetCurValue(const uint64_t& aID,
+                                                  const double& aValue,
+                                                  bool* aRetVal) override;
 
-  virtual bool RecvMinValue(const uint64_t& aID,
-                            double* aValue) override;
+  virtual mozilla::ipc::IPCResult RecvMinValue(const uint64_t& aID,
+                                               double* aValue) override;
 
-  virtual bool RecvMaxValue(const uint64_t& aID,
-                            double* aValue) override;
+  virtual mozilla::ipc::IPCResult RecvMaxValue(const uint64_t& aID,
+                                               double* aValue) override;
 
-  virtual bool RecvStep(const uint64_t& aID,
-                        double* aStep) override;
+  virtual mozilla::ipc::IPCResult RecvStep(const uint64_t& aID,
+                                           double* aStep) override;
 
-  virtual bool RecvTakeFocus(const uint64_t& aID) override;
+  virtual mozilla::ipc::IPCResult RecvTakeFocus(const uint64_t& aID) override;
 
-  virtual bool RecvFocusedChild(const uint64_t& aID,
-                                uint64_t* aChild,
-                                bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvFocusedChild(const uint64_t& aID,
+                                                   uint64_t* aChild,
+                                                   bool* aOk) override;
 
-  virtual bool RecvLanguage(const uint64_t& aID, nsString* aLocale) override;
-  virtual bool RecvDocType(const uint64_t& aID, nsString* aType) override;
-  virtual bool RecvTitle(const uint64_t& aID, nsString* aTitle) override;
-  virtual bool RecvURL(const uint64_t& aID, nsString* aURL) override;
-  virtual bool RecvMimeType(const uint64_t& aID, nsString* aMime) override;
-  virtual bool RecvURLDocTypeMimeType(const uint64_t& aID,
-                                      nsString* aURL,
-                                      nsString* aDocType,
-                                      nsString* aMimeType) override;
+  virtual mozilla::ipc::IPCResult RecvLanguage(const uint64_t& aID, nsString* aLocale) override;
+  virtual mozilla::ipc::IPCResult RecvDocType(const uint64_t& aID, nsString* aType) override;
+  virtual mozilla::ipc::IPCResult RecvTitle(const uint64_t& aID, nsString* aTitle) override;
+  virtual mozilla::ipc::IPCResult RecvURL(const uint64_t& aID, nsString* aURL) override;
+  virtual mozilla::ipc::IPCResult RecvMimeType(const uint64_t& aID, nsString* aMime) override;
+  virtual mozilla::ipc::IPCResult RecvURLDocTypeMimeType(const uint64_t& aID,
+                                                         nsString* aURL,
+                                                         nsString* aDocType,
+                                                         nsString* aMimeType) override;
 
-  virtual bool RecvAccessibleAtPoint(const uint64_t& aID,
-                                     const int32_t& aX,
-                                     const int32_t& aY,
-                                     const bool& aNeedsScreenCoords,
-                                     const uint32_t& aWhich,
-                                     uint64_t* aResult,
-                                     bool* aOk) override;
+  virtual mozilla::ipc::IPCResult RecvAccessibleAtPoint(const uint64_t& aID,
+                                                        const int32_t& aX,
+                                                        const int32_t& aY,
+                                                        const bool& aNeedsScreenCoords,
+                                                        const uint32_t& aWhich,
+                                                        uint64_t* aResult,
+                                                        bool* aOk) override;
 
-  virtual bool RecvExtents(const uint64_t& aID,
-                           const bool& aNeedsScreenCoords,
-                           int32_t* aX,
-                           int32_t* aY,
-                           int32_t* aWidth,
-                           int32_t* aHeight) override;
-  virtual bool RecvDOMNodeID(const uint64_t& aID, nsString* aDOMNodeID) override;
+  virtual mozilla::ipc::IPCResult RecvExtents(const uint64_t& aID,
+                                              const bool& aNeedsScreenCoords,
+                                              int32_t* aX,
+                                              int32_t* aY,
+                                              int32_t* aWidth,
+                                              int32_t* aHeight) override;
+  virtual mozilla::ipc::IPCResult RecvDOMNodeID(const uint64_t& aID, nsString* aDOMNodeID) override;
 private:
 
   Accessible* IdToAccessible(const uint64_t& aID) const;
   Accessible* IdToAccessibleLink(const uint64_t& aID) const;
   Accessible* IdToAccessibleSelect(const uint64_t& aID) const;
   HyperTextAccessible* IdToHyperTextAccessible(const uint64_t& aID) const;
   TextLeafAccessible* IdToTextLeafAccessible(const uint64_t& aID) const;
   ImageAccessible* IdToImageAccessible(const uint64_t& aID) const;
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -337,19 +337,19 @@ this.AccessFu = { // jshint ignore:line
         }
         break;
       case 'Accessibility:MoveByGranularity':
         this.Input.moveByGranularity(JSON.parse(aData));
         break;
       case 'remote-browser-shown':
       case 'inprocess-browser-shown':
       {
-        // Ignore notifications that aren't from a BrowserOrApp
+        // Ignore notifications that aren't from a Browser
         let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
-        if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
+        if (!frameLoader.ownerIsMozBrowserFrame) {
           return;
         }
         this._handleMessageManager(frameLoader.messageManager);
         break;
       }
     }
   },
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -531,33 +531,52 @@ function eventQueue(aEventType)
         if (eventQueue.compareEvents(nextChecker, aEvent)) {
           this.processMatchedChecker(aEvent, nextChecker, scnIdx, eventSeq.idx);
           hasMatchedCheckers = true;
           continue;
         }
       }
 
       // Check if handled event matches any expected async events.
+      var haveUnmatchedAsync = false;
       for (idx = 0; idx < eventSeq.length; idx++) {
+        if (eventSeq[idx] instanceof orderChecker && haveUnmatchedAsync) {
+            break;
+        }
+
+        if (!eventSeq[idx].wasCaught) {
+          haveUnmatchedAsync = true;
+        }
+
         if (!eventSeq[idx].unexpected && eventSeq[idx].async) {
           if (eventQueue.compareEvents(eventSeq[idx], aEvent)) {
             this.processMatchedChecker(aEvent, eventSeq[idx], scnIdx, idx);
             hasMatchedCheckers = true;
             break;
           }
         }
       }
     }
 
     if (hasMatchedCheckers) {
       var invoker = this.getInvoker();
       if ("check" in invoker)
         invoker.check(aEvent);
     }
 
+    for (idx = 0; idx < eventSeq.length; idx++) {
+      if (!eventSeq[idx].wasCaught) {
+        if (eventSeq[idx] instanceof orderChecker) {
+          eventSeq[idx].wasCaught++;
+        } else {
+          break;
+        }
+      }
+    }
+
     // If we don't have more events to wait then schedule next invoker.
     if (this.hasMatchedScenario()) {
       if (this.mNextInvokerStatus == kInvokerNotScheduled) {
         this.processNextInvokerInTimeout();
 
       } else if (this.mNextInvokerStatus == kInvokerCanceled) {
         this.setInvokerStatus(kInvokerPending,
                               "Full match. Void the cancelation of next invoker processing");
@@ -591,33 +610,34 @@ function eventQueue(aEventType)
   {
     if (!("idx" in aEventSeq))
       aEventSeq.idx = 0;
 
     while (aEventSeq.idx < aEventSeq.length &&
            (aEventSeq[aEventSeq.idx].unexpected ||
             aEventSeq[aEventSeq.idx].todo ||
             aEventSeq[aEventSeq.idx].async ||
+            aEventSeq[aEventSeq.idx] instanceof orderChecker ||
             aEventSeq[aEventSeq.idx].wasCaught > 0)) {
       aEventSeq.idx++;
     }
 
     return aEventSeq.idx != aEventSeq.length ? aEventSeq[aEventSeq.idx] : null;
   }
 
   this.areExpectedEventsLeft =
     function eventQueue_areExpectedEventsLeft(aScenario)
   {
     function scenarioHasUnhandledExpectedEvent(aEventSeq)
     {
       // Check if we have unhandled async (can be anywhere in the sequance) or
       // sync expcected events yet.
       for (var idx = 0; idx < aEventSeq.length; idx++) {
         if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
-            !aEventSeq[idx].wasCaught)
+            !aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
           return true;
       }
 
       return false;
     }
 
     if (aScenario)
       return scenarioHasUnhandledExpectedEvent(aScenario);
@@ -1675,16 +1695,25 @@ function invokerChecker(aEventType, aTar
     return prettyName(this.mTarget);
   }
 
   this.mTarget = aTargetOrFunc;
   this.mTargetFuncArg = aTargetFuncArg;
 }
 
 /**
+ * event checker that forces preceeding async events to happen before this
+ * checker.
+ */
+function orderChecker()
+{
+  this.__proto__ = new invokerChecker(null, null, null, false);
+}
+
+/**
  * Generic invoker checker for todo events.
  */
 function todo_invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
 {
   this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
                                       aTargetFuncArg, true);
   this.todo = true;
 }
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -608,19 +608,16 @@ pref("dom.ipc.processPriorityManager.BAC
 // The kernel can only accept 6 (OomScoreAdjust, KillUnderKB) pairs. But it is
 // okay, kernel will still kill processes with larger OomScoreAdjust first even
 // its OomScoreAdjust don't have a corresponding KillUnderKB.
 
 pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
 pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
 pref("hal.processPriorityManager.gonk.MASTER.cgroup", "");
 
-pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
-pref("hal.processPriorityManager.gonk.PREALLOC.cgroup", "apps/bg_non_interactive");
-
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.cgroup", "apps/critical");
 
 pref("hal.processPriorityManager.gonk.FOREGROUND.OomScoreAdjust", 134);
 pref("hal.processPriorityManager.gonk.FOREGROUND.KillUnderKB", 6144);
 pref("hal.processPriorityManager.gonk.FOREGROUND.cgroup", "apps");
 
@@ -688,22 +685,16 @@ pref("gonk.notifyHardLowMemUnderKB", 143
 // placed above the BACKGROUND priority class.
 pref("gonk.notifySoftLowMemUnderKB", 43008);
 
 // We wait this long before polling the memory-pressure fd after seeing one
 // memory pressure event.  (When we're not under memory pressure, we sit
 // blocked on a poll(), and this pref has no effect.)
 pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
 
-// Enable pre-launching content processes for improved startup time
-// (hiding latency).
-pref("dom.ipc.processPrelaunch.enabled", true);
-// Wait this long before pre-launching a new subprocess.
-pref("dom.ipc.processPrelaunch.delayMs", 5000);
-
 pref("dom.ipc.reuse_parent_app", false);
 
 // When a process receives a system message, we hold a CPU wake lock on its
 // behalf for this many seconds, or until it handles the system message,
 // whichever comes first.
 pref("dom.ipc.systemMessageCPULockTimeoutSec", 30);
 
 // Ignore the "dialog=1" feature in window.open.
--- a/b2g/chrome/content/devtools/hud.js
+++ b/b2g/chrome/content/devtools/hud.js
@@ -31,35 +31,32 @@ XPCOMUtils.defineLazyGetter(this, 'Event
 XPCOMUtils.defineLazyGetter(this, 'PerformanceEntriesFront', function() {
   return devtools.require('devtools/server/actors/performance-entries').PerformanceEntriesFront;
 });
 
 XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() {
   return devtools.require('devtools/server/actors/memory').MemoryFront;
 });
 
-Cu.import('resource://gre/modules/Frames.jsm');
-
 var _telemetryDebug = false;
 
 function telemetryDebug(...args) {
   if (_telemetryDebug) {
     args.unshift('[AdvancedTelemetry]');
     console.log(...args);
   }
 }
 
 /**
  * The Developer HUD is an on-device developer tool that displays widgets,
  * showing visual debug information about apps. Each widget corresponds to a
  * metric as tracked by a metric watcher (e.g. consoleWatcher).
  */
 var developerHUD = {
 
-  _targets: new Map(),
   _histograms: new Set(),
   _customHistograms: new Set(),
   _client: null,
   _conn: null,
   _watchers: [],
   _logging: true,
   _telemetry: false,
 
@@ -94,23 +91,16 @@ var developerHUD = {
     this._client = new DebuggerClient(transport);
 
     for (let w of this._watchers) {
       if (w.init) {
         w.init(this._client);
       }
     }
 
-    Frames.addObserver(this);
-
-    let appFrames = Frames.list().filter(frame => frame.getAttribute('mozapp'));
-    for (let frame of appFrames) {
-      this.trackFrame(frame);
-    }
-
     SettingsListener.observe('hud.logging', this._logging, enabled => {
       this._logging = enabled;
     });
 
     SettingsListener.observe('hud.telemetry.logging', _telemetryDebug, enabled => {
       _telemetryDebug = enabled;
     });
 
@@ -119,73 +109,20 @@ var developerHUD = {
     });
   },
 
   uninit() {
     if (!this._client) {
       return;
     }
 
-    for (let frame of this._targets.keys()) {
-      this.untrackFrame(frame);
-    }
-
-    Frames.removeObserver(this);
-
     this._client.close();
     delete this._client;
   },
 
-  /**
-   * This method will ask all registered watchers to track and update metrics
-   * on an app frame.
-   */
-  trackFrame(frame) {
-    if (this._targets.has(frame)) {
-      return;
-    }
-
-    DebuggerServer.connectToChild(this._conn, frame).then(actor => {
-      let target = new Target(frame, actor);
-      this._targets.set(frame, target);
-
-      for (let w of this._watchers) {
-        w.trackTarget(target);
-      }
-    });
-  },
-
-  untrackFrame(frame) {
-    let target = this._targets.get(frame);
-    if (target) {
-      for (let w of this._watchers) {
-        w.untrackTarget(target);
-      }
-
-      target.destroy();
-      this._targets.delete(frame);
-    }
-  },
-
-  onFrameCreated(frame, isFirstAppFrame) {
-    let mozapp = frame.getAttribute('mozapp');
-    if (!mozapp) {
-      return;
-    }
-    this.trackFrame(frame);
-  },
-
-  onFrameDestroyed(frame, isLastAppFrame) {
-    let mozapp = frame.getAttribute('mozapp');
-    if (!mozapp) {
-      return;
-    }
-    this.untrackFrame(frame);
-  },
-
   log(message) {
     if (this._logging) {
       dump(DEVELOPER_HUD_LOG_PREFIX + ': ' + message + '\n');
     }
   }
 
 };
 
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -353,17 +353,16 @@ var shell = {
     // <html:iframe id="systemapp"
     //              mozbrowser="true" allowfullscreen="true"
     //              style="overflow: hidden; height: 100%; width: 100%; border: none;"
     //              src="data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;'>"/>
     let systemAppFrame =
       document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');
     systemAppFrame.setAttribute('id', 'systemapp');
     systemAppFrame.setAttribute('mozbrowser', 'true');
-    systemAppFrame.setAttribute('mozapp', manifestURL);
     systemAppFrame.setAttribute('allowfullscreen', 'true');
     systemAppFrame.setAttribute('src', 'blank.html');
     let container = document.getElementById('container');
 
     if (AppConstants.platform == 'macosx') {
       // See shell.html
       let hotfix = document.getElementById('placeholder');
       if (hotfix) {
--- a/b2g/chrome/content/shell_remote.js
+++ b/b2g/chrome/content/shell_remote.js
@@ -48,17 +48,16 @@ var remoteShell = {
     // <html:iframe id="this.id"
     //              mozbrowser="true"
     //              allowfullscreen="true"
     //              src="blank.html"/>
     let systemAppFrame =
       document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
     systemAppFrame.setAttribute("id", this.id);
     systemAppFrame.setAttribute("mozbrowser", "true");
-    systemAppFrame.setAttribute("mozapp", manifestURL);
     systemAppFrame.setAttribute("allowfullscreen", "true");
     systemAppFrame.setAttribute("src", "blank.html");
 
     let container = document.getElementById("container");
     this.contentBrowser = container.appendChild(systemAppFrame);
     this.contentBrowser.src = homeURL + window.location.hash;
 
     window.addEventListener("unload", this);
--- a/b2g/components/AlertsHelper.jsm
+++ b/b2g/components/AlertsHelper.jsm
@@ -35,18 +35,16 @@ XPCOMUtils.defineLazyGetter(this, "ppmm"
 });
 
 function debug(str) {
   //dump("=*= AlertsHelper.jsm : " + str + "\n");
 }
 
 const kNotificationIconSize = 128;
 
-const kDesktopNotificationPerm = "desktop-notification";
-
 const kNotificationSystemMessageName = "notification";
 
 const kDesktopNotification      = "desktop-notification";
 const kDesktopNotificationShow  = "desktop-notification-show";
 const kDesktopNotificationClick = "desktop-notification-click";
 const kDesktopNotificationClose = "desktop-notification-close";
 
 const kTopicAlertClickCallback = "alertclickcallback";
@@ -251,23 +249,16 @@ var AlertsHelper = {
   closeAlert: function(name) {
     SystemAppProxy._sendCustomEvent(kMozChromeNotificationEvent, {
       type: kDesktopNotificationClose,
       id: name
     });
   },
 
   receiveMessage: function(aMessage) {
-    if (!aMessage.target.assertAppHasPermission(kDesktopNotificationPerm)) {
-      Cu.reportError("Desktop-notification message " + aMessage.name +
-                     " from a content process with no " + kDesktopNotificationPerm +
-                     " privileges.");
-      return;
-    }
-
     switch(aMessage.name) {
       case kMessageAlertNotificationSend:
         this.showAlertNotification(aMessage);
         break;
 
       case kMessageAlertNotificationClose:
         this.closeAlert(aMessage.data.name);
         break;
--- a/b2g/components/DebuggerActors.js
+++ b/b2g/components/DebuggerActors.js
@@ -25,20 +25,17 @@ XPCOMUtils.defineLazyGetter(this, "Frame
 function B2GTabList(connection) {
   BrowserTabList.call(this, connection);
   this._listening = false;
 }
 
 B2GTabList.prototype = Object.create(BrowserTabList.prototype);
 
 B2GTabList.prototype._getBrowsers = function() {
-  return Frames.list().filter(frame => {
-    // Ignore app frames
-    return !frame.getAttribute("mozapp");
-  });
+  return Frames.list();
 };
 
 B2GTabList.prototype._getSelectedBrowser = function() {
   return this._getBrowsers().find(frame => {
     // Find the one visible browser (if any)
     return !frame.classList.contains("hidden");
   });
 };
@@ -54,30 +51,20 @@ B2GTabList.prototype._listenForEventsIf 
   if (this._listening != shouldListen) {
     let op = shouldListen ? "addObserver" : "removeObserver";
     Frames[op](this);
     this._listening = shouldListen;
   }
 };
 
 B2GTabList.prototype.onFrameCreated = function(frame) {
-  let mozapp = frame.getAttribute("mozapp");
-  if (mozapp) {
-    // Ignore app frames
-    return;
-  }
   this._notifyListChanged();
   this._checkListening();
 };
 
 B2GTabList.prototype.onFrameDestroyed = function(frame) {
-  let mozapp = frame.getAttribute("mozapp");
-  if (mozapp) {
-    // Ignore app frames
-    return;
-  }
   let actor = this._actorByBrowser.get(frame);
   if (actor) {
     this._handleActorClose(actor, frame);
   }
 };
 
 exports.B2GTabList = B2GTabList;
--- a/b2g/components/ErrorPage.jsm
+++ b/b2g/components/ErrorPage.jsm
@@ -171,17 +171,17 @@ var ErrorPage = {
 
   init: function errorPageInit() {
     Services.obs.addObserver(this, 'inprocess-browser-shown', false);
     Services.obs.addObserver(this, 'remote-browser-shown', false);
   },
 
   observe: function errorPageObserve(aSubject, aTopic, aData) {
     let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
-    // Ignore notifications that aren't from a BrowserOrApp
-    if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
+    // Ignore notifications that aren't from a Browser
+    if (!frameLoader.ownerIsMozBrowserFrame) {
       return;
     }
     this._listenError(frameLoader);
   }
 };
 
 ErrorPage.init();
--- a/b2g/components/Frames.jsm
+++ b/b2g/components/Frames.jsm
@@ -14,40 +14,32 @@ Cu.import('resource://gre/modules/System
 
 const listeners = [];
 
 const Observer = {
   // Save a map of (MessageManager => Frame) to be able to dispatch
   // the FrameDestroyed event with a frame reference.
   _frames: new Map(),
 
-  // Also save current number of iframes opened by app
-  _apps: new Map(),
-
   start: function () {
     Services.obs.addObserver(this, 'remote-browser-shown', false);
     Services.obs.addObserver(this, 'inprocess-browser-shown', false);
     Services.obs.addObserver(this, 'message-manager-close', false);
 
     SystemAppProxy.getFrames().forEach(frame => {
       let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
       this._frames.set(mm, frame);
-      let mozapp = frame.getAttribute('mozapp');
-      if (mozapp) {
-        this._apps.set(mozapp, (this._apps.get(mozapp) || 0) + 1);
-      }
     });
   },
 
   stop: function () {
     Services.obs.removeObserver(this, 'remote-browser-shown');
     Services.obs.removeObserver(this, 'inprocess-browser-shown');
     Services.obs.removeObserver(this, 'message-manager-close');
     this._frames.clear();
-    this._apps.clear();
   },
 
   observe: function (subject, topic, data) {
     switch(topic) {
 
       // Listen for frame creation in OOP (device) as well as in parent process (b2g desktop)
       case 'remote-browser-shown':
       case 'inprocess-browser-shown':
@@ -65,54 +57,38 @@ const Observer = {
         this.onMessageManagerDestroyed(subject);
         break;
     }
   },
 
   onMessageManagerCreated: function (mm, frame) {
     this._frames.set(mm, frame);
 
-    let isFirstAppFrame = null;
-    let mozapp = frame.getAttribute('mozapp');
-    if (mozapp) {
-      let count = (this._apps.get(mozapp) || 0) + 1;
-      this._apps.set(mozapp, count);
-      isFirstAppFrame = (count === 1);
-    }
-
     listeners.forEach(function (listener) {
       try {
-        listener.onFrameCreated(frame, isFirstAppFrame);
+        listener.onFrameCreated(frame);
       } catch(e) {
         dump('Exception while calling Frames.jsm listener:' + e + '\n' +
              e.stack + '\n');
       }
     });
   },
 
   onMessageManagerDestroyed: function (mm) {
     let frame = this._frames.get(mm);
     if (!frame) {
       // We received an event for an unknown message manager
       return;
     }
 
     this._frames.delete(mm);
 
-    let isLastAppFrame = null;
-    let mozapp = frame.getAttribute('mozapp');
-    if (mozapp) {
-      let count = (this._apps.get(mozapp) || 0) - 1;
-      this._apps.set(mozapp, count);
-      isLastAppFrame = (count === 0);
-    }
-
     listeners.forEach(function (listener) {
       try {
-        listener.onFrameDestroyed(frame, isLastAppFrame);
+        listener.onFrameDestroyed(frame);
       } catch(e) {
         dump('Exception while calling Frames.jsm listener:' + e + '\n' +
              e.stack + '\n');
       }
     });
   }
 
 };
--- a/b2g/components/SafeMode.jsm
+++ b/b2g/components/SafeMode.jsm
@@ -71,17 +71,16 @@ this.SafeMode = {
     let document = SafeMode.window.document;
     SafeMode.window.screen.mozLockOrientation("portrait");
 
     let url = Services.io.newURI(shell.homeURL, null, null)
                          .resolve(kSafeModePage);
     debug("Registry is ready, loading " + url);
     let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
     frame.setAttribute("mozbrowser", "true");
-    frame.setAttribute("mozapp", shell.manifestURL);
     frame.setAttribute("id", "systemapp"); // To keep screen.js happy.
     let contentBrowser = document.body.appendChild(frame);
 
     return new Promise((aResolve, aReject) => {
       let content = contentBrowser.contentWindow;
 
       // Stripped down version of the system app bootstrap.
       function handleEvent(e) {
--- a/b2g/dev/config/tooltool-manifests/linux64/releng.manifest
+++ b/b2g/dev/config/tooltool-manifests/linux64/releng.manifest
@@ -19,24 +19,16 @@
 "version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
 "size": 68921028,
 "digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
-"size": 3027932,
-"digest": "a5c99eeb12b3b9b49632c259c762e34ec13cf72dadf90a0608b8ab1dc66b36cb114c5b45f71d326e12d31d9e88a41b029e6a728ca64cef392c0a8d211c2fe191",
-"algorithm": "sha512",
-"filename": "cargo.tar.xz",
-"unpack": true
-},
-{
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
 "filename": "sccache.tar.bz2",
 "unpack": true
 },
 {
 "size": 31078810,
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -326,18 +326,16 @@
 @RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 
 ; JavaScript components
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
-@RESPATH@/components/BrowserElementProxy.manifest
-@RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/PhoneNumberService.js
 @RESPATH@/components/PhoneNumberService.manifest
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/PermissionSettings.js
 @RESPATH@/components/PermissionSettings.manifest
 @RESPATH@/components/PermissionPromptService.js
 @RESPATH@/components/PermissionPromptService.manifest
@@ -570,17 +568,17 @@
 @RESPATH@/components/InputMethod.manifest
 #ifdef MOZ_B2G
 @RESPATH@/components/inputmethod.xpt
 #endif
 
 @RESPATH@/components/SystemUpdate.manifest
 @RESPATH@/components/SystemUpdateManager.js
 
-#ifdef MOZ_DEBUG
+#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @RESPATH@/components/TestInterfaceJS.js
 @RESPATH@/components/TestInterfaceJS.manifest
 @RESPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 ; Modules
 @RESPATH@/modules/*
 
--- a/b2g/simulator/custom-prefs.js
+++ b/b2g/simulator/custom-prefs.js
@@ -1,8 +1,7 @@
 user_pref("devtools.debugger.prompt-connection", false);
 user_pref("devtools.debugger.forbid-certified-apps", false);
-user_pref("devtools.apps.forbidden-permissions", "");
 user_pref("b2g.software-buttons", true);
 
 // Required for Mulet in order to run the debugger server from the command line
 user_pref("devtools.debugger.remote-enabled", true);
 user_pref("devtools.chrome.enabled", true);
--- a/browser/.eslintrc.js
+++ b/browser/.eslintrc.js
@@ -5,11 +5,12 @@ module.exports = {
     "../toolkit/.eslintrc.js"
   ],
 
   "rules": {
     "no-unused-vars": ["error", {
       "vars": "local",
       "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
       "args": "none",
-    }]
+    }],
+    "no-shadow": "error"
   }
 };
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -18,16 +18,25 @@ endif
 endif
 
 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
+# If we are trying to show an error dialog about the lack of SSE2 support,
+# make sure that code itself doesn't use SSE2.
+ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
+CXXFLAGS := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXXFLAGS))
+CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
+CXXFLAGS += -mno-sse -mno-sse2 -mfpmath=387
+CXX += -march=pentiumpro
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 # Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
 # (this dependency should really be just for firefox.exe, not other targets)
 # Note the manifest file exists in the tree, so we use the explicit filename
 # here.
 EXTRA_DEPS += firefox.exe.manifest
 endif
 
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -1,10 +1,10 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<blocklist lastupdate="1479216129114" xmlns="http://www.mozilla.org/2006/addons-blocklist">
+<blocklist lastupdate="1479243909840" xmlns="http://www.mozilla.org/2006/addons-blocklist">
   <emItems>
     <emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
       <prefs/>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
     <emItem blockID="i398" id="{377e5d4d-77e5-476a-8716-7e70a9272da0}">
       <prefs/>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
@@ -262,21 +262,21 @@
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
     <emItem blockID="i706" id="thefoxonlybetter@quicksaver">
       <prefs/>
       <versionRange minVersion="1.10" maxVersion="*" severity="3"/>
       <versionRange minVersion="1.6.160" maxVersion="1.6.160" severity="3"/>
       <versionRange minVersion="0" maxVersion="0.*" severity="3"/>
     </emItem>
-    <emItem blockID="i1210" id="auto-plugin-checker@jetpack">
+    <emItem blockID="i497" id="{872b5b88-9db5-4310-bdd0-ac189557e5f5}">
       <prefs/>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
-    <emItem blockID="i497" id="{872b5b88-9db5-4310-bdd0-ac189557e5f5}">
+    <emItem blockID="i1210" id="auto-plugin-checker@jetpack">
       <prefs/>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
     <emItem blockID="i91" id="crossriderapp4926@crossrider.com">
       <prefs/>
       <versionRange minVersion="0" maxVersion="0.81.43" severity="1"/>
     </emItem>
     <emItem blockID="i376" id="{9e09ac65-43c0-4b9d-970f-11e2e9616c55}">
@@ -593,28 +593,28 @@
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
     <emItem blockID="i730" id="25p@9eAkaLq.net">
       <prefs>
         <pref>browser.startup.homepage</pref>
       </prefs>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
-    <emItem blockID="i400" id="{dd6b651f-dfb9-4142-b0bd-09912ad22674}">
-      <prefs/>
-      <versionRange minVersion="0" maxVersion="*" severity="1"/>
-    </emItem>
     <emItem blockID="i1227" id="{A34CAF42-A3E3-11E5-945F-18C31D5D46B0}">
       <prefs>
         <pref>security.csp.enable</pref>
         <pref>security.fileuri.strict_origin_policy</pref>
         <pref>security.mixed_content.block_active_content</pref>
       </prefs>
       <versionRange minVersion="0" maxVersion="*" severity="1"/>
     </emItem>
+    <emItem blockID="i400" id="{dd6b651f-dfb9-4142-b0bd-09912ad22674}">
+      <prefs/>
+      <versionRange minVersion="0" maxVersion="*" severity="1"/>
+    </emItem>
     <emItem blockID="i11" id="yslow@yahoo-inc.com">
       <prefs/>
       <versionRange minVersion="2.0.5" maxVersion="2.0.5">
         <targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
           <versionRange maxVersion="*" minVersion="3.5.7"/>
         </targetApplication>
       </versionRange>
     </emItem>
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -81,11 +81,14 @@ if CONFIG['MOZ_LINKER']:
     OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']
 
 if CONFIG['MOZ_GPSD']:
     DEFINES['MOZ_GPSD'] = True
 
+if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
+    DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
+
 for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
     DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % (
         TOPOBJDIR, icon)
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -38,16 +38,62 @@
 #include "BinaryPath.h"
 
 #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
 
 #include "mozilla/Sprintf.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
+#ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
+#include <cpuid.h>
+#include "mozilla/Unused.h"
+
+static bool
+IsSSE2Available()
+{
+  // The rest of the app has been compiled to assume that SSE2 is present
+  // unconditionally, so we can't use the normal copy of SSE.cpp here.
+  // Since SSE.cpp caches the results and we need them only transiently,
+  // instead of #including SSE.cpp here, let's just inline the specific check
+  // that's needed.
+  unsigned int level = 1u;
+  unsigned int eax, ebx, ecx, edx;
+  unsigned int bits = (1u<<26);
+  unsigned int max = __get_cpuid_max(0, nullptr);
+  if (level > max) {
+    return false;
+  }
+  __cpuid_count(level, 0, eax, ebx, ecx, edx);
+  return (edx & bits) == bits;
+}
+
+static const char sSSE2Message[] =
+    "This browser version requires a processor with the SSE2 instruction "
+    "set extension.\nYou may be able to obtain a version that does not "
+    "require SSE2 from your Linux distribution.\n";
+
+__attribute__((constructor))
+static void
+SSE2Check()
+{
+  if (IsSSE2Available()) {
+    return;
+  }
+  // Using write() in order to avoid jemalloc-based buffering. Ignoring return
+  // values, since there isn't much we could do on failure and there is no
+  // point in trying to recover from errors.
+  MOZ_UNUSED(write(STDERR_FILENO,
+                   sSSE2Message,
+                   MOZ_ARRAY_LENGTH(sSSE2Message) - 1));
+  // _exit() instead of exit() to avoid running the usual "at exit" code.
+  _exit(255);
+}
+#endif
+
 #if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) \
   && !(defined(XP_LINUX) && defined(MOZ_SANDBOX))
 #define MOZ_BROWSER_CAN_BE_CONTENTPROC
 #include "../../ipc/contentproc/plugin-container.cpp"
 #endif
 
 using namespace mozilla;
 
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -431,18 +431,16 @@ pref("browser.tabs.drawInTitlebar", true
 // true   return to the tab that opened this tab (its owner)
 // false  return to the adjacent tab (old default)
 pref("browser.tabs.selectOwnerOnClose", true);
 
 pref("browser.tabs.showAudioPlayingIcon", true);
 // This should match Chromium's audio indicator delay.
 pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
 
-pref("browser.tabs.dontfocusfordialogs", true);
-
 pref("browser.ctrlTab.previews", false);
 
 // By default, do not export HTML at shutdown.
 // If true, at shutdown the bookmarks in your menu and toolbar will
 // be exported as HTML to the bookmarks.html file.
 pref("browser.bookmarks.autoExportHTML",          false);
 
 // The maximum number of daily bookmark backups to
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -362,17 +362,17 @@ appUpdater.prototype =
     case Components.results.NS_BINDING_ABORTED:
       // Do not remove UI listener since the user may resume downloading again.
       break;
     case Components.results.NS_OK:
       this.removeDownloadListener();
       if (this.backgroundUpdateEnabled) {
         this.selectPanel("applying");
         let self = this;
-        Services.obs.addObserver(function (aSubject, aTopic, aData) {
+        Services.obs.addObserver(function(aSubject, aTopic, aData) {
           // Update the UI when the background updater is finished
           let status = aData;
           if (status == "applied" || status == "applied-service" ||
               status == "pending" || status == "pending-service" ||
               status == "pending-elevate") {
             // If the update is successfully applied, or if the updater has
             // fallen back to non-staged updates, show the "Restart to Update"
             // button.
--- a/browser/base/content/aboutNetError.xhtml
+++ b/browser/base/content/aboutNetError.xhtml
@@ -179,24 +179,24 @@
           // error code link in the advanced panel.
           var div = document.getElementById("certificateErrorDebugInformation");
           div.style.display = "none";
         }
 
         document.getElementById("learnMoreContainer").style.display = "block";
 
         var checkbox = document.getElementById("automaticallyReportInFuture");
-        checkbox.addEventListener("change", function ({target: {checked}}) {
+        checkbox.addEventListener("change", function({target: {checked}}) {
           document.dispatchEvent(new CustomEvent("AboutNetErrorSetAutomatic", {
             detail: checked,
             bubbles: true
           }));
         });
 
-        addEventListener("AboutNetErrorOptions", function (event) {
+        addEventListener("AboutNetErrorOptions", function(event) {
           var options = JSON.parse(event.detail);
           if (options && options.enabled) {
             // Display error reporting UI
             document.getElementById("certificateErrorReporting").style.display = "block";
 
             // set the checkbox
             checkbox.checked = !!options.automatic;
           }
@@ -254,17 +254,17 @@
         var ld = document.getElementById("errorLongDesc");
         if (ld)
         {
           ld.innerHTML = errDesc.innerHTML;
         }
 
         if (err == "sslv3Used") {
           document.getElementById("learnMoreContainer").style.display = "block";
-          var learnMoreLink = document.getElementById("learnMoreLink");
+          let learnMoreLink = document.getElementById("learnMoreLink");
           learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
           document.body.className = "certerror";
         }
 
         if (err == "weakCryptoUsed") {
           document.body.className = "certerror";
         }
 
@@ -300,17 +300,17 @@
           // almost certainly useless. (Bug 553180)
           document.getElementById("netErrorButtonContainer").style.display = "none";
         }
 
         window.addEventListener("AboutNetErrorOptions", function(evt) {
         // Pinning errors are of type nssFailure2
           if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
             document.getElementById("learnMoreContainer").style.display = "block";
-            var learnMoreLink = document.getElementById("learnMoreLink");
+            let learnMoreLink = document.getElementById("learnMoreLink");
             // nssFailure2 also gets us other non-overrideable errors. Choose
             // a "learn more" link based on description:
             if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
               learnMoreLink.href = "https://support.mozilla.org/kb/certificate-pinning-reports";
             }
             if (getErrorCode() == "weakCryptoUsed") {
               learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-weak-crypto-error-messages-firefox";
             }
@@ -319,19 +319,20 @@
             if (options && options.enabled) {
               var checkbox = document.getElementById("automaticallyReportInFuture");
               showCertificateErrorReporting();
               if (options.automatic) {
                 // set the checkbox
                 checkbox.checked = true;
               }
 
-              checkbox.addEventListener("change", function(evt) {
+              checkbox.addEventListener("change", function(changeEvt) {
                   var event = new CustomEvent("AboutNetErrorSetAutomatic",
-                    {bubbles:true, detail:evt.target.checked});
+                    {bubbles: true,
+                     detail: changeEvt.target.checked});
                   document.dispatchEvent(event);
                 }, false);
             }
             const hasPrefStyleError = [
               "interrupted", // This happens with subresources that are above the max tls
               "SSL_ERROR_PROTOCOL_VERSION_ALERT",
               "SSL_ERROR_UNSUPPORTED_VERSION",
               "SSL_ERROR_NO_CYPHER_OVERLAP",
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -24,20 +24,16 @@ const OBSERVER_TOPICS = [
   fxAccountsCommon.ONVERIFIED_NOTIFICATION,
   fxAccountsCommon.ONLOGOUT_NOTIFICATION,
 ];
 
 function log(msg) {
   // dump("FXA: " + msg + "\n");
 }
 
-function error(msg) {
-  console.log("Firefox Account Error: " + msg + "\n");
-}
-
 function getPreviousAccountNameHash() {
   try {
     return Services.prefs.getComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString).data;
   } catch (_) {
     return "";
   }
 }
 
@@ -100,17 +96,17 @@ function updateDisplayedEmail(user) {
   if (emailDiv && user) {
     emailDiv.textContent = user.email;
   }
 }
 
 var wrapper = {
   iframe: null,
 
-  init: function (url, urlParams) {
+  init: function(url, urlParams) {
     // If a master-password is enabled, we want to encourage the user to
     // unlock it.  Things still work if not, but the user will probably need
     // to re-auth next startup (in which case we will get here again and
     // re-prompt)
     Utils.ensureMPUnlocked();
 
     let iframe = document.getElementById("remote");
     this.iframe = iframe;
@@ -129,17 +125,17 @@ var wrapper = {
     this.url = url;
     // Set the iframe's location with loadURI/LOAD_FLAGS_REPLACE_HISTORY to
     // avoid having a new history entry being added. REPLACE_HISTORY is used
     // to replace the current entry, which is `about:blank`.
     let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null);
   },
 
-  retry: function () {
+  retry: function() {
     let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
   },
 
   iframeListener: {
     QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference,
                                          Ci.nsISupports]),
@@ -175,17 +171,17 @@ var wrapper = {
       }
     },
 
     onProgressChange: function() {},
     onStatusChange: function() {},
     onSecurityChange: function() {},
   },
 
-  handleEvent: function (evt) {
+  handleEvent: function(evt) {
     switch (evt.type) {
       case "load":
         this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this);
         this.iframe.removeEventListener("load", this);
         break;
       case "FirefoxAccountsCommand":
         this.handleRemoteCommand(evt);
         break;
@@ -193,17 +189,17 @@ var wrapper = {
   },
 
   /**
    * onLogin handler receives user credentials from the jelly after a
    * sucessful login and stores it in the fxaccounts service
    *
    * @param accountData the user's account data and credentials
    */
-  onLogin: function (accountData) {
+  onLogin: function(accountData) {
     log("Received: 'login'. Data:" + JSON.stringify(accountData));
 
     if (accountData.customizeSync) {
       Services.prefs.setBoolPref(PREF_SYNC_SHOW_CUSTOMIZATION, true);
     }
     delete accountData.customizeSync;
     // sessionTokenContext is erroneously sent by the content server.
     // https://github.com/mozilla/fxa-content-server/issues/2766
@@ -259,26 +255,26 @@ var wrapper = {
     // We need to confirm a relink - see shouldAllowRelink for more
     let ok = shouldAllowRelink(accountData.email);
     this.injectData("message", { status: "can_link_account", data: { ok: ok } });
   },
 
   /**
    * onSignOut handler erases the current user's session from the fxaccounts service
    */
-  onSignOut: function () {
+  onSignOut: function() {
     log("Received: 'sign_out'.");
 
     fxAccounts.signOut().then(
       () => this.injectData("message", { status: "sign_out" }),
       (err) => this.injectData("message", { status: "error", error: err })
     );
   },
 
-  handleRemoteCommand: function (evt) {
+  handleRemoteCommand: function(evt) {
     log('command: ' + evt.detail.command);
     let data = evt.detail.data;
 
     switch (evt.detail.command) {
       case "login":
         this.onLogin(data);
         break;
       case "can_link_account":
@@ -288,17 +284,17 @@ var wrapper = {
         this.onSignOut(data);
         break;
       default:
         log("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
         break;
     }
   },
 
-  injectData: function (type, content) {
+  injectData: function(type, content) {
     return fxAccounts.promiseAccountsSignUpURI().then(authUrl => {
       let data = {
         type: type,
         content: content
       };
       this.iframe.contentWindow.postMessage(data, authUrl);
     })
     .catch(e => {
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -10,111 +10,111 @@ Cu.import("resource://gre/modules/Prefer
 Cu.import("resource://gre/modules/Services.jsm");
 
 const prefs = new Preferences("datareporting.healthreport.");
 
 const PREF_UNIFIED = "toolkit.telemetry.unified";
 const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
 
 var healthReportWrapper = {
-  init: function () {
+  init: function() {
     let iframe = document.getElementById("remote-report");
     iframe.addEventListener("load", healthReportWrapper.initRemotePage, false);
     iframe.src = this._getReportURI().spec;
     prefs.observe("uploadEnabled", this.updatePrefState, healthReportWrapper);
   },
 
-  uninit: function () {
+  uninit: function() {
     prefs.ignore("uploadEnabled", this.updatePrefState, healthReportWrapper);
   },
 
-  _getReportURI: function () {
+  _getReportURI: function() {
     let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
     return Services.io.newURI(url, null, null);
   },
 
-  setDataSubmission: function (enabled) {
+  setDataSubmission: function(enabled) {
     MozSelfSupport.healthReportDataSubmissionEnabled = enabled;
     this.updatePrefState();
   },
 
-  updatePrefState: function () {
+  updatePrefState: function() {
     try {
-      let prefs = {
+      let prefsObj = {
         enabled: MozSelfSupport.healthReportDataSubmissionEnabled,
       };
-      healthReportWrapper.injectData("prefs", prefs);
+      healthReportWrapper.injectData("prefs", prefsObj);
     }
     catch (ex) {
       healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PREFS_FAILED);
     }
   },
 
-  sendTelemetryPingList: function () {
+  sendTelemetryPingList: function() {
     console.log("AboutHealthReport: Collecting Telemetry ping list.");
     MozSelfSupport.getTelemetryPingList().then((list) => {
       console.log("AboutHealthReport: Sending Telemetry ping list.");
       this.injectData("telemetry-ping-list", list);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting ping list failed: " + ex);
     });
   },
 
-  sendTelemetryPingData: function (pingId) {
+  sendTelemetryPingData: function(pingId) {
     console.log("AboutHealthReport: Collecting Telemetry ping data.");
     MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
       console.log("AboutHealthReport: Sending Telemetry ping data.");
       this.injectData("telemetry-ping-data", {
         id: pingId,
         pingData: ping,
       });
     }).catch((ex) => {
       console.log("AboutHealthReport: Loading ping data failed: " + ex);
       this.injectData("telemetry-ping-data", {
         id: pingId,
         error: "error-generic",
       });
     });
   },
 
-  sendCurrentEnvironment: function () {
+  sendCurrentEnvironment: function() {
     console.log("AboutHealthReport: Sending Telemetry environment data.");
     MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
       this.injectData("telemetry-current-environment-data", environment);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting current environment data failed: " + ex);
     });
   },
 
-  sendCurrentPingData: function () {
+  sendCurrentPingData: function() {
     console.log("AboutHealthReport: Sending current Telemetry ping data.");
     MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
       this.injectData("telemetry-current-ping-data", ping);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting current ping data failed: " + ex);
     });
   },
 
-  injectData: function (type, content) {
+  injectData: function(type, content) {
     let report = this._getReportURI();
 
     // file URIs can't be used for targetOrigin, so we use "*" for this special case
     // in all other cases, pass in the URL to the report so we properly restrict the message dispatch
     let reportUrl = report.scheme == "file" ? "*" : report.spec;
 
     let data = {
       type: type,
       content: content
     }
 
     let iframe = document.getElementById("remote-report");
     iframe.contentWindow.postMessage(data, reportUrl);
   },
 
-  handleRemoteCommand: function (evt) {
+  handleRemoteCommand: function(evt) {
     // Do an origin check to harden against the frame content being loaded from unexpected locations.
     let allowedPrincipal = Services.scriptSecurityManager.getCodebasePrincipal(this._getReportURI());
     let targetPrincipal = evt.target.nodePrincipal;
     if (!allowedPrincipal.equals(targetPrincipal)) {
       Cu.reportError(`Origin check failed for message "${evt.detail.command}": ` +
                      `target origin is "${targetPrincipal.origin}", expected "${allowedPrincipal.origin}"`);
       return;
     }
@@ -142,39 +142,39 @@ var healthReportWrapper = {
         this.sendCurrentPingData();
         break;
       default:
         Cu.reportError("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
         break;
     }
   },
 
-  initRemotePage: function () {
+  initRemotePage: function() {
     let iframe = document.getElementById("remote-report").contentDocument;
     iframe.addEventListener("RemoteHealthReportCommand",
                             function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
                             false);
     healthReportWrapper.updatePrefState();
   },
 
   // error handling
   ERROR_INIT_FAILED:    1,
   ERROR_PAYLOAD_FAILED: 2,
   ERROR_PREFS_FAILED:   3,
 
-  reportFailure: function (error) {
+  reportFailure: function(error) {
     let details = {
       errorType: error,
     }
     healthReportWrapper.injectData("error", details);
   },
 
-  handleInitFailure: function () {
+  handleInitFailure: function() {
     healthReportWrapper.reportFailure(healthReportWrapper.ERROR_INIT_FAILED);
   },
 
-  handlePayloadFailure: function () {
+  handlePayloadFailure: function() {
     healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PAYLOAD_FAILED);
   },
 }
 
-window.addEventListener("load", function () { healthReportWrapper.init(); });
-window.addEventListener("unload", function () { healthReportWrapper.uninit(); });
+window.addEventListener("load", function() { healthReportWrapper.init(); });
+window.addEventListener("unload", function() { healthReportWrapper.uninit(); });
--- a/browser/base/content/abouthome/aboutHome.js
+++ b/browser/base/content/abouthome/aboutHome.js
@@ -22,33 +22,33 @@ const SNIPPETS_UPDATE_INTERVAL_MS = 1440
 const DATABASE_NAME = "abouthome";
 const DATABASE_VERSION = 1;
 const DATABASE_STORAGE = "persistent";
 const SNIPPETS_OBJECTSTORE_NAME = "snippets";
 var searchText;
 
 // This global tracks if the page has been set up before, to prevent double inits
 var gInitialized = false;
-var gObserver = new MutationObserver(function (mutations) {
+var gObserver = new MutationObserver(function(mutations) {
   for (let mutation of mutations) {
     // The addition of the restore session button changes our width:
     if (mutation.attributeName == "session") {
       fitToWidth();
     }
     if (mutation.attributeName == "snippetsVersion") {
       if (!gInitialized) {
         ensureSnippetsMapThen(loadSnippets);
         gInitialized = true;
       }
       return;
     }
   }
 });
 
-window.addEventListener("pageshow", function () {
+window.addEventListener("pageshow", function() {
   // Delay search engine setup, cause browser.js::BrowserOnAboutPageLoad runs
   // later and may use asynchronous getters.
   window.gObserver.observe(document.documentElement, { attributes: true });
   window.gObserver.observe(document.getElementById("launcher"), { attributes: true });
   fitToWidth();
   setupSearch();
   window.addEventListener("resize", fitToWidth);
 
@@ -113,96 +113,96 @@ function ensureSnippetsMapThen(aCallback
 
   // Handle multiple requests during the async initialization.
   gSnippetsMapCallbacks.push(aCallback);
   if (gSnippetsMapCallbacks.length > 1) {
     // We are already updating, the callbacks will be invoked when done.
     return;
   }
 
-  let invokeCallbacks = function () {
+  let invokeCallbacks = function() {
     if (!gSnippetsMap) {
       gSnippetsMap = Object.freeze(new Map());
     }
 
     for (let callback of gSnippetsMapCallbacks) {
       callback(gSnippetsMap);
     }
     gSnippetsMapCallbacks.length = 0;
   }
 
   let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION,
                                                    storage: DATABASE_STORAGE});
 
-  openRequest.onerror = function (event) {
+  openRequest.onerror = function(event) {
     // Try to delete the old database so that we can start this process over
     // next time.
     indexedDB.deleteDatabase(DATABASE_NAME);
     invokeCallbacks();
   };
 
-  openRequest.onupgradeneeded = function (event) {
+  openRequest.onupgradeneeded = function(event) {
     let db = event.target.result;
     if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {
       db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);
     }
   }
 
-  openRequest.onsuccess = function (event) {
+  openRequest.onsuccess = function(event) {
     let db = event.target.result;
 
-    db.onerror = function (event) {
+    db.onerror = function() {
       invokeCallbacks();
     }
 
-    db.onversionchange = function (event) {
-      event.target.close();
+    db.onversionchange = function(versionChangeEvent) {
+      versionChangeEvent.target.close();
       invokeCallbacks();
     }
 
     let cache = new Map();
     let cursorRequest;
     try {
       cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)
                         .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();
     } catch (ex) {
       console.error(ex);
       invokeCallbacks();
       return;
     }
 
-    cursorRequest.onerror = function (event) {
+    cursorRequest.onerror = function() {
       invokeCallbacks();
     }
 
-    cursorRequest.onsuccess = function(event) {
-      let cursor = event.target.result;
+    cursorRequest.onsuccess = function(cursorRequestEvent) {
+      let cursor = cursorRequestEvent.target.result;
 
       // Populate the cache from the persistent storage.
       if (cursor) {
         cache.set(cursor.key, cursor.value);
         cursor.continue();
         return;
       }
 
       // The cache has been filled up, create the snippets map.
       gSnippetsMap = Object.freeze({
         get: (aKey) => cache.get(aKey),
-        set: function (aKey, aValue) {
+        set: function(aKey, aValue) {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey);
           return cache.set(aKey, aValue);
         },
         has: (aKey) => cache.has(aKey),
-        delete: function (aKey) {
+        delete: function(aKey) {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey);
           return cache.delete(aKey);
         },
-        clear: function () {
+        clear: function() {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).clear();
           return cache.clear();
         },
         get size() { return cache.size; },
       });
 
       setTimeout(invokeCallbacks, 0);
@@ -278,17 +278,17 @@ function loadSnippets()
                      Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS;
   if (updateURL && shouldUpdate) {
     // Try to update from network.
     let xhr = new XMLHttpRequest();
     xhr.timeout = 5000;
     // Even if fetching should fail we don't want to spam the server, thus
     // set the last update time regardless its results.  Will retry tomorrow.
     gSnippetsMap.set("snippets-last-update", Date.now());
-    xhr.onloadend = function (event) {
+    xhr.onloadend = function() {
       if (xhr.status == 200) {
         gSnippetsMap.set("snippets", xhr.responseText);
         gSnippetsMap.set("snippets-cached-version", currentVersion);
       }
       showSnippets();
       loadCompleted();
     };
     try {
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -25,32 +25,32 @@ function removeNotificationOnEnd(notific
       onDownloadFailed: maybeRemove,
       onInstallFailed: maybeRemove,
       onInstallEnded: maybeRemove
     });
   }
 }
 
 const gXPInstallObserver = {
-  _findChildShell: function (aDocShell, aSoughtShell)
+  _findChildShell: function(aDocShell, aSoughtShell)
   {
     if (aDocShell == aSoughtShell)
       return aDocShell;
 
     var node = aDocShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
     for (var i = 0; i < node.childCount; ++i) {
       var docShell = node.getChildAt(i);
       docShell = this._findChildShell(docShell, aSoughtShell);
       if (docShell == aSoughtShell)
         return docShell;
     }
     return null;
   },
 
-  _getBrowser: function (aDocShell)
+  _getBrowser: function(aDocShell)
   {
     for (let browser of gBrowser.browsers) {
       if (this._findChildShell(browser.docShell, aDocShell))
         return browser;
     }
     return null;
   },
 
@@ -127,20 +127,22 @@ const gXPInstallObserver = {
             let container = document.createElement("hbox");
 
             let name = document.createElement("label");
             name.setAttribute("value", install.addon.name);
             name.setAttribute("class", "addon-install-confirmation-name");
             container.appendChild(name);
 
             if (someUnsigned && install.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
-              let unsigned = document.createElement("label");
-              unsigned.setAttribute("value", gNavigatorBundle.getString("addonInstall.unsigned"));
-              unsigned.setAttribute("class", "addon-install-confirmation-unsigned");
-              container.appendChild(unsigned);
+              let unsignedLabel = document.createElement("label");
+              unsignedLabel.setAttribute("value",
+                gNavigatorBundle.getString("addonInstall.unsigned"));
+              unsignedLabel.setAttribute("class",
+                "addon-install-confirmation-unsigned");
+              container.appendChild(unsignedLabel);
             }
 
             addonList.appendChild(container);
           }
 
           this.acceptInstallation = () => {
             for (let install of installInfo.installs)
               install.install();
@@ -189,17 +191,16 @@ const gXPInstallObserver = {
     cancelButton.label = gNavigatorBundle.getString("addonInstall.cancelButton.label");
     cancelButton.accessKey = gNavigatorBundle.getString("addonInstall.cancelButton.accesskey");
 
     let acceptButton = document.getElementById("addon-install-confirmation-accept");
     acceptButton.label = gNavigatorBundle.getString("addonInstall.acceptButton.label");
     acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
 
     if (height) {
-      let notification = document.getElementById("addon-install-confirmation-notification");
       notification.style.minHeight = height + "px";
     }
 
     let tab = gBrowser.getTabForBrowser(browser);
     if (tab) {
       gBrowser.selectedTab = tab;
     }
 
@@ -209,17 +210,17 @@ const gXPInstallObserver = {
 
     removeNotificationOnEnd(popup, installInfo.installs);
 
     Services.telemetry
             .getHistogramById("SECURITY_UI")
             .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
   },
 
-  observe: function (aSubject, aTopic, aData)
+  observe: function(aSubject, aTopic, aData)
   {
     var brandBundle = document.getElementById("bundle_brand");
     var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
     var browser = installInfo.browser;
 
     // Make sure the browser is still alive.
     if (!browser || gBrowser.browsers.indexOf(browser) == -1)
       return;
@@ -437,24 +438,24 @@ const gXPInstallObserver = {
   _removeProgressNotification(aBrowser) {
     let notification = PopupNotifications.getNotification("addon-progress", aBrowser);
     if (notification)
       notification.remove();
   }
 };
 
 var LightWeightThemeWebInstaller = {
-  init: function () {
+  init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("LightWeightThemeWebInstaller:Install", this);
     mm.addMessageListener("LightWeightThemeWebInstaller:Preview", this);
     mm.addMessageListener("LightWeightThemeWebInstaller:ResetPreview", this);
   },
 
-  receiveMessage: function (message) {
+  receiveMessage: function(message) {
     // ignore requests from background tabs
     if (message.target != gBrowser.selectedBrowser) {
       return;
     }
 
     let data = message.data;
 
     switch (message.name) {
@@ -468,33 +469,33 @@ var LightWeightThemeWebInstaller = {
       }
       case "LightWeightThemeWebInstaller:ResetPreview": {
         this._resetPreview(data && data.baseURI);
         break;
       }
     }
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "TabSelect": {
         this._resetPreview();
         break;
       }
     }
   },
 
-  get _manager () {
+  get _manager() {
     let temp = {};
     Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
     delete this._manager;
     return this._manager = temp.LightweightThemeManager;
   },
 
-  _installRequest: function (dataString, baseURI) {
+  _installRequest: function(dataString, baseURI) {
     let data = this._manager.parseTheme(dataString, baseURI);
 
     if (!data) {
       return;
     }
 
     let uri = makeURI(baseURI);
 
@@ -525,47 +526,47 @@ var LightWeightThemeWebInstaller = {
     let allowButtonAccesskey =
       gNavigatorBundle.getString("lwthemeInstallRequest.allowButton.accesskey");
     let message =
       gNavigatorBundle.getFormattedString("lwthemeInstallRequest.message",
                                           [uri.host]);
     let buttons = [{
       label: allowButtonText,
       accessKey: allowButtonAccesskey,
-      callback: function () {
+      callback: function() {
         LightWeightThemeWebInstaller._install(data, notify);
       }
     }];
 
     this._removePreviousNotifications();
 
     let notificationBox = gBrowser.getNotificationBox();
     let notificationBar =
       notificationBox.appendNotification(message, "lwtheme-install-request", "",
                                          notificationBox.PRIORITY_INFO_MEDIUM,
                                          buttons);
     notificationBar.persistence = 1;
   },
 
-  _install: function (newLWTheme, notify) {
+  _install: function(newLWTheme, notify) {
     let previousLWTheme = this._manager.currentTheme;
 
     let listener = {
       onEnabling: function(aAddon, aRequiresRestart) {
         if (!aRequiresRestart) {
           return;
         }
 
         let messageString = gNavigatorBundle.getFormattedString("lwthemeNeedsRestart.message",
           [aAddon.name], 1);
 
         let action = {
           label: gNavigatorBundle.getString("lwthemeNeedsRestart.button"),
           accessKey: gNavigatorBundle.getString("lwthemeNeedsRestart.accesskey"),
-          callback: function () {
+          callback: function() {
             BrowserUtils.restartApplication();
           }
         };
 
         let options = {
           timeout: Date.now() + 30000
         };
 
@@ -581,80 +582,80 @@ var LightWeightThemeWebInstaller = {
       }
     };
 
     AddonManager.addAddonListener(listener);
     this._manager.currentTheme = newLWTheme;
     AddonManager.removeAddonListener(listener);
   },
 
-  _postInstallNotification: function (newTheme, previousTheme) {
+  _postInstallNotification: function(newTheme, previousTheme) {
     function text(id) {
       return gNavigatorBundle.getString("lwthemePostInstallNotification." + id);
     }
 
     let buttons = [{
       label: text("undoButton"),
       accessKey: text("undoButton.accesskey"),
-      callback: function () {
+      callback: function() {
         LightWeightThemeWebInstaller._manager.forgetUsedTheme(newTheme.id);
         LightWeightThemeWebInstaller._manager.currentTheme = previousTheme;
       }
     }, {
       label: text("manageButton"),
       accessKey: text("manageButton.accesskey"),
-      callback: function () {
+      callback: function() {
         BrowserOpenAddonsMgr("addons://list/theme");
       }
     }];
 
     this._removePreviousNotifications();
 
     let notificationBox = gBrowser.getNotificationBox();
     let notificationBar =
       notificationBox.appendNotification(text("message"),
                                          "lwtheme-install-notification", "",
                                          notificationBox.PRIORITY_INFO_MEDIUM,
                                          buttons);
     notificationBar.persistence = 1;
     notificationBar.timeout = Date.now() + 20000; // 20 seconds
   },
 
-  _removePreviousNotifications: function () {
+  _removePreviousNotifications: function() {
     let box = gBrowser.getNotificationBox();
 
     ["lwtheme-install-request",
-     "lwtheme-install-notification"].forEach(function (value) {
+     "lwtheme-install-notification"].forEach(function(value) {
         let notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
   },
 
-  _preview: function (dataString, baseURI) {
+  _preview: function(dataString, baseURI) {
     if (!this._isAllowed(baseURI))
       return;
 
     let data = this._manager.parseTheme(dataString, baseURI);
     if (!data)
       return;
 
     this._resetPreview();
     gBrowser.tabContainer.addEventListener("TabSelect", this, false);
     this._manager.previewTheme(data);
   },
 
-  _resetPreview: function (baseURI) {
+  _resetPreview: function(baseURI) {
     if (baseURI && !this._isAllowed(baseURI))
       return;
     gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
     this._manager.resetPreview();
   },
 
-  _isAllowed: function (srcURIString) {
+  _isAllowed: function(srcURIString) {
     let uri;
     try {
       uri = makeURI(srcURIString);
     }
     catch (e) {
       // makeURI fails if srcURIString is a nonsense URI
       return false;
     }
@@ -669,33 +670,33 @@ var LightWeightThemeWebInstaller = {
 };
 
 /*
  * Listen for Lightweight Theme styling changes and update the browser's theme accordingly.
  */
 var LightweightThemeListener = {
   _modifiedStyles: [],
 
-  init: function () {
+  init: function() {
     XPCOMUtils.defineLazyGetter(this, "styleSheet", function() {
       for (let i = document.styleSheets.length - 1; i >= 0; i--) {
         let sheet = document.styleSheets[i];
         if (sheet.href == "chrome://browser/skin/browser-lightweightTheme.css")
           return sheet;
       }
       return undefined;
     });
 
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.addObserver(this, "lightweight-theme-optimized", false);
     if (document.documentElement.hasAttribute("lwtheme"))
       this.updateStyleSheet(document.documentElement.style.backgroundImage);
   },
 
-  uninit: function () {
+  uninit: function() {
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
     Services.obs.removeObserver(this, "lightweight-theme-optimized");
   },
 
   /**
    * Append the headerImage to the background-image property of all rulesets in
    * browser-lightweightTheme.css.
    *
@@ -726,17 +727,17 @@ var LightweightThemeListener = {
       } else {
         Cu.reportError("Unsupported rule encountered");
       }
     }
     return styleRulesModified;
   },
 
   // nsIObserver
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     if ((aTopic != "lightweight-theme-styling-update" && aTopic != "lightweight-theme-optimized") ||
           !this.styleSheet)
       return;
 
     if (aTopic == "lightweight-theme-optimized" && aSubject != window)
       return;
 
     let themeData = JSON.parse(aData);
--- a/browser/base/content/browser-ctrlTab.js
+++ b/browser/base/content/browser-ctrlTab.js
@@ -43,17 +43,17 @@ var tabPreviews = {
   },
 
   capture: function tabPreviews_capture(aTab, aShouldCache) {
     let browser = aTab.linkedBrowser;
     let uri = browser.currentURI.spec;
     let canvas = PageThumbs.createCanvas(window);
     PageThumbs.shouldStoreThumbnail(browser, (aDoStore) => {
       if (aDoStore && aShouldCache) {
-        PageThumbs.captureAndStore(browser, function () {
+        PageThumbs.captureAndStore(browser, function() {
           let img = new Image;
           img.src = PageThumbs.getThumbnailURL(uri);
           aTab.__thumbnail = img;
           aTab.__thumbnail_lastURI = uri;
           canvas.getContext("2d").drawImage(img, 0, 0);
         });
       } else {
         PageThumbs.captureToCanvas(browser, canvas, () => {
@@ -73,17 +73,17 @@ var tabPreviews = {
         if (this._selectedTab &&
             this._selectedTab.parentNode &&
             !this._pendingUpdate) {
           // Generate a thumbnail for the tab that was selected.
           // The timeout keeps the UI snappy and prevents us from generating thumbnails
           // for tabs that will be closed. During that timeout, don't generate other
           // thumbnails in case multiple TabSelect events occur fast in succession.
           this._pendingUpdate = true;
-          setTimeout(function (self, aTab) {
+          setTimeout(function(self, aTab) {
             self._pendingUpdate = false;
             if (aTab.parentNode &&
                 !aTab.hasAttribute("busy") &&
                 !aTab.hasAttribute("pending"))
               self.capture(aTab, true);
           }, 2000, this, this._selectedTab);
         }
         this._selectedTab = event.target;
@@ -91,39 +91,39 @@ var tabPreviews = {
       case "SSTabRestored":
         this.capture(event.target, true);
         break;
     }
   }
 };
 
 var tabPreviewPanelHelper = {
-  opening: function (host) {
+  opening: function(host) {
     host.panel.hidden = false;
 
     var handler = this._generateHandler(host);
     host.panel.addEventListener("popupshown", handler, false);
     host.panel.addEventListener("popuphiding", handler, false);
 
     host._prevFocus = document.commandDispatcher.focusedElement;
   },
-  _generateHandler: function (host) {
+  _generateHandler: function(host) {
     var self = this;
-    return function (event) {
+    return function(event) {
       if (event.target == host.panel) {
         host.panel.removeEventListener(event.type, arguments.callee, false);
         self["_" + event.type](host);
       }
     };
   },
-  _popupshown: function (host) {
+  _popupshown: function(host) {
     if ("setupGUI" in host)
       host.setupGUI();
   },
-  _popuphiding: function (host) {
+  _popuphiding: function(host) {
     if ("suspendGUI" in host)
       host.suspendGUI();
 
     if (host._prevFocus) {
       Services.focus.setFocus(host._prevFocus, Ci.nsIFocusManager.FLAG_NOSCROLL);
       host._prevFocus = null;
     } else
       gBrowser.selectedBrowser.focus();
@@ -134,67 +134,67 @@ var tabPreviewPanelHelper = {
     }
   }
 };
 
 /**
  * Ctrl-Tab panel
  */
 var ctrlTab = {
-  get panel () {
+  get panel() {
     delete this.panel;
     return this.panel = document.getElementById("ctrlTab-panel");
   },
-  get showAllButton () {
+  get showAllButton() {
     delete this.showAllButton;
     return this.showAllButton = document.getElementById("ctrlTab-showAll");
   },
-  get previews () {
+  get previews() {
     delete this.previews;
     return this.previews = this.panel.getElementsByClassName("ctrlTab-preview");
   },
-  get maxTabPreviews () {
+  get maxTabPreviews() {
     delete this.maxTabPreviews;
     return this.maxTabPreviews = this.previews.length - 1;
   },
-  get canvasWidth () {
+  get canvasWidth() {
     delete this.canvasWidth;
     return this.canvasWidth = Math.ceil(screen.availWidth * .85 / this.maxTabPreviews);
   },
-  get canvasHeight () {
+  get canvasHeight() {
     delete this.canvasHeight;
     return this.canvasHeight = Math.round(this.canvasWidth * tabPreviews.aspectRatio);
   },
-  get keys () {
+  get keys() {
     var keys = {};
-    ["close", "find", "selectAll"].forEach(function (key) {
+    ["close", "find", "selectAll"].forEach(function(key) {
       keys[key] = document.getElementById("key_" + key)
                           .getAttribute("key")
                           .toLocaleLowerCase().charCodeAt(0);
     });
     delete this.keys;
     return this.keys = keys;
   },
   _selectedIndex: 0,
-  get selected () {
+  get selected() {
     return this._selectedIndex < 0 ?
              document.activeElement :
              this.previews.item(this._selectedIndex);
   },
-  get isOpen () {
+  get isOpen() {
     return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
   },
-  get tabCount () {
+  get tabCount() {
     return this.tabList.length;
   },
-  get tabPreviewCount () {
+  get tabPreviewCount() {
     return Math.min(this.maxTabPreviews, this.tabCount);
   },
 
-  get tabList () {
+  get tabList() {
     return this._recentlyUsedTabs;
   },
 
   init: function ctrlTab_init() {
     if (!this._recentlyUsedTabs) {
       tabPreviews.init();
 
       this._initRecentlyUsedTabs();
@@ -214,17 +214,17 @@ var ctrlTab = {
       (!gPrefService.prefHasUserValue("browser.ctrlTab.disallowForScreenReaders") ||
        !gPrefService.getBoolPref("browser.ctrlTab.disallowForScreenReaders"));
 
     if (enable)
       this.init();
     else
       this.uninit();
   },
-  observe: function (aSubject, aTopic, aPrefName) {
+  observe: function(aSubject, aTopic, aPrefName) {
     this.readPref();
   },
 
   updatePreviews: function ctrlTab_updatePreviews() {
     for (let i = 0; i < this.previews.length; i++)
       this.updatePreview(this.previews[i], this.tabList[i]);
 
     var showAllLabel = gNavigatorBundle.getString("ctrlTab.listAllTabs.label");
@@ -342,17 +342,17 @@ var ctrlTab = {
 
     document.addEventListener("keyup", this, true);
 
     this.updatePreviews();
     this._selectedIndex = 1;
 
     // Add a slight delay before showing the UI, so that a quick
     // "ctrl-tab" keypress just flips back to the MRU tab.
-    this._timer = setTimeout(function (self) {
+    this._timer = setTimeout(function(self) {
       self._timer = null;
       self._openPanel();
     }, 200, this);
   },
 
   _openPanel: function ctrlTab_openPanel() {
     tabPreviewPanelHelper.opening(this);
 
@@ -383,17 +383,17 @@ var ctrlTab = {
 
   setupGUI: function ctrlTab_setupGUI() {
     this.selected.focus();
     this._selectedIndex = -1;
 
     // Track mouse movement after a brief delay so that the item that happens
     // to be under the mouse pointer initially won't be selected unintentionally.
     this._trackMouseOver = false;
-    setTimeout(function (self) {
+    setTimeout(function(self) {
       if (self.isOpen)
         self._trackMouseOver = true;
     }, 0, this);
   },
 
   suspendGUI: function ctrlTab_suspendGUI() {
     document.removeEventListener("keyup", this, true);
 
@@ -457,17 +457,17 @@ var ctrlTab = {
 
     if (this.selected.hidden)
       this.advanceFocus(false);
     if (this.selected == this.showAllButton)
       this.advanceFocus(false);
 
     // If the current tab is removed, another tab can steal our focus.
     if (aTab.selected && this.panel.state == "open") {
-      setTimeout(function (selected) {
+      setTimeout(function(selected) {
         selected.focus();
       }, 0, this.selected);
     }
   },
 
   handleEvent: function ctrlTab_handleEvent(event) {
     switch (event.type) {
       case "SSWindowRestored":
@@ -503,31 +503,31 @@ var ctrlTab = {
         break;
       case "popupshowing":
         if (event.target.id == "menu_viewPopup")
           document.getElementById("menu_showAllTabs").hidden = !allTabs.canOpen;
         break;
     }
   },
 
-  filterForThumbnailExpiration: function (aCallback) {
+  filterForThumbnailExpiration: function(aCallback) {
     // Save a few more thumbnails than we actually display, so that when tabs
     // are closed, the previews we add instead still get thumbnails.
     const extraThumbnails = 3;
     const thumbnailCount = Math.min(this.tabPreviewCount + extraThumbnails,
                                     this.tabCount);
 
     let urls = [];
     for (let i = 0; i < thumbnailCount; i++)
       urls.push(this.tabList[i].linkedBrowser.currentURI.spec);
 
     aCallback(urls);
   },
 
-  _initRecentlyUsedTabs: function () {
+  _initRecentlyUsedTabs: function() {
     this._recentlyUsedTabs =
       Array.filter(gBrowser.tabs, tab => !tab.closing)
            .sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
   },
 
   _init: function ctrlTab__init(enable) {
     var toggleEventListener = enable ? "addEventListener" : "removeEventListener";
 
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -34,21 +34,21 @@ var gDataNotificationInfoBar = {
       }
     }, false);
 
     for (let o of this._OBSERVERS) {
       Services.obs.addObserver(this, o, true);
     }
   },
 
-  _getDataReportingNotification: function (name=this._DATA_REPORTING_NOTIFICATION) {
+  _getDataReportingNotification: function(name = this._DATA_REPORTING_NOTIFICATION) {
     return this._notificationBox.getNotificationWithValue(name);
   },
 
-  _displayDataPolicyInfoBar: function (request) {
+  _displayDataPolicyInfoBar: function(request) {
     if (this._getDataReportingNotification()) {
       return;
     }
 
     let brandBundle = document.getElementById("bundle_brand");
     let appName = brandBundle.getString("brandShortName");
     let vendorName = brandBundle.getString("vendorShortName");
 
@@ -83,17 +83,17 @@ var gDataNotificationInfoBar = {
     );
     // It is important to defer calling onUserNotifyComplete() until we're
     // actually sure the notification was displayed. If we ever called
     // onUserNotifyComplete() without showing anything to the user, that
     // would be very good for user choice. It may also have legal impact.
     request.onUserNotifyComplete();
   },
 
-  _clearPolicyNotification: function () {
+  _clearPolicyNotification: function() {
     let notification = this._getDataReportingNotification();
     if (notification) {
       this._log.debug("Closing notification.");
       notification.close();
     }
   },
 
   observe: function(subject, topic, data) {
--- a/browser/base/content/browser-devedition.js
+++ b/browser/base/content/browser-devedition.js
@@ -16,17 +16,17 @@ var DevEdition = {
     return this.styleSheet && !this.styleSheet.sheet.disabled;
   },
 
   get isThemeCurrentlyApplied() {
     let theme = LightweightThemeManager.currentTheme;
     return theme && theme.id == "firefox-devedition@mozilla.org";
   },
 
-  init: function () {
+  init: function() {
     this.initialized = true;
     Services.prefs.addObserver(this._devtoolsThemePrefName, this, false);
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.addObserver(this, "lightweight-theme-window-updated", false);
     this._updateDevtoolsThemeAttribute();
 
     if (this.isThemeCurrentlyApplied) {
       this._toggleStyleSheet(true);
@@ -37,17 +37,17 @@ var DevEdition = {
     let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`;
     this.styleSheet = document.createProcessingInstruction(
       "xml-stylesheet", styleSheetAttr);
     this.styleSheet.addEventListener("load", this);
     document.insertBefore(this.styleSheet, document.documentElement);
     this.styleSheet.sheet.disabled = true;
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     if (topic == "lightweight-theme-styling-update") {
       let newTheme = JSON.parse(data);
       if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") {
         this._toggleStyleSheet(true);
       } else {
         this._toggleStyleSheet(false);
       }
     } else if (topic == "lightweight-theme-window-updated" && subject == window) {
@@ -117,17 +117,17 @@ var DevEdition = {
       this.styleSheet.sheet.disabled = false;
       this.refreshBrowserDisplay();
     } else if (!deveditionThemeEnabled && wasEnabled) {
       this.styleSheet.sheet.disabled = true;
       this.refreshBrowserDisplay();
     }
   },
 
-  uninit: function () {
+  uninit: function() {
     Services.prefs.removeObserver(this._devtoolsThemePrefName, this);
     Services.obs.removeObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.removeObserver(this, "lightweight-theme-window-updated", false);
     if (this.styleSheet) {
       this.styleSheet.removeEventListener("load", this);
     }
     this.styleSheet = null;
   }
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
@@ -272,17 +272,17 @@ var FullScreen = {
 
   uninit: function() {
     for (let type of this._MESSAGES) {
       window.messageManager.removeMessageListener(type, this);
     }
     this.cleanup();
   },
 
-  toggle: function () {
+  toggle: function() {
     var enterFS = window.fullScreen;
 
     // Toggle the View:FullScreen command, which controls elements like the
     // fullscreen menuitem, and menubars.
     let fullscreenCommand = document.getElementById("View:FullScreen");
     if (enterFS) {
       fullscreenCommand.setAttribute("checked", enterFS);
     } else {
@@ -341,17 +341,17 @@ var FullScreen = {
                         .add(1);
     }
   },
 
   exitDomFullScreen : function() {
     document.exitFullscreen();
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "fullscreen":
         this.toggle();
         break;
       case "MozDOMFullscreen:Entered": {
         // The event target is the element which requested the DOM
         // fullscreen. If we were entering DOM fullscreen for a remote
         // browser, the target would be `gBrowser` and the original
@@ -451,39 +451,39 @@ var FullScreen = {
     gBrowser.tabContainer.addEventListener("TabSelect", this.exitDomFullScreen);
 
     // Add listener to detect when the fullscreen window is re-focused.
     // If a fullscreen window loses focus, we show a warning when the
     // fullscreen window is refocused.
     window.addEventListener("activate", this);
   },
 
-  cleanup: function () {
+  cleanup: function() {
     if (!window.fullScreen) {
       MousePosTracker.removeListener(this);
       document.removeEventListener("keypress", this._keyToggleCallback, false);
       document.removeEventListener("popupshown", this._setPopupOpen, false);
       document.removeEventListener("popuphidden", this._setPopupOpen, false);
     }
   },
 
-  cleanupDomFullscreen: function () {
+  cleanupDomFullscreen: function() {
     window.messageManager
           .broadcastAsyncMessage("DOMFullscreen:CleanUp");
 
     PointerlockFsWarning.close();
     gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
     gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
     gBrowser.tabContainer.removeEventListener("TabSelect", this.exitDomFullScreen);
     window.removeEventListener("activate", this);
 
     document.documentElement.removeAttribute("inDOMFullscreen");
   },
 
-  _isRemoteBrowser: function (aBrowser) {
+  _isRemoteBrowser: function(aBrowser) {
     return gMultiProcessBrowser && aBrowser.getAttribute("remote") == "true";
   },
 
   get _windowUtils() {
     return window.QueryInterface(Ci.nsIInterfaceRequestor)
                  .getInterface(Ci.nsIDOMWindowUtils);
   },
 
@@ -511,17 +511,17 @@ var FullScreen = {
     // F6 is another shortcut to the address bar, but its not covered in OpenLocation()
     else if (aEvent.keyCode == aEvent.DOM_VK_F6)
       FullScreen.showNavToolbox();
   },
 
   // Checks whether we are allowed to collapse the chrome
   _isPopupOpen: false,
   _isChromeCollapsed: false,
-  _safeToCollapse: function () {
+  _safeToCollapse: function() {
     if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
       return false;
 
     // a popup menu is open in chrome: don't collapse chrome
     if (this._isPopupOpen)
       return false;
 
     // On OS X Lion we don't want to hide toolbars.
@@ -586,17 +586,17 @@ var FullScreen = {
         right: rect.right
       };
       MousePosTracker.addListener(this);
     }
 
     this._isChromeCollapsed = false;
   },
 
-  hideNavToolbox: function (aAnimate = false) {
+  hideNavToolbox: function(aAnimate = false) {
     if (this._isChromeCollapsed || !this._safeToCollapse())
       return;
 
     this._fullScrToggler.hidden = false;
 
     if (aAnimate && gPrefService.getBoolPref("browser.fullscreen.animate")) {
       gNavToolbox.setAttribute("fullscreenShouldAnimate", true);
       // Hide the fullscreen toggler until the transition ends.
@@ -610,17 +610,17 @@ var FullScreen = {
     }
 
     gNavToolbox.style.marginTop =
       -gNavToolbox.getBoundingClientRect().height + "px";
     this._isChromeCollapsed = true;
     MousePosTracker.removeListener(this);
   },
 
-  _updateToolbars: function (aEnterFS) {
+  _updateToolbars: function(aEnterFS) {
     for (let el of document.querySelectorAll("toolbar[fullscreentoolbar=true]")) {
       if (aEnterFS) {
         // Give the main nav bar and the tab bar the fullscreen context menu,
         // otherwise remove context menu to prevent breakage
         el.setAttribute("saved-context", el.getAttribute("context"));
         if (el.id == "nav-bar" || el.id == "TabsToolbar")
           el.setAttribute("context", "autohide-context");
         else
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -84,17 +84,17 @@ var FullZoom = {
         this._ignorePendingZoomAccesses(browser);
         this._applyZoomToPref(browser);
         break;
     }
   },
 
   // nsIObserver
 
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
         switch (aData) {
           case "browser.zoom.siteSpecific":
             this._siteSpecificPref =
               gPrefService.getBoolPref("browser.zoom.siteSpecific");
             break;
           case "browser.zoom.updateBackgroundTabs":
@@ -149,18 +149,18 @@ var FullZoom = {
                           this._ensureValid(aValue);
 
     // If the current page doesn't have a site-specific preference, then its
     // zoom should be set to the new global preference now that the global
     // preference has changed.
     let hasPref = false;
     let token = this._getBrowserToken(browser);
     this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
-      handleResult: function () { hasPref = true; },
-      handleCompletion: function () {
+      handleResult: function() { hasPref = true; },
+      handleCompletion: function() {
         if (!hasPref && token.isCurrent)
           this._applyPrefToZoom(undefined, browser);
       }.bind(this)
     });
   },
 
   // location change observer
 
@@ -218,18 +218,18 @@ var FullZoom = {
                             this._notifyOnLocationChange.bind(this, browser));
       return;
     }
 
     // It's not cached, so we have to asynchronously fetch it.
     let value = undefined;
     let token = this._getBrowserToken(browser);
     this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
-      handleResult: function (resultPref) { value = resultPref.value; },
-      handleCompletion: function () {
+      handleResult: function(resultPref) { value = resultPref.value; },
+      handleCompletion: function() {
         if (!token.isCurrent) {
           this._notifyOnLocationChange(browser);
           return;
         }
         this._applyPrefToZoom(value, browser,
                               this._notifyOnLocationChange.bind(this, browser));
       }.bind(this)
     });
@@ -264,17 +264,17 @@ var FullZoom = {
     this._ignorePendingZoomAccesses(browser);
     this._applyZoomToPref(browser);
   },
 
   /**
    * Sets the zoom level for the given browser to the given floating
    * point value, where 1 is the default zoom level.
    */
-  setZoom: function (value, browser = gBrowser.selectedBrowser) {
+  setZoom: function(value, browser = gBrowser.selectedBrowser) {
     ZoomManager.setZoomForBrowser(browser, value);
     this._ignorePendingZoomAccesses(browser);
     this._applyZoomToPref(browser);
   },
 
   /**
    * Sets the zoom level of the page in the given browser to the global zoom
    * level.
@@ -359,34 +359,34 @@ var FullZoom = {
     if (!this.siteSpecific ||
         gInPrintPreviewMode ||
         browser.isSyntheticDocument)
       return;
 
     this._cps2.set(browser.currentURI.spec, this.name,
                    ZoomManager.getZoomForBrowser(browser),
                    this._loadContextFromBrowser(browser), {
-      handleCompletion: function () {
+      handleCompletion: function() {
         this._isNextContentPrefChangeInternal = true;
       }.bind(this),
     });
   },
 
   /**
    * Removes from the content prefs store the zoom level of the given browser.
    *
    * @param browser  The zoom of this browser will be removed.  Required.
    */
   _removePref: function FullZoom__removePref(browser) {
     Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
     if (browser.isSyntheticDocument)
       return;
     let ctxt = this._loadContextFromBrowser(browser);
     this._cps2.removeByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
-      handleCompletion: function () {
+      handleCompletion: function() {
         this._isNextContentPrefChangeInternal = true;
       }.bind(this),
     });
   },
 
   // Utilities
 
   /**
@@ -482,17 +482,17 @@ var FullZoom = {
     // * Otherwise, this._globalValue is a number, the global value.
     return new Promise(resolve => {
       if ("_globalValue" in this) {
         resolve(this._globalValue);
         return;
       }
       let value = undefined;
       this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
-        handleResult: function (pref) { value = pref.value; },
+        handleResult: function(pref) { value = pref.value; },
         handleCompletion: (reason) => {
           this._globalValue = this._ensureValid(value);
           resolve(this._globalValue);
         }
       });
     });
   },
 
@@ -508,17 +508,17 @@ var FullZoom = {
 
   /**
    * Asynchronously broadcasts "browser-fullZoom:location-change" so that
    * listeners can be notified when the zoom levels on those pages change.
    * The notification is always asynchronous so that observers are guaranteed a
    * consistent behavior.
    */
   _notifyOnLocationChange: function FullZoom__notifyOnLocationChange(browser) {
-    this._executeSoon(function () {
+    this._executeSoon(function() {
       Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
     });
   },
 
   _executeSoon: function FullZoom__executeSoon(callback) {
     if (!callback)
       return;
     Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -82,17 +82,17 @@ var gFxAccounts = {
     return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled");
   },
 
   get remoteClients() {
     return Weave.Service.clientsEngine.remoteClients
            .sort((a, b) => a.name.localeCompare(b.name));
   },
 
-  init: function () {
+  init: function() {
     // Bail out if we're already initialized and for pop-up windows.
     if (this._initialized || !window.toolbar.visible) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.addObserver(this, topic, false);
     }
@@ -101,43 +101,43 @@ var gFxAccounts = {
     gNavToolbox.addEventListener("customizationending", this);
 
     EnsureFxAccountsWebChannel();
     this._initialized = true;
 
     this.updateUI();
   },
 
-  uninit: function () {
+  uninit: function() {
     if (!this._initialized) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.removeObserver(this, topic);
     }
 
     this._initialized = false;
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     switch (topic) {
       case "fxa-migration:state-changed":
         this.onMigrationStateChanged(data, subject);
         break;
       case this.FxAccountsCommon.ONPROFILE_IMAGE_CHANGE_NOTIFICATION:
         this.updateUI();
         break;
       default:
         this.updateUI();
         break;
     }
   },
 
-  onMigrationStateChanged: function () {
+  onMigrationStateChanged: function() {
     // Since we nuked most of the migration code, this notification will fire
     // once after legacy Sync has been disconnected (and should never fire
     // again)
     let nb = window.document.getElementById("global-notificationbox");
 
     let msg = this.strings.GetStringFromName("autoDisconnectDescription")
     let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label");
     let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey");
@@ -169,36 +169,36 @@ var gFxAccounts = {
                           undefined,
                           nb.PRIORITY_WARNING_LOW,
                           buttons);
 
     // ensure the hamburger menu reflects the newly disconnected state.
     this.updateAppMenuItem();
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     this._inCustomizationMode = event.type == "customizationstarting";
     this.updateAppMenuItem();
   },
 
-  updateUI: function () {
+  updateUI: function() {
     // It's possible someone signed in to FxA after seeing our notification
     // about "Legacy Sync migration" (which now is actually "Legacy Sync
     // auto-disconnect") so kill that notification if it still exists.
     let nb = window.document.getElementById("global-notificationbox");
     let n = nb.getNotificationWithValue(this.SYNC_MIGRATION_NOTIFICATION_TITLE);
     if (n) {
       nb.removeNotification(n, true);
     }
 
     this.updateAppMenuItem();
   },
 
   // Note that updateAppMenuItem() returns a Promise that's only used by tests.
-  updateAppMenuItem: function () {
+  updateAppMenuItem: function() {
     let profileInfoEnabled = false;
     try {
       profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
     } catch (e) { }
 
     // Bail out if FxA is disabled.
     if (!this.weave.fxAccountsEnabled) {
       return Promise.resolve();
@@ -314,17 +314,17 @@ var gFxAccounts = {
       // The most likely scenario is a user logged out, so reflect that.
       // Bug 995134 calls for better errors so we could retry if we were
       // sure this was the failure reason.
       this.FxAccountsCommon.log.error("Error updating FxA account info", error);
       updateWithUserData(null);
     });
   },
 
-  onMenuPanelCommand: function () {
+  onMenuPanelCommand: function() {
 
     switch (this.panelUIFooter.getAttribute("fxastatus")) {
     case "signedin":
       this.openPreferences();
       break;
     case "error":
       if (this.panelUIFooter.getAttribute("unverified")) {
         this.openPreferences();
@@ -335,57 +335,56 @@ var gFxAccounts = {
     default:
       this.openPreferences();
       break;
     }
 
     PanelUI.hide();
   },
 
-  openPreferences: function () {
+  openPreferences: function() {
     openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } });
   },
 
-  openAccountsPage: function (action, urlParams={}) {
+  openAccountsPage: function(action, urlParams = {}) {
     let params = new URLSearchParams();
     if (action) {
       params.set("action", action);
     }
     for (let name in urlParams) {
       if (urlParams[name] !== undefined) {
         params.set(name, urlParams[name]);
       }
     }
     let url = "about:accounts?" + params;
     switchToTabHavingURI(url, true, {
       replaceQueryString: true
     });
   },
 
-  openSignInAgainPage: function (entryPoint) {
+  openSignInAgainPage: function(entryPoint) {
     this.openAccountsPage("reauth", { entrypoint: entryPoint });
   },
 
-  sendTabToDevice: function (url, clientId, title) {
+  sendTabToDevice: function(url, clientId, title) {
     Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
   },
 
-  populateSendTabToDevicesMenu: function (devicesPopup, url, title) {
+  populateSendTabToDevicesMenu: function(devicesPopup, url, title) {
     // remove existing menu items
     while (devicesPopup.hasChildNodes()) {
       devicesPopup.removeChild(devicesPopup.firstChild);
     }
 
     const fragment = document.createDocumentFragment();
 
     const onTargetDeviceCommand = (event) => {
-      const clientId = event.target.getAttribute("clientId");
-      const clients = clientId
-                      ? [clientId]
-                      : this.remoteClients.map(client => client.id);
+      let clients = event.target.getAttribute("clientId") ?
+        [event.target.getAttribute("clientId")] :
+        this.remoteClients.map(client => client.id);
 
       clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
     }
 
     function addTargetDevice(clientId, name) {
       const targetDevice = document.createElement("menuitem");
       targetDevice.addEventListener("command", onTargetDeviceCommand, true);
       targetDevice.setAttribute("class", "sendtab-target");
@@ -405,27 +404,27 @@ var gFxAccounts = {
       fragment.appendChild(separator);
       const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem");
       addTargetDevice("", allDevicesLabel);
     }
 
     devicesPopup.appendChild(fragment);
   },
 
-  updateTabContextMenu: function (aPopupMenu) {
+  updateTabContextMenu: function(aPopupMenu) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
     const remoteClientPresent = this.remoteClients.length > 0;
     ["context_sendTabToDevice", "context_sendTabToDevice_separator"]
     .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
   },
 
-  initPageContextMenu: function (contextMenu) {
+  initPageContextMenu: function(contextMenu) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
     const remoteClientPresent = this.remoteClients.length > 0;
     // showSendLink and showSendPage are mutually exclusive
     const showSendLink = remoteClientPresent
                          && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
@@ -437,17 +436,17 @@ var gFxAccounts = {
 
     ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
     .forEach(id => contextMenu.showItem(id, showSendPage));
     ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
     .forEach(id => contextMenu.showItem(id, showSendLink));
   }
 };
 
-XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
+XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function() {
   return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator",
   "resource://services-sync/FxaMigrator.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EnsureFxAccountsWebChannel",
   "resource://gre/modules/FxAccountsWebChannel.jsm");
--- a/browser/base/content/browser-gestureSupport.js
+++ b/browser/base/content/browser-gestureSupport.js
@@ -129,28 +129,28 @@ var gGestureSupport = {
       aPref[pref] = this._getPref(aGesture + "." + pref, def);
 
     // Keep track of the total deltas and latching behavior
     let offset = 0;
     let latchDir = aEvent.delta > 0 ? 1 : -1;
     let isLatched = false;
 
     // Create the update function here to capture closure state
-    this._doUpdate = function GS__doUpdate(aEvent) {
+    this._doUpdate = function GS__doUpdate(updateEvent) {
       // Update the offset with new event data
-      offset += aEvent.delta;
+      offset += updateEvent.delta;
 
       // Check if the cumulative deltas exceed the threshold
       if (Math.abs(offset) > aPref["threshold"]) {
         // Trigger the action if we don't care about latching; otherwise, make
         // sure either we're not latched and going the same direction of the
         // initial motion; or we're latched and going the opposite way
         let sameDir = (latchDir ^ offset) >= 0;
         if (!aPref["latched"] || (isLatched ^ sameDir)) {
-          this._doAction(aEvent, [aGesture, offset > 0 ? aInc : aDec]);
+          this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
 
           // We must be getting latched or leaving it, so just toggle
           isLatched = !isLatched;
         }
 
         // Reset motion counter to prepare for more of the same gesture
         offset = 0;
       }
@@ -237,35 +237,35 @@ var gGestureSupport = {
 
     this._doUpdate = function GS__doUpdate(aEvent) {
       gHistorySwipeAnimation.updateAnimation(aEvent.delta);
     };
 
     this._doEnd = function GS__doEnd(aEvent) {
       gHistorySwipeAnimation.swipeEndEventReceived();
 
-      this._doUpdate = function (aEvent) {};
-      this._doEnd = function (aEvent) {};
+      this._doUpdate = function() {};
+      this._doEnd = function() {};
     }
   },
 
   /**
    * Generator producing the powerset of the input array where the first result
    * is the complete set and the last result (before StopIteration) is empty.
    *
    * @param aArray
    *        Source array containing any number of elements
    * @yield Array that is a subset of the input array from full set to empty
    */
   _power: function* GS__power(aArray) {
     // Create a bitmask based on the length of the array
     let num = 1 << aArray.length;
     while (--num >= 0) {
       // Only select array elements where the current bit is set
-      yield aArray.reduce(function (aPrev, aCurr, aIndex) {
+      yield aArray.reduce(function(aPrev, aCurr, aIndex) {
         if (num & 1 << aIndex)
           aPrev.push(aCurr);
         return aPrev;
       }, []);
     }
   },
 
   /**
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -139,17 +139,17 @@ var gEMEHandler = {
     box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
                            buttons);
   },
   showPopupNotificationForSuccess: function(browser, keySystem) {
     // We're playing EME content! Remove any "we can't play because..." messages.
     var box = gBrowser.getNotificationBox(browser);
     ["drmContentDisabled",
      "drmContentCDMInstalling"
-     ].forEach(function (value) {
+     ].forEach(function(value) {
         var notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
 
     // Don't bother creating it if it's already there:
     if (PopupNotifications.getNotification("drmContentPlaying", browser)) {
       return;
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -31,31 +31,31 @@ var StarUI = {
   // Array of command elements to disable when the panel is opened.
   get _blockedCommands() {
     delete this._blockedCommands;
     return this._blockedCommands =
       ["cmd_close", "cmd_closeWindow"].map(id => this._element(id));
   },
 
   _blockCommands: function SU__blockCommands() {
-    this._blockedCommands.forEach(function (elt) {
+    this._blockedCommands.forEach(function(elt) {
       // make sure not to permanently disable this item (see bug 409155)
       if (elt.hasAttribute("wasDisabled"))
         return;
       if (elt.getAttribute("disabled") == "true") {
         elt.setAttribute("wasDisabled", "true");
       } else {
         elt.setAttribute("wasDisabled", "false");
         elt.setAttribute("disabled", "true");
       }
     });
   },
 
   _restoreCommandsState: function SU__restoreCommandsState() {
-    this._blockedCommands.forEach(function (elt) {
+    this._blockedCommands.forEach(function(elt) {
       if (elt.getAttribute("wasDisabled") != "true")
         elt.removeAttribute("disabled");
       elt.removeAttribute("wasDisabled");
     });
   },
 
   // nsIDOMEventListener
   handleEvent(aEvent) {
@@ -193,17 +193,17 @@ var StarUI = {
     if (this._overlayLoaded) {
       this._doShowEditBookmarkPanel(aNode, aAnchorElement, aPosition);
       return;
     }
 
     this._overlayLoading = true;
     document.loadOverlay(
       "chrome://browser/content/places/editBookmarkOverlay.xul",
-      (function (aSubject, aTopic, aData) {
+      (function(aSubject, aTopic, aData) {
         // Move the header (star, title, button) into the grid,
         // so that it aligns nicely with the other items (bug 484022).
         let header = this._element("editBookmarkPanelHeader");
         let rows = this._element("editBookmarkPanelGrid").lastChild;
         rows.insertBefore(header, rows.firstChild);
         header.hidden = false;
 
         this._overlayLoading = false;
@@ -528,17 +528,17 @@ var PlacesCommandHook = {
    *        bookmarked.
    * @param aURL (string)
    *        the address of the link target
    * @param aTitle
    *        The link text
    * @param [optional] aDescription
    *        The linked page description, if available
    */
-  bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription="") {
+  bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription = "") {
     let node = yield PlacesUIUtils.fetchNodeLike({ url: aURL });
     if (node) {
       PlacesUIUtils.showBookmarkDialog({ action: "edit"
                                        , node
                                        }, window.top);
       return;
     }
 
@@ -1139,17 +1139,17 @@ var PlacesToolbarHelper = {
 
   _getShouldWrap: function PTH_getShouldWrap() {
     let placement = CustomizableUI.getPlacementOfWidget("personal-bookmarks");
     let area = placement && placement.area;
     let areaType = area && CustomizableUI.getAreaType(area);
     return !area || CustomizableUI.TYPE_MENU_PANEL == areaType;
   },
 
-  onPlaceholderCommand: function () {
+  onPlaceholderCommand: function() {
     let widgetGroup = CustomizableUI.getWidget("personal-bookmarks");
     let widget = widgetGroup.forWindow(window);
     if (widget.overflowed ||
         widgetGroup.areaType == CustomizableUI.TYPE_MENU_PANEL) {
       PlacesCommandHook.showPlacesOrganizer("BookmarksToolbar");
     }
   },
 
@@ -1898,21 +1898,21 @@ var BookmarkingUI = {
         // Only need to update the UI if it wasn't marked as starred before:
         if (this._itemIds.length == 1) {
           this._updateStar();
         }
       }
     }
   },
 
-  onBeginUpdateBatch: function () {},
-  onEndUpdateBatch: function () {},
-  onBeforeItemRemoved: function () {},
-  onItemVisited: function () {},
-  onItemMoved: function () {},
+  onBeginUpdateBatch: function() {},
+  onEndUpdateBatch: function() {},
+  onBeforeItemRemoved: function() {},
+  onItemVisited: function() {},
+  onItemMoved: function() {},
 
   // CustomizableUI events:
   _starButtonLabel: null,
   get _starButtonOverflowedLabel() {
     delete this._starButtonOverflowedLabel;
     return this._starButtonOverflowedLabel =
       gNavigatorBundle.getString("starButtonOverflowed.label");
   },
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -12,39 +12,39 @@ var gPluginHandler = {
     "PluginContent:UpdateHiddenPluginUI",
     "PluginContent:HideNotificationBar",
     "PluginContent:InstallSinglePlugin",
     "PluginContent:ShowPluginCrashedNotification",
     "PluginContent:SubmitReport",
     "PluginContent:LinkClickCallback",
   ],
 
-  init: function () {
+  init: function() {
     const mm = window.messageManager;
     for (let msg of this.MESSAGES) {
       mm.addMessageListener(msg, this);
     }
     window.addEventListener("unload", this);
   },
 
-  uninit: function () {
+  uninit: function() {
     const mm = window.messageManager;
     for (let msg of this.MESSAGES) {
       mm.removeMessageListener(msg, this);
     }
     window.removeEventListener("unload", this);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     if (event.type == "unload") {
       this.uninit();
     }
   },
 
-  receiveMessage: function (msg) {
+  receiveMessage: function(msg) {
     switch (msg.name) {
       case "PluginContent:ShowClickToPlayNotification":
         this.showClickToPlayNotification(msg.target, msg.data.plugins, msg.data.showNow,
                                          msg.principal, msg.data.location);
         break;
       case "PluginContent:RemoveNotification":
         this.removeNotification(msg.target, msg.data.name);
         break;
@@ -78,17 +78,17 @@ var gPluginHandler = {
         break;
       default:
         Cu.reportError("gPluginHandler did not expect to handle message " + msg.name);
         break;
     }
   },
 
   // Callback for user clicking on a disabled plugin
-  managePlugins: function () {
+  managePlugins: function() {
     BrowserOpenAddonsMgr("addons://list/plugin");
   },
 
   // Callback for user clicking on the link in a click-to-play plugin
   // (where the plugin has an update)
   openPluginUpdatePage: function(pluginTag) {
     let url = Services.blocklist.getPluginInfoURL(pluginTag);
     if (!url) {
@@ -101,22 +101,22 @@ var gPluginHandler = {
     if (!AppConstants.MOZ_CRASHREPORTER) {
       return;
     }
     Services.prefs.setBoolPref("dom.ipc.plugins.reportCrashURL", submitURLOptIn);
     PluginCrashReporter.submitCrashReport(runID, keyVals);
   },
 
   // Callback for user clicking a "reload page" link
-  reloadPage: function (browser) {
+  reloadPage: function(browser) {
     browser.reload();
   },
 
   // Callback for user clicking the help icon
-  openHelpPage: function () {
+  openHelpPage: function() {
     openHelpLink("plugin-crashed", false);
   },
 
   _clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
     if (event == "showing") {
       Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")
         .add(!this.options.primaryPlugin);
       // Histograms always start at 0, even though our data starts at 1
@@ -134,17 +134,17 @@ var gPluginHandler = {
     }
   },
 
   /**
    * Called from the plugin doorhanger to set the new permissions for a plugin
    * and activate plugins if necessary.
    * aNewState should be either "allownow" "allowalways" or "block"
    */
-  _updatePluginPermission: function (aNotification, aPluginInfo, aNewState) {
+  _updatePluginPermission: function(aNotification, aPluginInfo, aNewState) {
     let permission;
     let expireType;
     let expireTime;
     let histogram =
       Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION");
 
     // Update the permission manager.
     // Also update the current state of pluginInfo.fallbackType so that
@@ -203,18 +203,18 @@ var gPluginHandler = {
     }
 
     browser.messageManager.sendAsyncMessage("BrowserPlugins:ActivatePlugins", {
       pluginInfo: aPluginInfo,
       newState: aNewState,
     });
   },
 
-  showClickToPlayNotification: function (browser, plugins, showNow,
-                                         principal, location) {
+  showClickToPlayNotification: function(browser, plugins, showNow,
+                                        principal, location) {
     // It is possible that we've received a message from the frame script to show
     // a click to play notification for a principal that no longer matches the one
     // that the browser's content now has assigned (ie, the browser has browsed away
     // after the message was sent, but before the message was received). In that case,
     // we should just ignore the message.
     if (!principal.equals(browser.contentPrincipal)) {
       return;
     }
@@ -284,31 +284,31 @@ var gPluginHandler = {
       principal: principal,
     };
     PopupNotifications.show(browser, "click-to-play-plugins",
                             "", "plugins-notification-icon",
                             null, null, options);
     browser.messageManager.sendAsyncMessage("BrowserPlugins:NotificationShown");
   },
 
-  removeNotification: function (browser, name) {
+  removeNotification: function(browser, name) {
     let notification = PopupNotifications.getNotification(name, browser);
     if (notification)
       PopupNotifications.remove(notification);
   },
 
-  hideNotificationBar: function (browser, name) {
+  hideNotificationBar: function(browser, name) {
     let notificationBox = gBrowser.getNotificationBox(browser);
     let notification = notificationBox.getNotificationWithValue(name);
     if (notification)
       notificationBox.removeNotification(notification, true);
   },
 
-  updateHiddenPluginUI: function (browser, haveInsecure, actions,
-                                  principal, location) {
+  updateHiddenPluginUI: function(browser, haveInsecure, actions,
+                                 principal, location) {
     let origin = principal.originNoSuffix;
 
     // It is possible that we've received a message from the frame script to show
     // the hidden plugin notification for a principal that no longer matches the one
     // that the browser's content now has assigned (ie, the browser has browsed away
     // after the message was sent, but before the message was received). In that case,
     // we should just ignore the message.
     if (!principal.equals(browser.contentPrincipal)) {
@@ -431,17 +431,17 @@ var gPluginHandler = {
       if (notificationPermission == Ci.nsIPermissionManager.DENY_ACTION) {
         hideNotification();
       } else {
         showNotification();
       }
     }
   },
 
-  contextMenuCommand: function (browser, plugin, command) {
+  contextMenuCommand: function(browser, plugin, command) {
     browser.messageManager.sendAsyncMessage("BrowserPlugins:ContextMenuCommand",
       { command: command }, { plugin: plugin });
   },
 
   // Crashed-plugin observer. Notified once per plugin crash, before events
   // are dispatched to individual plugin instances.
   NPAPIPluginCrashed : function(subject, topic, data) {
     let propertyBag = subject;
@@ -487,17 +487,17 @@ var gPluginHandler = {
    *        The browser to show the notification for.
    * @param messageString
    *        The string to put in the notification bar
    * @param pluginID
    *        The unique-per-process identifier for the NPAPI plugin or GMP.
    *        For a GMP, this is the pluginID. For NPAPI plugins (where "pluginID"
    *        means something different), this is the runID.
    */
-  showPluginCrashedNotification: function (browser, messageString, pluginID) {
+  showPluginCrashedNotification: function(browser, messageString, pluginID) {
     // If there's already an existing notification bar, don't do anything.
     let notificationBox = gBrowser.getNotificationBox(browser);
     let notification = notificationBox.getNotificationWithValue("plugin-crashed");
     if (notification) {
       return;
     }
 
     // Configure the notification bar
--- a/browser/base/content/browser-refreshblocker.js
+++ b/browser/base/content/browser-refreshblocker.js
@@ -63,17 +63,17 @@ var RefreshBlocker = {
       let refreshButtonText =
         gNavigatorBundle.getString("refreshBlocked.goButton");
       let refreshButtonAccesskey =
         gNavigatorBundle.getString("refreshBlocked.goButton.accesskey");
 
       let buttons = [{
         label: refreshButtonText,
         accessKey: refreshButtonAccesskey,
-        callback: function (notification, button) {
+        callback: function() {
           if (browser.messageManager) {
             browser.messageManager.sendAsyncMessage("RefreshBlocker:Refresh", data);
           }
         }
       }];
 
       notificationBox.appendNotification(message, "refresh-blocked",
                                          "chrome://browser/skin/Info.png",
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -34,17 +34,17 @@ var gSyncUI = {
   ],
 
   _unloaded: false,
   // The last sync start time. Used to calculate the leftover animation time
   // once syncing completes (bug 1239042).
   _syncStartTime: 0,
   _syncAnimationTimer: 0,
 
-  init: function () {
+  init: function() {
     Cu.import("resource://services-common/stringbundle.js");
 
     // Proceed to set up the UI if Sync has already started up.
     // Otherwise we'll do it when Sync is firing up.
     if (this.weaveService.ready) {
       this.initUI();
       return;
     }
@@ -132,17 +132,17 @@ var gSyncUI = {
     // Otherwise we are configured for legacy Sync, which has no verification
     // concept.
     return Promise.resolve(false);
   },
 
   // Note that we don't show login errors in a notification bar here, but do
   // still need to track a login-failed state so the "Tools" menu updates
   // with the correct state.
-  _loginFailed: function () {
+  _loginFailed: function() {
     // If Sync isn't already ready, we don't want to force it to initialize
     // by referencing Weave.Status - and it isn't going to be accurate before
     // Sync is ready anyway.
     if (!this.weaveService.ready) {
       this.log.debug("_loginFailed has sync not ready, so returning false");
       return false;
     }
     this.log.debug("_loginFailed has sync state=${sync}",
@@ -237,17 +237,17 @@ var gSyncUI = {
     // the hamburger menu.
     this.updateUI();
   },
 
   onLogout: function SUI_onLogout() {
     this.updateUI();
   },
 
-  _getAppName: function () {
+  _getAppName: function() {
     let brand = new StringBundle("chrome://branding/locale/brand.properties");
     return brand.get("brandShortName");
   },
 
   // Commands
   // doSync forces a sync - it *does not* return a promise as it is called
   // via the various UI components.
   doSync() {
@@ -299,33 +299,33 @@ var gSyncUI = {
         window.openDialog("chrome://browser/content/sync/setup.xul",
                           "weaveSetup", "centerscreen,chrome,resizable=no",
                           wizardType);
       }
     }
   },
 
   // Open the legacy-sync device pairing UI. Note used for FxA Sync.
-  openAddDevice: function () {
+  openAddDevice: function() {
     if (!Weave.Utils.ensureMPUnlocked())
       return;
 
     let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
     if (win)
       win.focus();
     else
       window.openDialog("chrome://browser/content/sync/addDevice.xul",
                         "syncAddDevice", "centerscreen,chrome,resizable=no");
   },
 
-  openPrefs: function (entryPoint) {
+  openPrefs: function(entryPoint) {
     openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
   },
 
-  openSignInAgainPage: function (entryPoint = "syncbutton") {
+  openSignInAgainPage: function(entryPoint = "syncbutton") {
     gFxAccounts.openSignInAgainPage(entryPoint);
   },
 
   openSyncedTabsPanel() {
     let placement = CustomizableUI.getPlacementOfWidget("sync-button");
     let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR;
     let anchor = document.getElementById("sync-button") ||
                  document.getElementById("PanelUI-menu-button");
@@ -421,20 +421,20 @@ var gSyncUI = {
         broadcaster.removeAttribute("tooltiptext");
       }
     }
   }),
 
   formatLastSyncDate: function(date) {
     let dateFormat;
     let sixDaysAgo = (() => {
-      let date = new Date();
-      date.setDate(date.getDate() - 6);
-      date.setHours(0, 0, 0, 0);
-      return date;
+      let tempDate = new Date();
+      tempDate.setDate(tempDate.getDate() - 6);
+      tempDate.setHours(0, 0, 0, 0);
+      return tempDate;
     })();
     // It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
     if (date < sixDaysAgo) {
       dateFormat = {month: 'long', day: 'numeric'};
     } else {
       dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'};
     }
     let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat);
--- a/browser/base/content/browser-tabsintitlebar-stub.js
+++ b/browser/base/content/browser-tabsintitlebar-stub.js
@@ -2,16 +2,16 @@
  * 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/. */
 
 // This file is used as a stub object for platforms which
 // don't have CAN_DRAW_IN_TITLEBAR defined.
 
 var TabsInTitlebar = {
-  init: function () {},
-  uninit: function () {},
-  allowedBy: function (condition, allow) {},
+  init: function() {},
+  uninit: function() {},
+  allowedBy: function(condition, allow) {},
   updateAppearance: function updateAppearance(aForce) {},
   get enabled() {
     return document.documentElement.getAttribute("tabsintitlebar") == "true";
   },
 };
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -2,17 +2,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/. */
 
 // Note: the file browser-tabsintitlebar-stub.js is used instead of
 // this one on platforms which don't have CAN_DRAW_IN_TITLEBAR defined.
 
 var TabsInTitlebar = {
-  init: function () {
+  init: function() {
     if (this._initialized) {
       return;
     }
     this._readPref();
     Services.prefs.addObserver(this._prefName, this, false);
 
     // We need to update the appearance of the titlebar when the menu changes
     // from the active to the inactive state. We can't, however, rely on
@@ -44,17 +44,17 @@ var TabsInTitlebar = {
     if (this._updateOnInit) {
       // We don't need to call this with 'true', even if original calls
       // (before init()) did, because this will be the first call and so
       // we will update anyway.
       this._update();
     }
   },
 
-  allowedBy: function (condition, allow) {
+  allowedBy: function(condition, allow) {
     if (allow) {
       if (condition in this._disallowed) {
         delete this._disallowed[condition];
         this._update(true);
       }
     } else if (!(condition in this._disallowed)) {
       this._disallowed[condition] = null;
       this._update(true);
@@ -64,49 +64,49 @@ var TabsInTitlebar = {
   updateAppearance: function updateAppearance(aForce) {
     this._update(aForce);
   },
 
   get enabled() {
     return document.documentElement.getAttribute("tabsintitlebar") == "true";
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     if (topic == "nsPref:changed")
       this._readPref();
   },
 
-  handleEvent: function (aEvent) {
+  handleEvent: function(aEvent) {
     if (aEvent.type == "resolutionchange" && aEvent.target == window) {
       this._update(true);
     }
   },
 
-  _onMenuMutate: function (aMutations) {
+  _onMenuMutate: function(aMutations) {
     for (let mutation of aMutations) {
       if (mutation.attributeName == "inactive" ||
           mutation.attributeName == "autohide") {
         TabsInTitlebar._update(true);
         return;
       }
     }
   },
 
   _initialized: false,
   _updateOnInit: false,
   _disallowed: {},
   _prefName: "browser.tabs.drawInTitlebar",
   _lastSizeMode: null,
 
-  _readPref: function () {
+  _readPref: function() {
     this.allowedBy("pref",
                    Services.prefs.getBoolPref(this._prefName));
   },
 
-  _update: function (aForce=false) {
+  _update: function(aForce = false) {
     let $ = id => document.getElementById(id);
     let rect = ele => ele.getBoundingClientRect();
     let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
 
     if (window.fullScreen)
       return;
 
     // In some edgecases it is possible for this to fire before we've initialized.
@@ -248,22 +248,22 @@ var TabsInTitlebar = {
     }
 
     ToolbarIconColor.inferFromText();
     if (CustomizationHandler.isCustomizing()) {
       gCustomizeMode.updateLWTStyling();
     }
   },
 
-  _sizePlaceholder: function (type, width) {
-    Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
-                  function (node) { node.width = width; });
+  _sizePlaceholder: function(type, width) {
+    Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
+                  function(node) { node.width = width; });
   },
 
-  uninit: function () {
+  uninit: function() {
     this._initialized = false;
     removeEventListener("resolutionchange", this);
     Services.prefs.removeObserver(this._prefName, this);
     this._menuObserver.disconnect();
     CustomizableUI.removeListener(this);
   }
 };
 
--- a/browser/base/content/browser-thumbnails.js
+++ b/browser/base/content/browser-thumbnails.js
@@ -31,29 +31,29 @@ var gBrowserThumbnails = {
   init: function Thumbnails_init() {
     PageThumbs.addExpirationFilter(this);
     gBrowser.addTabsProgressListener(this);
     Services.prefs.addObserver(this.PREF_DISK_CACHE_SSL, this, false);
 
     this._sslDiskCacheEnabled =
       Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL);
 
-    this._tabEvents.forEach(function (aEvent) {
+    this._tabEvents.forEach(function(aEvent) {
       gBrowser.tabContainer.addEventListener(aEvent, this, false);
     }, this);
 
     this._timeouts = new WeakMap();
   },
 
   uninit: function Thumbnails_uninit() {
     PageThumbs.removeExpirationFilter(this);
     gBrowser.removeTabsProgressListener(this);
     Services.prefs.removeObserver(this.PREF_DISK_CACHE_SSL, this);
 
-    this._tabEvents.forEach(function (aEvent) {
+    this._tabEvents.forEach(function(aEvent) {
       gBrowser.tabContainer.removeEventListener(aEvent, this, false);
     }, this);
   },
 
   handleEvent: function Thumbnails_handleEvent(aEvent) {
     switch (aEvent.type) {
       case "scroll":
         let browser = aEvent.currentTarget;
@@ -89,30 +89,30 @@ var gBrowserThumbnails = {
         aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK)
       this._delayedCapture(aBrowser);
   },
 
   _capture: function Thumbnails_capture(aBrowser) {
     // Only capture about:newtab top sites.
     if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) == -1)
       return;
-    this._shouldCapture(aBrowser, function (aResult) {
+    this._shouldCapture(aBrowser, function(aResult) {
       if (aResult) {
         PageThumbs.captureAndStoreIfStale(aBrowser);
       }
     });
   },
 
   _delayedCapture: function Thumbnails_delayedCapture(aBrowser) {
     if (this._timeouts.has(aBrowser))
       clearTimeout(this._timeouts.get(aBrowser));
     else
       aBrowser.addEventListener("scroll", this, true);
 
-    let timeout = setTimeout(function () {
+    let timeout = setTimeout(function() {
       this._clearTimeout(aBrowser);
       this._capture(aBrowser);
     }.bind(this), this._captureDelayMS);
 
     this._timeouts.set(aBrowser, timeout);
   },
 
   _shouldCapture: function Thumbnails_shouldCapture(aBrowser, aCallback) {
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -524,17 +524,18 @@ toolbar:not(#TabsToolbar) > #personal-bo
 }
 
 #PopupSearchAutoComplete {
   -moz-binding: url("chrome://browser/content/search/search.xml#browser-search-autocomplete-result-popup");
 }
 
 /* Overlay a badge on top of the icon of additional open search providers
    in the search panel. */
-.addengine-item > .button-box > .button-icon {
+.addengine-item > .button-box > .button-icon,
+.addengine-item[type="menu"] > .button-box > .box-inherit > .button-icon {
   -moz-binding: url("chrome://browser/content/search/search.xml#addengine-icon");
   display: -moz-stack;
 }
 
 #PopupAutoCompleteRichResult {
   -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
 }
 
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -92,17 +92,17 @@ XPCOMUtils.defineLazyGetter(this, "gBrow
 });
 
 XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() {
   let scope = {};
   Cu.import("resource:///modules/CustomizeMode.jsm", scope);
   return new scope.CustomizeMode(window);
 });
 
-XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
+XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function() {
   // Only show resizers on Windows 2000 and XP
   return AppConstants.isPlatformAndVersionAtMost("win", "5.9");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
   return Services.prefs;
 });
 
@@ -113,42 +113,42 @@ XPCOMUtils.defineLazyGetter(this, "Inlin
 });
 
 XPCOMUtils.defineLazyGetter(this, "PageMenuParent", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/PageMenu.jsm", tmp);
   return new tmp.PageMenuParent();
 });
 
-XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
+XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/PopupNotifications.jsm", tmp);
   try {
     return new tmp.PopupNotifications(gBrowser,
                                       document.getElementById("notification-popup"),
                                       document.getElementById("notification-popup-box"));
   } catch (ex) {
     Cu.reportError(ex);
     return null;
   }
 });
 
-XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
+XPCOMUtils.defineLazyGetter(this, "Win7Features", function() {
   if (AppConstants.platform != "win")
     return null;
 
   const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
   if (WINTASKBAR_CONTRACTID in Cc &&
       Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
     let AeroPeek = Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", {}).AeroPeek;
     return {
-      onOpenWindow: function () {
+      onOpenWindow: function() {
         AeroPeek.onOpenWindow(window);
       },
-      onCloseWindow: function () {
+      onCloseWindow: function() {
         AeroPeek.onCloseWindow(window);
       }
     };
   }
   return null;
 });
 
 
@@ -172,26 +172,26 @@ if (AppConstants.platform != "macosx") {
 }
 
 /* globals gBrowser, gNavToolbox, gURLBar, gNavigatorBundle*/
 [
   ["gBrowser",            "content"],
   ["gNavToolbox",         "navigator-toolbox"],
   ["gURLBar",             "urlbar"],
   ["gNavigatorBundle",    "bundle_browser"]
-].forEach(function (elementGlobal) {
+].forEach(function(elementGlobal) {
   var [name, id] = elementGlobal;
-  window.__defineGetter__(name, function () {
+  window.__defineGetter__(name, function() {
     var element = document.getElementById(id);
     if (!element)
       return null;
     delete window[name];
     return window[name] = element;
   });
-  window.__defineSetter__(name, function (val) {
+  window.__defineSetter__(name, function(val) {
     delete window[name];
     return window[name] = val;
   });
 });
 
 // Smart getter for the findbar.  If you don't wish to force the creation of
 // the findbar, check gFindBarInitialized first.
 
@@ -203,17 +203,17 @@ this.__defineGetter__("gFindBarInitializ
   return window.gBrowser.isFindBarInitialized();
 });
 
 this.__defineGetter__("AddonManager", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
   return this.AddonManager = tmp.AddonManager;
 });
-this.__defineSetter__("AddonManager", function (val) {
+this.__defineSetter__("AddonManager", function(val) {
   delete this.AddonManager;
   return this.AddonManager = val;
 });
 
 
 var gInitialPages = [
   "about:blank",
   "about:newtab",
@@ -425,28 +425,28 @@ function findChildShell(aDocument, aDocS
       return docShell;
   }
   return null;
 }
 
 var gPopupBlockerObserver = {
   _reportButton: null,
 
-  onReportButtonMousedown: function (aEvent)
+  onReportButtonMousedown: function(aEvent)
   {
     // If this method is called on the same event tick as the popup gets
     // hidden, do nothing to avoid re-opening the popup.
     if (aEvent.button != 0 || aEvent.target != this._reportButton || this.isPopupHidingTick)
       return;
 
     document.getElementById("blockedPopupOptions")
             .openPopup(this._reportButton, "after_end", 0, 2, false, false, aEvent);
   },
 
-  handleEvent: function (aEvent)
+  handleEvent: function(aEvent)
   {
     if (aEvent.originalTarget != gBrowser.selectedBrowser)
       return;
 
     if (!this._reportButton)
       this._reportButton = document.getElementById("page-report-button");
 
     if (!gBrowser.selectedBrowser.blockedPopups ||
@@ -507,30 +507,30 @@ var gPopupBlockerObserver = {
       }
 
       // Record the fact that we've reported this blocked popup, so we don't
       // show it again.
       gBrowser.selectedBrowser.blockedPopups.reported = true;
     }
   },
 
-  toggleAllowPopupsForSite: function (aEvent)
+  toggleAllowPopupsForSite: function(aEvent)
   {
     var pm = Services.perms;
     var shouldBlock = aEvent.target.getAttribute("block") == "true";
     var perm = shouldBlock ? pm.DENY_ACTION : pm.ALLOW_ACTION;
     pm.add(gBrowser.currentURI, "popup", perm);
 
     if (!shouldBlock)
       this.showAllBlockedPopups(gBrowser.selectedBrowser);
 
     gBrowser.getNotificationBox().removeCurrentNotification();
   },
 
-  fillPopupList: function (aEvent)
+  fillPopupList: function(aEvent)
   {
     // XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites
     //          we should really walk the blockedPopups and create a list of "allow for <host>"
     //          menuitems for the common subset of hosts present in the report, this will
     //          make us frame-safe.
     //
     // XXXjst - Note that when this is fixed to work with multi-framed sites,
     //          also back out the fix for bug 343772 where
@@ -623,50 +623,50 @@ var gPopupBlockerObserver = {
 
       // Show the separator if we added any
       // showable popup addresses to the menu.
       if (foundUsablePopupURI)
         blockedPopupsSeparator.removeAttribute("hidden");
     }, null);
   },
 
-  onPopupHiding: function (aEvent) {
+  onPopupHiding: function(aEvent) {
     if (aEvent.target.anchorNode.id == "page-report-button")
       aEvent.target.anchorNode.removeAttribute("open");
 
     this.isPopupHidingTick = true;
     setTimeout(() => this.isPopupHidingTick = false, 0);
 
     let item = aEvent.target.lastChild;
     while (item && item.getAttribute("observes") != "blockedPopupsSeparator") {
       let next = item.previousSibling;
       item.parentNode.removeChild(item);
       item = next;
     }
   },
 
-  showBlockedPopup: function (aEvent)
+  showBlockedPopup: function(aEvent)
   {
     var target = aEvent.target;
     var popupReportIndex = target.getAttribute("popupReportIndex");
     let browser = target.popupReportBrowser;
     browser.unblockPopup(popupReportIndex);
   },
 
-  showAllBlockedPopups: function (aBrowser)
+  showAllBlockedPopups: function(aBrowser)
   {
     aBrowser.retrieveListOfBlockedPopups().then(popups => {
       for (let i = 0; i < popups.length; i++) {
         if (popups[i].popupWindowURIspec)
           aBrowser.unblockPopup(i);
       }
     }, null);
   },
 
-  editPopupSettings: function ()
+  editPopupSettings: function()
   {
     var host = "";
     try {
       host = gBrowser.currentURI.host;
     }
     catch (e) { }
 
     var bundlePreferences = document.getElementById("bundle_preferences");
@@ -682,17 +682,17 @@ var gPopupBlockerObserver = {
       existingWindow.initWithParams(params);
       existingWindow.focus();
     }
     else
       window.openDialog("chrome://browser/content/preferences/permissions.xul",
                         "_blank", "resizable,dialog=no,centerscreen", params);
   },
 
-  dontShowMessage: function ()
+  dontShowMessage: function()
   {
     var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
     gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
     gBrowser.getNotificationBox().removeCurrentNotification();
   }
 };
 
 function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
@@ -752,29 +752,29 @@ function gKeywordURIFixup({ target: brow
   // 1097347366913 (ff7f000001) gets resolved by using the final bytes,
   // making it the same as 7f000001, which is 127.0.0.1 aka localhost.
   // While 2130706433 would get normalized by network, 1097347366913
   // does not, and we have to deal with both cases here:
   if (isIPv4Address(asciiHost) || /^(?:\d+|0x[a-f0-9]+)$/i.test(asciiHost))
     return;
 
   let onLookupComplete = (request, record, status) => {
-    let browser = weakBrowser.get();
-    if (!Components.isSuccessCode(status) || !browser)
+    let browserRef = weakBrowser.get();
+    if (!Components.isSuccessCode(status) || !browserRef)
       return;
 
-    let currentURI = browser.currentURI;
+    let currentURI = browserRef.currentURI;
     // If we're in case (3) (see above), don't show an info bar.
     if (!currentURI.equals(previousURI) &&
         !currentURI.equals(preferredURI)) {
       return;
     }
 
     // show infobar offering to visit the host
-    let notificationBox = gBrowser.getNotificationBox(browser);
+    let notificationBox = gBrowser.getNotificationBox(browserRef);
     if (notificationBox.getNotificationWithValue("keyword-uri-fixup"))
       return;
 
     let message = gNavigatorBundle.getFormattedString(
       "keywordURIFixup.message", [hostName]);
     let yesMessage = gNavigatorBundle.getFormattedString(
       "keywordURIFixup.goTo", [hostName])
 
@@ -1059,17 +1059,17 @@ var gBrowserInit = {
 
     // Wait until chrome is painted before executing code not critical to making the window visible
     this._boundDelayedStartup = this._delayedStartup.bind(this);
     window.addEventListener("MozAfterPaint", this._boundDelayedStartup);
 
     this._loadHandled = true;
   },
 
-  _cancelDelayedStartup: function () {
+  _cancelDelayedStartup: function() {
     window.removeEventListener("MozAfterPaint", this._boundDelayedStartup);
     this._boundDelayedStartup = null;
   },
 
   _delayedStartup: function() {
     let tmp = {};
     Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", tmp);
     let TelemetryTimestamps = tmp.TelemetryTimestamps;
@@ -1233,17 +1233,16 @@ var gBrowserInit = {
     UpdateUrlbarSearchSplitterState();
 
     if (!(isBlankPageURL(uriToLoad) || uriToLoad == "about:privatebrowsing") ||
         !focusAndSelectUrlBar()) {
       if (gBrowser.selectedBrowser.isRemoteBrowser) {
         // If the initial browser is remote, in order to optimize for first paint,
         // we'll defer switching focus to that browser until it has painted.
         let focusedElement = document.commandDispatcher.focusedElement;
-        let mm = window.messageManager;
         mm.addMessageListener("Browser:FirstPaint", function onFirstPaint() {
           mm.removeMessageListener("Browser:FirstPaint", onFirstPaint);
           // If focus didn't move while we were waiting for first paint, we're okay
           // to move to the browser.
           if (document.commandDispatcher.focusedElement == focusedElement) {
             gBrowser.selectedBrowser.focus();
           }
         });
@@ -1438,17 +1437,17 @@ var gBrowserInit = {
 
     this.delayedStartupFinished = true;
 
     Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
     TelemetryTimestamps.add("delayedStartupFinished");
   },
 
   // Returns the URI(s) to load at startup.
-  _getUriToLoad: function () {
+  _getUriToLoad: function() {
     // window.arguments[0]: URI to load (string), or an nsIArray of
     //                      nsISupportsStrings to load, or a xul:tab of
     //                      a tabbrowser, which will be replaced by this
     //                      window (for this case, all other arguments are
     //                      ignored).
     if (!window.arguments || !window.arguments[0])
       return null;
 
@@ -2543,96 +2542,96 @@ var gMenuButtonBadgeManager = {
   BADGEID_APPUPDATE: "update",
   BADGEID_DOWNLOAD: "download",
   BADGEID_FXA: "fxa",
 
   fxaBadge: null,
   downloadBadge: null,
   appUpdateBadge: null,
 
-  init: function () {
+  init: function() {
     PanelUI.panel.addEventListener("popupshowing", this, true);
   },
 
-  uninit: function () {
+  uninit: function() {
     PanelUI.panel.removeEventListener("popupshowing", this, true);
   },
 
-  handleEvent: function (e) {
+  handleEvent: function(e) {
     if (e.type === "popupshowing") {
       this.clearBadges();
     }
   },
 
-  _showBadge: function () {
+  _showBadge: function() {
     let badgeToShow = this.downloadBadge || this.appUpdateBadge || this.fxaBadge;
 
     if (badgeToShow) {
       PanelUI.menuButton.setAttribute("badge-status", badgeToShow);
     } else {
       PanelUI.menuButton.removeAttribute("badge-status");
     }
   },
 
-  _changeBadge: function (badgeId, badgeStatus = null) {
+  _changeBadge: function(badgeId, badgeStatus = null) {
     if (badgeId == this.BADGEID_APPUPDATE) {
       this.appUpdateBadge = badgeStatus;
     } else if (badgeId == this.BADGEID_DOWNLOAD) {
       this.downloadBadge = badgeStatus;
     } else if (badgeId == this.BADGEID_FXA) {
       this.fxaBadge = badgeStatus;
     } else {
       Cu.reportError("The badge ID '" + badgeId + "' is unknown!");
     }
     this._showBadge();
   },
 
-  addBadge: function (badgeId, badgeStatus) {
+  addBadge: function(badgeId, badgeStatus) {
     if (!badgeStatus) {
       Cu.reportError("badgeStatus must be defined");
       return;
     }
     this._changeBadge(badgeId, badgeStatus);
   },
 
-  removeBadge: function (badgeId) {
+  removeBadge: function(badgeId) {
     this._changeBadge(badgeId);
   },
 
-  clearBadges: function () {
+  clearBadges: function() {
     this.appUpdateBadge = null;
     this.downloadBadge = null;
     this.fxaBadge = null;
     this._showBadge();
   }
 };
 
 // Setup the hamburger button badges for updates, if enabled.
 var gMenuButtonUpdateBadge = {
   enabled: false,
   badgeWaitTime: 0,
   timer: null,
   cancelObserverRegistered: false,
 
-  init: function () {
+  init: function() {
     try {
       this.enabled = Services.prefs.getBoolPref("app.update.badge");
     } catch (e) {}
     if (this.enabled) {
       try {
         this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime");
       } catch (e) {
         this.badgeWaitTime = 345600; // 4 days
       }
       Services.obs.addObserver(this, "update-staged", false);
       Services.obs.addObserver(this, "update-downloaded", false);
     }
   },
 
-  uninit: function () {
+  uninit: function() {
     if (this.timer)
       this.timer.cancel();
     if (this.enabled) {
       Services.obs.removeObserver(this, "update-staged");
       Services.obs.removeObserver(this, "update-downloaded");
       this.enabled = false;
     }
     if (this.cancelObserverRegistered) {
@@ -2653,17 +2652,17 @@ var gMenuButtonUpdateBadge = {
       }
     } else {
       // open the page for manual update
       let url = Services.urlFormatter.formatURLPref("app.update.url.manual");
       openUILinkIn(url, "tab");
     }
   },
 
-  observe: function (subject, topic, status) {
+  observe: function(subject, topic, status) {
     if (topic == "update-canceled") {
       this.reset();
       return;
     }
     if (status == "failed") {
       // Background update has failed, let's show the UI responsible for
       // prompting the user to update manually.
       this.uninit();
@@ -2673,25 +2672,25 @@ var gMenuButtonUpdateBadge = {
 
     // Give the user badgeWaitTime seconds to react before prompting.
     this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this.timer.initWithCallback(this, this.badgeWaitTime * 1000,
                                 this.timer.TYPE_ONE_SHOT);
     // The timer callback will call uninit() when it completes.
   },
 
-  notify: function () {
+  notify: function() {
     // If the update is successfully applied, or if the updater has fallen back
     // to non-staged updates, add a badge to the hamburger menu to indicate an
     // update will be applied once the browser restarts.
     this.uninit();
     this.displayBadge(true);
   },
 
-  displayBadge: function (succeeded) {
+  displayBadge: function(succeeded) {
     let status = succeeded ? "succeeded" : "failed";
     let badgeStatus = "update-" + status;
     gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, badgeStatus);
 
     let stringId;
     let updateButtonText;
     if (succeeded) {
       let brandBundle = document.getElementById("bundle_brand");
@@ -2707,17 +2706,17 @@ var gMenuButtonUpdateBadge = {
     }
 
     let updateButton = document.getElementById("PanelUI-update-status");
     updateButton.setAttribute("label", updateButtonText);
     updateButton.setAttribute("update-status", status);
     updateButton.hidden = false;
   },
 
-  reset: function () {
+  reset: function() {
     gMenuButtonBadgeManager.removeBadge(
       gMenuButtonBadgeManager.BADGEID_APPUPDATE);
     let updateButton = document.getElementById("PanelUI-update-status");
     updateButton.hidden = true;
     this.uninit();
     this.init();
   }
 };
@@ -2735,43 +2734,43 @@ const PREF_SSL_IMPACT = PREF_SSL_IMPACT_
 }, []);
 
 /**
  * Handle command events bubbling up from error page content
  * or from about:newtab or from remote error pages that invoke
  * us via async messaging.
  */
 var BrowserOnClick = {
-  init: function () {
+  init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("Browser:CertExceptionError", this);
     mm.addMessageListener("Browser:SiteBlockedError", this);
     mm.addMessageListener("Browser:EnableOnlineMode", this);
     mm.addMessageListener("Browser:SendSSLErrorReport", this);
     mm.addMessageListener("Browser:SetSSLErrorReportAuto", this);
     mm.addMessageListener("Browser:ResetSSLPreferences", this);
     mm.addMessageListener("Browser:SSLErrorReportTelemetry", this);
     mm.addMessageListener("Browser:OverrideWeakCrypto", this);
     mm.addMessageListener("Browser:SSLErrorGoBack", this);
   },
 
-  uninit: function () {
+  uninit: function() {
     let mm = window.messageManager;
     mm.removeMessageListener("Browser:CertExceptionError", this);
     mm.removeMessageListener("Browser:SiteBlockedError", this);
     mm.removeMessageListener("Browser:EnableOnlineMode", this);
     mm.removeMessageListener("Browser:SendSSLErrorReport", this);
     mm.removeMessageListener("Browser:SetSSLErrorReportAuto", this);
     mm.removeMessageListener("Browser:ResetSSLPreferences", this);
     mm.removeMessageListener("Browser:SSLErrorReportTelemetry", this);
     mm.removeMessageListener("Browser:OverrideWeakCrypto", this);
     mm.removeMessageListener("Browser:SSLErrorGoBack", this);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     if (!event.isTrusted || // Don't trust synthetic events
         event.button == 2) {
       return;
     }
 
     let originalTarget = event.originalTarget;
     let ownerDoc = originalTarget.ownerDocument;
     if (!ownerDoc) {
@@ -2779,17 +2778,17 @@ var BrowserOnClick = {
     }
 
     if (gMultiProcessBrowser &&
         ownerDoc.documentURI.toLowerCase() == "about:newtab") {
       this.onE10sAboutNewTab(event, ownerDoc);
     }
   },
 
-  receiveMessage: function (msg) {
+  receiveMessage: function(msg) {
     switch (msg.name) {
       case "Browser:CertExceptionError":
         this.onCertError(msg.target, msg.data.elementId,
                          msg.data.isTopFrame, msg.data.location,
                          msg.data.securityInfoAsString);
       break;
       case "Browser:SiteBlockedError":
         this.onAboutBlocked(msg.data.elementId, msg.data.reason,
@@ -2851,17 +2850,17 @@ var BrowserOnClick = {
     transportSecurityInfo.QueryInterface(Ci.nsITransportSecurityInfo)
 
     let errorReporter = Cc["@mozilla.org/securityreporter;1"]
                           .getService(Ci.nsISecurityReporter);
     errorReporter.reportTLSError(transportSecurityInfo,
                                  uri.host, uri.port);
   },
 
-  onCertError: function (browser, elementId, isTopFrame, location, securityInfoAsString) {
+  onCertError: function(browser, elementId, isTopFrame, location, securityInfoAsString) {
     let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
     let securityInfo;
 
     switch (elementId) {
       case "exceptionDialogButton":
         if (isTopFrame) {
           secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_CLICK_ADD_EXCEPTION);
         }
@@ -2920,17 +2919,17 @@ var BrowserOnClick = {
         let detailedInfo = getDetailedCertErrorInfo(location,
                                                     securityInfo);
         gClipboardHelper.copyString(detailedInfo);
         break;
 
     }
   },
 
-  onAboutBlocked: function (elementId, reason, isTopFrame, location) {
+  onAboutBlocked: function(elementId, reason, isTopFrame, location) {
     // Depending on what page we are displaying here (malware/phishing/unwanted)
     // use the right strings and links for each.
     let bucketName = "";
     let sendTelemetry = false;
     if (reason === 'malware') {
       sendTelemetry = true;
       bucketName = "WARNING_MALWARE_PAGE_";
     } else if (reason === 'phishing') {
@@ -2991,17 +2990,17 @@ var BrowserOnClick = {
     if (anchorTarget instanceof HTMLAnchorElement &&
         anchorTarget.classList.contains("newtab-link")) {
       event.preventDefault();
       let where = whereToOpenLink(event, false, false);
       openLinkIn(anchorTarget.href, where, { charset: ownerDoc.characterSet, referrerURI: ownerDoc.documentURIObject });
     }
   },
 
-  ignoreWarningButton: function (reason) {
+  ignoreWarningButton: function(reason) {
     // Allow users to override and continue through to the site,
     // but add a notify bar as a reminder, so that they don't lose
     // track after, e.g., tab switching.
     gBrowser.loadURIWithFlags(gBrowser.currentURI.spec,
                               nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
                               null, null, null);
 
     Services.perms.add(gBrowser.currentURI, "safe-browsing",
@@ -3258,78 +3257,78 @@ function getPEMString(cert)
          + "\r\n-----END CERTIFICATE-----\r\n";
 }
 
 var PrintPreviewListener = {
   _printPreviewTab: null,
   _tabBeforePrintPreview: null,
   _simplifyPageTab: null,
 
-  getPrintPreviewBrowser: function () {
+  getPrintPreviewBrowser: function() {
     if (!this._printPreviewTab) {
       let browser = gBrowser.selectedTab.linkedBrowser;
       let forceNotRemote = gMultiProcessBrowser && !browser.isRemoteBrowser;
       this._tabBeforePrintPreview = gBrowser.selectedTab;
       this._printPreviewTab = gBrowser.loadOneTab("about:blank",
                                                   { inBackground: false,
                                                     forceNotRemote,
                                                     relatedBrowser: browser });
       gBrowser.selectedTab = this._printPreviewTab;
     }
     return gBrowser.getBrowserForTab(this._printPreviewTab);
   },
-  createSimplifiedBrowser: function () {
+  createSimplifiedBrowser: function() {
     this._simplifyPageTab = gBrowser.loadOneTab("about:blank",
                                                 { inBackground: true });
     return this.getSimplifiedSourceBrowser();
   },
-  getSourceBrowser: function () {
+  getSourceBrowser: function() {
     return this._tabBeforePrintPreview ?
       this._tabBeforePrintPreview.linkedBrowser : gBrowser.selectedBrowser;
   },
-  getSimplifiedSourceBrowser: function () {
+  getSimplifiedSourceBrowser: function() {
     return this._simplifyPageTab ?
       gBrowser.getBrowserForTab(this._simplifyPageTab) : null;
   },
-  getNavToolbox: function () {
+  getNavToolbox: function() {
     return gNavToolbox;
   },
-  onEnter: function () {
+  onEnter: function() {
     // We might have accidentally switched tabs since the user invoked print
     // preview
     if (gBrowser.selectedTab != this._printPreviewTab) {
       gBrowser.selectedTab = this._printPreviewTab;
     }
     gInPrintPreviewMode = true;
     this._toggleAffectedChrome();
   },
-  onExit: function () {
+  onExit: function() {
     gBrowser.selectedTab = this._tabBeforePrintPreview;
     this._tabBeforePrintPreview = null;
     gInPrintPreviewMode = false;
     this._toggleAffectedChrome();
     if (this._simplifyPageTab) {
       gBrowser.removeTab(this._simplifyPageTab);
       this._simplifyPageTab = null;
     }
     gBrowser.removeTab(this._printPreviewTab);
     gBrowser.deactivatePrintPreviewBrowsers();
     this._printPreviewTab = null;
   },
-  _toggleAffectedChrome: function () {
+  _toggleAffectedChrome: function() {
     gNavToolbox.collapsed = gInPrintPreviewMode;
 
     if (gInPrintPreviewMode)
       this._hideChrome();
     else
       this._showChrome();
 
     TabsInTitlebar.allowedBy("print-preview", !gInPrintPreviewMode);
   },
-  _hideChrome: function () {
+  _hideChrome: function() {
     this._chromeState = {};
 
     this._chromeState.sidebarOpen = SidebarUI.isOpen;
     this._sidebarCommand = SidebarUI.currentID;
     SidebarUI.hide();
 
     var notificationBox = gBrowser.getNotificationBox();
     this._chromeState.notificationsOpen = !notificationBox.notificationsHidden;
@@ -3347,17 +3346,17 @@ var PrintPreviewListener = {
 
     this._chromeState.syncNotificationsOpen = false;
     var syncNotifications = document.getElementById("sync-notifications");
     if (syncNotifications) {
       this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden;
       syncNotifications.notificationsHidden = true;
     }
   },
-  _showChrome: function () {
+  _showChrome: function() {
     if (this._chromeState.notificationsOpen)
       gBrowser.getNotificationBox().notificationsHidden = false;
 
     if (this._chromeState.findOpen)
       gFindBar.open();
 
     if (this._chromeState.globalNotificationsOpen)
       document.getElementById("global-notificationbox").notificationsHidden = false;
@@ -3383,47 +3382,47 @@ function getMarkupDocumentViewer()
 function FillInHTMLTooltip(tipElement)
 {
   document.getElementById("aHTMLTooltip").fillInPageTooltip(tipElement);
 }
 
 var browserDragAndDrop = {
   canDropLink: aEvent => Services.droppedLinkHandler.canDropLink(aEvent, true),
 
-  dragOver: function (aEvent)
+  dragOver: function(aEvent)
   {
     if (this.canDropLink(aEvent)) {
       aEvent.preventDefault();
     }
   },
 
-  dropLinks: function (aEvent, aDisallowInherit) {
+  dropLinks: function(aEvent, aDisallowInherit) {
     return Services.droppedLinkHandler.dropLinks(aEvent, aDisallowInherit);
   }
 };
 
 var homeButtonObserver = {
-  onDrop: function (aEvent)
+  onDrop: function(aEvent)
     {
       // disallow setting home pages that inherit the principal
       let links = browserDragAndDrop.dropLinks(aEvent, true);
       if (links.length) {
         setTimeout(openHomeDialog, 0, links.map(link => link.url).join("|"));
       }
     },
 
-  onDragOver: function (aEvent)
+  onDragOver: function(aEvent)
     {
       if (gPrefService.prefIsLocked("browser.startup.homepage")) {
         return;
       }
       browserDragAndDrop.dragOver(aEvent);
       aEvent.dropEffect = "link";
     },
-  onDragExit: function (aEvent)
+  onDragExit: function(aEvent)
     {
     }
 }
 
 function openHomeDialog(aURL)
 {
   var promptTitle = gNavigatorBundle.getString("droponhometitle");
   var promptMsg;
@@ -3440,17 +3439,17 @@ function openHomeDialog(aURL)
   if (pressedVal == 0) {
     try {
       var homepageStr = Components.classes["@mozilla.org/supports-string;1"]
                         .createInstance(Components.interfaces.nsISupportsString);
       homepageStr.data = aURL;
       gPrefService.setComplexValue("browser.startup.homepage",
                                    Components.interfaces.nsISupportsString, homepageStr);
     } catch (ex) {
-      dump("Failed to set the home page.\n"+ex+"\n");
+      dump("Failed to set the home page.\n" + ex + "\n");
     }
   }
 }
 
 var newTabButtonObserver = {
   onDragOver(aEvent) {
     browserDragAndDrop.dragOver(aEvent);
   },
@@ -3487,17 +3486,17 @@ var newWindowButtonObserver = {
 const DOMLinkHandler = {
   init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("Link:AddFeed", this);
     mm.addMessageListener("Link:SetIcon", this);
     mm.addMessageListener("Link:AddSearch", this);
   },
 
-  receiveMessage: function (aMsg) {
+  receiveMessage: function(aMsg) {
     switch (aMsg.name) {
       case "Link:AddFeed":
         let link = {type: aMsg.data.type, href: aMsg.data.href, title: aMsg.data.title};
         FeedHandler.addFeed(link, aMsg.target);
         break;
 
       case "Link:SetIcon":
         this.setIcon(aMsg.target, aMsg.data.url, aMsg.data.loadingPrincipal);
@@ -3588,17 +3587,17 @@ const BrowserSearch = {
     if (window.location.href != getBrowserURL()) {
       var win = getTopWin();
       if (win) {
         // If there's an open browser window, it should handle this command
         win.focus();
         win.BrowserSearch.webSearch();
       } else {
         // If there are no open browser windows, open a new one
-        var observer = function observer(subject, topic, data) {
+        var observer = function(subject, topic, data) {
           if (subject == win) {
             BrowserSearch.webSearch();
             Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
           }
         }
         win = window.openDialog(getBrowserURL(), "_blank",
                                 "chrome,all,dialog=no", "about:blank");
         Services.obs.addObserver(observer, "browser-delayed-startup-finished", false);
@@ -3654,17 +3653,17 @@ const BrowserSearch = {
    * @param purpose [optional]
    *        A string meant to indicate the context of the search request. This
    *        allows the search service to provide a different nsISearchSubmission
    *        depending on e.g. where the search is triggered in the UI.
    *
    * @return engine The search engine used to perform a search, or null if no
    *                search was performed.
    */
-  _loadSearch: function (searchText, useNewTab, purpose) {
+  _loadSearch: function(searchText, useNewTab, purpose) {
     let engine;
 
     // If the search bar is visible, use the current engine, otherwise, fall
     // back to the default engine.
     if (isElementVisible(this.searchBar))
       engine = Services.search.currentEngine;
     else
       engine = Services.search.defaultEngine;
@@ -3704,24 +3703,24 @@ const BrowserSearch = {
   },
 
   /**
    * Perform a search initiated from the context menu.
    *
    * This should only be called from the context menu. See
    * BrowserSearch.loadSearch for the preferred API.
    */
-  loadSearchFromContext: function (terms) {
+  loadSearchFromContext: function(terms) {
     let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
     if (engine) {
       BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
     }
   },
 
-  pasteAndSearch: function (event) {
+  pasteAndSearch: function(event) {
     BrowserSearch.searchBar.select();
     goDoCommand("cmd_paste");
     BrowserSearch.searchBar.handleSearchCommand(event);
   },
 
   /**
    * Returns the search bar element if it is present in the toolbar, null otherwise.
    */
@@ -3734,17 +3733,17 @@ const BrowserSearch = {
   },
 
   loadAddEngines: function BrowserSearch_loadAddEngines() {
     var newWindowPref = gPrefService.getIntPref("browser.link.open_newwindow");
     var where = newWindowPref == 3 ? "tab" : "window";
     openUILinkIn(this.searchEnginesURL, where);
   },
 
-  _getSearchEngineId: function (engine) {
+  _getSearchEngineId: function(engine) {
     if (engine && engine.identifier) {
       return engine.identifier;
     }
 
     if (!engine || (engine.name === undefined) ||
         !Services.prefs.getBoolPref("toolkit.telemetry.enabled"))
       return "other";
 
@@ -3763,17 +3762,17 @@ const BrowserSearch = {
    *        allowed values.
    * @param details [optional]
    *        An optional parameter passed to |BrowserUsageTelemetry.recordSearch|.
    *        See its documentation for allowed options.
    *        Additionally, if the search was a suggested search, |details.selection|
    *        indicates where the item was in the suggestion list and how the user
    *        selected it: {selection: {index: The selected index, kind: "key" or "mouse"}}
    */
-  recordSearchInTelemetry: function (engine, source, details={}) {
+  recordSearchInTelemetry: function(engine, source, details = {}) {
     BrowserUITelemetry.countSearchEvent(source, null, details.selection);
     try {
       BrowserUsageTelemetry.recordSearch(engine, source, details);
     } catch (ex) {
       Cu.reportError(ex);
     }
   },
 
@@ -3787,17 +3786,17 @@ const BrowserSearch = {
    * @param source
    *        (string) Where the search originated from. See BrowserUsageTelemetry for
    *        allowed values.
    * @param type
    *        (string) Indicates how the user selected the search item.
    * @param where
    *        (string) Where was the search link opened (e.g. new tab, current tab, ..).
    */
-  recordOneoffSearchInTelemetry: function (engine, source, type, where) {
+  recordOneoffSearchInTelemetry: function(engine, source, type, where) {
     let id = this._getSearchEngineId(engine) + "." + source;
     BrowserUITelemetry.countOneoffSearchEvent(id, type, where);
     try {
       const details = {type, isOneOff: true};
       BrowserUsageTelemetry.recordSearch(engine, source, details);
     } catch (ex) {
       Cu.reportError(ex);
     }
@@ -3876,17 +3875,17 @@ function FillHistoryMenu(aParent) {
       item.setAttribute("uri", uri);
       item.setAttribute("label", entry.title || uri);
       item.setAttribute("index", j);
 
       // Cache this so that gotoHistoryIndex doesn't need the original index
       item.setAttribute("historyindex", j - index);
 
       if (j != index) {
-        PlacesUtils.favicons.getFaviconURLForPage(entryURI, function (aURI) {
+        PlacesUtils.favicons.getFaviconURLForPage(entryURI, function(aURI) {
           if (aURI) {
             let iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec;
             item.style.listStyleImage = "url(" + iconURL + ")";
           }
         });
       }
 
       if (j < index) {
@@ -4011,17 +4010,17 @@ function OpenBrowserWindow(options)
 
   // if and only if the current window is a browser window and it has a document with a character
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document)
   {
     var DocCharset = window.content.document.characterSet;
-    charsetArg = "charset="+DocCharset;
+    charsetArg = "charset=" + DocCharset;
 
     // we should "inherit" the charset menu setting in a new window
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
   }
   else // forget about the charset information.
   {
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
   }
@@ -4179,112 +4178,112 @@ var XULBrowserWindow = {
   defaultStatus: "",
   overLink: "",
   startTime: 0,
   statusText: "",
   isBusy: false,
   // Left here for add-on compatibility, see bug 752434
   inContentWhitelist: [],
 
-  QueryInterface: function (aIID) {
+  QueryInterface: function(aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
         aIID.equals(Ci.nsIWebProgressListener2) ||
         aIID.equals(Ci.nsISupportsWeakReference) ||
         aIID.equals(Ci.nsIXULBrowserWindow) ||
         aIID.equals(Ci.nsISupports))
       return this;
     throw Cr.NS_NOINTERFACE;
   },
 
-  get stopCommand () {
+  get stopCommand() {
     delete this.stopCommand;
     return this.stopCommand = document.getElementById("Browser:Stop");
   },
-  get reloadCommand () {
+  get reloadCommand() {
     delete this.reloadCommand;
     return this.reloadCommand = document.getElementById("Browser:Reload");
   },
-  get statusTextField () {
+  get statusTextField() {
     return gBrowser.getStatusPanel();
   },
-  get isImage () {
+  get isImage() {
     delete this.isImage;
     return this.isImage = document.getElementById("isImage");
   },
-  get canViewSource () {
+  get canViewSource() {
     delete this.canViewSource;
     return this.canViewSource = document.getElementById("canViewSource");
   },
 
-  init: function () {
+  init: function() {
     // Initialize the security button's state and tooltip text.
     var securityUI = gBrowser.securityUI;
     this.onSecurityChange(null, null, securityUI.state, true);
   },
 
-  setJSStatus: function () {
+  setJSStatus: function() {
     // unsupported
   },
 
   forceInitialBrowserRemote: function() {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     return initBrowser.frameLoader.tabParent;
   },
 
   forceInitialBrowserNonRemote: function(aOpener) {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     gBrowser.updateBrowserRemoteness(initBrowser, false, aOpener);
   },
 
-  setDefaultStatus: function (status) {
+  setDefaultStatus: function(status) {
     this.defaultStatus = status;
     this.updateStatusField();
   },
 
-  setOverLink: function (url, anchorElt) {
+  setOverLink: function(url, anchorElt) {
     // Encode bidirectional formatting characters.
     // (RFC 3987 sections 3.2 and 4.1 paragraph 6)
     url = url.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
                       encodeURIComponent);
 
     if (gURLBar && gURLBar._mayTrimURLs /* corresponds to browser.urlbar.trimURLs */)
       url = trimURL(url);
 
     this.overLink = url;
     LinkTargetDisplay.update();
   },
 
-  showTooltip: function (x, y, tooltip, direction) {
+  showTooltip: function(x, y, tooltip, direction) {
     if (Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).
         getCurrentSession()) {
       return;
     }
 
     // The x,y coordinates are relative to the <browser> element using
     // the chrome zoom level.
     let elt = document.getElementById("remoteBrowserTooltip");
     elt.label = tooltip;
     elt.style.direction = direction;
 
     let anchor = gBrowser.selectedBrowser;
     elt.openPopupAtScreen(anchor.boxObject.screenX + x, anchor.boxObject.screenY + y, false, null);
   },
 
-  hideTooltip: function () {
+  hideTooltip: function() {
     let elt = document.getElementById("remoteBrowserTooltip");
     elt.hidePopup();
   },
 
-  getTabCount: function () {
+  getTabCount: function() {
     return gBrowser.tabs.length;
   },
 
-  updateStatusField: function () {
+  updateStatusField: function() {
     var text, type, types = ["overLink"];
     if (this._busyUI)
       types.push("status");
     types.push("defaultStatus");
     for (type of types) {
       text = this[type];
       if (text)
         break;
@@ -4326,32 +4325,32 @@ var XULBrowserWindow = {
     if (!E10SUtils.shouldLoadURI(aDocShell, aURI, aReferrer)) {
       E10SUtils.redirectLoad(aDocShell, aURI, aReferrer);
       return false;
     }
 
     return true;
   },
 
-  onProgressChange: function (aWebProgress, aRequest,
-                              aCurSelfProgress, aMaxSelfProgress,
-                              aCurTotalProgress, aMaxTotalProgress) {
+  onProgressChange: function(aWebProgress, aRequest,
+                             aCurSelfProgress, aMaxSelfProgress,
+                             aCurTotalProgress, aMaxTotalProgress) {
     // Do nothing.
   },
 
-  onProgressChange64: function (aWebProgress, aRequest,
-                                aCurSelfProgress, aMaxSelfProgress,
-                                aCurTotalProgress, aMaxTotalProgress) {
+  onProgressChange64: function(aWebProgress, aRequest,
+                               aCurSelfProgress, aMaxSelfProgress,
+                               aCurTotalProgress, aMaxTotalProgress) {
     return this.onProgressChange(aWebProgress, aRequest,
       aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
       aMaxTotalProgress);
   },
 
   // This function fires only for the currently selected tab.
-  onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
     const nsIWebProgressListener = Ci.nsIWebProgressListener;
     const nsIChannel = Ci.nsIChannel;
 
     let browser = gBrowser.selectedBrowser;
 
     if (aStateFlags & nsIWebProgressListener.STATE_START &&
         aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
 
@@ -4425,17 +4424,17 @@ var XULBrowserWindow = {
         this._busyUI = false;
 
         this.stopCommand.setAttribute("disabled", "true");
         CombinedStopReload.switchToReload(aRequest instanceof Ci.nsIRequest);
       }
     }
   },
 
-  onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
+  onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
     var location = aLocationURI ? aLocationURI.spec : "";
 
     // If displayed, hide the form validation popup.
     FormValidationHandler.hidePopup();
 
     let pageTooltip = document.getElementById("aHTMLTooltip");
     let tooltipNode = pageTooltip.triggerNode;
     if (tooltipNode) {
@@ -4489,34 +4488,34 @@ var XULBrowserWindow = {
 
       SocialUI.updateState();
 
       UITour.onLocationChange(location);
 
       gTabletModePageCounter.inc();
 
       // Utility functions for disabling find
-      var shouldDisableFind = function shouldDisableFind(aDocument) {
+      var shouldDisableFind = function(aDocument) {
         let docElt = aDocument.documentElement;
         return docElt && docElt.getAttribute("disablefastfind") == "true";
       }
 
-      var disableFindCommands = function disableFindCommands(aDisable) {
+      var disableFindCommands = function(aDisable) {
         let findCommands = [document.getElementById("cmd_find"),
                             document.getElementById("cmd_findAgain"),
                             document.getElementById("cmd_findPrevious")];
         for (let elt of findCommands) {
           if (aDisable)
             elt.setAttribute("disabled", "true");
           else
             elt.removeAttribute("disabled");
         }
       }
 
-      var onContentRSChange = function onContentRSChange(e) {
+      var onContentRSChange = function(e) {
         if (e.target.readyState != "interactive" && e.target.readyState != "complete")
           return;
 
         e.target.removeEventListener("readystatechange", onContentRSChange);
         disableFindCommands(shouldDisableFind(e.target));
       }
 
       // Disable find commands in documents that ask for them to be disabled.
@@ -4547,17 +4546,17 @@ var XULBrowserWindow = {
     UpdateBackForwardCommands(gBrowser.webNavigation);
     ReaderParent.updateReaderButton(gBrowser.selectedBrowser);
 
     gGestureSupport.restoreRotationState();
 
     // See bug 358202, when tabs are switched during a drag operation,
     // timers don't fire on windows (bug 203573)
     if (aRequest)
-      setTimeout(function () { XULBrowserWindow.asyncUpdateUI(); }, 0);
+      setTimeout(function() { XULBrowserWindow.asyncUpdateUI(); }, 0);
     else
       this.asyncUpdateUI();
 
     if (AppConstants.MOZ_CRASHREPORTER && aLocationURI) {
       let uri = aLocationURI.clone();
       try {
         // If the current URI contains a username/password, remove it.
         uri.userPass = "";
@@ -4569,40 +4568,40 @@ var XULBrowserWindow = {
         // Don't make noise when the crash reporter is built but not enabled.
         if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) {
           throw ex;
         }
       }
     }
   },
 
-  asyncUpdateUI: function () {
+  asyncUpdateUI: function() {
     FeedHandler.updateFeeds();
     BrowserSearch.updateOpenSearchBadge();
   },
 
   // Left here for add-on compatibility, see bug 752434
   hideChromeForLocation: function() {},
 
-  onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
+  onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
     this.status = aMessage;
     this.updateStatusField();
   },
 
   // Properties used to cache security state used to update the UI
   _state: null,
   _lastLocation: null,
 
   // This is called in multiple ways:
   //  1. Due to the nsIWebProgressListener.onSecurityChange notification.
   //  2. Called by tabbrowser.xml when updating the current browser.
   //  3. Called directly during this object's initializations.
   // aRequest will be null always in case 2 and 3, and sometimes in case 1 (for
   // instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed).
-  onSecurityChange: function (aWebProgress, aRequest, aState, aIsSimulated) {
+  onSecurityChange: function(aWebProgress, aRequest, aState, aIsSimulated) {
     // Don't need to do anything if the data we use to update the UI hasn't
     // changed
     let uri = gBrowser.currentURI;
     let spec = uri.spec;
     if (this._state == aState &&
         this._lastLocation == spec)
       return;
     this._state = aState;
@@ -4649,21 +4648,21 @@ var LinkTargetDisplay = {
   get DELAY_SHOW() {
      delete this.DELAY_SHOW;
      return this.DELAY_SHOW = Services.prefs.getIntPref("browser.overlink-delay");
   },
 
   DELAY_HIDE: 250,
   _timer: 0,
 
-  get _isVisible () {
+  get _isVisible() {
     return XULBrowserWindow.statusTextField.label != "";
   },
 
-  update: function () {
+  update: function() {
     clearTimeout(this._timer);
     window.removeEventListener("mousemove", this, true);
 
     if (!XULBrowserWindow.overLink) {
       if (XULBrowserWindow.hideOverLinkImmediately)
         this._hide();
       else
         this._timer = setTimeout(this._hide.bind(this), this.DELAY_HIDE);
@@ -4674,85 +4673,85 @@ var LinkTargetDisplay = {
       XULBrowserWindow.updateStatusField();
     } else {
       // Let the display appear when the mouse doesn't move within the delay
       this._showDelayed();
       window.addEventListener("mousemove", this, true);
     }
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "mousemove":
         // Restart the delay since the mouse was moved
         clearTimeout(this._timer);
         this._showDelayed();
         break;
     }
   },
 
-  _showDelayed: function () {
-    this._timer = setTimeout(function (self) {
+  _showDelayed: function() {
+    this._timer = setTimeout(function(self) {
       XULBrowserWindow.updateStatusField();
       window.removeEventListener("mousemove", self, true);
     }, this.DELAY_SHOW, this);
   },
 
-  _hide: function () {
+  _hide: function() {
     clearTimeout(this._timer);
 
     XULBrowserWindow.updateStatusField();
   }
 };
 
 var CombinedStopReload = {
-  init: function () {
+  init: function() {
     if (this._initialized)
       return;
 
     let reload = document.getElementById("urlbar-reload-button");
     let stop = document.getElementById("urlbar-stop-button");
     if (!stop || !reload || reload.nextSibling != stop)
       return;
 
     this._initialized = true;
     if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
       reload.setAttribute("displaystop", "true");
     stop.addEventListener("click", this, false);
     this.reload = reload;
     this.stop = stop;
   },
 
-  uninit: function () {
+  uninit: function() {
     if (!this._initialized)
       return;
 
     this._cancelTransition();
     this._initialized = false;
     this.stop.removeEventListener("click", this, false);
     this.reload = null;
     this.stop = null;
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     // the only event we listen to is "click" on the stop button
     if (event.button == 0 &&
         !this.stop.disabled)
       this._stopClicked = true;
   },
 
-  switchToStop: function () {
+  switchToStop: function() {
     if (!this._initialized)
       return;
 
     this._cancelTransition();
     this.reload.setAttribute("displaystop", "true");
   },
 
-  switchToReload: function (aDelay) {
+  switchToReload: function(aDelay) {
     if (!this._initialized)
       return;
 
     this.reload.removeAttribute("displaystop");
 
     if (!aDelay || this._stopClicked) {
       this._stopClicked = false;
       this._cancelTransition();
@@ -4762,37 +4761,37 @@ var CombinedStopReload = {
     }
 
     if (this._timer)
       return;
 
     // Temporarily disable the reload button to prevent the user from
     // accidentally reloading the page when intending to click the stop button
     this.reload.disabled = true;
-    this._timer = setTimeout(function (self) {
+    this._timer = setTimeout(function(self) {
       self._timer = 0;
       self.reload.disabled = XULBrowserWindow.reloadCommand
                                              .getAttribute("disabled") == "true";
     }, 650, this);
   },
 
-  _cancelTransition: function () {
+  _cancelTransition: function() {
     if (this._timer) {
       clearTimeout(this._timer);
       this._timer = 0;
     }
   }
 };
 
 var TabsProgressListener = {
   // Keep track of which browsers we've started load timers for, since
   // we won't see STATE_START events for pre-rendered tabs.
   _startedLoadTimer: new WeakSet(),
 
-  onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
     // Collect telemetry data about tab load times.
     if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) {
       if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
         if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
           this._startedLoadTimer.add(aBrowser);
           TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
           Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
         } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
@@ -4836,18 +4835,18 @@ var TabsProgressListener = {
         aBrowser.removeEventListener("click", BrowserOnClick, true);
         aBrowser.removeEventListener("pagehide", onPageHide, true);
         if (event.target.documentElement)
           event.target.documentElement.removeAttribute("hasBrowserHandlers");
       }, true);
     }
   },
 
-  onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
-                              aFlags) {
+  onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
+                             aFlags) {
     // Filter out location changes caused by anchor navigation
     // or history.push/pop/replaceState.
     if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
       // Reader mode actually cares about these:
       let mm = gBrowser.selectedBrowser.messageManager;
       mm.sendAsyncMessage("Reader:PushState", {isArticle: gBrowser.selectedBrowser.isArticle});
       return;
     }
@@ -4875,19 +4874,19 @@ var TabsProgressListener = {
 }
 
 function nsBrowserAccess() { }
 
 nsBrowserAccess.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]),
 
   _openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
-                             aIsExternal, aForceNotRemote=false,
-                             aUserContextId=Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
-                             aOpener=null) {
+                             aIsExternal, aForceNotRemote = false,
+                             aUserContextId = Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
+                             aOpener = null) {
     let win, needToFocusWin;
 
     // try the current window.  if we're in a popup, fall back on the most recent browser window
     if (window.toolbar.visible)
       win = window;
     else {
       win = RecentWindow.getMostRecentBrowserWindow({private: aIsPrivate});
       needToFocusWin = true;
@@ -4918,17 +4917,17 @@ nsBrowserAccess.prototype = {
     let browser = win.gBrowser.getBrowserForTab(tab);
 
     if (needToFocusWin || (!loadInBackground && aIsExternal))
       win.focus();
 
     return browser;
   },
 
-  openURI: function (aURI, aOpener, aWhere, aFlags) {
+  openURI: function(aURI, aOpener, aWhere, aFlags) {
     // This function should only ever be called if we're opening a URI
     // from a non-remote browser window (via nsContentTreeOwner).
     if (aOpener && Cu.isCrossProcessWrapper(aOpener)) {
       Cu.reportError("nsBrowserAccess.openURI was passed a CPOW for aOpener. " +
                      "openURI should only ever be called from non-remote browsers.");
       throw Cr.NS_ERROR_FAILURE;
     }
 
@@ -5032,17 +5031,17 @@ nsBrowserAccess.prototype = {
                                         isExternal, false,
                                         userContextId);
     if (browser)
       return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
 
     return null;
   },
 
-  isTabContentWindow: function (aWindow) {
+  isTabContentWindow: function(aWindow) {
     return gBrowser.browsers.some(browser => browser.contentWindow == aWindow);
   },
 
   canClose() {
     return CanCloseWindow();
   },
 }
 
@@ -5054,17 +5053,17 @@ function getTogglableToolbars() {
 }
 
 function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
   var popup = aEvent.target;
   if (popup != aEvent.currentTarget)
     return;
 
   // Empty the menu
-  for (var i = popup.childNodes.length-1; i >= 0; --i) {
+  for (var i = popup.childNodes.length - 1; i >= 0; --i) {
     var deadItem = popup.childNodes[i];
     if (deadItem.hasAttribute("toolbarId"))
       popup.removeChild(deadItem);
   }
 
   var firstMenuItem = aInsertPoint || popup.firstChild;
 
   let toolbarNodes = getTogglableToolbars();
@@ -5149,17 +5148,17 @@ function onViewToolbarsPopupShowing(aEve
 }
 
 function onViewToolbarCommand(aEvent) {
   var toolbarId = aEvent.originalTarget.getAttribute("toolbarId");
   var isVisible = aEvent.originalTarget.getAttribute("checked") == "true";
   CustomizableUI.setToolbarVisibility(toolbarId, isVisible);
 }
 
-function setToolbarVisibility(toolbar, isVisible, persist=true) {
+function setToolbarVisibility(toolbar, isVisible, persist = true) {
   let hidingAttribute;
   if (toolbar.getAttribute("type") == "menubar") {
     hidingAttribute = "autohide";
     if (AppConstants.platform == "linux") {
       Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", !isVisible);
     }
   } else {
     hidingAttribute = "collapsed";
@@ -5248,39 +5247,39 @@ var gTabletModePageCounter = {
 function displaySecurityInfo()
 {
   BrowserPageInfo(null, "securityTab");
 }
 
 
 var gHomeButton = {
   prefDomain: "browser.startup.homepage",
-  observe: function (aSubject, aTopic, aPrefName)
+  observe: function(aSubject, aTopic, aPrefName)
   {
     if (aTopic != "nsPref:changed" || aPrefName != this.prefDomain)
       return;
 
     this.updateTooltip();
   },
 
-  updateTooltip: function (homeButton)
+  updateTooltip: function(homeButton)
   {
     if (!homeButton)
       homeButton = document.getElementById("home-button");
     if (homeButton) {
       var homePage = this.getHomePage();
       homePage = homePage.replace(/\|/g, ', ');
       if (homePage.toLowerCase() == "about:home")
         homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
       else
         homeButton.setAttribute("tooltiptext", homePage);
     }
   },
 
-  getHomePage: function ()
+  getHomePage: function()
   {
     var url;
     try {
       url = gPrefService.getComplexValue(this.prefDomain,
                                 Components.interfaces.nsIPrefLocalizedString).data;
     } catch (e) {
     }
 
@@ -5771,42 +5770,42 @@ var gPageStyleMenu = {
    * @param browser (optional)
    *        The <xul:browser> to search for stylesheets. If omitted, this
    *        defaults to the currently selected tab's browser.
    * @returns Array
    *        An Array of Objects representing stylesheets in the browser.
    *        See the documentation for gPageStyleMenu for a description
    *        of the Object structure.
    */
-  getBrowserStyleSheets: function (browser) {
+  getBrowserStyleSheets: function(browser) {
     if (!browser) {
       browser = gBrowser.selectedBrowser;
     }
 
     let data = this._pageStyleSheets.get(browser.permanentKey);
     if (!data) {
       return [];
     }
     return data.filteredStyleSheets;
   },
 
-  _getStyleSheetInfo: function (browser) {
+  _getStyleSheetInfo: function(browser) {
     let data = this._pageStyleSheets.get(browser.permanentKey);
     if (!data) {
       return {
         filteredStyleSheets: [],
         authorStyleDisabled: false,
         preferredStyleSheetSet: true
       };
     }
 
     return data;
   },
 
-  fillPopup: function (menuPopup) {
+  fillPopup: function(menuPopup) {
     let styleSheetInfo = this._getStyleSheetInfo(gBrowser.selectedBrowser);
     var noStyle = menuPopup.firstChild;
     var persistentOnly = noStyle.nextSibling;
     var sep = persistentOnly.nextSibling;
     while (sep.nextSibling)
       menuPopup.removeChild(sep.nextSibling);
 
     let styleSheets = styleSheetInfo.filteredStyleSheets;
@@ -5840,22 +5839,22 @@ var gPageStyleMenu = {
     }
 
     noStyle.setAttribute("checked", styleDisabled);
     persistentOnly.setAttribute("checked", !altStyleSelected && !styleDisabled);
     persistentOnly.hidden = styleSheetInfo.preferredStyleSheetSet ? haveAltSheets : false;
     sep.hidden = (noStyle.hidden && persistentOnly.hidden) || !haveAltSheets;
   },
 
-  switchStyleSheet: function (title) {
+  switchStyleSheet: function(title) {
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.sendAsyncMessage("PageStyle:Switch", {title: title});
   },
 
-  disableStyle: function () {
+  disableStyle: function() {
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.sendAsyncMessage("PageStyle:Disable");
   },
 };
 
 /* Legacy global page-style functions */
 var stylesheetFillPopup = gPageStyleMenu.fillPopup.bind(gPageStyleMenu);
 function stylesheetSwitchAll(contentWindow, title) {
@@ -5878,77 +5877,77 @@ var LanguageDetectionListener = {
   }
 };
 
 
 var BrowserOffline = {
   _inited: false,
 
   // BrowserOffline Public Methods
-  init: function ()
+  init: function()
   {
     if (!this._uiElement)
       this._uiElement = document.getElementById("workOfflineMenuitemState");
 
     Services.obs.addObserver(this, "network:offline-status-changed", false);
 
     this._updateOfflineUI(Services.io.offline);
 
     this._inited = true;
   },
 
-  uninit: function ()
+  uninit: function()
   {
     if (this._inited) {
       Services.obs.removeObserver(this, "network:offline-status-changed");
     }
   },
 
-  toggleOfflineStatus: function ()
+  toggleOfflineStatus: function()
   {
     var ioService = Services.io;
 
     if (!ioService.offline && !this._canGoOffline()) {
       this._updateOfflineUI(false);
       return;
     }
 
     ioService.offline = !ioService.offline;
   },
 
   // nsIObserver
-  observe: function (aSubject, aTopic, aState)
+  observe: function(aSubject, aTopic, aState)
   {
     if (aTopic != "network:offline-status-changed")
       return;
 
     // This notification is also received because of a loss in connectivity,
     // which we ignore by updating the UI to the current value of io.offline
     this._updateOfflineUI(Services.io.offline);
   },
 
   // BrowserOffline Implementation Methods
-  _canGoOffline: function ()
+  _canGoOffline: function()
   {
     try {
       var cancelGoOffline = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
       Services.obs.notifyObservers(cancelGoOffline, "offline-requested", null);
 
       // Something aborted the quit process.
       if (cancelGoOffline.data)
         return false;
     }
     catch (ex) {
     }
 
     return true;
   },
 
   _uiElement: null,
-  _updateOfflineUI: function (aOffline)
+  _updateOfflineUI: function(aOffline)
   {
     var offlineLocked = gPrefService.prefIsLocked("network.online");
     if (offlineLocked)
       this._uiElement.setAttribute("disabled", "true");
 
     this._uiElement.setAttribute("checked", aOffline);
   }
 };
@@ -6029,27 +6028,27 @@ var OfflineApps = {
       notification.options.controlledItems.push([
         Cu.getWeakReference(browser), docId, uri
       ]);
     } else {
       let mainAction = {
         label: gNavigatorBundle.getString("offlineApps.allow"),
         accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
         callback: function() {
-          for (let [browser, docId, uri] of notification.options.controlledItems) {
-            OfflineApps.allowSite(browser, docId, uri);
+          for (let [ciBrowser, ciDocId, ciUri] of notification.options.controlledItems) {
+            OfflineApps.allowSite(ciBrowser, ciDocId, ciUri);
           }
         }
       };
       let secondaryActions = [{
         label: gNavigatorBundle.getString("offlineApps.never"),
         accessKey: gNavigatorBundle.getString("offlineApps.neverAccessKey"),
         callback: function() {
-          for (let [, , uri] of notification.options.controlledItems) {
-            OfflineApps.disallowSite(uri);
+          for (let [, , ciUri] of notification.options.controlledItems) {
+            OfflineApps.disallowSite(ciUri);
           }
         }
       }];
       let message = gNavigatorBundle.getFormattedString("offlineApps.available",
                                                         [host]);
       let anchorID = "indexedDB-notification-icon";
       let options = {
         controlledItems : [[Cu.getWeakReference(browser), docId, uri]]
@@ -6323,53 +6322,53 @@ function warnAboutClosingWindow() {
   // OS X doesn't quit the application when the last window is closed, but keeps
   // the session alive. Hence don't prompt users to save tabs, but warn about
   // closing multiple tabs.
   return AppConstants.platform != "macosx"
          || (isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL));
 }
 
 var MailIntegration = {
-  sendLinkForBrowser: function (aBrowser) {
+  sendLinkForBrowser: function(aBrowser) {
     this.sendMessage(aBrowser.currentURI.spec, aBrowser.contentTitle);
   },
 
-  sendMessage: function (aBody, aSubject) {
+  sendMessage: function(aBody, aSubject) {
     // generate a mailto url based on the url and the url's title
     var mailtoUrl = "mailto:";
     if (aBody) {
       mailtoUrl += "?body=" + encodeURIComponent(aBody);
       mailtoUrl += "&subject=" + encodeURIComponent(aSubject);
     }
 
     var uri = makeURI(mailtoUrl);
 
     // now pass this uri to the operating system
     this._launchExternalUrl(uri);
   },
 
   // a generic method which can be used to pass arbitrary urls to the operating
   // system.
   // aURL --> a nsIURI which represents the url to launch
-  _launchExternalUrl: function (aURL) {
+  _launchExternalUrl: function(aURL) {
     var extProtocolSvc =
        Cc["@mozilla.org/uriloader/external-protocol-service;1"]
          .getService(Ci.nsIExternalProtocolService);
     if (extProtocolSvc)
       extProtocolSvc.loadUrl(aURL);
   }
 };
 
 function BrowserOpenAddonsMgr(aView) {
   return new Promise(resolve => {
     if (aView) {
       let emWindow;
       let browserWindow;
 
-      var receivePong = function receivePong(aSubject, aTopic, aData) {
+      var receivePong = function(aSubject, aTopic, aData) {
         let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIWebNavigation)
                                  .QueryInterface(Ci.nsIDocShellTreeItem)
                                  .rootTreeItem
                                  .QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIDOMWindow);
         if (!emWindow || browserWin == window /* favor the current window */) {
           emWindow = aSubject;
@@ -6646,107 +6645,107 @@ var gIdentityHandler = {
   get _hasInsecureLoginForms() {
     // checks if the page has been flagged for an insecure login. Also checks
     // if the pref to degrade the UI is set to true
     return LoginManagerParent.hasInsecureLoginForms(gBrowser.selectedBrowser) &&
            Services.prefs.getBoolPref("security.insecure_password.ui.enabled");
   },
 
   // smart getters
-  get _identityPopup () {
+  get _identityPopup() {
     delete this._identityPopup;
     return this._identityPopup = document.getElementById("identity-popup");
   },
-  get _identityBox () {
+  get _identityBox() {
     delete this._identityBox;
     return this._identityBox = document.getElementById("identity-box");
   },
-  get _identityPopupMultiView () {
+  get _identityPopupMultiView() {
     delete _identityPopupMultiView;
     return document.getElementById("identity-popup-multiView");
   },
-  get _identityPopupContentHosts () {
+  get _identityPopupContentHosts() {
     delete this._identityPopupContentHosts;
     let selector = ".identity-popup-headline.host";
     return this._identityPopupContentHosts = [
       ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
       ...document.querySelectorAll(selector)
     ];
   },
-  get _identityPopupContentHostless () {
+  get _identityPopupContentHostless() {
     delete this._identityPopupContentHostless;
     let selector = ".identity-popup-headline.hostless";
     return this._identityPopupContentHostless = [
       ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
       ...document.querySelectorAll(selector)
     ];
   },
-  get _identityPopupContentOwner () {
+  get _identityPopupContentOwner() {
     delete this._identityPopupContentOwner;
     return this._identityPopupContentOwner =
       document.getElementById("identity-popup-content-owner");
   },
-  get _identityPopupContentSupp () {
+  get _identityPopupContentSupp() {
     delete this._identityPopupContentSupp;
     return this._identityPopupContentSupp =
       document.getElementById("identity-popup-content-supplemental");
   },
-  get _identityPopupContentVerif () {
+  get _identityPopupContentVerif() {
     delete this._identityPopupContentVerif;
     return this._identityPopupContentVerif =
       document.getElementById("identity-popup-content-verifier");
   },
-  get _identityPopupMixedContentLearnMore () {
+  get _identityPopupMixedContentLearnMore() {
     delete this._identityPopupMixedContentLearnMore;
     return this._identityPopupMixedContentLearnMore =
       document.getElementById("identity-popup-mcb-learn-more");
   },
-  get _identityPopupInsecureLoginFormsLearnMore () {
+  get _identityPopupInsecureLoginFormsLearnMore() {
     delete this._identityPopupInsecureLoginFormsLearnMore;
     return this._identityPopupInsecureLoginFormsLearnMore =
       document.getElementById("identity-popup-insecure-login-forms-learn-more");
   },
-  get _identityIconLabels () {
+  get _identityIconLabels() {
     delete this._identityIconLabels;
     return this._identityIconLabels = document.getElementById("identity-icon-labels");
   },
-  get _identityIconLabel () {
+  get _identityIconLabel() {
     delete this._identityIconLabel;
     return this._identityIconLabel = document.getElementById("identity-icon-label");
   },
-  get _connectionIcon () {
+  get _connectionIcon() {
     delete this._connectionIcon;
     return this._connectionIcon = document.getElementById("connection-icon");
   },
-  get _overrideService () {
+  get _overrideService() {
     delete this._overrideService;
     return this._overrideService = Cc["@mozilla.org/security/certoverride;1"]
                                      .getService(Ci.nsICertOverrideService);
   },
-  get _identityIconCountryLabel () {
+  get _identityIconCountryLabel() {
     delete this._identityIconCountryLabel;
     return this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
   },
-  get _identityIcon () {
+  get _identityIcon() {
     delete this._identityIcon;
     return this._identityIcon = document.getElementById("identity-icon");
   },
-  get _permissionList () {
+  get _permissionList() {
     delete this._permissionList;
     return this._permissionList = document.getElementById("identity-popup-permission-list");
   },
   get _permissionEmptyHint() {
     delete this._permissionEmptyHint;
     return this._permissionEmptyHint = document.getElementById("identity-popup-permission-empty-hint");
   },
-  get _permissionReloadHint () {
+  get _permissionReloadHint() {
     delete this._permissionReloadHint;
     return this._permissionReloadHint = document.getElementById("identity-popup-permission-reload-hint");
   },
-  get _permissionAnchors () {
+  get _permissionAnchors() {
     delete this._permissionAnchors;
     let permissionAnchors = {};
     for (let anchor of document.getElementById("blocked-permissions-container").children) {
       permissionAnchors[anchor.getAttribute("data-permission-id")] = anchor;
     }
     return this._permissionAnchors = permissionAnchors;
   },
 
@@ -7088,17 +7087,17 @@ var gIdentityHandler = {
       if (this._uri.port > 0) {
         port = this._uri.port;
       }
     } catch (e) {}
 
     let buttons = [{
       label: gNavigatorBundle.getString("revokeOverride.label"),
       accessKey: gNavigatorBundle.getString("revokeOverride.accesskey"),
-      callback: function (aNotification, aButton) {
+      callback: function(aNotification, aButton) {
         try {
           let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"]
                                      .getService(Ci.nsIWeakCryptoOverride);
           weakCryptoOverride.removeWeakCryptoOverride(host, port,
             PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser));
           BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
         } catch (e) {
           Cu.reportError(e);
@@ -7339,52 +7338,52 @@ var gIdentityHandler = {
   },
 
   observe(subject, topic, data) {
     if (topic == "perm-changed") {
       this.refreshIdentityBlock();
     }
   },
 
-  onDragStart: function (event) {
+  onDragStart: function(event) {
     if (gURLBar.getAttribute("pageproxystate") != "valid")
       return;
 
     let value = gBrowser.currentURI.spec;
     let urlString = value + "\n" + gBrowser.contentTitle;
     let htmlString = "<a href=\"" + value + "\">" + value + "</a>";
 
     let dt = event.dataTransfer;
     dt.setData("text/x-moz-url", urlString);
     dt.setData("text/uri-list", value);
     dt.setData("text/plain", value);
     dt.setData("text/html", htmlString);
     dt.setDragImage(this._identityIcon, 16, 16);
   },
 
-  onLocationChange: function () {
+  onLocationChange: function() {
     this._permissionJustRemoved = false;
     this.updatePermissionHint();
   },
 
-  updatePermissionHint: function () {
+  updatePermissionHint: function() {
     if (!this._permissionList.hasChildNodes() && !this._permissionJustRemoved) {
       this._permissionEmptyHint.removeAttribute("hidden");
     } else {
       this._permissionEmptyHint.setAttribute("hidden", "true");
     }
 
     if (this._permissionJustRemoved) {
       this._permissionReloadHint.removeAttribute("hidden");
     } else {
       this._permissionReloadHint.setAttribute("hidden", "true");
     }
   },
 
-  updateSitePermissions: function () {
+  updateSitePermissions: function() {
     while (this._permissionList.hasChildNodes())
       this._permissionList.removeChild(this._permissionList.lastChild);
 
     let uri = gBrowser.currentURI;
 
     let permissions = SitePermissions.getPermissionDetailsByURI(uri);
     if (this._sharingState) {
       // If WebRTC device or screen permissions are in use, we need to find
@@ -7427,17 +7426,17 @@ var gIdentityHandler = {
       heightAfter = parseInt(heightAfter) +
                     parseInt(getComputedStyle(this._permissionList.nextSibling).height);
     }
     let heightChange = parseInt(heightAfter) - parseInt(heightBefore);
     if (heightChange)
       this._identityPopupMultiView.setHeightToFit(heightChange);
   },
 
-  _createPermissionItem: function (aPermission) {
+  _createPermissionItem: function(aPermission) {
     let container = document.createElement("hbox");
     container.setAttribute("class", "identity-popup-permission-item");
     container.setAttribute("align", "center");
 
     let img = document.createElement("image");
     let classes = "identity-popup-permission-icon " + aPermission.id + "-icon";
     if (aPermission.state == SitePermissions.BLOCK)
       classes += " blocked-permission-icon";
@@ -7637,17 +7636,17 @@ var gRemoteTabsUI = {
  *          If set to "whenComparingAndReplace", the fragment will be replaced.
  *        - 'ignoreQueryString' boolean property to be set to true to exclude query string
  *        matching when comparing URIs.
  *        - 'replaceQueryString' boolean property to be set to true to exclude query string
  *        matching when comparing URIs and overwrite the initial query string with
  *        the one from the new URI.
  * @return True if an existing tab was found, false otherwise
  */
-function switchToTabHavingURI(aURI, aOpenNew, aOpenParams={}) {
+function switchToTabHavingURI(aURI, aOpenNew, aOpenParams = {}) {
   // Certain URLs can be switched to irrespective of the source or destination
   // window being in private browsing mode:
   const kPrivateBrowsingWhitelist = new Set([
     "about:addons",
   ]);
 
   let ignoreFragment = aOpenParams.ignoreFragment;
   let ignoreQueryString = aOpenParams.ignoreQueryString;
@@ -7737,25 +7736,25 @@ function switchToTabHavingURI(aURI, aOpe
     else
       openUILinkIn(aURI.spec, "tab", aOpenParams);
   }
 
   return false;
 }
 
 var RestoreLastSessionObserver = {
-  init: function () {
+  init: function() {
     if (SessionStore.canRestoreLastSession &&
         !PrivateBrowsingUtils.isWindowPrivate(window)) {
       Services.obs.addObserver(this, "sessionstore-last-session-cleared", true);
       goSetCommandEnabled("Browser:RestoreLastSession", true);
     }
   },
 
-  observe: function () {
+  observe: function() {
     // The last session can only be restored once so there's
     // no way we need to re-enable our menu item.
     Services.obs.removeObserver(this, "sessionstore-last-session-cleared");
     goSetCommandEnabled("Browser:RestoreLastSession", false);
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference])
@@ -7956,45 +7955,45 @@ var MousePosTracker = {
   _listeners: new Set(),
   _x: 0,
   _y: 0,
   get _windowUtils() {
     delete this._windowUtils;
     return this._windowUtils = window.getInterface(Ci.nsIDOMWindowUtils);
   },
 
-  addListener: function (listener) {
+  addListener: function(listener) {
     if (this._listeners.has(listener))
       return;
 
     listener._hover = false;
     this._listeners.add(listener);
 
     this._callListener(listener);
   },
 
-  removeListener: function (listener) {
+  removeListener: function(listener) {
     this._listeners.delete(listener);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     var fullZoom = this._windowUtils.fullZoom;
     this._x = event.screenX / fullZoom - window.mozInnerScreenX;
     this._y = event.screenY / fullZoom - window.mozInnerScreenY;
 
-    this._listeners.forEach(function (listener) {
+    this._listeners.forEach(function(listener) {
       try {
         this._callListener(listener);
       } catch (e) {
         Cu.reportError(e);
       }
     }, this);
   },
 
-  _callListener: function (listener) {
+  _callListener: function(listener) {
     let rect = listener.getMouseTargetRect();
     let hover = this._x >= rect.left &&
                 this._x <= rect.right &&
                 this._y >= rect.top &&
                 this._y <= rect.bottom;
 
     if (hover == listener._hover)
       return;
@@ -8006,58 +8005,58 @@ var MousePosTracker = {
         listener.onMouseEnter();
     } else if (listener.onMouseLeave) {
       listener.onMouseLeave();
     }
   }
 };
 
 var ToolbarIconColor = {
-  init: function () {
+  init: function() {
     this._initialized = true;
 
     window.addEventListener("activate", this);
     window.addEventListener("deactivate", this);
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
 
     // If the window isn't active now, we assume that it has never been active
     // before and will soon become active such that inferFromText will be
     // called from the initial activate event.
     if (Services.focus.activeWindow == window)
       this.inferFromText();
   },
 
-  uninit: function () {
+  uninit: function() {
     this._initialized = false;
 
     window.removeEventListener("activate", this);
     window.removeEventListener("deactivate", this);
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "activate":
       case "deactivate":
         this.inferFromText();
         break;
     }
   },
 
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "lightweight-theme-styling-update":
         // inferFromText needs to run after LightweightThemeConsumer.jsm's
         // lightweight-theme-styling-update observer.
         setTimeout(() => { this.inferFromText(); }, 0);
         break;
     }
   },
 
-  inferFromText: function () {
+  inferFromText: function() {
     if (!this._initialized)
       return;
 
     function parseRGB(aColorString) {
       let rgb = aColorString.match(/^rgba?\((\d+), (\d+), (\d+)/);
       rgb.shift();
       return rgb.map(x => parseInt(x));
     }
@@ -8112,17 +8111,17 @@ var PanicButtonNotifier = {
   },
   close: function() {
     let popup = document.getElementById("panic-button-success-notification");
     popup.hidePopup();
   },
 };
 
 var AboutPrivateBrowsingListener = {
-  init: function () {
+  init: function() {
     window.messageManager.addMessageListener(
       "AboutPrivateBrowsing:OpenPrivateWindow",
       msg => {
         OpenBrowserWindow({private: true});
     });
     window.messageManager.addMessageListener(
       "AboutPrivateBrowsing:ToggleTrackingProtection",
       msg => {
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -78,17 +78,17 @@ addEventListener("pageshow", function(ev
 });
 addEventListener("DOMAutoComplete", function(event) {
   LoginManagerContent.onUsernameInput(event);
 });
 addEventListener("blur", function(event) {
   LoginManagerContent.onUsernameInput(event);
 });
 
-var handleContentContextMenu = function (event) {
+var handleContentContextMenu = function(event) {
   let defaultPrevented = event.defaultPrevented;
   if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
     let plugin = null;
     try {
       plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
     } catch (e) {}
     if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
       // Don't open a context menu for plugins.
@@ -355,17 +355,17 @@ var AboutNetAndCertErrorListener = {
       this.onOverride(aEvent);
       break;
     case "AboutNetErrorResetPreferences":
       this.onResetPreferences(aEvent);
       break;
     }
   },
 
-  changedCertPrefs: function () {
+  changedCertPrefs: function() {
     for (let prefName of PREF_SSL_IMPACT) {
       if (Services.prefs.prefHasUserValue(prefName)) {
         return true;
       }
     }
 
     return false;
   },
@@ -514,44 +514,44 @@ var ClickEventHandler = {
     }
 
     // This might be middle mouse navigation.
     if (event.button == 1) {
       sendAsyncMessage("Content:Click", json);
     }
   },
 
-  onCertError: function (targetElement, ownerDoc) {
+  onCertError: function(targetElement, ownerDoc) {
     let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
                                        .getInterface(Ci.nsIWebNavigation)
                                        .QueryInterface(Ci.nsIDocShell);
     sendAsyncMessage("Browser:CertExceptionError", {
       location: ownerDoc.location.href,
       elementId: targetElement.getAttribute("id"),
       isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView),
       securityInfoAsString: getSerializedSecurityInfo(docShell),
     });
   },
 
-  onAboutBlocked: function (targetElement, ownerDoc) {
+  onAboutBlocked: function(targetElement, ownerDoc) {
     var reason = 'phishing';
     if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
       reason = 'malware';
     } else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) {
       reason = 'unwanted';
     }
     sendAsyncMessage("Browser:SiteBlockedError", {
       location: ownerDoc.location.href,
       reason: reason,
       elementId: targetElement.getAttribute("id"),
       isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView)
     });
   },
 
-  onAboutNetError: function (event, documentURI) {
+  onAboutNetError: function(event, documentURI) {
     let elmId = event.originalTarget.getAttribute("id");
     if (elmId == "returnButton") {
       sendAsyncMessage("Browser:SSLErrorGoBack", {});
       return;
     }
     if (elmId != "errorTryAgain" || !/e=netOffline/.test(documentURI)) {
       return;
     }
@@ -678,17 +678,17 @@ var PageMetadataMessenger = {
         sendAsyncMessage("PageMetadata:MicroformatsResult", result);
         break;
       }
     }
   }
 }
 PageMetadataMessenger.init();
 
-addEventListener("ActivateSocialFeature", function (aEvent) {
+addEventListener("ActivateSocialFeature", function(aEvent) {
   let document = content.document;
   let dwu = content.QueryInterface(Ci.nsIInterfaceRequestor)
                    .getInterface(Ci.nsIDOMWindowUtils);
   if (!dwu.isHandlingUserInput) {
     Cu.reportError("attempt to activate provider without user input from " + document.nodePrincipal.origin);
     return;
   }
 
@@ -830,17 +830,17 @@ addMessageListener("ContextMenu:SearchFi
 
     let type = el.type.toLowerCase();
 
     if (((el instanceof content.HTMLInputElement && el.mozIsTextField(true)) ||
         type == "hidden" || type == "textarea") ||
         ((type == "checkbox" || type == "radio") && el.checked)) {
       formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
     } else if (el instanceof content.HTMLSelectElement && el.selectedIndex >= 0) {
-      for (let j=0; j < el.options.length; j++) {
+      for (let j = 0; j < el.options.length; j++) {
         if (el.options[j].selected)
           formData.push(escapeNameValuePair(el.name, el.options[j].value,
                                             isURLEncoded));
       }
     }
   }
 
   let postData;
@@ -868,17 +868,17 @@ var LightWeightThemeWebInstallListener =
   _previewWindow: null,
 
   init: function() {
     addEventListener("InstallBrowserTheme", this, false, true);
     addEventListener("PreviewBrowserTheme", this, false, true);
     addEventListener("ResetBrowserThemePreview", this, false, true);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "InstallBrowserTheme": {
         sendAsyncMessage("LightWeightThemeWebInstaller:Install", {
           baseURI: event.target.baseURI,
           themeData: event.target.getAttribute("data-browsertheme"),
         });
         break;
       }
@@ -902,17 +902,17 @@ var LightWeightThemeWebInstallListener =
                            {baseURI: event.target.baseURI});
           this._resetPreviewWindow();
         }
         break;
       }
     }
   },
 
-  _resetPreviewWindow: function () {
+  _resetPreviewWindow: function() {
     this._previewWindow.removeEventListener("pagehide", this, true);
     this._previewWindow = null;
   }
 };
 
 LightWeightThemeWebInstallListener.init();
 
 function disableSetDesktopBackground(aTarget) {
@@ -1142,18 +1142,18 @@ var PageInfoListener = {
   getMediaItems: function(document, strings, elem)
   {
     // Check for images defined in CSS (e.g. background, borders)
     let computedStyle = elem.ownerGlobal.getComputedStyle(elem);
     // A node can have multiple media items associated with it - for example,
     // multiple background images.
     let mediaItems = [];
 
-    let addImage = (url, type, alt, elem, isBg) => {
-      let element = this.serializeElementInfo(document, url, type, alt, elem, isBg);
+    let addImage = (url, type, alt, el, isBg) => {
+      let element = this.serializeElementInfo(document, url, type, alt, el, isBg);
       mediaItems.push([url, type, alt, element, isBg]);
     };
 
     if (computedStyle) {
       let addImgFunc = (label, val) => {
         if (val.primitiveType == content.CSSPrimitiveValue.CSS_URI) {
           addImage(val.getStringValue(), label, strings.notSet, elem, true);
         }
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
 "use strict";
 
-this.ContentSearchUIController = (function () {
+this.ContentSearchUIController = (function() {
 
 const MAX_DISPLAYED_SUGGESTIONS = 6;
 const SUGGESTION_ID_PREFIX = "searchSuggestion";
 const ONE_OFF_ID_PREFIX = "oneOff";
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 
 /**
@@ -33,17 +33,17 @@ const HTML_NS = "http://www.w3.org/1999/
  *        This will be sent with the search data for FHR to record the search.
  * @param searchPurpose
  *        Sent with search data, see nsISearchEngine.getSubmission.
  * @param idPrefix
  *        The IDs of elements created by the object will be prefixed with this
  *        string.
  */
 function ContentSearchUIController(inputElement, tableParent, healthReportKey,
-                                   searchPurpose, idPrefix="") {
+                                   searchPurpose, idPrefix = "") {
   this.input = inputElement;
   this._idPrefix = idPrefix;
   this._healthReportKey = healthReportKey;
   this._searchPurpose = searchPurpose;
 
   let tableID = idPrefix + "searchSuggestionTable";
   this.input.autocomplete = "off";
   this.input.setAttribute("aria-autocomplete", "true");
@@ -188,52 +188,52 @@ ContentSearchUIController.prototype = {
     }
     return this.defaultEngine.name;
   },
 
   get numSuggestions() {
     return this._suggestionsList.children.length;
   },
 
-  selectAndUpdateInput: function (idx) {
+  selectAndUpdateInput: function(idx) {
     this.selectedIndex = idx;
     let newValue = this.suggestionAtIndex(idx) || this._stickyInputValue;
     // Setting the input value when the value has not changed commits the current
     // IME composition, which we don't want to do.
     if (this.input.value != newValue) {
       this.input.value = newValue;
     }
     this._updateSearchWithHeader();
   },
 
-  suggestionAtIndex: function (idx) {
+  suggestionAtIndex: function(idx) {
     let row = this._suggestionsList.children[idx];
     return row ? row.textContent : null;
   },
 
-  deleteSuggestionAtIndex: function (idx) {
+  deleteSuggestionAtIndex: function(idx) {
     // Only form history suggestions can be deleted.
     if (this.isFormHistorySuggestionAtIndex(idx)) {
       let suggestionStr = this.suggestionAtIndex(idx);
       this._sendMsg("RemoveFormHistoryEntry", suggestionStr);
       this._suggestionsList.children[idx].remove();
       this.selectAndUpdateInput(-1);
     }
   },
 
-  isFormHistorySuggestionAtIndex: function (idx) {
+  isFormHistorySuggestionAtIndex: function(idx) {
     let row = this._suggestionsList.children[idx];
     return row && row.classList.contains("formHistory");
   },
 
-  addInputValueToFormHistory: function () {
+  addInputValueToFormHistory: function() {
     this._sendMsg("AddFormHistoryEntry", this.input.value);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     this["_on" + event.type[0].toUpperCase() + event.type.substr(1)](event);
   },
 
   _onCommand: function(aEvent) {
     if (this.selectedButtonIndex == this._oneOffButtons.length) {
       // Settings button was selected.
       this._sendMsg("ManageEngines");
       return;
@@ -241,17 +241,17 @@ ContentSearchUIController.prototype = {
 
     this.search(aEvent);
 
     if (aEvent) {
       aEvent.preventDefault();
     }
   },
 
-  search: function (aEvent) {
+  search: function(aEvent) {
     if (!this.defaultEngine) {
       return; // Not initialized yet.
     }
 
     let searchText = this.input;
     let searchTerms;
     if (this._table.hidden ||
         aEvent.originalTarget.id == "contentSearchDefaultEngineHeader" ||
@@ -290,30 +290,30 @@ ContentSearchUIController.prototype = {
         eventData.selection.kind = "key";
       }
     }
 
     this._sendMsg("Search", eventData);
     this.addInputValueToFormHistory();
   },
 
-  _onInput: function () {
+  _onInput: function() {
     if (!this.input.value) {
       this._stickyInputValue = "";
       this._hideSuggestions();
     }
     else if (this.input.value != this._stickyInputValue) {
       // Only fetch new suggestions if the input value has changed.
       this._getSuggestions();
       this.selectAndUpdateInput(-1);
     }
     this._updateSearchWithHeader();
   },
 
-  _onKeypress: function (event) {
+  _onKeypress: function(event) {
     let selectedIndexDelta = 0;
     let selectedSuggestionDelta = 0;
     let selectedOneOffDelta = 0;
 
     switch (event.keyCode) {
     case event.DOM_VK_UP:
       if (this._table.hidden) {
         return;
@@ -450,92 +450,92 @@ ContentSearchUIController.prototype = {
       this.selectedButtonIndex = newSelectedIndex;
     }
 
     // Prevent the input's caret from moving.
     event.preventDefault();
   },
 
   _currentEngineIndex: -1,
-  _cycleCurrentEngine: function (aReverse) {
+  _cycleCurrentEngine: function(aReverse) {
     if ((this._currentEngineIndex == this._engines.length - 1 && !aReverse) ||
         (this._currentEngineIndex == 0 && aReverse)) {