Merge mozilla-central to inbound. a=merge CLOSED TREE
authorshindli <shindli@mozilla.com>
Tue, 20 Nov 2018 23:50:05 +0200
changeset 503844 7720051470685844a99bc96d95e1e86d21041f1d
parent 503843 e62a7d9b6d0cd12f26bfde01d8875417ee137925 (current diff)
parent 503772 8991d660f20e3eea652e060c30e17670b45a9257 (diff)
child 503845 31766e8403ad17eb5b384c52750cbb49d1327e2e
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to inbound. a=merge CLOSED TREE
browser/base/content/test/urlbar/browser_urlbarHighlightSearchAlias.js
browser/components/customizableui/content/toolbar.xml
js/src/.clang-format
--- a/.clang-format
+++ b/.clang-format
@@ -1,22 +1,23 @@
 BasedOnStyle: Google
 
 # Prevent the loss of indentation with these macros
 MacroBlockBegin: "^\
+JS_BEGIN_MACRO|\
 NS_INTERFACE_MAP_BEGIN|\
 NS_INTERFACE_TABLE_HEAD|\
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION|\
 NS_IMPL_CYCLE_COLLECTION_.*_BEGIN|\
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED|\
 NS_INTERFACE_TABLE_BEGIN|\
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED|\
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED$"
 MacroBlockEnd: "^\
+JS_END_MACRO|\
 NS_INTERFACE_MAP_END|\
 NS_IMPL_CYCLE_COLLECTION_.*_END|\
 NS_INTERFACE_TABLE_END|\
 NS_INTERFACE_MAP_END_INHERITING|\
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END_INHERITED|\
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED$"
 
 SortIncludes: false
-
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -726,23 +726,22 @@ function getTextFromClipboard() {
   trans.init(getLoadContext());
   if (!trans)
     return "";
 
   trans.addDataFlavor("text/unicode");
   Services.clipboard.getData(trans, Services.clipboard.kGlobalClipboard);
 
   var str = {};
-  var strLength = {};
-  trans.getTransferData("text/unicode", str, strLength);
+  trans.getTransferData("text/unicode", str);
 
   if (str)
     str = str.value.QueryInterface(Ci.nsISupportsString);
   if (str)
-    return str.data.substring(0, strLength.value / 2);
+    return str.data;
 
   return "";
 }
 
 /**
  * Extract DOMNode id from an accessible. If e10s is enabled, DOMNode is not
  * present in parent process but, if available, DOMNode id is attached to an
  * accessible object.
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -320,16 +320,17 @@ window:not([chromehidden~="toolbar"]) #n
 }
 
 #personal-bookmarks {
   -moz-window-dragging: inherit;
 }
 
 toolbarpaletteitem {
   -moz-window-dragging: no-drag;
+  -moz-box-pack: start;
 }
 
 .titlebar-buttonbox-container {
   -moz-box-ordinal-group: 1000;
 }
 
 %ifdef XP_MACOSX
 #titlebar-fullscreen-button {
@@ -1255,52 +1256,39 @@ toolbarpaletteitem[dragover] {
   flex-shrink: 0;
   flex-wrap: wrap;
 }
 
 #customization-toolbar-visibility-button > .box-inherit > .button-menu-dropmarker {
   display: -moz-box;
 }
 
-toolbarpaletteitem {
-  -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbarpaletteitem");
-}
-
 toolbarpaletteitem[place="palette"] {
   -moz-box-orient: vertical;
   width: 7em;
+  max-width: 7em;
   /* icon (16) + margin (9 + 12) + 3 lines of text: */
   height: calc(39px + 3em);
   margin-bottom: 5px;
   margin-inline-end: 24px;
   overflow: visible;
   display: inline-block;
   vertical-align: top;
 }
 
-toolbarpaletteitem:not([place="palette"]) > .toolbarpaletteitem-label,
 toolbarpaletteitem[place="palette"][hidden] {
   display: none;
 }
 
-.toolbarpaletteitem-box {
+toolbarpaletteitem > toolbarbutton,
+toolbarpaletteitem > toolbaritem {
   /* Prevent children from getting events */
   pointer-events: none;
 }
 
-toolbarpaletteitem[place="palette"] > .toolbarpaletteitem-box {
-  -moz-box-pack: center;
-  width: 7em;
-  max-width: 7em;
-}
-
-toolbarpaletteitem:not([place="palette"]) > .toolbarpaletteitem-box {
-  -moz-box-flex: 1;
-}
-
 #main-window[customizing=true] .addon-banner-item,
 #main-window[customizing=true] .panel-banner-item {
   display: none;
 }
 
 /* UI Tour */
 
 @keyframes uitour-wobble {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -130,16 +130,18 @@ XPCOMUtils.defineLazyScriptGetter(this, 
                                          "DownloadsSummary", "DownloadsFooter",
                                          "DownloadsBlockedSubview"],
                                   "chrome://browser/content/downloads/downloads.js");
 XPCOMUtils.defineLazyScriptGetter(this, ["DownloadsButton",
                                          "DownloadsIndicatorView"],
                                   "chrome://browser/content/downloads/indicator.js");
 XPCOMUtils.defineLazyScriptGetter(this, "gEditItemOverlay",
                                   "chrome://browser/content/places/editBookmark.js");
+XPCOMUtils.defineLazyScriptGetter(this, "SearchOneOffs",
+                                  "chrome://browser/content/search/search-one-offs.js");
 if (AppConstants.NIGHTLY_BUILD) {
   XPCOMUtils.defineLazyScriptGetter(this, "gWebRender",
                                     "chrome://browser/content/browser-webrender.js");
 }
 
 // lazy service getters
 
 XPCOMUtils.defineLazyServiceGetters(this, {
@@ -2499,22 +2501,21 @@ function readFromClipboard() {
 
     // If available, use selection clipboard, otherwise global one
     if (Services.clipboard.supportsSelectionClipboard())
       Services.clipboard.getData(trans, Services.clipboard.kSelectionClipboard);
     else
       Services.clipboard.getData(trans, Services.clipboard.kGlobalClipboard);
 
     var data = {};
-    var dataLen = {};
-    trans.getTransferData("text/unicode", data, dataLen);
+    trans.getTransferData("text/unicode", data);
 
     if (data) {
       data = data.value.QueryInterface(Ci.nsISupportsString);
-      url = data.data.substring(0, dataLen.value / 2);
+      url = data.data;
     }
   } catch (ex) {
   }
 
   return url;
 }
 
 /**
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -84,17 +84,16 @@
 
 <script type="application/javascript"
 #ifdef BROWSER_XHTML
 xmlns="http://www.w3.org/1999/xhtml"
 #endif
 >
   Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
   Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
-  Services.scriptloader.loadSubScript("chrome://browser/content/search/search-one-offs.js", this);
 
   window.onload = gBrowserInit.onLoad.bind(gBrowserInit);
   window.onunload = gBrowserInit.onUnload.bind(gBrowserInit);
   window.onclose = WindowIsClosing;
 
 #ifdef BROWSER_XHTML
   window.addEventListener("readystatechange", () => {
     // We initially hide the window to prevent layouts during parse. This lets us
--- a/browser/base/content/test/general/browser_alltabslistener.js
+++ b/browser/base/content/test/general/browser_alltabslistener.js
@@ -148,52 +148,56 @@ function runTest(browser, url, next) {
 
 function startTest1() {
   info("\nTest 1");
   gBrowser.addProgressListener(gFrontProgressListener);
   gBrowser.addTabsProgressListener(gAllProgressListener);
 
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = gAllNotifications;
   runTest(gForegroundBrowser, "http://example.org" + gTestPage, startTest2);
 }
 
 function startTest2() {
   info("\nTest 2");
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = gAllNotifications;
   runTest(gForegroundBrowser, "https://example.com" + gTestPage, startTest3);
 }
 
 function startTest3() {
   info("\nTest 3");
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = [];
   runTest(gBackgroundBrowser, "http://example.org" + gTestPage, startTest4);
 }
 
 function startTest4() {
   info("\nTest 4");
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = [];
   runTest(gBackgroundBrowser, "https://example.com" + gTestPage, startTest5);
 }
 
@@ -204,28 +208,30 @@ function startTest5() {
   [gForegroundTab, gBackgroundTab] = [gBackgroundTab, gForegroundTab];
   // Avoid the onLocationChange this will fire
   gBrowser.removeProgressListener(gFrontProgressListener);
   gBrowser.selectedTab = gForegroundTab;
   gBrowser.addProgressListener(gFrontProgressListener);
 
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = gAllNotifications;
   runTest(gForegroundBrowser, "http://example.org" + gTestPage, startTest6);
 }
 
 function startTest6() {
   info("\nTest 6");
   gAllNotifications = [
     "onStateChange",
+    "onSecurityChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
   gFrontNotifications = [];
   runTest(gBackgroundBrowser, "http://example.org" + gTestPage, finishTest);
 }
 
--- a/browser/base/content/test/performance/browser_preferences_usage.js
+++ b/browser/base/content/test/performance/browser_preferences_usage.js
@@ -184,29 +184,29 @@ add_task(async function navigate_around(
       min: 100,
       max: 110,
     },
     "network.loadinfo.skip_type_assertion": {
       // This is accessed in debug only.
     },
     "security.insecure_connection_icon.pbmode.enabled": {
       min: 20,
-      max: 30,
+      max: 60,
     },
     "security.insecure_connection_icon.enabled": {
       min: 20,
-      max: 30,
+      max: 60,
     },
     "security.insecure_connection_text.enabled": {
       min: 20,
-      max: 30,
+      max: 60,
     },
     "security.insecure_connection_text.pbmode.enabled": {
       min: 20,
-      max: 30,
+      max: 60,
     },
     "toolkit.cosmeticAnimations.enabled": {
       min: 45,
       max: 55,
     },
   };
 
   Services.prefs.resetStats();
--- a/browser/base/content/test/siteIdentity/browser_ignore_same_page_navigation.js
+++ b/browser/base/content/test/siteIdentity/browser_ignore_same_page_navigation.js
@@ -26,16 +26,16 @@ add_task(async function() {
     };
     browser.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_ALL);
 
     let uri = getRootDirectory(gTestPath).replace("chrome://mochitests/content",
                                                   "https://example.com") + "dummy_page.html";
     BrowserTestUtils.loadURI(browser, uri);
     await BrowserTestUtils.browserLoaded(browser, false, uri);
     is(onLocationChangeCount, 1, "should have 1 onLocationChange event");
-    is(onSecurityChangeCount, 1, "should have 1 onSecurityChange event");
+    is(onSecurityChangeCount, 2, "should have 2 onSecurityChange event");
     await ContentTask.spawn(browser, null, async () => {
       content.history.pushState({}, "", "https://example.com");
     });
     is(onLocationChangeCount, 2, "should have 2 onLocationChange events");
-    is(onSecurityChangeCount, 1, "should still have only 1 onSecurityChange event");
+    is(onSecurityChangeCount, 2, "should still have only 2 onSecurityChange event");
   });
 });
--- a/browser/base/content/test/trackingUI/browser_trackingUI_animation_2.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_animation_2.js
@@ -6,16 +6,18 @@
 
 const TP_PREF = "privacy.trackingprotection.enabled";
 const TP_PB_PREF = "privacy.trackingprotection.enabled";
 const NCB_PREF = "network.cookie.cookieBehavior";
 const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
 const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
 const COOKIE_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/cookiePage.html";
 
+requestLongerTimeout(2);
+
 registerCleanupFunction(function() {
   UrlClassifierTestUtils.cleanupTestTrackers();
   Services.prefs.clearUserPref(TP_PREF);
   Services.prefs.clearUserPref(TP_PB_PREF);
   Services.prefs.clearUserPref(NCB_PREF);
   Services.prefs.clearUserPref(ContentBlocking.prefIntroCount);
 });
 
@@ -78,36 +80,36 @@ async function testTrackingProtectionAni
   securityChanged = waitForSecurityChange(tabbrowser);
   tabbrowser.selectedTab = trackingCookiesTab;
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
 
   info("Reload tracking cookies tab");
-  securityChanged = waitForSecurityChange(tabbrowser, 2);
+  securityChanged = waitForSecurityChange(tabbrowser, 4);
   tabbrowser.reload();
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(ContentBlocking.iconBox.hasAttribute("animate"), "iconBox animating");
   await BrowserTestUtils.waitForEvent(ContentBlocking.animatedIcon, "animationend");
 
   info("Reload tracking tab");
-  securityChanged = waitForSecurityChange(tabbrowser, 3);
+  securityChanged = waitForSecurityChange(tabbrowser, 5);
   tabbrowser.selectedTab = trackingTab;
   tabbrowser.reload();
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(ContentBlocking.iconBox.hasAttribute("animate"), "iconBox animating");
   await BrowserTestUtils.waitForEvent(ContentBlocking.animatedIcon, "animationend");
 
   info("Inject tracking cookie inside tracking tab");
-  securityChanged = waitForSecurityChange(tabbrowser);
+  securityChanged = waitForSecurityChange(tabbrowser, 2);
   await ContentTask.spawn(tabbrowser.selectedBrowser, {},
                           function() {
     content.postMessage("cookie", "*");
   });
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
@@ -121,28 +123,28 @@ async function testTrackingProtectionAni
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
 
   tabbrowser.selectedTab = trackingCookiesTab;
 
   info("Inject tracking cookie inside tracking cookies tab");
-  securityChanged = waitForSecurityChange(tabbrowser);
+  securityChanged = waitForSecurityChange(tabbrowser, 2);
   await ContentTask.spawn(tabbrowser.selectedBrowser, {},
                           function() {
     content.postMessage("cookie", "*");
   });
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
 
   info("Inject tracking element inside tracking cookies tab");
-  securityChanged = waitForSecurityChange(tabbrowser);
+  securityChanged = waitForSecurityChange(tabbrowser, 2);
   await ContentTask.spawn(tabbrowser.selectedBrowser, {},
                           function() {
     content.postMessage("tracking", "*");
   });
   await securityChanged;
 
   ok(ContentBlocking.iconBox.hasAttribute("active"), "iconBox active");
   ok(!ContentBlocking.iconBox.hasAttribute("animate"), "iconBox not animating");
--- a/browser/base/content/test/trackingUI/browser_trackingUI_telemetry.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_telemetry.js
@@ -46,17 +46,17 @@ add_task(async function setup() {
 add_task(async function testShieldHistogram() {
   Services.prefs.setBoolPref(PREF, true);
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   // Reset these to make counting easier
   getShieldHistogram().clear();
 
   await promiseTabLoadEvent(tab, BENIGN_PAGE);
-  is(getShieldCounts()[0], 1, "Page loads without tracking");
+  is(getShieldCounts()[0], 2, "Page loads without tracking");
 
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
   // Note that right now the shield histogram is not measuring what
   // you might think.  Since onSecurityChange fires twice for a tracking page,
   // the total page loads count is double counting, and the shield count
   // (which is meant to measure times when the shield wasn't shown) fires even
   // when tracking elements exist on the page.
   todo_is(getShieldCounts()[0], 1, "FIXME: TOTAL PAGE LOADS WITHOUT TRACKING IS DOUBLE COUNTING");
--- a/browser/base/content/test/trackingUI/browser_trackingUI_trackers_subview.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_trackers_subview.js
@@ -13,25 +13,24 @@ add_task(async function setup() {
 
 function openIdentityPopup() {
   let mainView = document.getElementById("identity-popup-mainView");
   let viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
   gIdentityHandler._identityBox.click();
   return viewShown;
 }
 
-function waitForSecurityChange(blocked) {
+function waitForSecurityChange(counter) {
   return new Promise(resolve => {
     let webProgressListener = {
       onStateChange: () => {},
       onStatusChange: () => {},
       onLocationChange: () => {},
       onSecurityChange: (webProgress, request, oldState, state) => {
-        if ((!blocked && state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT) ||
-            (blocked && state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT)) {
+        if (--counter == 0) {
           gBrowser.removeProgressListener(webProgressListener);
           resolve();
         }
       },
       onProgressChange: () => {},
       QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener]),
     };
 
@@ -63,17 +62,17 @@ async function assertSitesListed(blocked
     let mainView = document.getElementById("identity-popup-mainView");
     viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
     let backButton = trackersView.querySelector(".subviewbutton-back");
     backButton.click();
     await viewShown;
 
     ok(true, "Main view was shown");
 
-    let change = waitForSecurityChange(blocked);
+    let change = waitForSecurityChange(2);
 
     await ContentTask.spawn(browser, {}, function() {
       content.postMessage("more-tracking", "*");
     });
 
     await change;
 
     viewShown = BrowserTestUtils.waitForEvent(trackersView, "ViewShown");
--- a/browser/base/content/test/urlbar/browser.ini
+++ b/browser/base/content/test/urlbar/browser.ini
@@ -91,17 +91,16 @@ support-files =
 [browser_urlbarDecode.js]
 [browser_urlbarDelete.js]
 [browser_urlbarEnter.js]
 [browser_urlbar_whereToOpen.js]
 [browser_urlbarEnterAfterMouseOver.js]
 skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
 [browser_urlbarFocusedCmdK.js]
 [browser_urlbarHashChangeProxyState.js]
-[browser_urlbarHighlightSearchAlias.js]
 [browser_urlbarKeepStateAcrossTabSwitches.js]
 [browser_urlbarOneOffs.js]
 support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
 [browser_urlbarOneOffs_searchSuggestions.js]
 support-files =
   searchSuggestionEngine.xml
@@ -128,16 +127,17 @@ support-files =
 support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
 [browser_urlbarSearchTelemetry.js]
 support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
 [browser_urlbarStop.js]
+[browser_urlbarTokenAlias.js]
 [browser_urlbarUpdateForDomainCompletion.js]
 [browser_urlbar_autoFill_backspaced.js]
 [browser_urlbar_canonize_on_autofill.js]
 [browser_urlbar_blanking.js]
 support-files =
   file_blank_but_not_blank.html
 [browser_urlbar_locationchange_urlbar_edit_dos.js]
 support-files =
--- a/browser/base/content/test/urlbar/browser_page_action_menu_clipboard.js
+++ b/browser/base/content/test/urlbar/browser_page_action_menu_clipboard.js
@@ -23,14 +23,14 @@ add_task(async function copyURL() {
     // Check the clipboard.
     let transferable = Cc["@mozilla.org/widget/transferable;1"]
                          .createInstance(Ci.nsITransferable);
     transferable.init(null);
     let flavor = "text/unicode";
     transferable.addDataFlavor(flavor);
     Services.clipboard.getData(transferable, Services.clipboard.kGlobalClipboard);
     let strObj = {};
-    transferable.getTransferData(flavor, strObj, {});
+    transferable.getTransferData(flavor, strObj);
     Assert.ok(!!strObj.value);
     strObj.value.QueryInterface(Ci.nsISupportsString);
     Assert.equal(strObj.value.data, gBrowser.selectedBrowser.currentURI.spec);
   });
 });
rename from browser/base/content/test/urlbar/browser_urlbarHighlightSearchAlias.js
rename to browser/base/content/test/urlbar/browser_urlbarTokenAlias.js
--- a/browser/base/content/test/urlbar/browser_urlbarHighlightSearchAlias.js
+++ b/browser/base/content/test/urlbar/browser_urlbarTokenAlias.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// This test checks the urlbar.highlightSearchAlias() function.
+// This test checks "@" search engine aliases ("token aliases") in the urlbar.
 
 "use strict";
 
 const ALIAS = "@test";
 
 add_task(async function init() {
   Services.search.addEngineWithDetails("Test", {
     alias: ALIAS,
@@ -203,16 +203,53 @@ add_task(async function nonTokenAlias() 
 
   EventUtils.synthesizeKey("KEY_Escape");
   await promisePopupHidden(gURLBar.popup);
 
   engine.alias = ALIAS;
 });
 
 
+// Clicking on an @ alias in the popup should fill it in the urlbar input.
+add_task(async function clickAndFillAlias() {
+  // Do a search for "@" to show all the @ aliases.
+  gURLBar.search("@");
+  await promiseSearchComplete();
+
+  // Find our test engine in the results.  It's probably last, but for test
+  // robustness don't assume it is.
+  let testEngineItem;
+  for (let i = 0; !testEngineItem; i++) {
+    let item = await waitForAutocompleteResultAt(i);
+    let action = PlacesUtils.parseActionUrl(item.getAttribute("url"));
+    if (action && action.params.alias == ALIAS) {
+      testEngineItem = item;
+    }
+  }
+
+  // Click it.
+  let hiddenPromise = promisePopupHidden(gURLBar.popup);
+  EventUtils.synthesizeMouseAtCenter(testEngineItem, {});
+
+  // The popup will close and then open again with the new search string, which
+  // should be the test alias.
+  await hiddenPromise;
+  await promiseSearchComplete();
+  await promisePopupShown(gURLBar.popup);
+  assertAlias(true);
+
+  // The urlbar input value should be the alias followed by a space so that it's
+  // ready for the user to start typing.
+  Assert.equal(gURLBar.textValue, `${ALIAS} `);
+
+  EventUtils.synthesizeKey("KEY_Escape");
+  await promisePopupHidden(gURLBar.popup);
+});
+
+
 async function doSimpleTest(revertBetweenSteps) {
   // When autofill is enabled, searching for "@tes" will autofill to "@test",
   // which gets in the way of this test task, so temporarily disable it.
   Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref("browser.urlbar.autoFill");
   });
 
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -762,16 +762,27 @@ file, You can obtain one at http://mozil
                 // open in the current tab.
                 where = "current";
                 break;
               case "searchengine":
                 if (selectedOneOff && selectedOneOff.engine) {
                   // Replace the engine with the selected one-off engine.
                   action.params.engineName = selectedOneOff.engine.name;
                 }
+                // If the selected result is an @alias offer -- an @alias with
+                // an empty query string -- then instead of loading the engine's
+                // empty search results page, put the @alias in the input so
+                // that the user can type a search query and search directly
+                // from the urlbar.
+                if (action.params.alias &&
+                    action.params.alias.startsWith("@") &&
+                    !action.params.searchQuery) {
+                  this.search(action.params.input);
+                  return;
+                }
                 const actionDetails = {
                   isSuggestion: !!action.params.searchSuggestion,
                   alias: action.params.alias,
                 };
                 [url, postData] = this._parseAndRecordSearchEngineLoad(
                   action.params.engineName,
                   action.params.searchSuggestion || action.params.searchQuery,
                   event,
--- a/browser/components/customizableui/content/jar.mn
+++ b/browser/components/customizableui/content/jar.mn
@@ -1,8 +1,6 @@
 # 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/.
 
 browser.jar:
   content/browser/customizableui/panelUI.js
-  content/browser/customizableui/toolbar.xml
-
deleted file mode 100644
--- a/browser/components/customizableui/content/toolbar.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<bindings id="browserToolbarBindings"
-          xmlns="http://www.mozilla.org/xbl"
-          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-          xmlns:xbl="http://www.mozilla.org/xbl">
-  <binding id="toolbarpaletteitem">
-    <content>
-      <xul:hbox class="toolbarpaletteitem-box">
-        <children/>
-      </xul:hbox>
-      <xul:label class="toolbarpaletteitem-label" xbl:inherits="xbl:text=title"/>
-    </content>
-  </binding>
-</bindings>
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -960,17 +960,17 @@ PlacesController.prototype = {
     let action = {};
     let actionOwner;
     try {
       let xferable = Cc["@mozilla.org/widget/transferable;1"].
                      createInstance(Ci.nsITransferable);
       xferable.init(null);
       xferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_PLACE_ACTION);
       this.clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard);
-      xferable.getTransferData(PlacesUtils.TYPE_X_MOZ_PLACE_ACTION, action, {});
+      xferable.getTransferData(PlacesUtils.TYPE_X_MOZ_PLACE_ACTION, action);
       [action, actionOwner] =
         action.value.QueryInterface(Ci.nsISupportsString).data.split(",");
     } catch (ex) {
       // Paste from external sources don't have any associated action, just
       // fallback to a copy action.
       return "copy";
     }
     // For cuts also check who inited the action, since cuts across different
--- a/browser/extensions/mortar/host/common/ppapi-runtime.jsm
+++ b/browser/extensions/mortar/host/common/ppapi-runtime.jsm
@@ -2613,18 +2613,17 @@ dump(`callFromJSON: < ${JSON.stringify(c
             PP_Flash_Clipboard_Format.PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT) {
           let trans = Cc["@mozilla.org/widget/transferable;1"]
             .createInstance(Ci.nsITransferable);
           trans.init(null)
           trans.addDataFlavor("text/unicode");
           Services.clipboard.getData(
             trans, Services.clipboard.kGlobalClipboard);
           let str = {};
-          let strLength = {};
-          trans.getTransferData("text/unicode", str, strLength);
+          trans.getTransferData("text/unicode", str);
           let pasteText = str.value.QueryInterface(Ci.nsISupportsString).data;
           return new String_PP_Var(pasteText);
         }
       }
       return new PP_Var();
     },
 
     /**
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -4,29 +4,26 @@
 
 # The removed-files.in file specifies files and directories to be removed during
 # an application update that are not automatically removed by the application
 # update process. The application update process handles the vast majority of
 # file and directory removals automatically so this file should not be used in
 # the vast majority of cases.
 
 # When to use removed-files.in file to remove files and directories:
-# * Files and directories located in the installation's "distribution/" and
-#   "extensions/" directories that were added before Firefox 27. Files and
-#   directories located in these directories were not included in the
-#   application update file removals for a complete update prior to Firefox 27.
 # * Empty directories that were accidentally added to the installation
 #   directory.
-# * Third party files and directories that were added to the installation
-#   directory. Under normal circumstances this should only be done after release
-#   drivers have approved the removal of these third party files.
+# * Files and directories that were added to the installation directory after
+#   the build was completed (typically third party files). Under normal
+#   circumstances this should only be done after release drivers have approved
+#   the removal of these third party files.
 
 # If you are not sure whether a file or directory should be removed using the
-# removed-files.in file please contact one of the developers that work on
-# application update.
+# removed-files.in file please contact a developer that works on application
+# update.
 
 # Note: the "distribution/" and "browser/extensions/" directories should never
 # be removed recursively since these directories are used by Partner builds and
 # custom installations.
 
 # To specify a file to be removed add the path to the file.
 # * If the file doesn't exist the update will succeed.
 # * If the file exists and can't be removed (e.g. the file is locked) the
@@ -50,17 +47,17 @@
 #   will succeed.
 # * If a file within the directory can't be removed the update will fail.
 #
 # Example: path/to/dir/*
 
 # Due to Apple Mac OS X packaging requirements files that are in the same
 # directory on other platforms must be located in different directories on
 # Mac OS X. The following defines allow specifying the Mac OS X bundle
-# location which will also work on other platforms.
+# location and will use an empty string on other platforms.
 #
 # @DIR_MACOS@
 # Equals Contents/MacOS/ on Mac OS X and is an empty string on other platforms.
 #
 # @DIR_RESOURCES@
 # Equals Contents/Resources/ on Mac OS X and is an empty string on other
 # platforms.
 
--- a/browser/themes/shared/customizableui/customizeMode.inc.css
+++ b/browser/themes/shared/customizableui/customizeMode.inc.css
@@ -249,23 +249,30 @@ toolbarpaletteitem[place="toolbar"]:not(
   outline: 1px dotted;
   -moz-outline-radius: 2.5px;
 }
 
 toolbarpaletteitem[place="toolbar"]:not([mousedown="true"]):-moz-focusring {
   outline-offset: -5px;
 }
 
+toolbarpaletteitem[place=palette]::after {
+  content: attr(title);
+  display: block;
+  text-align: center;
+}
+
 toolbarpaletteitem[place=palette] > toolbarspring {
   width: 7em;
   min-width: 7em;
   outline: 1px solid;
   outline-offset: -8px;
   opacity: .6;
-  height: 37px;
+  min-height: 37px;
+  max-height: 37px;
 }
 
 toolbarpaletteitem[place=toolbar] > toolbarspring {
   outline: 1px solid;
   outline-offset: -2px;
   opacity: .6;
   margin-top: 5px;
   margin-bottom: 5px;
@@ -275,20 +282,27 @@ toolbarpaletteitem[place=toolbar] > tool
   opacity: 1; /* To ensure these buttons always look enabled in customize mode */
 }
 
 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-reset-button,
 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-reset-button + separator {
   display: none;
 }
 
-#customization-palette > toolbarpaletteitem > label {
-  text-align: center;
-  margin-left: 0;
-  margin-right: 0;
+/* Squeeze together the multi-button toolbarpaletteitems: */
+#wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-out-button,
+#wrapper-edit-controls[place="palette"] > #edit-controls > #cut-button {
+  -moz-box-align: end;
+}
+#wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-in-button,
+#wrapper-edit-controls[place="palette"] > #edit-controls > #paste-button {
+  -moz-box-align: start;
+}
+#wrapper-edit-controls[place="palette"] > #edit-controls > #copy-button {
+  -moz-box-flex: 0;
 }
 
 #customization-uidensity-touch-spacer {
   border-top: 1px solid ThreeDLightShadow;
   margin: 0 -10px 10px;
 }
 
 #customization-uidensity-autotouchmode-checkbox {
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -1198,16 +1198,17 @@ toolbarpaletteitem[place="palette"] > .t
   padding-top: 6px;
   padding-bottom: 6px;
 }
 
 toolbarpaletteitem[place="palette"] > #search-container {
   min-width: 7em;
   width: 7em;
   min-height: 37px;
+  max-height: 37px;
 }
 
 .toolbaritem-combined-buttons@inAnyPanel@ > toolbarbutton {
   border: 0;
   margin: 0;
   -moz-box-flex: 1;
   padding-top: 4px;
   padding-bottom: 4px;
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_navigate.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_navigate.js
@@ -10,17 +10,18 @@
 
 const TAB_URL_1 = "data:text/html,<title>TAB1</title>";
 const TAB_URL_2 = "data:text/html,<title>TAB2</title>";
 
 add_task(async function() {
   info("Force all debug target panes to be expanded");
   prepareCollapsibilitiesTest();
 
-  const { document, tab } = await openAboutDebugging();
+  const { document, tab, window } = await openAboutDebugging();
+  const AboutDebugging = window.AboutDebugging;
 
   const connectSidebarItem = findSidebarItemByText("Connect", document);
   const connectLink = connectSidebarItem.querySelector(".js-sidebar-link");
   ok(connectSidebarItem, "Found the Connect sidebar item");
 
   const thisFirefoxSidebarItem = findSidebarItemByText("This Firefox", document);
   const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".js-sidebar-link");
   ok(thisFirefoxSidebarItem, "Found the ThisFirefox sidebar item");
@@ -28,16 +29,17 @@ add_task(async function() {
     "ThisFirefox sidebar item is selected by default");
 
   info("Open a new background tab TAB1");
   const backgroundTab1 = await addTab(TAB_URL_1, { background: true });
 
   info("Wait for the tab to appear in the debug targets with the correct name");
   await waitUntil(() => findDebugTargetByText("TAB1", document));
 
+  await waitForRequestsToSettle(AboutDebugging.store);
   info("Click on the Connect item in the sidebar");
   connectLink.click();
 
   info("Wait until Connect page is displayed");
   await waitUntil(() => document.querySelector(".js-connect-page"));
   ok(isSidebarItemSelected(connectSidebarItem), "Connect sidebar item is selected");
   ok(!document.querySelector(".js-runtime-page"), "Runtime page no longer rendered");
 
@@ -63,14 +65,16 @@ add_task(async function() {
   await waitUntil(() => !findDebugTargetByText("TAB1", document));
 
   info("Remove second background tab");
   await removeTab(backgroundTab2);
 
   info("Check TAB2 disappears, meaning ThisFirefox client is correctly connected");
   await waitUntil(() => !findDebugTargetByText("TAB2", document));
 
+  await waitForRequestsToSettle(AboutDebugging.store);
+
   await removeTab(tab);
 });
 
 function isSidebarItemSelected(item) {
   return item.classList.contains("js-sidebar-item-selected");
 }
--- a/devtools/client/aboutdebugging-new/test/browser/head.js
+++ b/devtools/client/aboutdebugging-new/test/browser/head.js
@@ -56,16 +56,52 @@ async function openAboutDebugging(page, 
     waitForDispatch(AboutDebugging.store, "REQUEST_EXTENSIONS_SUCCESS"),
     waitForDispatch(AboutDebugging.store, "REQUEST_TABS_SUCCESS"),
     waitForDispatch(AboutDebugging.store, "REQUEST_WORKERS_SUCCESS"),
   ]);
 
   return { tab, document, window };
 }
 
+/**
+ * Wait for all client requests to settle, meaning here that no new request has been
+ * dispatched after the provided delay.
+ */
+async function waitForRequestsToSettle(store, delay = 500) {
+  let hasSettled = false;
+
+  // After each iteration of this while loop, we check is the timerPromise had the time
+  // to resolve or if we captured a REQUEST_*_SUCCESS action before.
+  while (!hasSettled) {
+    let timer;
+
+    // This timer will be executed only if no REQUEST_*_SUCCESS action is dispatched
+    // during the delay. We consider that when no request are received for some time, it
+    // means there are no ongoing requests anymore.
+    const timerPromise = new Promise(resolve => {
+      timer = setTimeout(() => {
+        hasSettled = true;
+        resolve();
+      }, delay);
+    });
+
+    // Wait either for a REQUEST_*_SUCCESS to be dispatched, or for the timer to resolve.
+    await Promise.race([
+      waitForDispatch(store, "REQUEST_EXTENSIONS_SUCCESS"),
+      waitForDispatch(store, "REQUEST_TABS_SUCCESS"),
+      waitForDispatch(store, "REQUEST_WORKERS_SUCCESS"),
+      timerPromise,
+    ]);
+
+    // Clear the timer to avoid setting hasSettled to true accidently unless timerPromise
+    // was the first to resolve.
+    clearTimeout(timer);
+  }
+}
+
 function waitForDispatch(store, type) {
   return new Promise(resolve => {
     store.dispatch({
       type: "@@service/waitUntil",
       predicate: action => action.type === type,
       run: (dispatch, getState, action) => {
         resolve(action);
       },
--- a/devtools/client/shared/widgets/ShapesInContextEditor.js
+++ b/devtools/client/shared/widgets/ShapesInContextEditor.js
@@ -33,32 +33,52 @@ class ShapesInContextEditor {
     // when toggling the highlighter on the same node for different CSS properties.
     this.mode = null;
     // Reference to Rule view used to listen for changes
     this.ruleView = this.inspector.getPanel("ruleview").view;
     // Reference of |state| from HighlightersOverlay.
     this.state = state;
     // Reference to DOM node of the toggle icon for shapes highlighter.
     this.swatch = null;
-    // Reference to TextProperty where shape changes will be written.
-    this.textProperty = null;
 
     // Commit triggers expensive DOM changes in TextPropertyEditor.update()
     // so we debounce it.
     this.commit = debounce(this.commit, 200, this);
     this.onHighlighterEvent = this.onHighlighterEvent.bind(this);
     this.onNodeFrontChanged = this.onNodeFrontChanged.bind(this);
     this.onShapeValueUpdated = this.onShapeValueUpdated.bind(this);
     this.onRuleViewChanged = this.onRuleViewChanged.bind(this);
 
     this.highlighter.on("highlighter-event", this.onHighlighterEvent);
     this.ruleView.on("ruleview-changed", this.onRuleViewChanged);
   }
 
   /**
+   * Get the reference to the TextProperty where shape changes should be written.
+   *
+   * We can't rely on the TextProperty to be consistent while changing the value of an
+   * inline style because the fix for Bug 1467076 forces a full rebuild of TextProperties
+   * for the inline style's mock-CSS Rule in the Rule view.
+   *
+   * On |toggle()|, we store the target TextProperty index, property name and parent rule.
+   * Here, we use that index and property name to attempt to re-identify the correct
+   * TextProperty in the rule.
+   *
+   * @return {TextProperty|null}
+   */
+  get textProperty() {
+    if (!this.rule || !this.rule.textProps) {
+      return null;
+    }
+
+    const textProp = this.rule.textProps[this.textPropIndex];
+    return (textProp && textProp.name === this.textPropName) ? textProp : null;
+  }
+
+  /**
   * Called when the element style changes from the Rule view.
   * If the TextProperty we're acting on isn't enabled anymore or overridden,
   * turn off the shapes highlighter.
   */
   async onRuleViewChanged() {
     if (this.textProperty &&
       (!this.textProperty.enabled || this.textProperty.overridden)) {
       await this.hide();
@@ -85,17 +105,22 @@ class ShapesInContextEditor {
     }
 
     // Same target node, dfferent modes -> toggle between shape-outside and clip-path.
     // Hide highlighter for previous property, but continue and show for other property.
     if ((node == this.highlighterTargetNode) && (this.mode !== options.mode)) {
       await this.hide();
     }
 
-    this.textProperty = prop;
+    // Save the target TextProperty's parent rule, index and property name for later
+    // re-identification of the TextProperty. @see |get textProperty()|.
+    this.rule = prop.rule;
+    this.textPropIndex = this.rule.textProps.indexOf(prop);
+    this.textPropName = prop.name;
+
     this.findSwatch();
     await this.show(node, options);
   }
 
   /**
    * Show the shapes highlighter for the given element.
    *
    * @param {NodeFront} node
@@ -126,32 +151,38 @@ class ShapesInContextEditor {
     } catch (err) {
       // silent error
     }
 
     if (this.swatch) {
       this.swatch.classList.remove("active");
     }
     this.swatch = null;
-    this.textProperty = null;
+    this.rule = null;
+    this.textPropIndex = -1;
+    this.textPropName = null;
 
     this.emit("hide", { node: this.highlighterTargetNode });
     this.inspector.selection.off("detached-front", this.onNodeFrontChanged);
     this.inspector.selection.off("new-node-front", this.onNodeFrontChanged);
     this.ruleView.off("property-value-updated", this.onShapeValueUpdated);
     this.highlighterTargetNode = null;
   }
 
   /**
    * Identify the swatch (aka toggle icon) DOM node from the TextPropertyEditor of the
    * TextProperty we're working with. Whenever the TextPropertyEditor is updated (i.e.
    * when committing the shape value to the Rule view), it rebuilds its DOM and the old
    * swatch reference becomes invalid. Call this method to identify the current swatch.
    */
   findSwatch() {
+    if (!this.textProperty) {
+      return;
+    }
+
     const valueSpan = this.textProperty.editor.valueSpan;
     this.swatch = valueSpan.querySelector(".ruleview-shapeswatch");
     if (this.swatch) {
       this.swatch.classList.add("active");
     }
   }
 
   /**
@@ -244,21 +275,25 @@ class ShapesInContextEditor {
   }
 
   /**
   * Handler for "property-value-updated" event triggered by the Rule view.
   * Called after the shape value has been written to the element's style and the Rule
   * view updated. Emits an event on HighlightersOverlay that is expected by
   * tests in order to check if the shape value has been correctly applied.
   */
-  onShapeValueUpdated() {
-    // When TextPropertyEditor updates, it replaces the previous swatch DOM node.
-    // Find and store the new one.
-    this.findSwatch();
-    this.inspector.highlighters.emit("shapes-highlighter-changes-applied");
+  async onShapeValueUpdated() {
+    if (this.textProperty) {
+      // When TextPropertyEditor updates, it replaces the previous swatch DOM node.
+      // Find and store the new one.
+      this.findSwatch();
+      this.inspector.highlighters.emit("shapes-highlighter-changes-applied");
+    } else {
+      await this.hide();
+    }
   }
 
   /**
   * Preview a shape value on the element without committing the changes to the Rule view.
   *
   * @param {String} value
   *        The shape value to set the current property to
   */
--- a/devtools/client/themes/fonts.css
+++ b/devtools/client/themes/fonts.css
@@ -342,16 +342,17 @@
 }
 
 .font-value-slider-container::after {
   content: attr(data-max);
   right: .3em;
 }
 
 .font-value-slider {
+  background: transparent;
   width: 100%;
   margin: 0;
 }
 
 /*
   The value of font-weight goes from 100 to 900 in increments of 100.
   Decorate the slider for font-weight to have 9 vertical notches using a linear gradient.
 */
--- a/devtools/client/themes/layout.css
+++ b/devtools/client/themes/layout.css
@@ -107,16 +107,20 @@
   border-block-end: 1px solid var(--theme-splitter-color);
 }
 
 .flex-header-button-prev::before {
   background-image: url("chrome://devtools/skin/images/arrowhead-left.svg");
   background-size: 16px;
 }
 
+html[dir="rtl"] .flex-header-button-prev::before {
+  background-image: url("chrome://devtools/skin/images/arrowhead-right.svg");
+}
+
 .flex-header-content {
   display: flex;
   flex: 1;
   padding: 2px 0;
   padding-inline-start: 20px;
   -moz-user-select: none;
 }
 
@@ -193,23 +197,31 @@
   fill: var(--theme-comment);
   -moz-context-properties: fill;
   position: absolute;
   right: 7px;
   width: 16px;
   height: 16px;
 }
 
+html[dir="rtl"] .flex-item-list .devtools-button::after {
+  background-image: url(chrome://devtools/skin/images/arrowhead-left.svg);
+  right: unset;
+  left: 7px;
+}
+
 .flex-item-list .flex-item-index {
   font-size: 12px;
   font-weight: bold;
+  float: inline-start;
 }
 
 .flex-item-list .objectBox-node {
   padding-inline-start: 8px;
+  vertical-align: middle;
 }
 
 /**
  * Flex Item Selector
  */
 
 #flex-item-selector {
   background-position: right 4px center;
@@ -231,16 +243,21 @@
 
 /**
  * Flex Item Sizing Outline
  */
 
 .flex-outline-container {
   display: flex;
   justify-content: center;
+  /* The flex outline is always drawn in ltr. Whether the UI of DevTools is in RTL or some
+     other writing mode doesn't have an impact on whether the outline should face left,
+     right, top or bottom. This should only be dictated by which direction does the flex
+     item currently face in the page. */
+  direction: ltr;
 }
 
 .flex-outline {
   display: grid;
   margin: 2em 0;
   grid-auto-rows: 35px;
   flex-basis: 80%;
   max-width: 450px;
@@ -461,21 +478,25 @@
 
 .flex-item-sizing .section:first-child {
   border: 0;
 }
 
 .flex-item-sizing .name {
   font-weight: 600;
   grid-column: 1;
+  display: grid;
+  grid-template-columns: max-content max-content;
+  gap: .5em;
 }
 
 .flex-item-sizing .value {
   text-align: end;
   font-weight: 600;
+  direction: ltr;
 }
 
 .flex-item-sizing .value .unit {
   color: var(--theme-comment);
   font-weight: normal;
 }
 
 .flex-item-sizing .css-property-link {
--- a/devtools/client/webconsole/test/mochitest/browser_jsterm_screenshot_command_clipboard.js
+++ b/devtools/client/webconsole/test/mochitest/browser_jsterm_screenshot_command_clipboard.js
@@ -160,21 +160,19 @@ async function getImageSizeFromClipboard
   const trans = Cc["@mozilla.org/widget/transferable;1"]
                 .createInstance(Ci.nsITransferable);
   const flavor = "image/png";
   trans.init(null);
   trans.addDataFlavor(flavor);
 
   clip.getData(trans, clipid.kGlobalClipboard);
   const data = {};
-  const dataLength = {};
-  trans.getTransferData(flavor, data, dataLength);
+  trans.getTransferData(flavor, data);
 
   ok(data.value, "screenshot exists");
-  ok(dataLength.value > 0, "screenshot has length");
 
   let image = data.value;
 
   // Due to the differences in how images could be stored in the clipboard the
   // checks below are needed. The clipboard could already provide the image as
   // byte streams or as image container. If it's not possible obtain a
   // byte stream, the function throws.
 
--- a/devtools/shared/platform/clipboard.js
+++ b/devtools/shared/platform/clipboard.js
@@ -37,17 +37,17 @@ function getText() {
   // Get the data into our transferable.
   Services.clipboard.getData(
     xferable,
     Services.clipboard.kGlobalClipboard
   );
 
   const data = {};
   try {
-    xferable.getTransferData(flavor, data, {});
+    xferable.getTransferData(flavor, data);
   } catch (e) {
     // Clipboard doesn't contain data in flavor, return null.
     return null;
   }
 
   // There's no data available, return.
   if (!data.value) {
     return null;
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1494,16 +1494,24 @@ NS_IMETHODIMP
 nsDocShell::GetHasForeignCookiesBeenBlocked(bool* aHasForeignCookiesBeenBlocked)
 {
   nsCOMPtr<nsIDocument> doc(GetDocument());
   *aHasForeignCookiesBeenBlocked = doc && doc->GetHasForeignCookiesBlocked();
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDocShell::GetHasCookiesLoaded(bool* aHasCookiesLoaded)
+{
+  nsCOMPtr<nsIDocument> doc(GetDocument());
+  *aHasCookiesLoaded = doc && doc->GetHasCookiesLoaded();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsDocShell::GetAllowPlugins(bool* aAllowPlugins)
 {
   NS_ENSURE_ARG_POINTER(aAllowPlugins);
 
   *aAllowPlugins = mAllowPlugins;
   return NS_OK;
 }
 
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -644,16 +644,22 @@ interface nsIDocShell : nsIDocShellTreeI
    [infallible] readonly attribute boolean hasAllCookiesBeenBlocked;
 
    /**
    * This attribute determines whether a document seen cookies or storage
    * blocked due to cookie behavior settings blocking all third-party cookies.
    */
    [infallible] readonly attribute boolean hasForeignCookiesBeenBlocked;
 
+   /**
+   * This attribute determines whether a document seen cookies or storage
+   * attempts ever whether they've been allowed or blocked.
+   */
+   [infallible] readonly attribute boolean hasCookiesLoaded;
+
   /**
    * Disconnects this docshell's editor from its window, and stores the
    * editor data in the open document's session history entry.  This
    * should be called only during page transitions.
    */
   [noscript, notxpcom] void DetachEditorFromWindow();
 
   /**
--- a/dom/base/ContentBlockingLog.h
+++ b/dom/base/ContentBlockingLog.h
@@ -161,17 +161,18 @@ public:
 
     // Now add the sizes of each origin log queue.
     // The const_cast is needed because the nsTHashtable::Iterator interface is
     // not const-safe.  :-(
     for (auto iter = const_cast<OriginDataHashTable&>(mLog).Iter();
          !iter.Done(); iter.Next()) {
       if (iter.UserData()) {
         aSizes.mDOMOtherSize +=
-          iter.UserData()->second().ShallowSizeOfIncludingThis(aSizes.mState.mMallocSizeOf);
+          aSizes.mState.mMallocSizeOf(iter.UserData()) +
+          iter.UserData()->second().ShallowSizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
       }
     }
   }
 
 private:
   OriginDataHashTable mLog;
 };
 
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -539,26 +539,27 @@ Navigator::CookieEnabled()
 
   if (!codebaseURI) {
     // Not a codebase, so technically can't set cookies, but let's
     // just return the default value.
     return cookieEnabled;
   }
 
   uint32_t rejectedReason = 0;
-  if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(mWindow,
-                                                              codebaseURI,
-                                                              &rejectedReason)) {
-    return true;
-  }
+  bool granted =
+    AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(mWindow,
+                                                            codebaseURI,
+                                                            &rejectedReason);
 
-  if (rejectedReason) {
-    AntiTrackingCommon::NotifyRejection(mWindow, rejectedReason);
-  }
-  return false;
+  AntiTrackingCommon::NotifyBlockingDecision(mWindow,
+                                             granted ?
+                                               AntiTrackingCommon::BlockingDecision::eAllow :
+                                               AntiTrackingCommon::BlockingDecision::eBlock,
+                                             rejectedReason);
+  return granted;
 }
 
 bool
 Navigator::OnLine()
 {
   return !NS_IsOffline();
 }
 
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -225,48 +225,44 @@ CheckAndGetExtensionForMime(const nsCStr
 //    transferable with an nsIFile for the directory we are to
 //    save in. That has to be done by platform-specific code (in
 //    widget), which gets the destination directory from
 //    OS-specific drag information.
 //
 NS_IMETHODIMP
 nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
                                                  const char *aFlavor,
-                                                 nsISupports **aData,
-                                                 uint32_t *aDataLen)
+                                                 nsISupports **aData)
 {
-  NS_ENSURE_ARG_POINTER(aData && aDataLen);
+  NS_ENSURE_ARG_POINTER(aData);
   *aData = nullptr;
-  *aDataLen = 0;
 
   nsresult rv = NS_ERROR_NOT_IMPLEMENTED;
 
   if (strcmp(aFlavor, kFilePromiseMime) == 0) {
     // get the URI from the kFilePromiseURLMime flavor
     NS_ENSURE_ARG(aTransferable);
     nsCOMPtr<nsISupports> tmp;
-    uint32_t dataSize = 0;
-    aTransferable->GetTransferData(kFilePromiseURLMime,
-                                   getter_AddRefs(tmp), &dataSize);
+    aTransferable->GetTransferData(kFilePromiseURLMime, getter_AddRefs(tmp));
     nsCOMPtr<nsISupportsString> supportsString =
       do_QueryInterface(tmp);
     if (!supportsString)
       return NS_ERROR_FAILURE;
 
     nsAutoString sourceURLString;
     supportsString->GetData(sourceURLString);
     if (sourceURLString.IsEmpty())
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIURI> sourceURI;
     rv = NS_NewURI(getter_AddRefs(sourceURI), sourceURLString);
     NS_ENSURE_SUCCESS(rv, rv);
 
     aTransferable->GetTransferData(kFilePromiseDestFilename,
-                                   getter_AddRefs(tmp), &dataSize);
+                                   getter_AddRefs(tmp));
     supportsString = do_QueryInterface(tmp);
     if (!supportsString)
       return NS_ERROR_FAILURE;
 
     nsAutoString targetFilename;
     supportsString->GetData(targetFilename);
     if (targetFilename.IsEmpty())
       return NS_ERROR_FAILURE;
@@ -275,17 +271,17 @@ nsContentAreaDragDropDataProvider::GetFl
     // Use the image request's MIME type to ensure the filename's
     // extension is compatible with the OS's handler for this type.
     // If it isn't, or is missing, replace the extension with the
     // primary extension. On Mac, do this in the parent process
     // because sandboxing blocks access to MIME-handler info from
     // content processes.
     if (XRE_IsParentProcess()) {
       aTransferable->GetTransferData(kImageRequestMime,
-                                     getter_AddRefs(tmp), &dataSize);
+                                     getter_AddRefs(tmp));
       supportsString = do_QueryInterface(tmp);
       if (!supportsString)
         return NS_ERROR_FAILURE;
 
       nsAutoString imageRequestMime;
       supportsString->GetData(imageRequestMime);
 
       // If we have a MIME type, check the extension is compatible
@@ -323,19 +319,18 @@ nsContentAreaDragDropDataProvider::GetFl
     // make the filename safe for the filesystem
     targetFilename.ReplaceChar(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS,
                                '-');
 #endif /* defined(XP_MACOSX) */
 
     // get the target directory from the kFilePromiseDirectoryMime
     // flavor
     nsCOMPtr<nsISupports> dirPrimitive;
-    dataSize = 0;
     aTransferable->GetTransferData(kFilePromiseDirectoryMime,
-                                   getter_AddRefs(dirPrimitive), &dataSize);
+                                   getter_AddRefs(dirPrimitive));
     nsCOMPtr<nsIFile> destDirectory = do_QueryInterface(dirPrimitive);
     if (!destDirectory)
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsIFile> file;
     rv = destDirectory->Clone(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -343,17 +338,16 @@ nsContentAreaDragDropDataProvider::GetFl
 
     bool isPrivate = aTransferable->GetIsPrivateData();
 
     nsCOMPtr<nsIPrincipal> principal = aTransferable->GetRequestingPrincipal();
     rv = SaveURIToFile(sourceURI, principal, file, isPrivate);
     // send back an nsIFile
     if (NS_SUCCEEDED(rv)) {
       CallQueryInterface(file, aData);
-      *aDataLen = sizeof(nsIFile*);
     }
   }
 
   return rv;
 }
 
 DragDataProducer::DragDataProducer(nsPIDOMWindowOuter* aWindow,
                                    nsIContent* aTarget,
@@ -789,37 +783,32 @@ DragDataProducer::Produce(DataTransfer* 
     else {
       rv = nsCopySupport::GetTransferableForNode(nodeToSerialize, doc,
                                                  getter_AddRefs(transferable));
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsISupports> supports;
     nsCOMPtr<nsISupportsString> data;
-    uint32_t dataSize;
-    rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(supports),
-                                       &dataSize);
+    rv = transferable->GetTransferData(kHTMLMime, getter_AddRefs(supports));
     data = do_QueryInterface(supports);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mHtmlString);
     }
-    rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(supports),
-                                       &dataSize);
+    rv = transferable->GetTransferData(kHTMLContext, getter_AddRefs(supports));
     data = do_QueryInterface(supports);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mContextString);
     }
-    rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(supports),
-                                       &dataSize);
+    rv = transferable->GetTransferData(kHTMLInfo, getter_AddRefs(supports));
     data = do_QueryInterface(supports);
     if (NS_SUCCEEDED(rv)) {
       data->GetData(mInfoString);
     }
-    rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(supports),
-                                       &dataSize);
+    rv = transferable->GetTransferData(kUnicodeMime, getter_AddRefs(supports));
     data = do_QueryInterface(supports);
     NS_ENSURE_SUCCESS(rv, rv); // require plain text at a minimum
     data->GetData(mTitleString);
   }
 
   // default text value is the URL
   if (mTitleString.IsEmpty()) {
     mTitleString = mUrlString;
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7750,41 +7750,40 @@ nsContentUtils::IPCTransferableToTransfe
       nsCOMPtr<nsISupportsString> dataWrapper =
         do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
 
       const nsString& text = item.data().get_nsString();
       rv = dataWrapper->SetData(text);
       NS_ENSURE_SUCCESS(rv, rv);
 
-      rv = aTransferable->SetTransferData(item.flavor().get(), dataWrapper,
-                                  text.Length() * sizeof(char16_t));
+      rv = aTransferable->SetTransferData(item.flavor().get(), dataWrapper);
 
       NS_ENSURE_SUCCESS(rv, rv);
     } else if (item.data().type() == IPCDataTransferData::TShmem) {
       if (nsContentUtils::IsFlavorImage(item.flavor())) {
         nsCOMPtr<imgIContainer> imageContainer;
         rv = nsContentUtils::DataTransferItemToImage(item,
                                                      getter_AddRefs(imageContainer));
         NS_ENSURE_SUCCESS(rv, rv);
 
-        aTransferable->SetTransferData(item.flavor().get(), imageContainer, sizeof(nsISupports*));
+        aTransferable->SetTransferData(item.flavor().get(), imageContainer);
       } else {
         nsCOMPtr<nsISupportsCString> dataWrapper =
           do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
 
         // The buffer contains the terminating null.
         Shmem itemData = item.data().get_Shmem();
         const nsDependentCSubstring text(itemData.get<char>(),
                                          itemData.Size<char>());
         rv = dataWrapper->SetData(text);
         NS_ENSURE_SUCCESS(rv, rv);
 
-        rv = aTransferable->SetTransferData(item.flavor().get(), dataWrapper, text.Length());
+        rv = aTransferable->SetTransferData(item.flavor().get(), dataWrapper);
 
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
       if (aContentParent) {
         Unused << aContentParent->DeallocShmem(item.data().get_Shmem());
       } else if (aTabChild) {
         Unused << aTabChild->DeallocShmem(item.data().get_Shmem());
@@ -7989,18 +7988,17 @@ nsContentUtils::TransferableToIPCTransfe
 
     for (uint32_t j = 0; j < flavorList.Length(); ++j) {
       nsCString& flavorStr = flavorList[j];
       if (!flavorStr.Length()) {
         continue;
       }
 
       nsCOMPtr<nsISupports> data;
-      uint32_t dataLen = 0;
-      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(data), &dataLen);
+      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(data));
 
       nsCOMPtr<nsISupportsString> text = do_QueryInterface(data);
       nsCOMPtr<nsISupportsCString> ctext = do_QueryInterface(data);
       if (text) {
         nsAutoString dataAsString;
         text->GetData(dataAsString);
         IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
         item->flavor() = flavorStr;
@@ -8947,21 +8945,29 @@ nsContentUtils::StorageDisabledByAntiTra
                                               nsIChannel* aChannel,
                                               nsIPrincipal* aPrincipal,
                                               nsIURI* aURI)
 {
   uint32_t rejectedReason = 0;
   bool disabled =
     StorageDisabledByAntiTrackingInternal(aWindow, aChannel, aPrincipal, aURI,
                                           &rejectedReason);
-  if (disabled && sAntiTrackingControlCenterUIEnabled && rejectedReason) {
+  if (sAntiTrackingControlCenterUIEnabled) {
     if (aWindow) {
-      AntiTrackingCommon::NotifyRejection(aWindow, rejectedReason);
+      AntiTrackingCommon::NotifyBlockingDecision(aWindow,
+                                                 disabled ?
+                                                   AntiTrackingCommon::BlockingDecision::eBlock :
+                                                   AntiTrackingCommon::BlockingDecision::eAllow,
+                                                 rejectedReason);
     } else if (aChannel) {
-      AntiTrackingCommon::NotifyRejection(aChannel, rejectedReason);
+      AntiTrackingCommon::NotifyBlockingDecision(aChannel,
+                                                 disabled ?
+                                                   AntiTrackingCommon::BlockingDecision::eBlock :
+                                                   AntiTrackingCommon::BlockingDecision::eAllow,
+                                                 rejectedReason);
     }
   }
   return disabled;
 }
 
 // static, private
 nsContentUtils::StorageAccess
 nsContentUtils::InternalStorageAllowedForPrincipal(nsIPrincipal* aPrincipal,
--- a/dom/base/nsCopySupport.cpp
+++ b/dom/base/nsCopySupport.cpp
@@ -410,18 +410,17 @@ nsCopySupport::ImageCopy(nsIImageLoading
     NS_ENSURE_TRUE(image, NS_ERROR_FAILURE);
 
 #ifdef XP_WIN
     rv = AppendImagePromise(trans, imgRequest, aImageElement);
     NS_ENSURE_SUCCESS(rv, rv);
 #endif
 
     // copy the image data onto the transferable
-    rv = trans->SetTransferData(kNativeImageMime, image,
-                                sizeof(nsISupports*));
+    rv = trans->SetTransferData(kNativeImageMime, image);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // get clipboard
   nsCOMPtr<nsIClipboard> clipboard(do_GetService(kCClipboardCID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // check whether the system supports the selection clipboard or not.
@@ -449,18 +448,17 @@ static nsresult AppendString(nsITransfer
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = data->SetData(aString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = aTransferable->AddDataFlavor(aFlavor);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return aTransferable->SetTransferData(aFlavor, data,
-                                        aString.Length() * sizeof(char16_t));
+  return aTransferable->SetTransferData(aFlavor, data);
 }
 
 static nsresult AppendDOMNode(nsITransferable *aTransferable,
                               nsINode *aDOMNode)
 {
   nsresult rv;
 
   // serializer
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -5370,16 +5370,24 @@ nsGlobalWindowOuter::NotifyContentBlocki
     if (!aBlocked) {
       unblocked = !doc->GetHasAllCookiesBlocked();
     }
   } else if (aState == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN) {
     doc->SetHasForeignCookiesBlocked(aBlocked, origin);
     if (!aBlocked) {
       unblocked = !doc->GetHasForeignCookiesBlocked();
     }
+  } else if (aState == nsIWebProgressListener::STATE_COOKIES_LOADED) {
+    MOZ_ASSERT(!aBlocked, "We don't expected to see blocked STATE_COOKIES_LOADED");
+    // Note that the logic in this branch is the logical negation of the logic
+    // in other branches, since the nsIDocument API we have is phrased in
+    // "loaded" terms as opposed to "blocked" terms.
+    doc->SetHasCookiesLoaded(!aBlocked, origin);
+    aBlocked = true;
+    unblocked = false;
   } else {
     // Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
   }
   const uint32_t oldState = state;
   if (aBlocked) {
     state |= aState;
   } else if (unblocked) {
     state &= ~aState;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1107,16 +1107,36 @@ public:
                                         const nsAString& aOriginBlocked)
   {
     RecordContentBlockingLog(aOriginBlocked,
                              nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION,
                              aHasCookiesBlockedByPermission);
   }
 
   /**
+   * Set the cookies loaded flag for this document.
+   */
+  void SetHasCookiesLoaded(bool aHasCookiesLoaded,
+                           const nsAString& aOriginLoaded)
+  {
+    RecordContentBlockingLog(aOriginLoaded,
+                             nsIWebProgressListener::STATE_COOKIES_LOADED,
+                             aHasCookiesLoaded);
+  }
+
+  /**
+   * Get cookies loaded flag for this document.
+   */
+  bool GetHasCookiesLoaded()
+  {
+    return mContentBlockingLog.HasBlockedAnyOfType(
+        nsIWebProgressListener::STATE_COOKIES_LOADED);
+  }
+
+  /**
    * Get tracking content loaded flag for this document.
    */
   bool GetHasTrackingContentLoaded()
   {
     return mContentBlockingLog.HasBlockedAnyOfType(
         nsIWebProgressListener::STATE_LOADED_TRACKING_CONTENT);
   }
 
--- a/dom/base/test/copypaste.js
+++ b/dom/base/test/copypaste.js
@@ -80,17 +80,17 @@ async function testCopyPaste (isXHTML) {
   }
   function getClipboardData(mime) {
     var transferable = SpecialPowers.Cc['@mozilla.org/widget/transferable;1']
                                     .createInstance(SpecialPowers.Ci.nsITransferable);
     transferable.init(getLoadContext());
     transferable.addDataFlavor(mime);
     clipboard.getData(transferable, 1);
     var data = SpecialPowers.createBlankObject();
-    transferable.getTransferData(mime, data, {}) ;
+    transferable.getTransferData(mime, data) ;
     return data;
   }
   function testHtmlClipboardValue(mime, expected) {
     // For Windows, navigator.platform returns "Win32".
     var expectedValue = expected;
     if (navigator.platform.includes("Win")) {
       // Windows has extra content.
       var expectedValue = "<html><body>\n<!--StartFragment-->" +
--- a/dom/base/test/test_bug166235.html
+++ b/dom/base/test/test_bug166235.html
@@ -55,17 +55,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   }
   function getClipboardData(mime) {
     var transferable = Cc['@mozilla.org/widget/transferable;1']
                          .createInstance(SpecialPowers.Ci.nsITransferable);
     transferable.init(getLoadContext());
     transferable.addDataFlavor(mime);
     clipboard.getData(transferable, 1);
     var data = SpecialPowers.createBlankObject();
-    transferable.getTransferData(mime, data, {}) ;
+    transferable.getTransferData(mime, data) ;
     return SpecialPowers.wrap(data);
   }
   function testHtmlClipboardValue(mime, expected, test) {
     var expectedValue = expected;
     // For Windows, navigator.platform returns "Win32".
     if (navigator.platform.includes("Win")) {
       expectedValue = "<html><body>\n<!--StartFragment-->" + expected + "<!--EndFragment-->\n</body>\n</html>";
     }
--- a/dom/base/test/test_copyimage.html
+++ b/dom/base/test/test_copyimage.html
@@ -27,17 +27,17 @@ function testCopyImage () {
     var transferable = Cc['@mozilla.org/widget/transferable;1']
                        .createInstance(Ci.nsITransferable);
     var loadingContext = SpecialPowers.wrap(window).docShell
                                       .QueryInterface(Ci.nsILoadContext);
     transferable.init(loadingContext);
     transferable.addDataFlavor(mime);
     clipboard.getData(transferable, 1);
     var data = SpecialPowers.createBlankObject();
-    transferable.getTransferData(mime, data, {});
+    transferable.getTransferData(mime, data);
     return data;
   }
 
   function testClipboardValue(mime, expected) {
     var data = SpecialPowers.wrap(getClipboardData(mime));
     var str = data.value == null ? data.value :
               data.value.QueryInterface(Ci.nsISupportsString).data;
     is(str, expected, "clipboard has correct [" + mime + "] content")
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -1071,18 +1071,17 @@ DataTransfer::GetTransferable(uint32_t a
 
               nsCString str;
               stringBuffer->ToString(totalCustomLength, str);
               nsCOMPtr<nsISupportsCString>
                 strSupports(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
               strSupports->SetData(str);
 
               nsresult rv = transferable->SetTransferData(kCustomTypesMime,
-                                                          strSupports,
-                                                          totalCustomLength);
+                                                          strSupports);
               if (NS_FAILED(rv)) {
                 return nullptr;
               }
 
               added = true;
             }
           }
         }
@@ -1112,18 +1111,17 @@ DataTransfer::GetTransferable(uint32_t a
         nsCOMPtr<nsIFormatConverter> converter =
           do_QueryInterface(convertedData);
         if (converter) {
           transferable->AddDataFlavor(format);
           transferable->SetConverter(converter);
           continue;
         }
 
-        nsresult rv = transferable->SetTransferData(format, convertedData,
-                                                    lengthInBytes);
+        nsresult rv = transferable->SetTransferData(format, convertedData);
         if (NS_FAILED(rv)) {
           return nullptr;
         }
 
         added = true;
       }
     }
 
--- a/dom/events/DataTransferItem.cpp
+++ b/dom/events/DataTransferItem.cpp
@@ -174,19 +174,18 @@ DataTransferItem::FillInExternalData()
     }
 
     nsresult rv = dragSession->GetData(trans, mIndex);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return;
     }
   }
 
-  uint32_t length = 0;
   nsCOMPtr<nsISupports> data;
-  nsresult rv = trans->GetTransferData(format, getter_AddRefs(data), &length);
+  nsresult rv = trans->GetTransferData(format, getter_AddRefs(data));
   if (NS_WARN_IF(NS_FAILED(rv) || !data)) {
     return;
   }
 
   // Fill the variant
   RefPtr<nsVariantCC> variant = new nsVariantCC();
 
   eKind oldKind = Kind();
--- a/dom/media/AudioNotificationReceiver.h
+++ b/dom/media/AudioNotificationReceiver.h
@@ -2,25 +2,27 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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/. */
 
 #ifndef MOZILLA_AUDIONOTIFICATIONRECEIVER_H_
 #define MOZILLA_AUDIONOTIFICATIONRECEIVER_H_
 
+// clang-format off
 /*
  * Architecture to send/receive default device-changed notification:
  *
  *  Chrome Process                       ContentProcess 1
  *  ------------------                   ------------------
  *
- *       AudioNotification               DeviceChangeListener 1
- * DeviceChangeListener N |      ^                             |      ^ ^ (4)|
- * |(2)                          |(3)   |(8)      . v      | v      |         v
+ *       AudioNotification               DeviceChangeListener 1   DeviceChangeListener N
+ *             |      ^                             |      ^         ^
+ *          (4)|      |(2)                          |(3)   |(8)      .
+ *             v      |                             v      |         v
  *   AudioNotificationSender                  AudioNotificationReceiver
  *     ^       |      ^                                ^
  *     .    (5)|      |(1)                             |(7)
  *     .       v      |                                |
  *     .  (P)ContentParent 1                   (P)ContentChild 1
  *     .          |                                    ^
  *     .       (6)|                                    |
  *     .          |                                    |
@@ -54,16 +56,17 @@
  * b) There is only one AudioNotificationReceiver and might be many
  *    DeviceChangeListeners in a content process.
  * c) There might be many ContentParent in a chrome process.
  * d) There is only one ContentChild in a content process.
  * e) All the DeviceChangeListeners are registered in the
  * AudioNotificationReceiver. f) All the ContentParents are registered in the
  * AudioNotificationSender.
  */
+// clang-format on
 
 namespace mozilla {
 namespace audio {
 
 // The base class that provides a ResetDefaultDevice interface that
 // will be called in AudioNotificationReceiver::NotifyDefaultDeviceChanged
 // when it receives device-changed notification from the chrome process.
 class DeviceChangeListener {
@@ -86,9 +89,9 @@ class AudioNotificationReceiver final {
 
   // Notify all the streams that the default device has been changed.
   static void NotifyDefaultDeviceChanged();
 };  // AudioNotificationReceiver
 
 }  // namespace audio
 }  // namespace mozilla
 
-#endif  // MOZILLA_AUDIONOTIFICATIONRECEIVER_H_
\ No newline at end of file
+#endif  // MOZILLA_AUDIONOTIFICATIONRECEIVER_H_
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -82,16 +82,17 @@ class MediaStreamTrackSourceGetter : pub
 
   virtual already_AddRefed<dom::MediaStreamTrackSource>
   GetMediaStreamTrackSource(TrackID aInputTrackID) = 0;
 
  protected:
   virtual ~MediaStreamTrackSourceGetter() {}
 };
 
+// clang-format off
 /**
  * DOM wrapper for MediaStreams.
  *
  * To account for track operations such as clone(), addTrack() and
  * removeTrack(), a DOMMediaStream wraps three internal (and chained)
  * MediaStreams:
  *   1. mInputStream
  *      - Controlled by the owner/source of the DOMMediaStream.
@@ -171,31 +172,35 @@ class MediaStreamTrackSourceGetter : pub
  *    var Z = B.getTracks()[0];
  *    A.addTrack(Z);
  *    A.removeTrack(X);
  *    B.removeTrack(Z);
  *    var A' = A.clone();
  *
  * DOMStream A
  *           Input        Owned          Playback
- *            t1 ---------> t1                      <- MediaStreamTrack X
- * (removed) (pointing to t1 in A) t2 ---------> t2 ------------> t2     <-
- * MediaStreamTrack Y \                                       (pointing to t2 in
- * A) \                    ------> t3     <- MediaStreamTrack Z \ / (pointing to
- * t1 in B) DOMStream B    \                / Input \      Owned   / Playback t1
- * ---^-----> t1 ---                  <- MediaStreamTrack Z (removed) \    \
- * (pointing to t1 in B)
+ *            t1 ---------> t1                      <- MediaStreamTrack X (removed)
+ *                                                     (pointing to t1 in A)
+ *            t2 ---------> t2 ------------> t2     <- MediaStreamTrack Y
+ *             \                                       (pointing to t2 in A)
+ *              \                    ------> t3     <- MediaStreamTrack Z
+ *               \                  /                  (pointing to t1 in B)
+ * DOMStream B    \                /
+ *           Input \      Owned   /      Playback
+ *            t1 ---^-----> t1 ---                  <- MediaStreamTrack Z (removed)
+ *              \    \                                 (pointing to t1 in B)
  *               \    \
  * DOMStream A'   \    \
  *           Input \    \ Owned          Playback
  *                  \    -> t1 ------------> t1     <- MediaStreamTrack Y'
  *                   \                                 (pointing to t1 in A')
  *                    ----> t2 ------------> t2     <- MediaStreamTrack Z'
  *                                                     (pointing to t2 in A')
  */
+// clang-format on
 class DOMMediaStream
     : public DOMEventTargetHelper,
       public dom::PrincipalChangeObserver<dom::MediaStreamTrack>,
       public RelativeTimeline {
   friend class dom::MediaStreamTrack;
   typedef dom::MediaStreamTrack MediaStreamTrack;
   typedef dom::AudioStreamTrack AudioStreamTrack;
   typedef dom::VideoStreamTrack VideoStreamTrack;
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -1580,57 +1580,48 @@ HTMLEditor::PasteInternal(int32_t aClipb
   // also get additional html copy hints, if present
   nsAutoString contextStr, infoStr;
 
   // If we have our internal html flavor on the clipboard, there is special
   // context to use instead of cfhtml context.
   bool bHavePrivateHTMLFlavor = HavePrivateHTMLFlavor(clipboard);
   if (bHavePrivateHTMLFlavor) {
     nsCOMPtr<nsISupports> contextDataObj, infoDataObj;
-    uint32_t contextLen, infoLen;
     nsCOMPtr<nsISupportsString> textDataObj;
 
     nsCOMPtr<nsITransferable> contextTransferable =
       do_CreateInstance("@mozilla.org/widget/transferable;1");
     if (NS_WARN_IF(!contextTransferable)) {
       return NS_ERROR_FAILURE;
     }
     contextTransferable->Init(nullptr);
     contextTransferable->AddDataFlavor(kHTMLContext);
     clipboard->GetData(contextTransferable, aClipboardType);
     contextTransferable->GetTransferData(kHTMLContext,
-                                         getter_AddRefs(contextDataObj),
-                                         &contextLen);
+                                         getter_AddRefs(contextDataObj));
 
     nsCOMPtr<nsITransferable> infoTransferable =
       do_CreateInstance("@mozilla.org/widget/transferable;1");
     if (NS_WARN_IF(!infoTransferable)) {
       return NS_ERROR_FAILURE;
     }
     infoTransferable->Init(nullptr);
     infoTransferable->AddDataFlavor(kHTMLInfo);
     clipboard->GetData(infoTransferable, aClipboardType);
     infoTransferable->GetTransferData(kHTMLInfo,
-                                      getter_AddRefs(infoDataObj),
-                                      &infoLen);
+                                      getter_AddRefs(infoDataObj));
 
     if (contextDataObj) {
-      nsAutoString text;
       textDataObj = do_QueryInterface(contextDataObj);
-      textDataObj->GetData(text);
-      MOZ_ASSERT(text.Length() <= contextLen / 2);
-      contextStr.Assign(text.get(), contextLen / 2);
+      textDataObj->GetData(contextStr);
     }
 
     if (infoDataObj) {
-      nsAutoString text;
       textDataObj = do_QueryInterface(infoDataObj);
-      textDataObj->GetData(text);
-      MOZ_ASSERT(text.Length() <= infoLen / 2);
-      infoStr.Assign(text.get(), infoLen / 2);
+      textDataObj->GetData(infoStr);
     }
   }
 
   rv = InsertFromTransferable(transferable, nullptr, contextStr, infoStr,
                               bHavePrivateHTMLFlavor, true);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
@@ -1789,20 +1780,18 @@ HTMLEditor::CanPasteTransferable(nsITran
     length = ArrayLength(textEditorFlavors);
   } else {
     flavors = textHtmlEditorFlavors;
     length = ArrayLength(textHtmlEditorFlavors);
   }
 
   for (size_t i = 0; i < length; i++, flavors++) {
     nsCOMPtr<nsISupports> data;
-    uint32_t dataLen;
     nsresult rv = aTransferable->GetTransferData(*flavors,
-                                                 getter_AddRefs(data),
-                                                 &dataLen);
+                                                 getter_AddRefs(data));
     if (NS_SUCCEEDED(rv) && data) {
       return true;
     }
   }
 
   return false;
 }
 
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -460,20 +460,18 @@ TextEditor::CanPasteTransferable(nsITran
   }
 
   // If |aTransferable| is null, assume that a paste will succeed.
   if (!aTransferable) {
     return true;
   }
 
   nsCOMPtr<nsISupports> data;
-  uint32_t dataLen;
   nsresult rv = aTransferable->GetTransferData(kUnicodeMime,
-                                               getter_AddRefs(data),
-                                               &dataLen);
+                                               getter_AddRefs(data));
   if (NS_SUCCEEDED(rv) && data) {
     return true;
   }
 
   return false;
 }
 
 bool
--- a/editor/libeditor/tests/test_CF_HTML_clipboard.html
+++ b/editor/libeditor/tests/test_CF_HTML_clipboard.html
@@ -50,17 +50,17 @@ function copyCF_HTML(cfhtml, success, fa
 
     var trans = Cc["@mozilla.org/widget/transferable;1"].
                 createInstance(Ci.nsITransferable);
     trans.init(getLoadContext());
     trans.addDataFlavor(CF_HTML);
     cb.getData(trans, cb.kGlobalClipboard);
     var data = SpecialPowers.createBlankObject();
     try {
-      trans.getTransferData(CF_HTML, data, {});
+      trans.getTransferData(CF_HTML, data);
       data = SpecialPowers.wrap(data).value.QueryInterface(Ci.nsISupportsCString).data;
     } catch (e) {
       setTimeout(function() { copyCF_HTML_worker(successFn, failureFn); }, 100);
       return;
     }
     success();
   }
 
deleted file mode 100644
--- a/js/src/.clang-format
+++ /dev/null
@@ -1,11 +0,0 @@
-BasedOnStyle: Google
-
-# Prevent the loss of indentation with these macros
-MacroBlockBegin: "^JS_BEGIN_MACRO$"
-MacroBlockEnd: "^JS_END_MACRO$"
-
-# Ignore all comments because they aren't reflowed properly.
-# We require 80-col comments and 99-col code.
-CommentPragmas: "^"
-
-SortIncludes: false
--- a/js/src/builtin/Array.h
+++ b/js/src/builtin/Array.h
@@ -40,52 +40,49 @@ IdIsIndex(jsid id, uint32_t* indexp)
         return false;
     }
 
     return js::StringIsArrayIndex(atom, indexp);
 }
 
 // The methods below only create dense boxed arrays.
 
-/* Create a dense array with no capacity allocated, length set to 0. */
+// Create a dense array with no capacity allocated, length set to 0.
 extern ArrayObject * JS_FASTCALL
 NewDenseEmptyArray(JSContext* cx, HandleObject proto = nullptr,
                    NewObjectKind newKind = GenericObject);
 
-/*
- * Create a dense array with a set length, but without allocating space for the
- * contents. This is useful, e.g., when accepting length from the user.
- */
+// Create a dense array with a set length, but without allocating space for the
+// contents. This is useful, e.g., when accepting length from the user.
 extern ArrayObject * JS_FASTCALL
 NewDenseUnallocatedArray(JSContext* cx, uint32_t length, HandleObject proto = nullptr,
                          NewObjectKind newKind = GenericObject);
 
-/*
- * Create a dense array with length and capacity == |length|, initialized length set to 0,
- * but with only |EagerAllocationMaxLength| elements allocated.
- */
+// Create a dense array with length and capacity == |length|, initialized length
+// set to 0, but with only |EagerAllocationMaxLength| elements allocated.
 extern ArrayObject * JS_FASTCALL
 NewDensePartlyAllocatedArray(JSContext* cx, uint32_t length, HandleObject proto = nullptr,
                              NewObjectKind newKind = GenericObject);
 
-/* Create a dense array with length and capacity == 'length', initialized length set to 0. */
+// Create a dense array with length and capacity == 'length', initialized length
+// set to 0.
 extern ArrayObject * JS_FASTCALL
 NewDenseFullyAllocatedArray(JSContext* cx, uint32_t length, HandleObject proto = nullptr,
                             NewObjectKind newKind = GenericObject);
 
-/* Create a dense array from the given array values, which must be rooted */
+// Create a dense array from the given array values, which must be rooted.
 extern ArrayObject*
 NewDenseCopiedArray(JSContext* cx, uint32_t length, const Value* values,
                     HandleObject proto = nullptr, NewObjectKind newKind = GenericObject);
 
-/* Create a dense array based on templateObject with the given length. */
+// Create a dense array based on templateObject with the given length.
 extern ArrayObject*
 NewDenseFullyAllocatedArrayWithTemplate(JSContext* cx, uint32_t length, JSObject* templateObject);
 
-/* Create a dense array with the same copy-on-write elements as another object. */
+// Create a dense array with the same copy-on-write elements as another object.
 extern ArrayObject*
 NewDenseCopyOnWriteArray(JSContext* cx, HandleArrayObject templateObject, gc::InitialHeap heap);
 
 extern ArrayObject*
 NewFullyAllocatedArrayTryUseGroup(JSContext* cx, HandleObjectGroup group, size_t length,
                                   NewObjectKind newKind = GenericObject);
 
 extern ArrayObject*
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -24,17 +24,17 @@
 using namespace js;
 
 using mozilla::IsNaN;
 using mozilla::NumberEqualsInt32;
 
 using JS::DoubleNaNValue;
 
 
-/*** HashableValue *******************************************************************************/
+/*** HashableValue **********************************************************/
 
 bool
 HashableValue::setValue(JSContext* cx, HandleValue v)
 {
     if (v.isString()) {
         // Atomize so that hash() and operator==() are fast and infallible.
         JSString* str = AtomizeString(cx, v.toString(), DoNotPinAtom);
         if (!str) {
@@ -133,17 +133,17 @@ HashableValue
 HashableValue::trace(JSTracer* trc) const
 {
     HashableValue hv(*this);
     TraceEdge(trc, &hv.value, "key");
     return hv;
 }
 
 
-/*** MapIterator *********************************************************************************/
+/*** MapIterator ************************************************************/
 
 namespace {
 
 } /* anonymous namespace */
 
 static const ClassOps MapIteratorObjectClassOps = {
     nullptr, /* addProperty */
     nullptr, /* delProperty */
@@ -405,17 +405,17 @@ MapIteratorObject::createResultPair(JSCo
 
     // See comments in MapIteratorObject::next.
     AddTypePropertyId(cx, resultPairObj, JSID_VOID, TypeSet::UnknownType());
 
     return resultPairObj;
 }
 
 
-/*** Map *****************************************************************************************/
+/*** Map ********************************************************************/
 
 const ClassOps MapObject::classOps_ = {
     nullptr, // addProperty
     nullptr, // delProperty
     nullptr, // enumerate
     nullptr, // newEnumerate
     nullptr, // resolve
     nullptr, // mayResolve
@@ -1032,17 +1032,17 @@ MapObject::clear(JSContext* cx, HandleOb
     if (!map.clear()) {
         ReportOutOfMemory(cx);
         return false;
     }
     return true;
 }
 
 
-/*** SetIterator *********************************************************************************/
+/*** SetIterator ************************************************************/
 
 static const ClassOps SetIteratorObjectClassOps = {
     nullptr, /* addProperty */
     nullptr, /* delProperty */
     nullptr, /* enumerate */
     nullptr, /* newEnumerate */
     nullptr, /* resolve */
     nullptr, /* mayResolve */
@@ -1263,17 +1263,17 @@ SetIteratorObject::createResult(JSContex
 
     // See comments in SetIteratorObject::next.
     AddTypePropertyId(cx, resultObj, JSID_VOID, TypeSet::UnknownType());
 
     return resultObj;
 }
 
 
-/*** Set *****************************************************************************************/
+/*** Set ********************************************************************/
 
 const ClassOps SetObject::classOps_ = {
     nullptr, // addProperty
     nullptr, // delProperty
     nullptr, // enumerate
     nullptr, // newEnumerate
     nullptr, // resolve
     nullptr, // mayResolve
@@ -1744,17 +1744,17 @@ SetObject::clear_impl(JSContext *cx, con
 
 bool
 SetObject::clear(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod(cx, is, clear_impl, args);
 }
 
-/*** JS static utility functions *********************************************/
+/*** JS static utility functions ********************************************/
 
 static bool
 forEach(const char* funcName, JSContext *cx, HandleObject obj, HandleValue callbackFn, HandleValue thisArg)
 {
     CHECK_THREAD(cx);
 
     RootedId forEachId(cx, NameToId(cx->names().forEach));
     RootedFunction forEachFunc(cx, JS::GetSelfHostedFunction(cx, funcName, forEachId, 2));
@@ -1835,17 +1835,17 @@ CallObjFunc(bool(*ObjFunc)(JSContext* cx
     if (obj != unwrappedObj) {
         if (!JS_WrapValue(cx, rval)) {
             return false;
         }
     }
     return true;
 }
 
-/*** JS public APIs **********************************************************/
+/*** JS public APIs *********************************************************/
 
 JS_PUBLIC_API JSObject*
 JS::NewMapObject(JSContext* cx)
 {
     return MapObject::create(cx);
 }
 
 JS_PUBLIC_API uint32_t
--- a/js/src/builtin/Promise.h
+++ b/js/src/builtin/Promise.h
@@ -273,16 +273,17 @@ MOZ_MUST_USE bool
 AsyncGeneratorEnqueue(JSContext* cx, HandleValue asyncGenVal, CompletionKind completionKind,
                       HandleValue completionValue, MutableHandleValue result);
 
 bool
 AsyncFromSyncIteratorMethod(JSContext* cx, CallArgs& args, CompletionKind completionKind);
 
 class MOZ_NON_TEMPORARY_CLASS PromiseLookup final
 {
+    // clang-format off
     /*
      * A PromiseLookup holds the following:
      *
      *  Promise's shape (promiseConstructorShape_)
      *       To ensure that Promise has not been modified.
      *
      *  Promise.prototype's shape (promiseProtoShape_)
      *      To ensure that Promise.prototype has not been modified.
@@ -298,16 +299,17 @@ class MOZ_NON_TEMPORARY_CLASS PromiseLoo
      *
      *  Promise.prototype's slot number for then (promiseProtoThenSlot_)
      *      To quickly retrieve the Promise.prototype.then function.
      *
      * MOZ_INIT_OUTSIDE_CTOR fields below are set in |initialize()|.  The
      * constructor only initializes a |state_| field, that defines whether the
      * other fields are accessible.
      */
+    // clang-format on
 
     // Shape of matching Promise object.
     MOZ_INIT_OUTSIDE_CTOR Shape* promiseConstructorShape_;
 
 #ifdef DEBUG
     // Accessor Shape containing the @@species property.
     // See isPromiseStateStillSane() for why this field is debug-only.
     MOZ_INIT_OUTSIDE_CTOR Shape* promiseSpeciesShape_;
--- a/js/src/builtin/Reflect.cpp
+++ b/js/src/builtin/Reflect.cpp
@@ -13,17 +13,17 @@
 #include "vm/JSContext.h"
 #include "vm/Stack.h"
 
 #include "vm/Interpreter-inl.h"
 
 using namespace js;
 
 
-/*** Reflect methods *****************************************************************************/
+/*** Reflect methods ********************************************************/
 
 /* ES6 26.1.4 Reflect.deleteProperty (target, propertyKey) */
 static bool
 Reflect_deleteProperty(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1.
@@ -212,17 +212,17 @@ static const JSFunctionSpec methods[] = 
     JS_FN("ownKeys", Reflect_ownKeys, 1, 0),
     JS_FN("preventExtensions", Reflect_preventExtensions, 1, 0),
     JS_FN("set", Reflect_set, 3, 0),
     JS_FN("setPrototypeOf", Reflect_setPrototypeOf, 2, 0),
     JS_FS_END
 };
 
 
-/*** Setup **************************************************************************************/
+/*** Setup ******************************************************************/
 
 JSObject*
 js::InitReflect(JSContext* cx, Handle<GlobalObject*> global)
 {
     RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
     if (!proto) {
         return nullptr;
     }
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -443,17 +443,18 @@ class NodeBuilder
         /*
          * Bug 575416: instead of Atomize, lookup constant atoms in tbl file
          */
         RootedAtom atom(cx, Atomize(cx, name, strlen(name)));
         if (!atom) {
             return false;
         }
 
-        /* Represent "no node" as null and ensure users are not exposed to magic values. */
+        // Represent "no node" as null and ensure users are not exposed to magic
+        // values.
         RootedValue optVal(cx, val.isMagic(JS_SERIALIZE_NO_NODE) ? NullValue() : val);
         return DefineDataProperty(cx, obj, atom->asPropertyName(), optVal);
     }
 
     MOZ_MUST_USE bool newNodeLoc(TokenPos* pos, MutableHandleValue dst);
 
     MOZ_MUST_USE bool setNodeLoc(HandleObject node, TokenPos* pos);
 
@@ -3650,17 +3651,18 @@ ASTSerializer::functionArgs(ParseNode* p
     return true;
 }
 
 bool
 ASTSerializer::functionBody(ParseNode* pn, TokenPos* pos, MutableHandleValue dst)
 {
     NodeVector elts(cx);
 
-    /* We aren't sure how many elements there are up front, so we'll check each append. */
+    // We aren't sure how many elements there are up front, so we'll check each
+    // append.
     for (ParseNode* next = pn; next; next = next->pn_next) {
         RootedValue child(cx);
         if (!sourceElement(next, &child) || !elts.append(child)) {
             return false;
         }
     }
 
     return builder.blockStatement(elts, pos, dst);
--- a/js/src/builtin/RegExp.cpp
+++ b/js/src/builtin/RegExp.cpp
@@ -45,73 +45,74 @@ js::CreateRegExpMatchResult(JSContext* c
      *
      * Array contents:
      *  0:              matched string
      *  1..pairCount-1: paren matches
      *  input:          input string
      *  index:          start index for the match
      */
 
-    /* Get the templateObject that defines the shape and type of the output object */
+    // Get the templateObject that defines the shape and type of the output
+    // object.
     JSObject* templateObject = cx->realm()->regExps.getOrCreateMatchResultTemplateObject(cx);
     if (!templateObject) {
         return false;
     }
 
     size_t numPairs = matches.length();
     MOZ_ASSERT(numPairs > 0);
 
-    /* Step 17. */
+    // Step 17.
     RootedArrayObject arr(cx, NewDenseFullyAllocatedArrayWithTemplate(cx, numPairs, templateObject));
     if (!arr) {
         return false;
     }
 
-    /* Steps 22-24.
-     * Store a Value for each pair. */
+    // Steps 22-24.
+    // Store a Value for each pair.
     for (size_t i = 0; i < numPairs; i++) {
         const MatchPair& pair = matches[i];
 
         if (pair.isUndefined()) {
-            MOZ_ASSERT(i != 0); /* Since we had a match, first pair must be present. */
+            MOZ_ASSERT(i != 0); // Since we had a match, first pair must be present.
             arr->setDenseInitializedLength(i + 1);
             arr->initDenseElement(i, UndefinedValue());
         } else {
             JSLinearString* str = NewDependentString(cx, input, pair.start, pair.length());
             if (!str) {
                 return false;
             }
             arr->setDenseInitializedLength(i + 1);
             arr->initDenseElement(i, StringValue(str));
         }
     }
 
-    /* Step 20 (reordered).
-     * Set the |index| property. */
+    // Step 20 (reordered).
+    // Set the |index| property.
     arr->setSlot(RegExpRealm::MatchResultObjectIndexSlot, Int32Value(matches[0].start));
 
-    /* Step 21 (reordered).
-     * Set the |input| property. */
+    // Step 21 (reordered).
+    // Set the |input| property.
     arr->setSlot(RegExpRealm::MatchResultObjectInputSlot, StringValue(input));
 
 #ifdef DEBUG
     RootedValue test(cx);
     RootedId id(cx, NameToId(cx->names().index));
     if (!NativeGetProperty(cx, arr, id, &test)) {
         return false;
     }
     MOZ_ASSERT(test == arr->getSlot(RegExpRealm::MatchResultObjectIndexSlot));
     id = NameToId(cx->names().input);
     if (!NativeGetProperty(cx, arr, id, &test)) {
         return false;
     }
     MOZ_ASSERT(test == arr->getSlot(RegExpRealm::MatchResultObjectInputSlot));
 #endif
 
-    /* Step 25. */
+    // Step 25.
     rval.setObject(*arr);
     return true;
 }
 
 static int32_t
 CreateRegExpSearchResult(const MatchPairs& matches)
 {
     /* Fit the start and limit of match into a int32_t. */
--- a/js/src/builtin/RegExp.h
+++ b/js/src/builtin/RegExp.h
@@ -26,17 +26,17 @@ InitRegExpClass(JSContext* cx, HandleObj
  * |input| may be nullptr if there is no JSString corresponding to
  * |chars| and |length|.
  */
 MOZ_MUST_USE bool
 ExecuteRegExpLegacy(JSContext* cx, RegExpStatics* res, Handle<RegExpObject*> reobj,
                     HandleLinearString input, size_t* lastIndex, bool test,
                     MutableHandleValue rval);
 
-/* Translation from MatchPairs to a JS array in regexp_exec()'s output format. */
+// Translation from MatchPairs to a JS array in regexp_exec()'s output format.
 MOZ_MUST_USE bool
 CreateRegExpMatchResult(JSContext* cx, HandleString input, const MatchPairs& matches,
                         MutableHandleValue rval);
 
 extern MOZ_MUST_USE bool
 RegExpMatcher(JSContext* cx, unsigned argc, Value* vp);
 
 extern MOZ_MUST_USE bool
--- a/js/src/builtin/Stream.cpp
+++ b/js/src/builtin/Stream.cpp
@@ -515,31 +515,32 @@ const Class cls::class_ = { \
 const Class cls::protoClass_ = { \
     "object", \
     JSCLASS_HAS_CACHED_PROTO(JSProto_##cls), \
     JS_NULL_CLASS_OPS, \
     &cls::classSpec_ \
 };
 
 
-/*** 3.2. Class ReadableStream *******************************************************************/
+/*** 3.2. Class ReadableStream **********************************************/
 
 /**
  * Streams spec, 3.2.3., steps 1-4.
  */
 ReadableStream*
 ReadableStream::createStream(JSContext* cx, HandleObject proto /* = nullptr */)
 {
     Rooted<ReadableStream*> stream(cx, NewObjectWithClassProto<ReadableStream>(cx, proto));
     if (!stream) {
         return nullptr;
     }
 
     // Step 1: Set this.[[state]] to "readable".
-    // Step 2: Set this.[[reader]] and this.[[storedError]] to undefined (implicit).
+    // Step 2: Set this.[[reader]] and this.[[storedError]] to
+    //         undefined (implicit).
     // Step 3: Set this.[[disturbed]] to false (implicit).
     // Step 4: Set this.[[readableStreamController]] to undefined (implicit).
     stream->initStateBits(Readable);
 
     return stream;
 }
 
 static MOZ_MUST_USE ReadableStreamDefaultController*
@@ -782,17 +783,18 @@ ReadableStream_getReader(JSContext* cx, 
         reader = CreateReadableStreamDefaultReader(cx, unwrappedStream, ForAuthorCodeBool::Yes);
     } else {
         // Step 3: Set mode to ? ToString(mode) (implicit).
         RootedString mode(cx, ToString<CanGC>(cx, modeVal));
         if (!mode) {
             return false;
         }
 
-        // Step 4: If mode is "byob", return ? AcquireReadableStreamBYOBReader(this).
+        // Step 4: If mode is "byob",
+        //         return ? AcquireReadableStreamBYOBReader(this).
         int32_t notByob;
         if (!CompareStrings(cx, mode, cx->names().byob, &notByob)) {
             return false;
         }
         if (notByob) {
             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                       JSMSG_READABLESTREAM_INVALID_READER_MODE);
             // Step 5: Throw a RangeError exception.
@@ -806,20 +808,24 @@ ReadableStream_getReader(JSContext* cx, 
     // Reordered second part of steps 2 and 4.
     if (!reader) {
         return false;
     }
     args.rval().setObject(*reader);
     return true;
 }
 
-// Streams spec, 3.2.5.4. pipeThrough({ writable, readable }, options)
+// Streams spec, 3.2.5.4.
+//      pipeThrough({ writable, readable }, options)
+//
 // Not implemented.
 
-// Streams spec, 3.2.5.5. pipeTo(dest, { preventClose, preventAbort, preventCancel } = {})
+// Streams spec, 3.2.5.5.
+//      pipeTo(dest, { preventClose, preventAbort, preventCancel } = {})
+//
 // Not implemented.
 
 static MOZ_MUST_USE bool
 ReadableStreamTee(JSContext* cx, Handle<ReadableStream*> unwrappedStream, bool cloneForBranch2,
                   MutableHandle<ReadableStream*> branch1, MutableHandle<ReadableStream*> branch2);
 
 /**
  * Streams spec, 3.2.5.6. tee()
@@ -866,28 +872,32 @@ static const JSFunctionSpec ReadableStre
 static const JSPropertySpec ReadableStream_properties[] = {
     JS_PSG("locked", ReadableStream_locked, 0),
     JS_PS_END
 };
 
 CLASS_SPEC(ReadableStream, 0, SlotCount, 0, 0, JS_NULL_CLASS_OPS);
 
 
-/*** 3.3. General readable stream abstract operations ********************************************/
+/*** 3.3. General readable stream abstract operations ***********************/
 
 // Streams spec, 3.3.1. AcquireReadableStreamBYOBReader ( stream )
 // Always inlined.
 
 // Streams spec, 3.3.2. AcquireReadableStreamDefaultReader ( stream )
 // Always inlined. See CreateReadableStreamDefaultReader.
 
-// Streams spec, 3.3.3. CreateReadableStream ( startAlgorithm, pullAlgorithm, cancelAlgorithm [, highWaterMark [, sizeAlgorithm ] ] )
+// Streams spec, 3.3.3. CreateReadableStream (
+//                          startAlgorithm, pullAlgorithm, cancelAlgorithm
+//                          [, highWaterMark [, sizeAlgorithm ] ] )
 // Not implemented.
 
-// Streams spec, 3.3.4. CreateReadableByteStream ( startAlgorithm, pullAlgorithm, cancelAlgorithm [, highWaterMark [, autoAllocateChunkSize ] ] )
+// Streams spec, 3.3.4. CreateReadableByteStream (
+//                          startAlgorithm, pullAlgorithm, cancelAlgorithm
+//                          [, highWaterMark [, autoAllocateChunkSize ] ] )
 // Not implemented.
 
 // Streams spec, 3.3.5. InitializeReadableStream ( stream )
 // Not implemented.
 
 // Streams spec, 3.3.6. IsReadableStream ( x )
 // Using is<T> instead.
 
@@ -1186,24 +1196,24 @@ TeeReaderClosedHandler(JSContext* cx, un
     // Step a: If closedOrErrored is false, then:
     if (!teeState->closedOrErrored()) {
         // Step a.iii: Set closedOrErrored to true.
         // Reordered to ensure that internal errors in the other steps don't
         // leave the teeState in an undefined state.
         teeState->setClosedOrErrored();
 
         // Step a.i: Perform ! ReadableStreamDefaultControllerErrorIfNeeded(
-        //           branch1.[[readableStreamController]], r).
+        //                          branch1.[[readableStreamController]], r).
         Rooted<ReadableStreamDefaultController*> branch1(cx, teeState->branch1());
         if (!ReadableStreamDefaultControllerErrorIfNeeded(cx, branch1, reason)) {
             return false;
         }
 
         // Step a.ii: Perform ! ReadableStreamDefaultControllerErrorIfNeeded(
-        //            branch2.[[readableStreamController]], r).
+        //                          branch2.[[readableStreamController]], r).
         Rooted<ReadableStreamDefaultController*> branch2(cx, teeState->branch2());
         if (!ReadableStreamDefaultControllerErrorIfNeeded(cx, branch2, reason)) {
             return false;
         }
     }
 
     args.rval().setUndefined();
     return true;
@@ -1302,17 +1312,17 @@ ReadableStreamTee(JSContext* cx,
         return false;
     }
 
     // Step 19: Return « branch1, branch2 ».
     return true;
 }
 
 
-/*** 3.4. The interface between readable streams and controllers *********************************/
+/*** 3.4. The interface between readable streams and controllers ************/
 
 inline static MOZ_MUST_USE bool
 AppendToListAtSlot(JSContext* cx,
                    HandleNativeObject unwrappedContainer,
                    uint32_t slot,
                    HandleObject obj);
 
 /**
@@ -1650,18 +1660,20 @@ ReadableStreamErrorInternal(JSContext* c
                                                      unwrappedStream->embeddingFlags(),
                                                      error);
     }
 
     return true;
 }
 
 /**
- * Streams spec, 3.4.7. ReadableStreamFulfillReadIntoRequest( stream, chunk, done )
- * Streams spec, 3.4.8. ReadableStreamFulfillReadRequest ( stream, chunk, done )
+ * Streams spec, 3.4.7.
+ *      ReadableStreamFulfillReadIntoRequest( stream, chunk, done )
+ * Streams spec, 3.4.8.
+ *      ReadableStreamFulfillReadRequest ( stream, chunk, done )
  * These two spec functions are identical in our implementation.
  */
 static MOZ_MUST_USE bool
 ReadableStreamFulfillReadOrReadIntoRequest(JSContext* cx,
                                            Handle<ReadableStream*> unwrappedStream,
                                            HandleValue chunk,
                                            bool done)
 {
@@ -1743,17 +1755,17 @@ ReadableStreamHasDefaultReader(JSContext
         return false;
     }
 
     *result = unwrappedReader->is<ReadableStreamDefaultReader>();
     return true;
 }
 
 
-/*** 3.5. Class ReadableStreamDefaultReader ******************************************************/
+/*** 3.5. Class ReadableStreamDefaultReader *********************************/
 
 static MOZ_MUST_USE bool
 ReadableStreamReaderGenericInitialize(JSContext* cx,
                                       Handle<ReadableStreamReader*> reader,
                                       Handle<ReadableStream*> unwrappedStream,
                                       ForAuthorCodeBool forAuthorCode);
 
 /**
@@ -1798,17 +1810,18 @@ bool
 ReadableStreamDefaultReader::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultReader")) {
         return false;
     }
 
-    // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError exception.
+    // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError
+    //         exception.
     Rooted<ReadableStream*> unwrappedStream(cx,
         UnwrapAndTypeCheckArgument<ReadableStream>(cx,
                                                    args,
                                                    "ReadableStreamDefaultReader constructor",
                                                    0));
     if (!unwrappedStream) {
         return false;
     }
@@ -1980,17 +1993,17 @@ static const JSPropertySpec ReadableStre
 const Class ReadableStreamReader::class_ = {
     "ReadableStreamReader"
 };
 
 CLASS_SPEC(ReadableStreamDefaultReader, 1, SlotCount, ClassSpec::DontDefineConstructor, 0,
            JS_NULL_CLASS_OPS);
 
 
-/*** 3.7. Readable stream reader abstract operations *********************************************/
+/*** 3.7. Readable stream reader abstract operations ************************/
 
 // Streams spec, 3.7.1. IsReadableStreamDefaultReader ( x )
 // Implemented via is<ReadableStreamDefaultReader>()
 
 // Streams spec, 3.7.2. IsReadableStreamBYOBReader ( x )
 // Implemented via is<ReadableStreamBYOBReader>()
 
 /**
@@ -2008,17 +2021,18 @@ ReadableStreamReaderGenericCancel(JSCont
         return nullptr;
     }
 
     // Step 3: Return ! ReadableStreamCancel(stream, reason).
     return ::ReadableStreamCancel(cx, unwrappedStream, reason);
 }
 
 /**
- * Streams spec, 3.7.4. ReadableStreamReaderGenericInitialize ( reader, stream )
+ * Streams spec, 3.7.4.
+ *      ReadableStreamReaderGenericInitialize ( reader, stream )
  */
 static MOZ_MUST_USE bool
 ReadableStreamReaderGenericInitialize(JSContext* cx,
                                       Handle<ReadableStreamReader*> reader,
                                       Handle<ReadableStream*> unwrappedStream,
                                       ForAuthorCodeBool forAuthorCode)
 {
     cx->check(reader);
@@ -2119,18 +2133,18 @@ ReadableStreamReaderGenericRelease(JSCon
         AutoRealm ar(cx, closedPromise);
         if (!cx->compartment()->wrap(cx, &exn)) {
             return false;
         }
         if (!PromiseObject::reject(cx, closedPromise, exn)) {
             return false;
         }
     } else {
-        // Step 4: Otherwise, set reader.[[closedPromise]] to a new promise rejected
-        //         with a TypeError exception.
+        // Step 4: Otherwise, set reader.[[closedPromise]] to a new promise
+        //         rejected with a TypeError exception.
         RootedObject closedPromise(cx, PromiseObject::unforgeableReject(cx, exn));
         if (!closedPromise) {
             return false;
         }
 
         AutoRealm ar(cx, unwrappedReader);
         if (!cx->compartment()->wrap(cx, &closedPromise)) {
             return false;
@@ -2178,18 +2192,18 @@ ReadableStreamDefaultReaderRead(JSContex
                                            unwrappedReader->forAuthorCode()));
         if (!iterResult) {
             return nullptr;
         }
         RootedValue iterResultVal(cx, ObjectValue(*iterResult));
         return PromiseObject::unforgeableResolve(cx, iterResultVal);
     }
 
-    // Step 6: If stream.[[state]] is "errored", return a new promise rejected with
-    //         stream.[[storedError]].
+    // Step 6: If stream.[[state]] is "errored", return a new promise rejected
+    //         with stream.[[storedError]].
     if (unwrappedStream->errored()) {
         RootedValue storedError(cx, unwrappedStream->storedError());
         if (!cx->compartment()->wrap(cx, &storedError)) {
             return nullptr;
         }
         return PromiseObject::unforgeableReject(cx, storedError);
     }
 
@@ -2197,17 +2211,17 @@ ReadableStreamDefaultReaderRead(JSContex
     MOZ_ASSERT(unwrappedStream->readable());
 
     // Step 8: Return ! stream.[[readableStreamController]].[[PullSteps]]().
     Rooted<ReadableStreamController*> unwrappedController(cx, unwrappedStream->controller());
     return ReadableStreamControllerPullSteps(cx, unwrappedController);
 }
 
 
-/*** 3.8. Class ReadableStreamDefaultController **************************************************/
+/*** 3.8. Class ReadableStreamDefaultController *****************************/
 
 inline static MOZ_MUST_USE bool
 ReadableStreamControllerCallPullIfNeeded(JSContext* cx,
                                          Handle<ReadableStreamController*> unwrappedController);
 
 /**
  * Streams spec, 3.8.3, step 11.a.
  * and
@@ -2224,19 +2238,21 @@ ControllerStartHandler(JSContext* cx, un
     controller->setStarted();
 
     // Step ii: Assert: controller.[[pulling]] is false.
     MOZ_ASSERT(!controller->pulling());
 
     // Step iii: Assert: controller.[[pullAgain]] is false.
     MOZ_ASSERT(!controller->pullAgain());
 
-    // Step iv: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
+    // Step iv: Perform
+    //          ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
     // or
-    // Step iv: Perform ! ReadableByteStreamControllerCallPullIfNeeded((controller).
+    // Step iv: Perform
+    //          ! ReadableByteStreamControllerCallPullIfNeeded((controller).
     if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return false;
     }
     args.rval().setUndefined();
     return true;
 }
 
 static MOZ_MUST_USE bool
@@ -2283,18 +2299,19 @@ ValidateAndNormalizeHighWaterMark(JSCont
 
 static MOZ_MUST_USE bool
 ValidateAndNormalizeQueuingStrategy(JSContext* cx,
                                     HandleValue size,
                                     HandleValue highWaterMarkVal,
                                     double* highWaterMark);
 
 /**
- * Streams spec, 3.8.3 new ReadableStreamDefaultController ( stream, underlyingSource,
- *                                                           size, highWaterMark )
+ * Streams spec, 3.8.3
+ *      new ReadableStreamDefaultController ( stream, underlyingSource,
+ *                                            size, highWaterMark )
  * Steps 3 - 11.
  *
  * Note: All arguments must be same-compartment with cx. ReadableStream
  * controllers are always created in the same compartment as the stream.
  */
 static MOZ_MUST_USE ReadableStreamDefaultController*
 CreateReadableStreamDefaultController(JSContext* cx,
                                       Handle<ReadableStream*> stream,
@@ -2569,18 +2586,18 @@ static const JSFunctionSpec ReadableStre
 const Class ReadableStreamController::class_ = {
     "ReadableStreamController"
 };
 
 CLASS_SPEC(ReadableStreamDefaultController, 4, SlotCount, ClassSpec::DontDefineConstructor, 0,
            JS_NULL_CLASS_OPS);
 
 /**
- * Unified implementation of ReadableStream controllers' [[CancelSteps]] internal
- * methods.
+ * Unified implementation of ReadableStream controllers' [[CancelSteps]]
+ * internal methods.
  * Streams spec, 3.8.5.1. [[CancelSteps]] ( reason )
  * and
  * Streams spec, 3.10.5.1. [[CancelSteps]] ( reason )
  */
 static MOZ_MUST_USE JSObject*
 ReadableStreamControllerCancelSteps(JSContext* cx,
                                     Handle<ReadableStreamController*> unwrappedController,
                                     HandleValue reason)
@@ -2698,17 +2715,18 @@ ReadableStreamDefaultControllerPullSteps
         if (unwrappedController->closeRequested() &&
             unwrappedQueue->getDenseInitializedLength() == 0)
         {
             if (!ReadableStreamCloseInternal(cx, unwrappedStream)) {
                 return nullptr;
             }
         }
 
-        // Step c: Otherwise, perform ! ReadableStreamDefaultControllerCallPullIfNeeded(this).
+        // Step c: Otherwise, perform
+        //         ! ReadableStreamDefaultControllerCallPullIfNeeded(this).
         else {
             if (!ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController)) {
                 return nullptr;
             }
         }
 
         // Step d: Return a promise resolved with
         //         ! ReadableStreamCreateReadResult(chunk, false, forAuthorCode).
@@ -2738,17 +2756,17 @@ ReadableStreamDefaultControllerPullSteps
         return nullptr;
     }
 
     // Step 5: Return pendingPromise.
     return pendingPromise;
 }
 
 
-/*** 3.9. Readable stream default controller abstract operations *********************************/
+/*** 3.9. Readable stream default controller abstract operations ************/
 
 // Streams spec, 3.9.1. IsReadableStreamDefaultController ( x )
 // Implemented via is<ReadableStreamDefaultController>()
 
 /**
  * Streams spec, 3.9.2 and 3.12.3. step 7:
  * Upon fulfillment of pullPromise,
  */
@@ -2766,17 +2784,18 @@ ControllerPullHandler(JSContext* cx, uns
     bool pullAgain = controller->pullAgain();
 
     // Step a: Set controller.[[pulling]] to false.
     // Step b.i: Set controller.[[pullAgain]] to false.
     controller->clearPullFlags();
 
     // Step b: If controller.[[pullAgain]] is true,
     if (pullAgain) {
-        // Step ii: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller).
+        // Step ii: Perform
+        //          ! ReadableByteStreamControllerCallPullIfNeeded(controller).
         if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
             return false;
         }
     }
 
     args.rval().setUndefined();
     return true;
 }
@@ -2811,18 +2830,20 @@ ControllerPullFailedHandler(JSContext* c
 
 static bool
 ReadableStreamControllerShouldCallPull(ReadableStreamController* unwrappedController);
 
 static MOZ_MUST_USE double
 ReadableStreamControllerGetDesiredSizeUnchecked(ReadableStreamController* unwrappedController);
 
 /**
- * Streams spec, 3.9.2 ReadableStreamDefaultControllerCallPullIfNeeded ( controller )
- * Streams spec, 3.12.3. ReadableByteStreamControllerCallPullIfNeeded ( controller )
+ * Streams spec, 3.9.2
+ *      ReadableStreamDefaultControllerCallPullIfNeeded ( controller )
+ * Streams spec, 3.12.3.
+ *      ReadableByteStreamControllerCallPullIfNeeded ( controller )
  */
 inline static MOZ_MUST_USE bool
 ReadableStreamControllerCallPullIfNeeded(JSContext* cx,
                                          Handle<ReadableStreamController*> unwrappedController)
 {
     // Step 1: Let shouldPull be
     //         ! ReadableByteStreamControllerShouldCallPull(controller).
     bool shouldPull = ReadableStreamControllerShouldCallPull(unwrappedController);
@@ -2843,17 +2864,18 @@ ReadableStreamControllerCallPullIfNeeded
 
     // Step 4: Assert: controller.[[pullAgain]] is false.
     MOZ_ASSERT(!unwrappedController->pullAgain());
 
     // Step 5: Set controller.[[pulling]] to true.
     unwrappedController->setPulling();
 
     // Step 6: Let pullPromise be
-    //         ! PromiseInvokeOrNoop(controller.[[underlyingByteSource]], "pull", controller).
+    //         ! PromiseInvokeOrNoop(controller.[[underlyingByteSource]],
+    //                               "pull", controller).
     RootedObject wrappedController(cx, unwrappedController);
     if (!cx->compartment()->wrap(cx, &wrappedController)) {
         return false;
     }
     RootedValue controllerVal(cx, ObjectValue(*wrappedController));
     RootedValue unwrappedUnderlyingSource(cx, unwrappedController->underlyingSource());
     RootedObject pullPromise(cx);
 
@@ -2898,18 +2920,20 @@ ReadableStreamControllerCallPullIfNeeded
     }
 
     return JS::AddPromiseReactions(cx, pullPromise, onPullFulfilled, onPullRejected);
 
     // Steps 7-8 implemented in functions above.
 }
 
 /**
- * Streams spec, 3.9.3. ReadableStreamDefaultControllerShouldCallPull ( controller )
- * Streams spec, 3.12.25. ReadableByteStreamControllerShouldCallPull ( controller )
+ * Streams spec, 3.9.3.
+ *      ReadableStreamDefaultControllerShouldCallPull ( controller )
+ * Streams spec, 3.12.25.
+ *      ReadableByteStreamControllerShouldCallPull ( controller )
  */
 static bool
 ReadableStreamControllerShouldCallPull(ReadableStreamController* unwrappedController)
 {
     // Step 1: Let stream be controller.[[controlledReadableStream]].
     ReadableStream* unwrappedStream = unwrappedController->stream();
 
     // Step 2: If stream.[[state]] is "closed" or stream.[[state]] is "errored",
@@ -2932,17 +2956,18 @@ ReadableStreamControllerShouldCallPull(R
 
     // Step 5: If ! IsReadableStreamLocked(stream) is true and
     //         ! ReadableStreamGetNumReadRequests(stream) > 0, return true.
     // Steps 5-6 of 3.12.24 are equivalent in our implementation.
     if (unwrappedStream->locked() && ReadableStreamGetNumReadRequests(unwrappedStream) > 0) {
         return true;
     }
 
-    // Step 6: Let desiredSize be ReadableStreamDefaultControllerGetDesiredSize(controller).
+    // Step 6: Let desiredSize be
+    //         ReadableStreamDefaultControllerGetDesiredSize(controller).
     double desiredSize = ReadableStreamControllerGetDesiredSizeUnchecked(unwrappedController);
 
     // Step 7: If desiredSize > 0, return true.
     // Step 8: Return false.
     // Steps 7-8 of 3.12.24 are equivalent in our implementation.
     return desiredSize > 0;
 }
 
@@ -2960,33 +2985,35 @@ ReadableStreamDefaultControllerClose(JSC
     MOZ_ASSERT(!unwrappedController->closeRequested());
 
     // Step 3: Assert: stream.[[state]] is "readable".
     MOZ_ASSERT(unwrappedStream->readable());
 
     // Step 4: Set controller.[[closeRequested]] to true.
     unwrappedController->setCloseRequested();
 
-    // Step 5: If controller.[[queue]] is empty, perform ! ReadableStreamClose(stream).
+    // Step 5: If controller.[[queue]] is empty, perform
+    //         ! ReadableStreamClose(stream).
     RootedNativeObject unwrappedQueue(cx, unwrappedController->queue());
     if (unwrappedQueue->getDenseInitializedLength() == 0) {
         return ReadableStreamCloseInternal(cx, unwrappedStream);
     }
 
     return true;
 }
 
 static MOZ_MUST_USE bool
 EnqueueValueWithSize(JSContext* cx,
                      Handle<ReadableStreamController*> unwrappedContainer,
                      HandleValue value,
                      HandleValue sizeVal);
 
 /**
- * Streams spec, 3.9.6. ReadableStreamDefaultControllerEnqueue ( controller, chunk )
+ * Streams spec, 3.9.6.
+ *      ReadableStreamDefaultControllerEnqueue ( controller, chunk )
  */
 static MOZ_MUST_USE bool
 ReadableStreamDefaultControllerEnqueue(JSContext* cx,
                                        Handle<ReadableStreamDefaultController*> unwrappedController,
                                        HandleValue chunk)
 {
     AssertSameCompartment(cx, chunk);
 
@@ -3010,17 +3037,18 @@ ReadableStreamDefaultControllerEnqueue(J
         // Step 5: Otherwise,
         // Step a: Let chunkSize be 1.
         RootedValue chunkSize(cx, NumberValue(1));
         bool success = true;
 
         // Step b: If controller.[[strategySize]] is not undefined,
         RootedValue strategySize(cx, unwrappedController->strategySize());
         if (!strategySize.isUndefined()) {
-            // Step i: Set chunkSize to Call(stream.[[strategySize]], undefined, chunk).
+            // Step i: Set chunkSize to
+            //         Call(stream.[[strategySize]], undefined, chunk).
             if (!cx->compartment()->wrap(cx, &strategySize)) {
                 return false;
             }
             success = Call(cx, strategySize, UndefinedHandleValue, chunk, &chunkSize);
         }
 
         // Step c: Let enqueueResult be
         //         EnqueueValueWithSize(controller, chunk, chunkSize).
@@ -3035,29 +3063,30 @@ ReadableStreamDefaultControllerEnqueue(J
             RootedValue exn(cx);
             if (!cx->isExceptionPending() || !GetAndClearException(cx, &exn)) {
                 // Uncatchable error. Die immediately without erroring the
                 // stream.
                 return false;
             }
 
             // Step b.ii.1: Perform
-            //         ! ReadableStreamDefaultControllerErrorIfNeeded(controller,
-            //                                                        chunkSize.[[Value]]).
+            //              ! ReadableStreamDefaultControllerErrorIfNeeded(
+            //                  controller, chunkSize.[[Value]]).
             if (!ReadableStreamDefaultControllerErrorIfNeeded(cx, unwrappedController, exn)) {
                 return false;
             }
 
             // Step b.ii.2: Return chunkSize.
             cx->setPendingException(exn);
             return false;
         }
     }
 
-    // Step 6: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
+    // Step 6: Perform
+    //         ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
     // Step 7: Return.
     return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController);
 }
 
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerClearPendingPullIntos(JSContext* cx,
                                                   Handle<ReadableByteStreamController*> unwrappedController);
 
@@ -3094,17 +3123,18 @@ ReadableStreamControllerError(JSContext*
         return false;
     }
 
     // Step 4 (or 5): Perform ! ReadableStreamError(stream, e).
     return ReadableStreamErrorInternal(cx, unwrappedStream, e);
 }
 
 /**
- * Streams spec, 3.9.7. ReadableStreamDefaultControllerErrorIfNeeded ( controller, e ) nothrow
+ * Streams spec, 3.9.7.
+ *      ReadableStreamDefaultControllerErrorIfNeeded ( controller, e ) nothrow
  */
 static MOZ_MUST_USE bool
 ReadableStreamDefaultControllerErrorIfNeeded(JSContext* cx,
                                              Handle<ReadableStreamDefaultController*> unwrappedController,
                                              HandleValue e)
 {
     MOZ_ASSERT(!cx->isExceptionPending());
 
@@ -3112,40 +3142,43 @@ ReadableStreamDefaultControllerErrorIfNe
     //         perform ! ReadableStreamDefaultControllerError(controller, e).
     if (unwrappedController->stream()->readable()) {
         return ReadableStreamControllerError(cx, unwrappedController, e);
     }
     return true;
 }
 
 /**
- * Streams spec, 3.9.8. ReadableStreamDefaultControllerGetDesiredSize ( controller )
- * Streams spec 3.12.14. ReadableByteStreamControllerGetDesiredSize ( controller )
+ * Streams spec, 3.9.8.
+ *      ReadableStreamDefaultControllerGetDesiredSize ( controller )
+ * Streams spec 3.12.14.
+ *      ReadableByteStreamControllerGetDesiredSize ( controller )
  */
 static MOZ_MUST_USE double
 ReadableStreamControllerGetDesiredSizeUnchecked(ReadableStreamController* controller)
 {
     // Steps 1-4 done at callsites, so only assert that they have been done.
 #if DEBUG
     ReadableStream* stream = controller->stream();
     MOZ_ASSERT(!(stream->errored() || stream->closed()));
 #endif // DEBUG
 
     // Step 5: Return controller.[[strategyHWM]] − controller.[[queueTotalSize]].
     return controller->strategyHWM() - controller->queueTotalSize();
 }
 
 
-/*** 3.10. Class ReadableByteStreamController ****************************************************/
+/*** 3.10. Class ReadableByteStreamController *******************************/
 
 #if 0 // disable user-defined byte streams
 
 /**
- * Streams spec, 3.10.3 new ReadableByteStreamController ( stream, underlyingSource,
- *                                                         highWaterMark )
+ * Streams spec, 3.10.3
+ *      new ReadableByteStreamController ( stream, underlyingSource,
+ *                                         highWaterMark )
  * Steps 3 - 16.
  *
  * Note: All arguments must be same-compartment with cx. ReadableStream
  * controllers are always created in the same compartment as the stream.
  */
 static MOZ_MUST_USE ReadableByteStreamController*
 CreateReadableByteStreamController(JSContext* cx,
                                    Handle<ReadableStream*> stream,
@@ -3441,29 +3474,32 @@ ReadableByteStreamControllerPullSteps(JS
                 MOZ_ASSERT(cb);
                 cb(cx, unwrappedStream, underlyingSource, unwrappedStream->embeddingFlags(),
                    buffer, queueTotalSize, &bytesWritten);
             }
 
             queueTotalSize = queueTotalSize - bytesWritten;
         } else {
             // Step 3.b: Let entry be the first element of this.[[queue]].
-            // Step 3.c: Remove entry from this.[[queue]], shifting all other elements
-            //           downward (so that the second becomes the first, and so on).
+            // Step 3.c: Remove entry from this.[[queue]], shifting all other
+            //           elements downward (so that the second becomes the
+            //           first, and so on).
             RootedNativeObject unwrappedQueue(cx, unwrappedController->queue());
             Rooted<ByteStreamChunk*> unwrappedEntry(cx,
                 ToUnwrapped<ByteStreamChunk>(cx, ShiftFromList<JSObject>(cx, unwrappedQueue)));
             if (!unwrappedEntry) {
                 return nullptr;
             }
 
             queueTotalSize = queueTotalSize - unwrappedEntry->byteLength();
 
-            // Step 3.f: Let view be ! Construct(%Uint8Array%, « entry.[[buffer]],
-            //                                   entry.[[byteOffset]], entry.[[byteLength]] »).
+            // Step 3.f: Let view be ! Construct(%Uint8Array%,
+            //                                   « entry.[[buffer]],
+            //                                     entry.[[byteOffset]],
+            //                                     entry.[[byteLength]] »).
             // (reordered)
             RootedObject buffer(cx, unwrappedEntry->buffer());
             if (!cx->compartment()->wrap(cx, &buffer)) {
                 return nullptr;
             }
 
             uint32_t byteOffset = unwrappedEntry->byteOffset();
             view = JS_NewUint8ArrayWithBuffer(cx, buffer, byteOffset, unwrappedEntry->byteLength());
@@ -3502,43 +3538,46 @@ ReadableByteStreamControllerPullSteps(JS
 
     // Step 4: Let autoAllocateChunkSize be this.[[autoAllocateChunkSize]].
     val = unwrappedController->autoAllocateChunkSize();
 
     // Step 5: If autoAllocateChunkSize is not undefined,
     if (!val.isUndefined()) {
         double autoAllocateChunkSize = val.toNumber();
 
-        // Step 5.a: Let buffer be Construct(%ArrayBuffer%, « autoAllocateChunkSize »).
+        // Step 5.a: Let buffer be
+        //           Construct(%ArrayBuffer%, « autoAllocateChunkSize »).
         JSObject* bufferObj = JS_NewArrayBuffer(cx, autoAllocateChunkSize);
 
         // Step 5.b: If buffer is an abrupt completion,
         //           return a promise rejected with buffer.[[Value]].
         if (!bufferObj) {
             return PromiseRejectedWithPendingError(cx);
         }
 
         RootedArrayBufferObject buffer(cx, &bufferObj->as<ArrayBufferObject>());
 
-        // Step 5.c: Let pullIntoDescriptor be Record {[[buffer]]: buffer.[[Value]],
-        //                                             [[byteOffset]]: 0,
-        //                                             [[byteLength]]: autoAllocateChunkSize,
-        //                                             [[bytesFilled]]: 0, [[elementSize]]: 1,
-        //                                             [[ctor]]: %Uint8Array%,
-        //                                             [[readerType]]: `"default"`}.
+        // Step 5.c: Let pullIntoDescriptor be
+        //           Record {[[buffer]]: buffer.[[Value]],
+        //                   [[byteOffset]]: 0,
+        //                   [[byteLength]]: autoAllocateChunkSize,
+        //                   [[bytesFilled]]: 0, [[elementSize]]: 1,
+        //                   [[ctor]]: %Uint8Array%,
+        //                   [[readerType]]: `"default"`}.
         RootedObject pullIntoDescriptor(cx,
             PullIntoDescriptor::create(cx, buffer, 0,
                                        autoAllocateChunkSize, 0, 1,
                                        nullptr,
                                        ReaderType_Default));
         if (!pullIntoDescriptor) {
             return PromiseRejectedWithPendingError(cx);
         }
 
-        // Step 5.d: Append pullIntoDescriptor as the last element of this.[[pendingPullIntos]].
+        // Step 5.d: Append pullIntoDescriptor as the last element of
+        //           this.[[pendingPullIntos]].
         if (!AppendToListAtSlot(cx,
                                 unwrappedController,
                                 ReadableByteStreamController::Slot_PendingPullIntos,
                                 pullIntoDescriptor))
         {
             return nullptr;
         }
     }
@@ -3575,39 +3614,42 @@ ReadableStreamControllerPullSteps(JSCont
     }
 
     Rooted<ReadableByteStreamController*> unwrappedByteController(cx,
         &unwrappedController->as<ReadableByteStreamController>());
     return ReadableByteStreamControllerPullSteps(cx, unwrappedByteController);
 }
 
 
-/*** 3.12. Readable stream BYOB controller abstract operations ***********************************/
+/*** 3.12. Readable stream BYOB controller abstract operations **************/
 
 // Streams spec, 3.12.1. IsReadableStreamBYOBRequest ( x )
 // Implemented via is<ReadableStreamBYOBRequest>()
 
 // Streams spec, 3.12.2. IsReadableByteStreamController ( x )
 // Implemented via is<ReadableByteStreamController>()
 
-// Streams spec, 3.12.3. ReadableByteStreamControllerCallPullIfNeeded ( controller )
+// Streams spec, 3.12.3.
+//      ReadableByteStreamControllerCallPullIfNeeded ( controller )
 // Unified with 3.9.2 above.
 
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerInvalidateBYOBRequest(JSContext* cx,
                                                   Handle<ReadableByteStreamController*> unwrappedController);
 
 /**
- * Streams spec, 3.12.5. ReadableByteStreamControllerClearPendingPullIntos ( controller )
+ * Streams spec, 3.12.5.
+ *      ReadableByteStreamControllerClearPendingPullIntos ( controller )
  */
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerClearPendingPullIntos(JSContext* cx,
                                                   Handle<ReadableByteStreamController*> unwrappedController)
 {
-    // Step 1: Perform ! ReadableByteStreamControllerInvalidateBYOBRequest(controller).
+    // Step 1: Perform
+    //         ! ReadableByteStreamControllerInvalidateBYOBRequest(controller).
     if (!ReadableByteStreamControllerInvalidateBYOBRequest(cx, unwrappedController)) {
         return false;
     }
 
     // Step 2: Set controller.[[pendingPullIntos]] to a new empty List.
     return SetNewList(cx, unwrappedController, ReadableByteStreamController::Slot_PendingPullIntos);
 }
 
@@ -3672,52 +3714,57 @@ ReadableByteStreamControllerClose(JSCont
 
     // Step 6: Perform ! ReadableStreamClose(stream).
     return ReadableStreamCloseInternal(cx, unwrappedStream);
 }
 
 // Streams spec, 3.12.11. ReadableByteStreamControllerError ( controller, e )
 // Unified with 3.9.7 above.
 
-// Streams spec 3.12.14. ReadableByteStreamControllerGetDesiredSize ( controller )
+// Streams spec 3.12.14.
+//      ReadableByteStreamControllerGetDesiredSize ( controller )
 // Unified with 3.9.8 above.
 
 /**
- * Streams spec, 3.12.15. ReadableByteStreamControllerHandleQueueDrain ( controller )
+ * Streams spec, 3.12.15.
+ *      ReadableByteStreamControllerHandleQueueDrain ( controller )
  */
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerHandleQueueDrain(JSContext* cx,
                                              Handle<ReadableStreamController*> unwrappedController)
 {
     MOZ_ASSERT(unwrappedController->is<ReadableByteStreamController>());
 
-    // Step 1: Assert: controller.[[controlledReadableStream]].[[state]] is "readable".
+    // Step 1: Assert: controller.[[controlledReadableStream]].[[state]]
+    //                 is "readable".
     Rooted<ReadableStream*> unwrappedStream(cx, unwrappedController->stream());
     MOZ_ASSERT(unwrappedStream->readable());
 
     // Step 2: If controller.[[queueTotalSize]] is 0 and
     //         controller.[[closeRequested]] is true,
     if (unwrappedController->queueTotalSize() == 0 && unwrappedController->closeRequested()) {
-        // Step a: Perform ! ReadableStreamClose(controller.[[controlledReadableStream]]).
+        // Step a: Perform
+        //         ! ReadableStreamClose(controller.[[controlledReadableStream]]).
         return ReadableStreamCloseInternal(cx, unwrappedStream);
     }
 
     // Step 3: Otherwise,
     // Step a: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller).
     return ReadableStreamControllerCallPullIfNeeded(cx, unwrappedController);
 }
 
 enum BYOBRequestSlots {
     BYOBRequestSlot_Controller,
     BYOBRequestSlot_View,
     BYOBRequestSlotCount
 };
 
 /**
- * Streams spec 3.12.16. ReadableByteStreamControllerInvalidateBYOBRequest ( controller )
+ * Streams spec 3.12.16.
+ *      ReadableByteStreamControllerInvalidateBYOBRequest ( controller )
  */
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerInvalidateBYOBRequest(JSContext* cx,
                                                   Handle<ReadableByteStreamController*> unwrappedController)
 {
     // Step 1: If controller.[[byobRequest]] is undefined, return.
     RootedValue unwrappedBYOBRequestVal(cx, unwrappedController->byobRequest());
     if (unwrappedBYOBRequestVal.isUndefined()) {
@@ -3725,34 +3772,36 @@ ReadableByteStreamControllerInvalidateBY
     }
 
     RootedNativeObject unwrappedBYOBRequest(cx,
         ToUnwrapped<NativeObject>(cx, unwrappedBYOBRequestVal));
     if (!unwrappedBYOBRequest) {
         return false;
     }
 
-    // Step 2: Set controller.[[byobRequest]].[[associatedReadableByteStreamController]]
+    // Step 2: Set controller.[[byobRequest]]
+    //                       .[[associatedReadableByteStreamController]]
     //         to undefined.
     unwrappedBYOBRequest->setFixedSlot(BYOBRequestSlot_Controller, UndefinedValue());
 
     // Step 3: Set controller.[[byobRequest]].[[view]] to undefined.
     unwrappedBYOBRequest->setFixedSlot(BYOBRequestSlot_View, UndefinedValue());
 
     // Step 4: Set controller.[[byobRequest]] to undefined.
     unwrappedController->clearBYOBRequest();
 
     return true;
 }
 
-// Streams spec, 3.12.25. ReadableByteStreamControllerShouldCallPull ( controller )
+// Streams spec, 3.12.25.
+//      ReadableByteStreamControllerShouldCallPull ( controller )
 // Unified with 3.9.3 above.
 
 
-/*** 6.1. Queuing strategies *********************************************************************/
+/*** 6.1. Queuing strategies ************************************************/
 
 // Streams spec, 6.1.2.2. new ByteLengthQueuingStrategy({ highWaterMark })
 bool
 js::ByteLengthQueuingStrategy::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject strategy(cx, NewBuiltinClassInstance<ByteLengthQueuingStrategy>(cx));
@@ -3848,17 +3897,17 @@ static const JSFunctionSpec CountQueuing
     JS_FS_END
 };
 
 CLASS_SPEC(CountQueuingStrategy, 1, 0, 0, 0, JS_NULL_CLASS_OPS);
 
 #undef CLASS_SPEC
 
 
-/*** 6.2. Queue-with-sizes operations ************************************************************/
+/*** 6.2. Queue-with-sizes operations ***************************************/
 
 /**
  * Streams spec, 6.2.1. DequeueValue ( container ) nothrow
  */
 inline static MOZ_MUST_USE bool
 DequeueValue(JSContext* cx, Handle<ReadableStreamController*> unwrappedContainer, MutableHandleValue chunk)
 {
     // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal
@@ -3918,18 +3967,18 @@ EnqueueValueWithSize(JSContext* cx,
     // Step 3: If ! IsFiniteNonNegativeNumber(size) is false, throw a RangeError
     //         exception.
     if (size < 0 || mozilla::IsNaN(size) || mozilla::IsInfinite(size)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_NUMBER_MUST_BE_FINITE_NON_NEGATIVE, "size");
         return false;
     }
 
-    // Step 4: Append Record {[[value]]: value, [[size]]: size} as the last element
-    //         of container.[[queue]].
+    // Step 4: Append Record {[[value]]: value, [[size]]: size} as the last
+    //         element of container.[[queue]].
     {
         AutoRealm ar(cx, unwrappedContainer);
         RootedNativeObject queue(cx, unwrappedContainer->queue());
         RootedValue wrappedVal(cx, value);
         if (!cx->compartment()->wrap(cx, &wrappedVal)) {
             return false;
         }
 
@@ -3968,17 +4017,17 @@ ResetQueue(JSContext* cx, Handle<Readabl
 
     // Step 3: Set container.[[queueTotalSize]] to 0.
     unwrappedContainer->setQueueTotalSize(0);
 
     return true;
 }
 
 
-/*** 6.3. Miscellaneous operations ***************************************************************/
+/*** 6.3. Miscellaneous operations ******************************************/
 
 /**
  * Appends the given |obj| to the given list |container|'s list.
  */
 inline static MOZ_MUST_USE bool
 AppendToListAtSlot(JSContext* cx,
                    HandleNativeObject unwrappedContainer,
                    uint32_t slot,
@@ -4064,40 +4113,42 @@ ValidateAndNormalizeHighWaterMark(JSCont
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_STREAM_INVALID_HIGHWATERMARK);
         return false;
     }
 
     // Step 4: Return highWaterMark.
     return true;
 }
 
-// Streams spec, obsolete (previously 6.4.6) ValidateAndNormalizeQueuingStrategy ( size, highWaterMark )
+// Streams spec, obsolete (previously 6.4.6)
+//      ValidateAndNormalizeQueuingStrategy ( size, highWaterMark )
 static MOZ_MUST_USE bool
 ValidateAndNormalizeQueuingStrategy(JSContext* cx, HandleValue size,
                                     HandleValue highWaterMarkVal, double* highWaterMark)
 {
     // Step 1: If size is not undefined and ! IsCallable(size) is false, throw a
     //         TypeError exception.
     if (!size.isUndefined() && !IsCallable(size)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION,
                                   "ReadableStream argument options.size");
         return false;
     }
 
-    // Step 2: Let highWaterMark be ? ValidateAndNormalizeHighWaterMark(highWaterMark).
+    // Step 2: Let highWaterMark be
+    //         ? ValidateAndNormalizeHighWaterMark(highWaterMark).
     if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, highWaterMark)) {
         return false;
     }
 
     // Step 3: Return Record {[[size]]: size, [[highWaterMark]]: highWaterMark}.
     return true;
 }
 
 
-/*** API entry points ****************************************************************************/
+/*** API entry points *******************************************************/
 
 JS_FRIEND_API JSObject*
 js::UnwrapReadableStream(JSObject* obj)
 {
     if (JSObject* unwrapped = CheckedUnwrap(obj)) {
         return unwrapped->is<ReadableStream>() ? unwrapped : nullptr;
     }
     return nullptr;
@@ -4415,17 +4466,18 @@ JS::ReadableStreamUpdateDataAvailableFro
         return false;
     }
     if (hasDefaultReader) {
         // Step b: Otherwise,
         // Step i: Assert: controller.[[queue]] is empty.
         MOZ_ASSERT(oldAvailableData == 0);
 
         // Step ii: Let transferredView be
-        //          ! Construct(%Uint8Array%, transferredBuffer, byteOffset, byteLength).
+        //          ! Construct(%Uint8Array%, transferredBuffer,
+        //                      byteOffset, byteLength).
         JSObject* viewObj = JS_NewUint8Array(cx, availableData);
         if (!viewObj) {
             return false;
         }
         Rooted<ArrayBufferViewObject*> transferredView(cx, &viewObj->as<ArrayBufferViewObject>());
         if (!transferredView) {
             return false;
         }
@@ -4440,33 +4492,32 @@ JS::ReadableStreamUpdateDataAvailableFro
             bool dummy;
             void* buffer = JS_GetArrayBufferViewData(transferredView, &dummy, noGC);
             auto cb = cx->runtime()->readableStreamWriteIntoReadRequestCallback;
             MOZ_ASSERT(cb);
             cb(cx, unwrappedStream, underlyingSource, unwrappedStream->embeddingFlags(), buffer,
                availableData, &bytesWritten);
         }
 
-        // Step iii: Perform ! ReadableStreamFulfillReadRequest(stream, transferredView, false).
+        // Step iii: Perform ! ReadableStreamFulfillReadRequest(stream,
+        //                                                      transferredView,
+        //                                                      false).
         RootedValue chunk(cx, ObjectValue(*transferredView));
         if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, unwrappedStream, chunk, false)) {
             return false;
         }
 
         unwrappedController->setQueueTotalSize(availableData - bytesWritten);
     } else {
         // Step b: Otherwise,
         // Step i: Assert: ! IsReadableStreamLocked(stream) is false.
         MOZ_ASSERT(!unwrappedStream->locked());
 
-        // Step ii: Perform
-        //          ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
-        //                                                            transferredBuffer,
-        //                                                            byteOffset,
-        //                                                            byteLength).
+        // Step ii: Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(
+        //              controller, transferredBuffer, byteOffset, byteLength).
         // (Not needed for external underlying sources.)
     }
 
     return true;
 }
 
 JS_PUBLIC_API bool
 JS::ReadableStreamTee(JSContext* cx, HandleObject streamObj,
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -2789,31 +2789,32 @@ BuildFlatRopeReplacement(JSContext* cx, 
 template <typename CharT>
 static bool
 AppendDollarReplacement(StringBuffer& newReplaceChars, size_t firstDollarIndex,
                         size_t matchStart, size_t matchLimit, JSLinearString* text,
                         const CharT* repChars, size_t repLength)
 {
     MOZ_ASSERT(firstDollarIndex < repLength);
 
-    /* Move the pre-dollar chunk in bulk. */
+    // Move the pre-dollar chunk in bulk.
     newReplaceChars.infallibleAppend(repChars, firstDollarIndex);
 
-    /* Move the rest char-by-char, interpreting dollars as we encounter them. */
+    // Move the rest char-by-char, interpreting dollars as we encounter them.
     const CharT* repLimit = repChars + repLength;
     for (const CharT* it = repChars + firstDollarIndex; it < repLimit; ++it) {
         if (*it != '$' || it == repLimit - 1) {
             if (!newReplaceChars.append(*it)) {
                 return false;
             }
             continue;
         }
 
         switch (*(it + 1)) {
-          case '$': /* Eat one of the dollars. */
+          case '$':
+            // Eat one of the dollars.
             if (!newReplaceChars.append(*it)) {
                 return false;
             }
             break;
           case '&':
             if (!newReplaceChars.appendSubstring(text, matchStart, matchLimit - matchStart)) {
                 return false;
             }
@@ -2823,23 +2824,25 @@ AppendDollarReplacement(StringBuffer& ne
                 return false;
             }
             break;
           case '\'':
             if (!newReplaceChars.appendSubstring(text, matchLimit, text->length() - matchLimit)) {
                 return false;
             }
             break;
-          default: /* The dollar we saw was not special (no matter what its mother told it). */
+          default:
+            // The dollar we saw was not special (no matter what its mother told
+            // it).
             if (!newReplaceChars.append(*it)) {
                 return false;
             }
             continue;
         }
-        ++it; /* We always eat an extra char in the above switch. */
+        ++it; // We always eat an extra char in the above switch.
     }
 
     return true;
 }
 
 /*
  * Perform a linear-scan dollar substitution on the replacement text.
  */
@@ -4279,35 +4282,36 @@ static bool
 BuildFlatMatchArray(JSContext* cx, HandleString str, HandleString pattern, int32_t match,
                     MutableHandleValue rval)
 {
     if (match < 0) {
         rval.setNull();
         return true;
     }
 
-    /* Get the templateObject that defines the shape and type of the output object */
+    // Get the templateObject that defines the shape and type of the output
+    // object.
     JSObject* templateObject = cx->realm()->regExps.getOrCreateMatchResultTemplateObject(cx);
     if (!templateObject) {
         return false;
     }
 
     RootedArrayObject arr(cx, NewDenseFullyAllocatedArrayWithTemplate(cx, 1, templateObject));
     if (!arr) {
         return false;
     }
 
-    /* Store a Value for each pair. */
+    // Store a Value for each pair.
     arr->setDenseInitializedLength(1);
     arr->initDenseElement(0, StringValue(pattern));
 
-    /* Set the |index| property. (TemplateObject positions it in slot 0) */
+    // Set the |index| property. (TemplateObject positions it in slot 0).
     arr->setSlot(0, Int32Value(match));
 
-    /* Set the |input| property. (TemplateObject positions it in slot 1) */
+    // Set the |input| property. (TemplateObject positions it in slot 1).
     arr->setSlot(1, StringValue(str));
 
 #ifdef DEBUG
     RootedValue test(cx);
     RootedId id(cx, NameToId(cx->names().index));
     if (!NativeGetProperty(cx, arr, id, &test)) {
         return false;
     }
--- a/js/src/builtin/String.h
+++ b/js/src/builtin/String.h
@@ -37,17 +37,17 @@ extern bool
 str_fromCharCode_one_arg(JSContext* cx, HandleValue code, MutableHandleValue rval);
 
 extern bool
 str_fromCodePoint(JSContext* cx, unsigned argc, Value* vp);
 
 extern bool
 str_fromCodePoint_one_arg(JSContext* cx, HandleValue code, MutableHandleValue rval);
 
-/* String methods exposed so they can be installed in the self-hosting global. */
+// String methods exposed so they can be installed in the self-hosting global.
 
 extern bool
 str_includes(JSContext* cx, unsigned argc, Value* vp);
 
 extern bool
 str_indexOf(JSContext* cx, unsigned argc, Value* vp);
 
 extern bool
--- a/js/src/builtin/TypedObject.h
+++ b/js/src/builtin/TypedObject.h
@@ -842,17 +842,18 @@ MOZ_MUST_USE bool ObjectIsOpaqueTypedObj
 
 /*
  * Usage: ObjectIsTransparentTypedObject(obj)
  *
  * True if `obj` is a transparent typed object.
  */
 MOZ_MUST_USE bool ObjectIsTransparentTypedObject(JSContext* cx, unsigned argc, Value* vp);
 
-/* Predicates on type descriptor objects.  In all cases, 'obj' must be a type descriptor. */
+// Predicates on type descriptor objects.  In all cases, 'obj' must be a type
+// descriptor.
 
 MOZ_MUST_USE bool TypeDescrIsSimpleType(JSContext*, unsigned argc, Value* vp);
 
 MOZ_MUST_USE bool TypeDescrIsArrayType(JSContext*, unsigned argc, Value* vp);
 
 /*
  * Usage: TypedObjectIsAttached(obj)
  *
--- a/js/src/builtin/intl/IntlObject.h
+++ b/js/src/builtin/intl/IntlObject.h
@@ -32,17 +32,18 @@ InitIntlClass(JSContext* cx, JS::Handle<
  * properties:
  *
  *   firstDayOfWeek
  *     an integer in the range 1=Sunday to 7=Saturday indicating the day
  *     considered the first day of the week in calendars, e.g. 1 for en-US,
  *     2 for en-GB, 1 for bn-IN
  *   minDays
  *     an integer in the range of 1 to 7 indicating the minimum number
- *     of days required in the first week of the year, e.g. 1 for en-US, 4 for de
+ *     of days required in the first week of the year, e.g. 1 for en-US,
+ *     4 for de
  *   weekendStart
  *     an integer in the range 1=Sunday to 7=Saturday indicating the day
  *     considered the beginning of a weekend, e.g. 7 for en-US, 7 for en-GB,
  *     1 for bn-IN
  *   weekendEnd
  *     an integer in the range 1=Sunday to 7=Saturday indicating the day
  *     considered the end of a weekend, e.g. 1 for en-US, 1 for en-GB,
  *     1 for bn-IN (note that "weekend" is *not* necessarily two days)
--- a/js/src/builtin/intl/RelativeTimeFormat.h
+++ b/js/src/builtin/intl/RelativeTimeFormat.h
@@ -51,20 +51,22 @@ CreateRelativeTimeFormatPrototype(JSCont
  */
 extern MOZ_MUST_USE bool
 intl_RelativeTimeFormat_availableLocales(JSContext* cx, unsigned argc, JS::Value* vp);
 
 /**
  * Returns a relative time as a string formatted according to the effective
  * locale and the formatting options of the given RelativeTimeFormat.
  *
- * t should be a number representing a number to be formatted.
- * unit should be "second", "minute", "hour", "day", "week", "month", "quarter", or "year".
- * numeric should be "always" or "auto".
+ * |t| should be a number representing a number to be formatted.
+ * |unit| should be "second", "minute", "hour", "day", "week", "month",
+ *                  "quarter", or "year".
+ * |numeric| should be "always" or "auto".
  *
- * Usage: formatted = intl_FormatRelativeTime(relativeTimeFormat, t, unit, numeric)
+ * Usage: formatted = intl_FormatRelativeTime(relativeTimeFormat, t,
+ *                                            unit, numeric)
  */
 extern MOZ_MUST_USE bool
 intl_FormatRelativeTime(JSContext* cx, unsigned argc, JS::Value* vp);
 
 } // namespace js
 
 #endif /* builtin_intl_RelativeTimeFormat_h */
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -2032,17 +2032,17 @@ InitCDataClass(JSContext* cx, HandleObje
                          JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT))
     return nullptr;
 
   // Define properties and functions common to all CDatas.
   if (!JS_DefineProperties(cx, prototype, sCDataProps) ||
       !JS_DefineFunctions(cx, prototype, sCDataFunctions))
     return nullptr;
 
-  if (//!JS_FreezeObject(cx, prototype) || // XXX fixme - see bug 541212!
+  if (// !JS_FreezeObject(cx, prototype) || // XXX fixme - see bug 541212!
       !JS_FreezeObject(cx, ctor))
     return nullptr;
 
   return prototype;
 }
 
 static bool
 DefineABIConstant(JSContext* cx,
@@ -2137,17 +2137,17 @@ InitTypeConstructor(JSContext* cx,
   if (instanceProps && !JS_DefineProperties(cx, dataProto, instanceProps)) {
     return false;
   }
 
   // Link the type prototype to the data prototype.
   JS_SetReservedSlot(typeProto, SLOT_OURDATAPROTO, ObjectValue(*dataProto));
 
   if (!JS_FreezeObject(cx, obj) ||
-      //!JS_FreezeObject(cx, dataProto) || // XXX fixme - see bug 541212!
+      // !JS_FreezeObject(cx, dataProto) || // XXX fixme - see bug 541212!
       !JS_FreezeObject(cx, typeProto))
     return false;
 
   return true;
 }
 
 static JSObject*
 InitInt64Class(JSContext* cx,
@@ -2296,17 +2296,18 @@ InitTypeClasses(JSContext* cx, HandleObj
     return false;
 
   protos[SLOT_CDATAPROTO].set(CDataProto);
 
   // Create and attach the ctypes.{Int64,UInt64} constructors.
   // Each of these has, respectively:
   //   * [[Class]] "Function"
   //   * __proto__ === Function.prototype
-  //   * A constructor that creates a ctypes.{Int64,UInt64} object, respectively.
+  //   * A constructor that creates a ctypes.{Int64,UInt64} object,
+  //     respectively.
   //   * 'prototype' property:
   //     * [[Class]] {"Int64Proto","UInt64Proto"}
   //     * 'constructor' property === ctypes.{Int64,UInt64}
   protos[SLOT_INT64PROTO].set(InitInt64Class(cx, ctypesObj, &sInt64ProtoClass,
     Int64::Construct, sInt64Functions, sInt64StaticFunctions));
   if (!protos[SLOT_INT64PROTO]) {
     return false;
   }
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -8691,23 +8691,25 @@ BytecodeEmitter::emitClass(ClassNode* cl
     //   } else {
     //     objProto = %ObjectPrototype%;
     //   }
     //
     //   let homeObject = ObjectCreate(objProto);
     //
     //   if defined <constructor> {
     //     if defined <BaseExpression> {
-    //       cons = DefineMethod(<constructor>, proto=homeObject, funProto=funProto);
+    //       cons = DefineMethod(<constructor>, proto=homeObject,
+    //                           funProto=funProto);
     //     } else {
     //       cons = DefineMethod(<constructor>, proto=homeObject);
     //     }
     //   } else {
     //     if defined <BaseExpression> {
-    //       cons = DefaultDerivedConstructor(proto=homeObject, funProto=funProto);
+    //       cons = DefaultDerivedConstructor(proto=homeObject,
+    //                                        funProto=funProto);
     //     } else {
     //       cons = DefaultConstructor(proto=homeObject);
     //     }
     //   }
     //
     //   cons.prototype = homeObject;
     //   homeObject.constructor = cons;
     //
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -60,17 +60,17 @@ class NameResolver
 
     /* Append a number to buf. */
     bool appendNumber(double n) {
         char number[30];
         int digits = SprintfLiteral(number, "%g", n);
         return buf->append(number, digits);
     }
 
-    /* Append "[<n>]" to buf, referencing a property named by a numeric literal. */
+    // Append "[<n>]" to buf, referencing a property named by a numeric literal.
     bool appendNumericPropertyReference(double n) {
         return buf->append("[") && appendNumber(n) && buf->append(']');
     }
 
     /*
      * Walk over the given ParseNode, attempting to convert it to a stringified
      * name that respresents where the function is being assigned to.
      *
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -12,16 +12,18 @@
 #include "frontend/TokenStream.h"
 #ifdef ENABLE_BIGINT
 #include "vm/BigIntType.h"
 #endif
 #include "vm/BytecodeUtil.h"
 #include "vm/Printer.h"
 #include "vm/Scope.h"
 
+/* clang-format off */
+//
 // A few notes on lifetime of ParseNode trees:
 //
 // - All the `ParseNode` instances MUST BE explicitly allocated in the context's `LifoAlloc`.
 //   This is typically implemented by the `FullParseHandler` or it can be reimplemented with
 //   a custom `new_`.
 //
 // - The tree is bulk-deallocated when the parser is deallocated. Consequently, references
 //   to a subtree MUST NOT exist once the parser has been deallocated.
@@ -31,16 +33,18 @@
 // - Instances of `LexicalScope::Data` MUST BE allocated as instances of `ParseNode`, in the same
 //   `LifoAlloc`. They are bulk-deallocated alongside the rest of the tree.
 //
 // - Instances of `JSAtom` used throughout the tree (including instances of `PropertyName`) MUST
 //   be kept alive by the parser. This is done through an instance of `AutoKeepAtoms` held by
 //   the parser.
 //
 // - Once the parser is deallocated, the `JSAtom` instances MAY be garbage-collected.
+//
+/* clang-format on */
 
 
 namespace js {
 namespace frontend {
 
 class ParseContext;
 class FullParseHandler;
 class FunctionBox;
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6971,17 +6971,18 @@ GeneralParser<ParseHandler, Unit>::trySt
      * kid3 is the finally statement
      *
      * catch nodes are binary.
      * left is the catch-name/pattern or null
      * right is the catch block
      *
      * catch lvalue nodes are either:
      *   a single identifier
-     *   TokenKind::RightBracket or TokenKind::RightCurly for a destructuring left-hand side
+     *   TokenKind::RightBracket for a destructuring left-hand side
+     *   TokenKind::RightCurly for a destructuring left-hand side
      *
      * finally nodes are TokenKind::LeftCurly statement lists.
      */
 
     Node innerBlock;
     {
         if (!mustMatchToken(TokenKind::LeftCurly, JSMSG_CURLY_BEFORE_TRY)) {
             return null();
@@ -7656,17 +7657,21 @@ GeneralParser<ParseHandler, Unit>::state
             if (forbiddenLetDeclaration) {
                 error(JSMSG_FORBIDDEN_AS_STATEMENT, "lexical declarations");
                 return null();
             }
         } else if (tt == TokenKind::Async) {
             // Peek only on the same line: ExpressionStatement's lookahead
             // restriction is phrased as
             //
-            //   [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]
+            //   [lookahead ∉ { '{',
+            //                  function,
+            //                  async [no LineTerminator here] function,
+            //                  class,
+            //                  let '[' }]
             //
             // meaning that code like this is valid:
             //
             //   if (true)
             //     async       // ASI opportunity
             //   function clownshoes() {}
             TokenKind maybeFunction;
             if (!tokenStream.peekTokenSameLine(&maybeFunction)) {
@@ -9502,17 +9507,19 @@ GeneralParser<ParseHandler, Unit>::check
                                                                        PossibleError* exprPossibleError,
                                                                        PossibleError* possibleError)
 {
     // ES2018 draft rev 0719f44aab93215ed9a626b2f45bd34f36916834
     // 12.15.5 Destructuring Assignment
     //
     // AssignmentElement[Yield, Await]:
     //   DestructuringAssignmentTarget[?Yield, ?Await]
-    //   DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]
+    //   DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In,
+    //                                                             ?Yield,
+    //                                                             ?Await]
 
     // If |expr| is an assignment element with an initializer expression, its
     // destructuring assignment target was already validated in assignExpr().
     // Otherwise we need to check that |expr| is a valid destructuring target.
     if (handler.isUnparenthesizedAssignment(expr)) {
         // Report any pending expression error if we're definitely not in a
         // destructuring context.
         if (!possibleError) {
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -258,17 +258,17 @@ class MOZ_STACK_CLASS ParserBase
 
     ScriptSource*       ss;
 
     RootedScriptSourceObject sourceObject;
 
     /* Root atoms and objects allocated for the parsed tree. */
     AutoKeepAtoms       keepAtoms;
 
-    /* Perform constant-folding; must be true when interfacing with the emitter. */
+    // Perform constant-folding; must be true when interfacing with the emitter.
     const bool          foldConstants:1;
 
   protected:
 #if DEBUG
     /* Our fallible 'checkOptions' member function has been called. */
     bool checkOptionsCalled:1;
 #endif
 
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -43,17 +43,17 @@
  *                               PRE-BARRIER
  *
  * To understand the pre-barrier, let's consider how incremental GC works. The
  * GC itself is divided into "slices". Between each slice, JS code is allowed to
  * run. Each slice should be short so that the user doesn't notice the
  * interruptions. In our GC, the structure of the slices is as follows:
  *
  * 1. ... JS work, which leads to a request to do GC ...
- * 2. [first GC slice, which performs all root marking and possibly more marking]
+ * 2. [first GC slice, which performs all root marking and (maybe) more marking]
  * 3. ... more JS work is allowed to run ...
  * 4. [GC mark slice, which runs entirely in GCRuntime::markUntilBudgetExhaused]
  * 5. ... more JS work ...
  * 6. [GC mark slice, which runs entirely in GCRuntime::markUntilBudgetExhaused]
  * 7. ... more JS work ...
  * 8. [GC marking finishes; sweeping done non-incrementally; GC is done]
  * 9. ... JS continues uninterrupted now that GC is finishes ...
  *
--- a/js/src/gc/FindSCCs.h
+++ b/js/src/gc/FindSCCs.h
@@ -57,17 +57,18 @@ struct GraphNodeBase
  *     void findOutgoingEdges(MyComponentFinder& finder)
  *     {
  *         for edge in my_outgoing_edges:
  *             if is_relevant(edge):
  *                 finder.addEdgeTo(edge.destination)
  *     }
  * }
  *
- * struct MyComponentFinder : public ComponentFinder<MyGraphNode, MyComponentFinder>
+ * struct MyComponentFinder : public ComponentFinder<MyGraphNode,
+ *                                                   MyComponentFinder>
  * {
  *     ...
  * };
  *
  * MyComponentFinder finder;
  * finder.addNode(v);
  */
 
@@ -144,17 +145,18 @@ class ComponentFinder
             cur->gcLowLink = Min(cur->gcLowLink, w->gcDiscoveryTime);
         }
     }
 
   private:
     /* Constant used to indicate an unprocessed vertex. */
     static const unsigned Undefined = 0;
 
-    /* Constant used to indicate an processed vertex that is no longer on the stack. */
+    // Constant used to indicate an processed vertex that is no longer on the
+    // stack.
     static const unsigned Finished = (unsigned)-1;
 
     void processNode(Node* v) {
         v->gcDiscoveryTime = clock;
         v->gcLowLink = clock;
         ++clock;
 
         v->gcNextGraphNode = stack;
--- a/js/src/gc/GC-inl.h
+++ b/js/src/gc/GC-inl.h
@@ -281,16 +281,18 @@ class ZoneCellIter<TenuredCell> {
 
     void next() {
         MOZ_ASSERT(!done());
         cellIter.next();
         settle();
     }
 };
 
+/* clang-format off */
+//
 // Iterator over the cells in a Zone, where the GC type (JSString, JSObject) is
 // known, for a single AllocKind. Example usages:
 //
 //   for (auto obj = zone->cellIter<JSObject>(AllocKind::OBJECT0); !obj.done(); obj.next()) {
 //       ...
 //   }
 //
 //   for (auto script = zone->cellIter<JSScript>(); !script.done(); script.next()) {
@@ -315,16 +317,17 @@ class ZoneCellIter<TenuredCell> {
 // remove themselves from the store buffer on deletion, but currently for
 // subtle reasons that isn't good enough.)
 //
 // If the iterator is used within a GC, then there is no need to evict the
 // nursery (again). You may select a variant that will skip the eviction either
 // by specializing on a GCType that is never allocated in the nursery, or
 // explicitly by passing in a trailing AutoAssertEmptyNursery argument.
 //
+/* clang-format on */
 template <typename GCType>
 class ZoneCellIter : public ZoneCellIter<TenuredCell> {
   public:
     // Non-nursery allocated (equivalent to having an entry in
     // MapTypeToFinalizeKind). The template declaration here is to discard this
     // constructor overload if MapTypeToFinalizeKind<GCType>::kind does not
     // exist. Note that there will be no remaining overloads that will work,
     // which makes sense given that you haven't specified which of the
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -1382,37 +1382,35 @@ GCRuntime::init(uint32_t maxbytes, uint3
     }
 
     return true;
 }
 
 void
 GCRuntime::finish()
 {
-    /* Wait for nursery background free to end and disable it to release memory. */
+    // Wait for nursery background free to end and disable it to release memory.
     if (nursery().isEnabled()) {
         nursery().waitBackgroundFreeEnd();
         nursery().disable();
     }
 
-    /*
-     * Wait until the background finalization and allocation stops and the
-     * helper thread shuts down before we forcefully release any remaining GC
-     * memory.
-     */
+    // Wait until the background finalization and allocation stops and the
+    // helper thread shuts down before we forcefully release any remaining GC
+    // memory.
     sweepTask.join();
     allocTask.cancelAndWait();
     decommitTask.cancelAndWait();
 
 #ifdef JS_GC_ZEAL
-    /* Free memory associated with GC verification. */
+    // Free memory associated with GC verification.
     finishVerifier();
 #endif
 
-    /* Delete all remaining zones. */
+    // Delete all remaining zones.
     if (rt->gcInitialized) {
         AutoSetThreadIsSweeping threadIsSweeping;
         for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
             for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
                 for (RealmsInCompartmentIter realm(comp); !realm.done(); realm.next()) {
                     js_delete(realm.get());
                 }
                 comp->realms().clear();
@@ -5624,50 +5622,47 @@ js::NotifyGCPostSwap(JSObject* a, JSObje
     }
 }
 
 IncrementalProgress
 GCRuntime::endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget)
 {
     gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP_MARK);
 
-    /*
-     * Mark any incoming black pointers from previously swept compartments
-     * whose referents are not marked. This can occur when gray cells become
-     * black by the action of UnmarkGray.
-     */
+    // Mark any incoming black pointers from previously swept compartments
+    // whose referents are not marked. This can occur when gray cells become
+    // black by the action of UnmarkGray.
     markIncomingCrossCompartmentPointers(MarkColor::Black);
     markWeakReferencesInCurrentGroup(gcstats::PhaseKind::SWEEP_MARK_WEAK);
 
-    /*
-     * Change state of current group to MarkGray to restrict marking to this
-     * group.  Note that there may be pointers to the atoms zone, and
-     * these will be marked through, as they are not marked with
-     * TraceCrossCompartmentEdge.
-     */
+    // Change state of current group to MarkGray to restrict marking to this
+    // group.  Note that there may be pointers to the atoms zone, and
+    // these will be marked through, as they are not marked with
+    // TraceCrossCompartmentEdge.
     for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next()) {
         zone->changeGCState(Zone::Mark, Zone::MarkGray);
     }
     marker.setMarkColorGray();
 
-    /* Mark incoming gray pointers from previously swept compartments. */
+    // Mark incoming gray pointers from previously swept compartments.
     markIncomingCrossCompartmentPointers(MarkColor::Gray);
 
-    /* Mark gray roots and mark transitively inside the current compartment group. */
+    // Mark gray roots and mark transitively inside the current compartment
+    // group.
     markGrayReferencesInCurrentGroup(gcstats::PhaseKind::SWEEP_MARK_GRAY);
     markWeakReferencesInCurrentGroup(gcstats::PhaseKind::SWEEP_MARK_GRAY_WEAK);
 
-    /* Restore marking state. */
+    // Restore marking state.
     for (SweepGroupZonesIter zone(rt); !zone.done(); zone.next()) {
         zone->changeGCState(Zone::MarkGray, Zone::Mark);
     }
     MOZ_ASSERT(marker.isDrained());
     marker.setMarkColorBlack();
 
-    /* We must not yield after this point before we start sweeping the group. */
+    // We must not yield after this point before we start sweeping the group.
     safeToYield = false;
 
     return Finished;
 }
 
 // Causes the given WeakCache to be swept when run.
 class ImmediateSweepWeakCacheTask : public GCParallelTaskHelper<ImmediateSweepWeakCacheTask>
 {
@@ -7493,17 +7488,17 @@ GCRuntime::incrementalSlice(SliceBudget&
             break;
         }
 
         MOZ_FALLTHROUGH;
 
       case State::Mark:
         AutoGCRooter::traceAllWrappers(rt->mainContextFromOwnThread(), &marker);
 
-        /* If we needed delayed marking for gray roots, then collect until done. */
+        // If we needed delayed marking for gray roots, then collect until done.
         if (isIncremental && !hasValidGrayRootsBuffer()) {
             budget.makeUnlimited();
             isIncremental = false;
             stats().nonincremental(AbortReason::GrayRootBufferingFailed);
         }
 
         if (markUntilBudgetExhaused(budget, gcstats::PhaseKind::MARK) == NotFinished) {
             break;
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -845,17 +845,17 @@ class GCRuntime
 #ifdef JS_GC_ZEAL
     /* Whether to pay attention the zeal settings in this incremental slice. */
     MainThreadData<bool> useZeal;
 #endif
 
     /* Indicates that the last incremental slice exhausted the mark stack. */
     MainThreadData<bool> lastMarkSlice;
 
-    /* Whether it's currently safe to yield to the mutator in an incremental GC. */
+    // Whether it's currently safe to yield to the mutator in an incremental GC.
     MainThreadData<bool> safeToYield;
 
     /* Whether any sweeping will take place in the separate GC helper thread. */
     MainThreadData<bool> sweepOnBackgroundThread;
 
     /* Singly linked list of zones to be swept in the background. */
     HelperThreadLockData<ZoneList> backgroundSweepZones;
 
--- a/js/src/gc/Heap.h
+++ b/js/src/gc/Heap.h
@@ -53,17 +53,17 @@ struct Chunk;
  * estimated lifetime or lifetime requirements of objects allocated from that
  * site.
  */
 enum InitialHeap : uint8_t {
     DefaultHeap,
     TenuredHeap
 };
 
-/* Cells are aligned to CellAlignShift, so the largest tagged null pointer is: */
+// Cells are aligned to CellAlignShift, so the largest tagged null pointer is:
 const uintptr_t LargestTaggedNullCellPointer = (1 << CellAlignShift) - 1;
 
 /*
  * The minimum cell size ends up as twice the cell alignment because the mark
  * bitmap contains one bit per CellBytesPerMarkBit bytes (which is equal to
  * CellAlignBytes) and we need two mark bits per cell.
  */
 const size_t MarkBitsPerCell = 2;
@@ -513,17 +513,18 @@ struct ChunkTrailer
 
     // Provide quick access to the runtime from absolutely anywhere.
     JSRuntime*      runtime;
 };
 
 static_assert(sizeof(ChunkTrailer) == ChunkTrailerSize,
               "ChunkTrailer size must match the API defined size.");
 
-/* The chunk header (located at the end of the chunk to preserve arena alignment). */
+// The chunk header (located at the end of the chunk to preserve arena
+// alignment).
 struct ChunkInfo
 {
     void init() {
         next = prev = nullptr;
     }
 
   private:
     friend class ChunkPool;
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -74,16 +74,17 @@ using mozilla::PodCopy;
 // --------
 //
 // The secondary JSTracer is the CallbackTracer. This simply invokes a callback
 // on each edge in a child.
 //
 // The following is a rough outline of the general struture of the tracing
 // internals.
 //
+/* clang-format off */
 //                                                                                              //
 //   .---------.    .---------.    .--------------------------.       .----------.              //
 //   |TraceEdge|    |TraceRoot|    |TraceManuallyBarrieredEdge|  ...  |TraceRange|   ... etc.   //
 //   '---------'    '---------'    '--------------------------'       '----------'              //
 //        \              \                        /                        /                    //
 //         \              \  .-----------------. /                        /                     //
 //          o------------->o-|TraceEdgeInternal|-o<----------------------o                      //
 //                           '-----------------'                                                //
@@ -114,19 +115,20 @@ using mozilla::PodCopy;
 //      o<-----------------o<========================OO============Oo                           //
 //                                                                                              //
 //                                                                                              //
 //   Legend:                                                                                    //
 //     ------  Direct calls                                                                     //
 //     . . .   Static dispatch                                                                  //
 //     ======  Dispatch through a manual stack.                                                 //
 //                                                                                              //
+/* clang-format on */
 
 
-/*** Tracing Invariants **************************************************************************/
+/*** Tracing Invariants *****************************************************/
 
 #if defined(DEBUG)
 template<typename T>
 static inline bool
 IsThingPoisoned(T* thing)
 {
     const uint8_t poisonBytes[] = {
         JS_FRESH_NURSERY_PATTERN,
@@ -391,17 +393,17 @@ js::gc::AssertRootMarkingPhase(JSTracer*
 {
     MOZ_ASSERT_IF(trc->isMarkingTracer(),
                   trc->runtime()->gc.state() == State::NotActive ||
                   trc->runtime()->gc.state() == State::MarkRoots);
 }
 #endif
 
 
-/*** Tracing Interface ***************************************************************************/
+/*** Tracing Interface ******************************************************/
 
 template <typename T> T DoCallback(JS::CallbackTracer* trc, T* thingp, const char* name);
 template <typename T> void DoMarking(GCMarker* gcmarker, T* thing);
 template <typename T> void DoMarking(GCMarker* gcmarker, const T& thing);
 template <typename T> void NoteWeakEdge(GCMarker* gcmarker, T** thingp);
 template <typename T> void NoteWeakEdge(GCMarker* gcmarker, T* thingp);
 
 template <typename T>
@@ -592,17 +594,17 @@ js::gc::TraceRangeInternal(JSTracer* trc
         if (InternalBarrierMethods<T>::isMarkable(vec[i])) {
             TraceEdgeInternal(trc, &vec[i], name);
         }
         ++index;
     }
 }
 
 
-/*** GC Marking Interface *************************************************************************/
+/*** GC Marking Interface ***************************************************/
 
 namespace js {
 
 typedef bool HasNoImplicitEdgesType;
 
 template <typename T>
 struct ImplicitEdgeHolderType {
     typedef HasNoImplicitEdgesType Type;
@@ -955,17 +957,17 @@ js::GCMarker::mark(T* thing)
     if (!TypeParticipatesInCC<T>::value) {
         return cell->markIfUnmarked(MarkColor::Black);
     }
 
     return cell->markIfUnmarked(markColor());
 }
 
 
-/*** Inline, Eager GC Marking *********************************************************************/
+/*** Inline, Eager GC Marking ***********************************************/
 
 // Each of the eager, inline marking paths is directly preceeded by the
 // out-of-line, generic tracing code for comparison. Both paths must end up
 // traversing equivalent subgraphs.
 
 void
 LazyScript::traceChildren(JSTracer* trc)
 {
@@ -1615,17 +1617,17 @@ VisitTraceList(F f, const int32_t* trace
     traceList++;
     while (*traceList != -1) {
         f(reinterpret_cast<Value*>(memory + *traceList), std::forward<Args>(args)...);
         traceList++;
     }
 }
 
 
-/*** Mark-stack Marking ***************************************************************************/
+/*** Mark-stack Marking *****************************************************/
 
 bool
 GCMarker::markUntilBudgetExhaused(SliceBudget& budget)
 {
 #ifdef DEBUG
     MOZ_ASSERT(!strictCompartmentChecking);
     strictCompartmentChecking = true;
     auto acc = mozilla::MakeScopeExit([&] {strictCompartmentChecking = false;});
@@ -2007,17 +2009,17 @@ GCMarker::restoreValueArray(const MarkSt
             start = end = vp;
         }
     }
 
     return MarkStack::ValueArray(obj, start, end);
 }
 
 
-/*** Mark Stack ***********************************************************************************/
+/*** Mark Stack *************************************************************/
 
 static_assert(sizeof(MarkStack::TaggedPtr) == sizeof(uintptr_t),
               "A TaggedPtr should be the same size as a pointer");
 static_assert(sizeof(MarkStack::ValueArray) == sizeof(MarkStack::SavedValueArray),
               "ValueArray and SavedValueArray should be the same size");
 static_assert((sizeof(MarkStack::ValueArray) % sizeof(uintptr_t)) == 0,
               "ValueArray and SavedValueArray should be multiples of the pointer size");
 
@@ -2459,17 +2461,17 @@ MarkStackIter::saveValueArray(const Mark
 
     MarkStack::TaggedPtr* ptr = &stack_.stack()[pos_ - ValueArrayWords];
     auto dest = reinterpret_cast<MarkStack::SavedValueArray*>(ptr);
     *dest = savedArray;
     MOZ_ASSERT(peekTag() == MarkStack::SavedValueArrayTag);
 }
 
 
-/*** GCMarker *************************************************************************************/
+/*** GCMarker ***************************************************************/
 
 /*
  * ExpandWeakMaps: the GC is recomputing the liveness of WeakMap entries by
  * expanding each live WeakMap into its constituent key->value edges, a table
  * of which will be consulted in a later phase whenever marking a potential
  * key.
  */
 GCMarker::GCMarker(JSRuntime* rt)
@@ -2722,17 +2724,17 @@ GCMarker::sizeOfExcludingThis(mozilla::M
     size_t size = stack.sizeOfExcludingThis(mallocSizeOf);
     for (ZonesIter zone(runtime(), WithAtoms); !zone.done(); zone.next()) {
         size += zone->gcGrayRoots().sizeOfExcludingThis(mallocSizeOf);
     }
     return size;
 }
 
 
-/*** Tenuring Tracer *****************************************************************************/
+/*** Tenuring Tracer ********************************************************/
 
 namespace js {
 template <typename T>
 void
 TenuringTracer::traverse(T** tp)
 {
 }
 
@@ -3317,17 +3319,17 @@ js::TenuringTracer::moveStringToTenured(
             nursery().removeMallocedBuffer(chars);
         }
     }
 
     return size;
 }
 
 
-/*** IsMarked / IsAboutToBeFinalized **************************************************************/
+/*** IsMarked / IsAboutToBeFinalized ****************************************/
 
 template <typename T>
 static inline void
 CheckIsMarkedThing(T* thingp)
 {
 #define IS_SAME_TYPE_OR(name, type, _) mozilla::IsSame<type*, T>::value ||
     static_assert(
             JS_FOR_EACH_TRACEKIND(IS_SAME_TYPE_OR)
@@ -3497,17 +3499,17 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(I
 
 #undef INSTANTIATE_INTERNAL_MARKING_FUNCTIONS_FROM_TRACEKIND
 #undef INSTANTIATE_INTERNAL_MARKING_FUNCTIONS
 
 } /* namespace gc */
 } /* namespace js */
 
 
-/*** Cycle Collector Barrier Implementation *******************************************************/
+/*** Cycle Collector Barrier Implementation *********************************/
 
 /*
  * The GC and CC are run independently. Consequently, the following sequence of
  * events can occur:
  * 1. GC runs and marks an object gray.
  * 2. The mutator runs (specifically, some C++ code with access to gray
  *    objects) and creates a pointer from a JS root or other black object to
  *    the gray object. If we re-ran a GC at this point, the object would now be
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -127,17 +127,17 @@ MapAlignedPages(size_t size, size_t alig
     MOZ_ASSERT(size >= allocGranularity);
     MOZ_ASSERT(size % alignment == 0);
     MOZ_ASSERT(size % pageSize == 0);
     MOZ_ASSERT_IF(alignment < allocGranularity, allocGranularity % alignment == 0);
     MOZ_ASSERT_IF(alignment > allocGranularity, alignment % allocGranularity == 0);
 
     void* p = MapMemory(size, MEM_COMMIT | MEM_RESERVE);
 
-    /* Special case: If we want allocation alignment, no further work is needed. */
+    // Special case: If we want allocation alignment, no further work is needed.
     if (alignment == allocGranularity) {
         return p;
     }
 
     if (OffsetFromAligned(p, alignment) == 0) {
         return p;
     }
 
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -308,58 +308,58 @@ js::Nursery::leaveZealMode() {
         setStartPosition();
     }
 }
 #endif // JS_GC_ZEAL
 
 JSObject*
 js::Nursery::allocateObject(JSContext* cx, size_t size, size_t nDynamicSlots, const js::Class* clasp)
 {
-    /* Ensure there's enough space to replace the contents with a RelocationOverlay. */
+    // Ensure there's enough space to replace the contents with a
+    // RelocationOverlay.
     MOZ_ASSERT(size >= sizeof(RelocationOverlay));
 
-    /* Sanity check the finalizer. */
+    // Sanity check the finalizer.
     MOZ_ASSERT_IF(clasp->hasFinalize(), CanNurseryAllocateFinalizedClass(clasp) ||
                                         clasp->isProxy());
 
-    /* Make the object allocation. */
+    // Make the object allocation.
     JSObject* obj = static_cast<JSObject*>(allocate(size));
     if (!obj) {
         return nullptr;
     }
 
-    /* If we want external slots, add them. */
+    // If we want external slots, add them.
     HeapSlot* slots = nullptr;
     if (nDynamicSlots) {
         MOZ_ASSERT(clasp->isNative());
         slots = static_cast<HeapSlot*>(allocateBuffer(cx->zone(), nDynamicSlots * sizeof(HeapSlot)));
         if (!slots) {
-            /*
-             * It is safe to leave the allocated object uninitialized, since we
-             * do not visit unallocated things in the nursery.
-             */
+            // It is safe to leave the allocated object uninitialized, since we
+            // do not visit unallocated things in the nursery.
             return nullptr;
         }
     }
 
-    /* Store slots pointer directly in new object. If no dynamic slots were
-     * requested, caller must initialize slots_ field itself as needed. We
-     * don't know if the caller was a native object or not. */
+    // Store slots pointer directly in new object. If no dynamic slots were
+    // requested, caller must initialize slots_ field itself as needed. We
+    // don't know if the caller was a native object or not.
     if (nDynamicSlots) {
         static_cast<NativeObject*>(obj)->initSlots(slots);
     }
 
     gcTracer.traceNurseryAlloc(obj, size);
     return obj;
 }
 
 Cell*
 js::Nursery::allocateString(Zone* zone, size_t size, AllocKind kind)
 {
-    /* Ensure there's enough space to replace the contents with a RelocationOverlay. */
+    // Ensure there's enough space to replace the contents with a
+    // RelocationOverlay.
     MOZ_ASSERT(size >= sizeof(RelocationOverlay));
 
     size_t allocSize = JS_ROUNDUP(sizeof(StringLayout) - 1 + size, CellAlignBytes);
     auto header = static_cast<StringLayout*>(allocate(allocSize));
     if (!header) {
         return nullptr;
     }
     header->zone = zone;
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -460,17 +460,17 @@ class Nursery
     /*
      * The set of externally malloced buffers potentially kept live by objects
      * stored in the nursery. Any external buffers that do not belong to a
      * tenured thing at the end of a minor GC must be freed.
      */
     typedef HashSet<void*, PointerHasher<void*>, SystemAllocPolicy> MallocedBuffersSet;
     MallocedBuffersSet mallocedBuffers;
 
-    /* A task structure used to free the malloced bufers on a background thread. */
+    // A task structure used to free the malloced bufers on a background thread.
     struct FreeMallocedBuffersTask;
     FreeMallocedBuffersTask* freeMallocedBuffersTask;
 
     /*
      * During a collection most hoisted slot and element buffers indicate their
      * new location with a forwarding pointer at the base. This does not work
      * for buffers whose length is less than pointer width, or when different
      * buffers might overlap each other. For these, an entry in the following
--- a/js/src/gc/ObjectKind-inl.h
+++ b/js/src/gc/ObjectKind-inl.h
@@ -113,17 +113,18 @@ GetGCObjectKindForBytes(size_t nbytes)
     MOZ_ASSERT(nbytes <= dataSlots * sizeof(Value));
     return GetGCObjectKind(dataSlots);
 }
 
 /* Get the number of fixed slots and initial capacity associated with a kind. */
 static inline size_t
 GetGCKindSlots(AllocKind thingKind)
 {
-    /* Using a switch in hopes that thingKind will usually be a compile-time constant. */
+    // Using a switch in hopes that thingKind will usually be a compile-time
+    // constant.
     switch (thingKind) {
       case AllocKind::FUNCTION:
       case AllocKind::OBJECT0:
       case AllocKind::OBJECT0_BACKGROUND:
         return 0;
       case AllocKind::FUNCTION_EXTENDED:
       case AllocKind::OBJECT2:
       case AllocKind::OBJECT2_BACKGROUND:
--- a/js/src/gc/Rooting.h
+++ b/js/src/gc/Rooting.h
@@ -81,17 +81,20 @@ typedef JS::Rooted<DebuggerObject*>     
 typedef JS::Rooted<Scope*>                  RootedScope;
 typedef JS::Rooted<ModuleObject*>           RootedModuleObject;
 
 typedef JS::GCVector<JSFunction*>   FunctionVector;
 typedef JS::GCVector<PropertyName*> PropertyNameVector;
 typedef JS::GCVector<Shape*>        ShapeVector;
 typedef JS::GCVector<JSString*>     StringVector;
 
-/** Interface substitute for Rooted<T> which does not root the variable's memory. */
+/**
+ * Interface substitute for Rooted<T> which does not root the variable's
+ * memory.
+ */
 template <typename T>
 class MOZ_RAII FakeRooted : public RootedBase<T, FakeRooted<T>>
 {
   public:
     using ElementType = T;
 
     template <typename CX>
     explicit FakeRooted(CX* cx) : ptr(JS::SafelyInitialized<T>()) {}
@@ -109,17 +112,20 @@ class MOZ_RAII FakeRooted : public Roote
 
     void set(const T& value) {
         ptr = value;
     }
 
     FakeRooted(const FakeRooted&) = delete;
 };
 
-/** Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */
+/**
+ * Interface substitute for MutableHandle<T> which is not required to point to
+ * rooted memory.
+ */
 template <typename T>
 class FakeMutableHandle : public js::MutableHandleBase<T, FakeMutableHandle<T>>
 {
   public:
     using ElementType = T;
 
     MOZ_IMPLICIT FakeMutableHandle(T* t) {
         ptr = t;
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -104,18 +104,18 @@
  *   2) Do some known amount of GC work now because the embedding knows now is
  *      a good time to do a long, unblockable operation of a known duration.
  *      These are INTER_SLICE_GC and REFRESH_FRAME.
  *
  *  Correctness reasons:
  *
  *   3) Do a GC now because correctness depends on some GC property. For
  *      example, CC_WAITING is where the embedding requires the mark bits
- *      to be set correct. Also, EVICT_NURSERY where we need to work on the tenured
- *      heap.
+ *      to be set correct. Also, EVICT_NURSERY where we need to work on the
+ *      tenured heap.
  *
  *   4) Do a GC because we are shutting down: e.g. SHUTDOWN_CC or DESTROY_*.
  *
  *   5) Do a GC because a compartment was accessed between GC slices when we
  *      would have otherwise discarded it. We have to do a second GC to clean
  *      it up: e.g. COMPARTMENT_REVIVED.
  *
  *  Emergency Reasons:
--- a/js/src/gc/Tracer.cpp
+++ b/js/src/gc/Tracer.cpp
@@ -35,17 +35,17 @@ using mozilla::DebugOnly;
 
 namespace js {
 template<typename T>
 void
 CheckTracedThing(JSTracer* trc, T thing);
 } // namespace js
 
 
-/*** Callback Tracer Dispatch ********************************************************************/
+/*** Callback Tracer Dispatch ***********************************************/
 
 template <typename T>
 T
 DoCallback(JS::CallbackTracer* trc, T* thingp, const char* name)
 {
     CheckTracedThing(trc, *thingp);
     JS::AutoTracingName ctx(trc, name);
     trc->dispatchToOnEdge(thingp);
@@ -110,17 +110,17 @@ JS::CallbackTracer::getTracingEdgeName(c
     if (contextIndex_ != InvalidIndex) {
         snprintf(buffer, bufferSize, "%s[%zu]", contextName_, contextIndex_);
         return;
     }
     snprintf(buffer, bufferSize, "%s", contextName_);
 }
 
 
-/*** Public Tracing API **************************************************************************/
+/*** Public Tracing API *****************************************************/
 
 JS_PUBLIC_API void
 JS::TraceChildren(JSTracer* trc, GCCellPtr thing)
 {
     js::TraceChildren(trc, thing.asCell(), thing.kind());
 }
 
 struct TraceChildrenFunctor {
@@ -176,17 +176,17 @@ JS::TraceIncomingCCWs(JSTracer* trc, con
             mozilla::DebugOnly<const CrossCompartmentKey> prior = e.front().key();
             e.front().mutableKey().applyToWrapped(TraceIncomingFunctor(trc, compartments));
             MOZ_ASSERT(e.front().key() == prior);
         }
     }
 }
 
 
-/*** Cycle Collector Helpers **********************************************************************/
+/*** Cycle Collector Helpers ************************************************/
 
 // This function is used by the Cycle Collector (CC) to trace through -- or in
 // CC parlance, traverse -- a Shape tree. The CC does not care about Shapes or
 // BaseShapes, only the JSObjects held live by them. Thus, we walk the Shape
 // lineage, but only report non-Shape things. This effectively makes the entire
 // shape lineage into a single node in the CC, saving tremendous amounts of
 // space and time in its algorithms.
 //
@@ -293,17 +293,17 @@ gc::TraceCycleCollectorChildren(JS::Call
 
     while (!groupTracer.worklist.empty()) {
         ObjectGroup* innerGroup = groupTracer.worklist.popCopy();
         innerGroup->traceChildren(&groupTracer);
     }
 }
 
 
-/*** Traced Edge Printer *************************************************************************/
+/*** Traced Edge Printer ****************************************************/
 
 static size_t
 CountDecimalDigits(size_t num)
 {
     size_t numDigits = 0;
     do {
         num /= 10;
         numDigits++;
--- a/js/src/gc/WeakMap-inl.h
+++ b/js/src/gc/WeakMap-inl.h
@@ -239,17 +239,17 @@ WeakMap<K, V>::sweep()
 
 #if DEBUG
     // Once we've swept, all remaining edges should stay within the known-live
     // part of the graph.
     assertEntriesNotAboutToBeFinalized();
 #endif
 }
 
-/* memberOf can be nullptr, which means that the map is not part of a JSObject. */
+// memberOf can be nullptr, which means that the map is not part of a JSObject.
 template <class K, class V>
 void
 WeakMap<K, V>::traceMappings(WeakMapTracer* tracer)
 {
     for (Range r = Base::all(); !r.empty(); r.popFront()) {
         gc::Cell* key = gc::ToMarkable(r.front().key());
         gc::Cell* value = gc::ToMarkable(r.front().value());
         if (key && value) {
--- a/js/src/gc/WeakMap.h
+++ b/js/src/gc/WeakMap.h
@@ -178,17 +178,18 @@ class WeakMap : public HashMap<Key, Valu
 
     void sweep() override;
 
     void clearAndCompact() override {
         Base::clear();
         Base::compact();
     }
 
-    /* memberOf can be nullptr, which means that the map is not part of a JSObject. */
+    // memberOf can be nullptr, which means that the map is not part of a
+    // JSObject.
     void traceMappings(WeakMapTracer* tracer) override;
 
   protected:
 #if DEBUG
     void assertEntriesNotAboutToBeFinalized();
 #endif
 };
 
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1497107.js
@@ -0,0 +1,37 @@
+function makeChain(n, base) {
+    var curr = base;
+    for (var i = 0; i < n; i++) {
+	curr = Object.create(curr);
+	var propname = "level" + i;
+	curr[propname] = true;
+    }
+    return curr;
+}
+
+function BaseClass() {
+    this.base = true;
+}
+
+Object.defineProperty(BaseClass.prototype, "getter", {get: function() { with({}){}; return this.base; }});
+
+function victim(arg) {
+    if (arg.getter) {
+	return 3;
+    } else {
+	return 4;
+    }
+}
+
+let root = new BaseClass();
+let chains = [];
+for (var i = 0; i < 6; i++) {
+    chains.push(makeChain(500, root));
+}
+
+with({}){};
+for (var i = 0; i < 1000 / 6; i++) {
+    with({}){};
+    for (var j = 0; j < chains.length; j++) {
+	victim(chains[j]);
+    }
+}
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -374,18 +374,20 @@ struct BaselineStackBuilder
         // before calling other ion frames, and the entry frame saves all
         // registers too.
         if (JSJitFrameIter::isEntry(type) || type == FrameType::IonJS || type == FrameType::IonICCall) {
             return nullptr;
         }
 
         // BaselineStub - Baseline calling into Ion.
         //  PrevFramePtr needs to point to the BaselineStubFrame's saved frame pointer.
-        //      STACK_START_ADDR + JitFrameLayout::Size() + PREV_FRAME_SIZE
-        //                      - BaselineStubFrameLayout::reverseOffsetOfSavedFramePtr()
+        //      STACK_START_ADDR
+        //          + JitFrameLayout::Size()
+        //          + PREV_FRAME_SIZE
+        //          - BaselineStubFrameLayout::reverseOffsetOfSavedFramePtr()
         if (type == FrameType::BaselineStub) {
             size_t offset = JitFrameLayout::Size() + topFrame->prevFrameLocalSize() +
                             BaselineStubFrameLayout::reverseOffsetOfSavedFramePtr();
             return virtualPointerAtStackOffset(offset);
         }
 
         MOZ_ASSERT(type == FrameType::Rectifier);
         // Rectifier - behaviour depends on the frame preceding the rectifier frame, and
@@ -538,16 +540,17 @@ IsPrologueBailout(const SnapshotIterator
 {
     // If we are propagating an exception for debug mode, we will not resume
     // into baseline code, but instead into HandleExceptionBaseline (i.e.,
     // never before the prologue).
     return iter.pcOffset() == 0 && !iter.resumeAfter() &&
            (!excInfo || !excInfo->propagatingIonExceptionForDebugMode());
 }
 
+/* clang-format off */
 // For every inline frame, we write out the following data:
 //
 //                      |      ...      |
 //                      +---------------+
 //                      |  Descr(???)   |  --- Descr size here is (PREV_FRAME_SIZE)
 //                      +---------------+
 //                      |  ReturnAddr   |
 //             --       +===============+  --- OVERWRITE STARTS HERE  (START_STACK_ADDR)
@@ -613,17 +616,17 @@ IsPrologueBailout(const SnapshotIterator
 //         |            |  ActualArgC   |
 //         |            +---------------+
 //         |            |  CalleeToken  |
 //         |            +---------------+
 //         +------------|  Descr(Rect)  |
 //                      +---------------+
 //                      |  ReturnAddr   | <-- return into ArgumentsRectifier after call
 //                      +===============+
-//
+/* clang-format on */
 static bool
 InitFromBailout(JSContext* cx, size_t frameNo,
                 HandleFunction fun, HandleScript script,
                 SnapshotIterator& iter, bool invalidate, BaselineStackBuilder& builder,
                 MutableHandle<GCVector<Value>> startFrameFormals, MutableHandleFunction nextCallee,
                 const ExceptionBailoutInfo* excInfo)
 {
     // The Baseline frames we will reconstruct on the heap are not rooted, so GC
--- a/js/src/jit/BaselineFrameInfo.h
+++ b/js/src/jit/BaselineFrameInfo.h
@@ -34,19 +34,19 @@ struct BytecodeInfo;
 //    var y = x + 9;
 //
 // Here two values are pushed: StackValue(LocalSlot(0)) and StackValue(Int32Value(9)).
 // Only when we reach the ADD op, code is generated to load the operands directly
 // into the right operand registers and sync all other stack values.
 //
 // For stack values, the following invariants hold (and are checked between ops):
 //
-// (1) If a value is synced (kind == Stack), all values below it must also be synced.
-//     In other words, values with kind other than Stack can only appear on top of the
-//     abstract stack.
+// (1) If a value is synced (kind == Stack), all values below it must also be
+//     synced. In other words, values with kind other than Stack can only appear
+//     on top of the abstract stack.
 //
 // (2) When we call a stub or IC, all values still on the stack must be synced.
 
 // Represents a value pushed on the stack. Note that StackValue is not used for
 // locals or arguments since these are always fully synced.
 class StackValue
 {
   public:
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -361,17 +361,17 @@ TryAttachStub(const char *name, JSContex
 }
 
 
 //
 // WarmUpCounter_Fallback
 //
 
 
-//
+/* clang-format off */
 // The following data is kept in a temporary heap-allocated buffer, stored in
 // JitRuntime (high memory addresses at top, low at bottom):
 //
 //     +----->+=================================+  --      <---- High Address
 //     |      |                                 |   |
 //     |      |     ...BaselineFrame...         |   |-- Copy of BaselineFrame + stack values
 //     |      |                                 |   |
 //     |      +---------------------------------+   |
@@ -381,16 +381,17 @@ TryAttachStub(const char *name, JSContex
 //     |      +=================================+  --
 //     |      |     Padding(Maybe Empty)        |
 //     |      +=================================+  --
 //     +------|-- baselineFrame                 |   |-- IonOsrTempData
 //            |   jitcode                       |   |
 //            +=================================+  --      <---- Low Address
 //
 // A pointer to the IonOsrTempData is returned.
+/* clang-format on */
 
 struct IonOsrTempData
 {
     void* jitcode;
     uint8_t* baselineFrame;
 };
 
 static IonOsrTempData*
@@ -4153,18 +4154,18 @@ ICCall_Fallback::Compiler::generateStubC
     EmitReturnFromIC(masm);
 
     // This is the resume point used when bailout rewrites call stack to undo
     // Ion inlined frames. The return address pushed onto reconstructed stack
     // will point here.
     assumeStubFrame();
     bailoutReturnOffset_.bind(masm.currentOffset());
 
-    // Load passed-in ThisV into R1 just in case it's needed.  Need to do this before
-    // we leave the stub frame since that info will be lost.
+    // Load passed-in ThisV into R1 just in case it's needed.  Need to do this
+    // before we leave the stub frame since that info will be lost.
     // Current stack:  [...., ThisV, ActualArgc, CalleeToken, Descriptor ]
     masm.loadValue(Address(masm.getStackPointer(), 3 * sizeof(size_t)), R1);
 
     leaveStubFrame(masm, true);
 
     // If this is a |constructing| call, if the callee returns a non-object, we replace it with
     // the |this| object passed in.
     if (isConstructing_) {
@@ -4222,17 +4223,19 @@ ICCallScriptedCompiler::generateStubCode
     regs.take(argcReg);
     regs.takeUnchecked(ICTailCallReg);
 
     if (isSpread_) {
         guardSpreadCall(masm, argcReg, &failure, isConstructing_);
     }
 
     // Load the callee in R1, accounting for newTarget, if necessary
-    // Stack Layout: [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, [newTarget] +ICStackValueOffset+ ]
+    // Stack Layout:
+    //      [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, [newTarget],
+    //        +ICStackValueOffset+ ]
     if (isSpread_) {
         unsigned skipToCallee = (2 + isConstructing_) * sizeof(Value);
         masm.loadValue(Address(masm.getStackPointer(), skipToCallee + ICStackValueOffset), R1);
     } else {
         // Account for newTarget, if necessary
         unsigned nonArgsSkip = (1 + isConstructing_) * sizeof(Value);
         BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + nonArgsSkip);
         masm.loadValue(calleeSlot, R1);
@@ -4289,17 +4292,18 @@ ICCallScriptedCompiler::generateStubCode
         masm.switchToObjectRealm(callee, regs.getAny());
     }
 
     if (isConstructing_) {
         // Save argc before call.
         masm.push(argcReg);
 
         // Stack now looks like:
-        //      [..., Callee, ThisV, Arg0V, ..., ArgNV, NewTarget, StubFrameHeader, ArgC ]
+        //      [ ..., Callee, ThisV, Arg0V, ..., ArgNV, NewTarget,
+        //        StubFrameHeader, ArgC ]
         masm.loadValue(Address(masm.getStackPointer(), STUB_FRAME_SIZE + sizeof(size_t)), R1);
         masm.push(masm.extractObject(R1, ExtractTemp0));
 
         if (isSpread_) {
             masm.loadValue(Address(masm.getStackPointer(),
                                    3 * sizeof(Value) + STUB_FRAME_SIZE + sizeof(size_t) +
                                    sizeof(JSObject*)),
                                    R1);
@@ -4328,19 +4332,22 @@ ICCallScriptedCompiler::generateStubCode
         regs = availableGeneralRegs(0);
         regs.take(R0);
         argcReg = regs.takeAny();
 
         // Restore saved argc so we can use it to calculate the address to save
         // the resulting this object to.
         masm.pop(argcReg);
 
-        // Save "this" value back into pushed arguments on stack.  R0 can be clobbered after that.
+        // Save "this" value back into pushed arguments on stack. R0 can be
+        // clobbered after that.
+        //
         // Stack now looks like:
-        //      [..., Callee, ThisV, Arg0V, ..., ArgNV, [NewTarget], StubFrameHeader ]
+        //      [ ..., Callee, ThisV, Arg0V, ..., ArgNV, [NewTarget],
+        //        StubFrameHeader ]
         if (isSpread_) {
             masm.storeValue(R0, Address(masm.getStackPointer(),
                                         (1 + isConstructing_) * sizeof(Value) + STUB_FRAME_SIZE));
         } else {
             BaseValueIndex thisSlot(masm.getStackPointer(), argcReg,
                                     STUB_FRAME_SIZE + isConstructing_ * sizeof(Value));
             masm.storeValue(R0, thisSlot);
         }
@@ -4419,46 +4426,51 @@ ICCallScriptedCompiler::generateStubCode
     masm.callJit(code);
 
     // If this is a constructing call, and the callee returns a non-object, replace it with
     // the |this| object passed in.
     if (isConstructing_) {
         Label skipThisReplace;
         masm.branchTestObject(Assembler::Equal, JSReturnOperand, &skipThisReplace);
 
-        // Current stack: [ Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
-        // However, we can't use this ThisVal, because it hasn't been traced.  We need to use
-        // The ThisVal higher up the stack:
-        // Current stack: [ ThisVal, ARGVALS..., ...STUB FRAME...,
-        //                  Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
+        // Current stack: [ Padding?, ARGVALS..., ThisVal, ActualArgc, Callee,
+        //                  Descriptor ]
+        // However, we can't use this ThisVal, because it hasn't been traced.
+        // We need to use the ThisVal higher up the stack:
+        // Current stack: [ ThisVal, ARGVALS..., ...STUB FRAME..., Padding?,
+        //                  ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
 
         // Restore the BaselineFrameReg based on the frame descriptor.
         //
         // BaselineFrameReg = BaselineStackReg
-        //                  + sizeof(Descriptor) + sizeof(Callee) + sizeof(ActualArgc)
+        //                  + sizeof(Descriptor)
+        //                  + sizeof(Callee)
+        //                  + sizeof(ActualArgc)
         //                  + stubFrameSize(Descriptor)
-        //                  - sizeof(ICStubReg) - sizeof(BaselineFrameReg)
+        //                  - sizeof(ICStubReg)
+        //                  - sizeof(BaselineFrameReg)
         Address descriptorAddr(masm.getStackPointer(), 0);
         masm.loadPtr(descriptorAddr, BaselineFrameReg);
         masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), BaselineFrameReg);
         masm.addPtr(Imm32((3 - 2) * sizeof(size_t)), BaselineFrameReg);
         masm.addStackPtrTo(BaselineFrameReg);
 
         // Load the number of arguments present before the stub frame.
         Register argcReg = JSReturnOperand.scratchReg();
         if (isSpread_) {
             // Account for the Array object.
             masm.move32(Imm32(1), argcReg);
         } else {
             Address argcAddr(masm.getStackPointer(), 2 * sizeof(size_t));
             masm.loadPtr(argcAddr, argcReg);
         }
 
-        // Current stack: [ ThisVal, ARGVALS..., ...STUB FRAME..., <-- BaselineFrameReg
-        //                  Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
+        // Current stack:
+        //      [ ThisVal, ARGVALS..., ...STUB FRAME..., <-- BaselineFrameReg
+        //        Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
         //
         // &ThisVal = BaselineFrameReg + argc * sizeof(Value) + STUB_FRAME_SIZE + sizeof(Value)
         // This last sizeof(Value) accounts for the newTarget on the end of the arguments vector
         // which is not reflected in actualArgc
         BaseValueIndex thisSlotAddr(BaselineFrameReg, argcReg, STUB_FRAME_SIZE + sizeof(Value));
         masm.loadValue(thisSlotAddr, JSReturnOperand);
 #ifdef DEBUG
         masm.branchTestObject(Assembler::Equal, JSReturnOperand, &skipThisReplace);
@@ -4483,17 +4495,18 @@ ICCallScriptedCompiler::generateStubCode
 
 typedef bool (*CopyStringSplitArrayFn)(JSContext*, HandleArrayObject, MutableHandleValue);
 static const VMFunction CopyStringSplitArrayInfo =
     FunctionInfo<CopyStringSplitArrayFn>(CopyStringSplitArray, "CopyStringSplitArray");
 
 bool
 ICCall_ConstStringSplit::Compiler::generateStubCode(MacroAssembler& masm)
 {
-    // Stack Layout: [ ..., CalleeVal, ThisVal, strVal, sepVal, +ICStackValueOffset+ ]
+    // Stack Layout:
+    //      [ ..., CalleeVal, ThisVal, strVal, sepVal, +ICStackValueOffset+ ]
     static const size_t SEP_DEPTH = 0;
     static const size_t STR_DEPTH = sizeof(Value);
     static const size_t CALLEE_DEPTH = 3 * sizeof(Value);
 
     AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
     Label failureRestoreArgc;
 #ifdef DEBUG
     Label twoArg;
@@ -5024,17 +5037,19 @@ ICCall_ScriptedFunCall::Compiler::genera
     AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
     bool canUseTailCallReg = regs.has(ICTailCallReg);
 
     Register argcReg = R0.scratchReg();
     regs.take(argcReg);
     regs.takeUnchecked(ICTailCallReg);
 
     // Load the callee in R1.
-    // Stack Layout: [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, +ICStackValueOffset+ ]
+    // Stack Layout:
+    //      [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal,
+    //        +ICStackValueOffset+ ]
     BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + sizeof(Value));
     masm.loadValue(calleeSlot, R1);
     regs.take(R1);
 
     // Ensure callee is fun_call.
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
 
     Register callee = masm.extractObject(R1, ExtractTemp0);
--- a/js/src/jit/BaselineJIT.h
+++ b/js/src/jit/BaselineJIT.h
@@ -29,18 +29,20 @@ class ReturnAddressEntry;
 
 class PCMappingSlotInfo
 {
     uint8_t slotInfo_;
 
   public:
     // SlotInfo encoding:
     //  Bits 0 & 1: number of slots at top of stack which are unsynced.
-    //  Bits 2 & 3: SlotLocation of top slot value (only relevant if numUnsynced > 0).
-    //  Bits 3 & 4: SlotLocation of next slot value (only relevant if numUnsynced > 1).
+    //  Bits 2 & 3: SlotLocation of top slot value (only relevant if
+    //              numUnsynced > 0).
+    //  Bits 3 & 4: SlotLocation of next slot value (only relevant if
+    //              numUnsynced > 1).
     enum SlotLocation { SlotInR0 = 0, SlotInR1 = 1, SlotIgnore = 3 };
 
     PCMappingSlotInfo()
       : slotInfo_(0)
     { }
 
     explicit PCMappingSlotInfo(uint8_t slotInfo)
       : slotInfo_(slotInfo)
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -1461,16 +1461,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
                         Register temp1, Register temp2, Register temp3,
                         size_t inputOutputDataStartOffset,
                         RegExpShared::CompilationMode mode,
                         bool stringsCanBeInNursery,
                         Label* notFound, Label* failure)
 {
     JitSpew(JitSpew_Codegen, "# Emitting PrepareAndExecuteRegExp");
 
+    // clang-format off
     /*
      * [SMDOC] Stack layout for PrepareAndExecuteRegExp
      *
      * inputOutputDataStartOffset +-----> +---------------+
      *                                    |InputOutputData|
      *          inputStartAddress +---------->  inputStart|
      *            inputEndAddress +---------->    inputEnd|
      *          startIndexAddress +---------->  startIndex|
@@ -1493,16 +1494,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
      *                                           .                   |
      *                                           .                   |
      *                                    +---------------+          |
      *                                    |   MatchPair   |          |
      *                                    |       start   |  <-------+
      *                                    |       limit   |
      *                                    +---------------+
      */
+    // clang-format on
 
     size_t matchPairsStartOffset = inputOutputDataStartOffset + sizeof(irregexp::InputOutputData);
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
 
     Address inputStartAddress(masm.getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputStart));
     Address inputEndAddress(masm.getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputEnd));
@@ -2128,16 +2130,17 @@ JitRealm::generateRegExpMatcherStub(JSCo
                   "Second slot holds the 'input' property");
 
     masm.loadPtr(Address(object, NativeObject::offsetOfSlots()), temp2);
     masm.storeValue(nativeTemplateObj.getSlot(RegExpRealm::MatchResultObjectIndexSlot),
                     Address(temp2, 0));
     masm.storeValue(nativeTemplateObj.getSlot(RegExpRealm::MatchResultObjectInputSlot),
                     Address(temp2, sizeof(Value)));
 
+    // clang-format off
    /*
     * [SMDOC] Stack layout for the RegExpMatcher stub
     *
     *                                    +---------------+
     *                                    |Return-Address |
     *                                    +---------------+
     * inputOutputDataStartOffset +-----> +---------------+
     *                                    |InputOutputData|
@@ -2157,16 +2160,17 @@ JitRealm::generateRegExpMatcherStub(JSCo
     *                                           .                   |
     *                                           .                   | `count` objects will be
     *                                    +---------------+          | initialized and can be
     *                                    |   MatchPair   |          | accessed below.
     *                                    |       start   |  <-------+
     *                                    |       limit   |
     *                                    +---------------+
     */
+    // clang-format on
 
     static_assert(sizeof(MatchPair) == 2 * sizeof(int32_t),
                   "MatchPair consists of two int32 values representing the start"
                   "and the end offset of the match");
 
     Address pairCountAddress = RegExpPairCountAddress(masm, inputOutputDataStartOffset);
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
@@ -2423,16 +2427,17 @@ JitRealm::generateRegExpSearcherStub(JSC
     if (!PrepareAndExecuteRegExp(cx, masm, regexp, input, lastIndex,
                                  temp1, temp2, temp3, inputOutputDataStartOffset,
                                  RegExpShared::Normal, stringsCanBeInNursery,
                                  &notFound, &oolEntry))
     {
         return nullptr;
     }
 
+    // clang-format off
     /*
      * [SMDOC] Stack layout for the RegExpSearcher stub
      *
      *                                    +---------------+
      *                                    |Return-Address |
      *                                    +---------------+
      * inputOutputDataStartOffset +-----> +---------------+
      *                                    |InputOutputData|
@@ -2452,16 +2457,17 @@ JitRealm::generateRegExpSearcherStub(JSC
      *                                           .                   |
      *                                           .                   | Only a single object will
      *                                    +---------------+          | be initialized and can be
      *                                    |   MatchPair   |          | accessed below.
      *                                    |       start   |  <-------+
      *                                    |       limit   |
      *                                    +---------------+
      */
+    // clang-format on
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
     Address matchPairStart(masm.getStackPointer(),
                            pairsVectorStartOffset + offsetof(MatchPair, start));
     Address matchPairLimit(masm.getStackPointer(),
                            pairsVectorStartOffset + offsetof(MatchPair, limit));
 
     masm.load32(matchPairStart, result);
--- a/js/src/jit/EffectiveAddressAnalysis.cpp
+++ b/js/src/jit/EffectiveAddressAnalysis.cpp
@@ -215,18 +215,20 @@ EffectiveAddressAnalysis::analyzeAsmJSHe
 
 // This analysis converts patterns of the form:
 //   truncate(x + (y << {0,1,2,3}))
 //   truncate(x + (y << {0,1,2,3}) + imm32)
 // into a single lea instruction, and patterns of the form:
 //   asmload(x + imm32)
 //   asmload(x << {0,1,2,3})
 //   asmload((x << {0,1,2,3}) + imm32)
-//   asmload((x << {0,1,2,3}) & mask)            (where mask is redundant with shift)
-//   asmload(((x << {0,1,2,3}) + imm32) & mask)  (where mask is redundant with shift + imm32)
+//   asmload((x << {0,1,2,3}) & mask)            (where mask is redundant
+//                                                with shift)
+//   asmload(((x << {0,1,2,3}) + imm32) & mask)  (where mask is redundant
+//                                                with shift + imm32)
 // into a single asmload instruction (and for asmstore too).
 //
 // Additionally, we should consider the general forms:
 //   truncate(x + y + imm32)
 //   truncate((y << {0,1,2,3}) + imm32)
 bool
 EffectiveAddressAnalysis::analyze()
 {
--- a/js/src/jit/InlineList.h
+++ b/js/src/jit/InlineList.h
@@ -484,20 +484,19 @@ class InlineListReverseIterator
     bool operator ==(const InlineListReverseIterator<T>& where) const {
         return iter == where.iter;
     }
 
   private:
     Node* iter;
 };
 
-/* This list type is more or less exactly an InlineForwardList without a sentinel
- * node. It is useful in cases where you are doing algorithms that deal with many
- * merging singleton lists, rather than often empty ones.
- */
+// This list type is more or less exactly an InlineForwardList without a
+// sentinel node. It is useful in cases where you are doing algorithms that deal
+// with many merging singleton lists, rather than often empty ones.
 template <typename T> class InlineConcatListIterator;
 template <typename T>
 class InlineConcatList
 {
   private:
     typedef InlineConcatList<T> Node;
 
     InlineConcatList<T>* thisFromConstructor() {
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -1974,16 +1974,18 @@ TypeAnalyzer::insertConversions()
             if (!adjustInputs(*iter)) {
                 return false;
             }
         }
     }
     return true;
 }
 
+/* clang-format off */
+//
 // This function tries to emit Float32 specialized operations whenever it's possible.
 // MIR nodes are flagged as:
 // - Producers, when they can create Float32 that might need to be coerced into a Double.
 //   Loads in Float32 arrays and conversions to Float32 are producers.
 // - Consumers, when they can have Float32 as inputs and validate a legal use of a Float32.
 //   Stores in Float32 arrays and conversions to Float32 are consumers.
 // - Float32 commutative, when using the Float32 instruction instead of the Double instruction
 //   does not result in a compound loss of precision. This is the case for +, -, /, * with 2
@@ -2009,16 +2011,18 @@ TypeAnalyzer::insertConversions()
 // 1 - Determine which phis are consumers. Each phi gets an initial value by making a global AND on
 // all its non-phi inputs. Then each phi propagates its value to other phis. If after propagation,
 // the flag value changed, we have to reapply the algorithm on all phi operands, as a phi is a
 // consumer if all of its uses are consumers.
 // 2 - Determine which phis are producers. It's the same algorithm, except that we have to reapply
 // the algorithm on all phi uses, as a phi is a producer if all of its operands are producers.
 // 3 - Go through all commutative operations and ensure their inputs are all producers and their
 // uses are all consumers.
+//
+/* clang-format on */
 bool
 TypeAnalyzer::markPhiConsumers()
 {
     MOZ_ASSERT(phiWorklist_.empty());
 
     // Iterate in postorder so worklist is initialized to RPO.
     for (PostorderIterator block(graph.poBegin()); block != graph.poEnd(); ++block) {
         if (mir->shouldCancel("Ensure Float32 commutativity - Consumer Phis - Initial state")) {
@@ -3481,17 +3485,18 @@ ExtractMathSpace(MDefinition* ins)
         return MathSpace::Infinite;
       case MDefinition::IndirectTruncate:
       case MDefinition::Truncate:
         return MathSpace::Modulo;
     }
     MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unknown TruncateKind");
 }
 
-// Extract a linear sum from ins, if possible (otherwise giving the sum 'ins + 0').
+// Extract a linear sum from ins, if possible (otherwise giving the
+// sum 'ins + 0').
 SimpleLinearSum
 jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
 {
     if (ins->isBeta()) {
         ins = ins->getOperand(0);
     }
 
     if (ins->type() != MIRType::Int32) {
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -5117,20 +5117,21 @@ IonBuilder::createCallObject(MDefinition
 
 MDefinition*
 IonBuilder::createThisScripted(MDefinition* callee, MDefinition* newTarget)
 {
     // Get callee.prototype.
     //
     // This instruction MUST be idempotent: since it does not correspond to an
     // explicit operation in the bytecode, we cannot use resumeAfter().
-    // Getters may not override |prototype| fetching, so this operation is indeed idempotent.
+    // Getters may not override |prototype| fetching, so this operation is
+    // indeed idempotent.
     // - First try an idempotent property cache.
-    // - Upon failing idempotent property cache, we can't use a non-idempotent cache,
-    //   therefore we fallback to CallGetProperty
+    // - Upon failing idempotent property cache, we can't use a non-idempotent
+    //   cache, therefore we fallback to CallGetProperty
     //
     // Note: both CallGetProperty and GetPropertyCache can trigger a GC,
     //       and thus invalidation.
     MInstruction* getProto;
     if (!invalidatedIdempotentCache()) {
         MConstant* id = constant(StringValue(names().prototype));
         MGetPropertyCache* getPropCache = MGetPropertyCache::New(alloc(), newTarget, id,
                                                                  /* monitored = */ false);
@@ -10395,17 +10396,17 @@ IonBuilder::commonPrototypeWithGetterSet
             }
             key = TypeSet::ObjectKey::get(proto);
         }
     }
 
     return foundProto;
 }
 
-void
+AbortReasonOr<Ok>
 IonBuilder::freezePropertiesForCommonPrototype(TemporaryTypeSet* types, PropertyName* name,
                                                JSObject* foundProto,
                                                bool allowEmptyTypesforGlobal/* = false*/)
 {
     for (unsigned i = 0; i < types->getObjectCount(); i++) {
         // If we found a Singleton object's own-property, there's nothing to
         // freeze.
         if (types->getSingleton(i) == foundProto) {
@@ -10413,31 +10414,36 @@ IonBuilder::freezePropertiesForCommonPro
         }
 
         TypeSet::ObjectKey* key = types->getObject(i);
         if (!key) {
             continue;
         }
 
         while (true) {
+            if (!alloc().ensureBallast()) {
+                return abort(AbortReason::Alloc);
+            }
+
             HeapTypeSetKey property = key->property(NameToId(name));
             MOZ_ALWAYS_TRUE(!property.isOwnProperty(constraints(), allowEmptyTypesforGlobal));
 
             // Don't mark the proto. It will be held down by the shape
             // guard. This allows us to use properties found on prototypes
             // with properties unknown to TI.
             if (key->proto() == TaggedProto(foundProto)) {
                 break;
             }
             key = TypeSet::ObjectKey::get(key->proto().toObjectOrNull());
         }
     }
-}
-
-bool
+    return Ok();
+}
+
+AbortReasonOr<bool>
 IonBuilder::testCommonGetterSetter(TemporaryTypeSet* types, PropertyName* name,
                                    bool isGetter, JSFunction* getterOrSetter,
                                    MDefinition** guard,
                                    Shape* globalShape/* = nullptr*/,
                                    MDefinition** globalGuard/* = nullptr */)
 {
     MOZ_ASSERT(getterOrSetter);
     MOZ_ASSERT_IF(globalShape, globalGuard);
@@ -10449,17 +10455,17 @@ IonBuilder::testCommonGetterSetter(Tempo
     if (!foundProto || (guardGlobal && !globalShape)) {
         trackOptimizationOutcome(TrackedOutcome::MultiProtoPaths);
         return false;
     }
 
     // We can optimize the getter/setter, so freeze all involved properties to
     // ensure there isn't a lower shadowing getter or setter installed in the
     // future.
-    freezePropertiesForCommonPrototype(types, name, foundProto, guardGlobal);
+    MOZ_TRY(freezePropertiesForCommonPrototype(types, name, foundProto, guardGlobal));
 
     // Add a shape guard on the prototype we found the property on. The rest of
     // the prototype chain is guarded by TI freezes, except when name is a global
     // name. In this case, we also have to guard on the globals shape to be able
     // to optimize, because the way global property sets are handled means
     // freezing doesn't work for what we want here. Note that a shape guard is
     // good enough here, even in the proxy case, because we have ensured there
     // are no lookup hooks for this property.
@@ -11512,37 +11518,40 @@ IonBuilder::getPropTryCommonGetter(bool*
         if (inspector->commonGetPropFunction(pc, innerized, &foundProto, &lastProperty, &commonGetter,
                                               &globalShape, &isOwnProperty,
                                               receivers, convertUnboxedGroups))
         {
             bool canUseTIForGetter = false;
             if (!isOwnProperty) {
                 // If it's not an own property, try to use TI to avoid shape guards.
                 // For own properties we use the path below.
-                canUseTIForGetter = testCommonGetterSetter(objTypes, name, /* isGetter = */ true,
-                                                           commonGetter, &guard,
-                                                           globalShape, &globalGuard);
+                MOZ_TRY_VAR(canUseTIForGetter,
+                            testCommonGetterSetter(objTypes, name, /* isGetter = */ true,
+                                                   commonGetter, &guard,
+                                                   globalShape, &globalGuard));
             }
             if (!canUseTIForGetter) {
                 // If it's an own property or type information is bad, we can still
                 // optimize the getter if we shape guard.
                 obj = addShapeGuardsForGetterSetter(obj, foundProto, lastProperty,
                                                     receivers, convertUnboxedGroups,
                                                     isOwnProperty);
                 if (!obj) {
                     return abort(AbortReason::Alloc);
                 }
             }
         } else if (inspector->megamorphicGetterSetterFunction(pc, /* isGetter = */ true,
                                                               &commonGetter))
         {
             // Try to use TI to guard on this getter.
-            if (!testCommonGetterSetter(objTypes, name, /* isGetter = */ true,
-                                        commonGetter, &guard))
-            {
+            bool canUseTIForGetter = false;
+            MOZ_TRY_VAR(canUseTIForGetter,
+                        testCommonGetterSetter(objTypes, name, /* isGetter = */ true,
+                                               commonGetter, &guard));
+            if (!canUseTIForGetter) {
                 return Ok();
             }
         } else {
             // The Baseline IC didn't have any information we can use.
             return Ok();
         }
     }
 
@@ -12177,36 +12186,39 @@ IonBuilder::setPropTryCommonSetter(bool*
         if (inspector->commonSetPropFunction(pc, &foundProto, &lastProperty, &commonSetter,
                                               &isOwnProperty,
                                               receivers, convertUnboxedGroups))
         {
             bool canUseTIForSetter = false;
             if (!isOwnProperty) {
                 // If it's not an own property, try to use TI to avoid shape guards.
                 // For own properties we use the path below.
-                canUseTIForSetter = testCommonGetterSetter(objTypes, name, /* isGetter = */ false,
-                                                           commonSetter, &guard);
+                MOZ_TRY_VAR(canUseTIForSetter,
+                            testCommonGetterSetter(objTypes, name, /* isGetter = */ false,
+                                                   commonSetter, &guard));
             }
             if (!canUseTIForSetter) {
                 // If it's an own property or type information is bad, we can still
                 // optimize the setter if we shape guard.
                 obj = addShapeGuardsForGetterSetter(obj, foundProto, lastProperty,
                                                     receivers, convertUnboxedGroups,
                                                     isOwnProperty);
                 if (!obj) {
                     return abort(AbortReason::Alloc);
                 }
             }
         } else if (inspector->megamorphicGetterSetterFunction(pc, /* isGetter = */ false,
                                                               &commonSetter))
         {
             // Try to use TI to guard on this setter.
-            if (!testCommonGetterSetter(objTypes, name, /* isGetter = */ false,
-                                        commonSetter, &guard))
-            {
+            bool canUseTIForSetter = false;
+            MOZ_TRY_VAR(canUseTIForSetter,
+                        testCommonGetterSetter(objTypes, name, /* isGetter = */ false,
+                                               commonSetter, &guard));
+            if (!canUseTIForSetter) {
                 return Ok();
             }
         } else {
             // The Baseline IC didn't have any information we can use.
             return Ok();
         }
     }
 
--- a/js/src/jit/IonBuilder.h
+++ b/js/src/jit/IonBuilder.h
@@ -803,25 +803,27 @@ class IonBuilder
     MDefinition* patchInlinedReturn(CallInfo& callInfo, MBasicBlock* exit, MBasicBlock* bottom);
     MDefinition* patchInlinedReturns(CallInfo& callInfo, MIRGraphReturns& returns,
                                      MBasicBlock* bottom);
     MDefinition* specializeInlinedReturn(MDefinition* rdef, MBasicBlock* exit);
 
     NativeObject* commonPrototypeWithGetterSetter(TemporaryTypeSet* types, PropertyName* name,
                                                   bool isGetter, JSFunction* getterOrSetter,
                                                   bool* guardGlobal);
-    void freezePropertiesForCommonPrototype(TemporaryTypeSet* types, PropertyName* name,
-                                            JSObject* foundProto, bool allowEmptyTypesForGlobal = false);
+    AbortReasonOr<Ok> freezePropertiesForCommonPrototype(TemporaryTypeSet* types,
+                                                         PropertyName* name, JSObject* foundProto,
+                                                         bool allowEmptyTypesForGlobal = false);
     /*
      * Callers must pass a non-null globalGuard if they pass a non-null globalShape.
      */
-    bool testCommonGetterSetter(TemporaryTypeSet* types, PropertyName* name,
-                                bool isGetter, JSFunction* getterOrSetter,
-                                MDefinition** guard, Shape* globalShape = nullptr,
-                                MDefinition** globalGuard = nullptr);
+    AbortReasonOr<bool> testCommonGetterSetter(TemporaryTypeSet* types, PropertyName* name,
+                                               bool isGetter, JSFunction* getterOrSetter,
+                                               MDefinition** guard,
+                                               Shape* globalShape = nullptr,
+                                               MDefinition** globalGuard = nullptr);
     AbortReasonOr<bool> testShouldDOMCall(TypeSet* inTypes,
                                           JSFunction* func, JSJitInfo::OpType opType);
 
     MDefinition*
     addShapeGuardsForGetterSetter(MDefinition* obj, JSObject* holder, Shape* holderShape,
                                   const BaselineInspector::ReceiverVector& receivers,
                                   const BaselineInspector::ObjectGroupVector& convertUnboxedGroups,
                                   bool isOwnProperty);
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -110,19 +110,20 @@ enum BailoutKind
     // We hit a hole in an array.
     Bailout_Hole,
 
     // Array access with negative index
     Bailout_NegativeIndex,
 
     // Pretty specific case:
     //  - need a type barrier on a property write
-    //  - all but one of the observed types have property types that reflect the value
+    //  - all but one of the observed types have property types that reflect
+    //    the value
     //  - we need to guard that we're not given an object of that one other type
-    // also used for the unused GuardClass instruction
+    //    also used for the unused GuardClass instruction
     Bailout_ObjectIdentityOrTypeGuard,
 
     // Unbox expects a given type, bails out if it doesn't get it.
     Bailout_NonInt32Input,
     Bailout_NonNumericInput, // unboxing a double works with int32 too
     Bailout_NonBooleanInput,
     Bailout_NonObjectInput,
     Bailout_NonStringInput,
--- a/js/src/jit/JitFrames.h
+++ b/js/src/jit/JitFrames.h
@@ -200,17 +200,18 @@ static const uintptr_t FRAMESIZE_SHIFT =
                                          1 /* cached saved frame bit */;
 static const uintptr_t FRAMESIZE_BITS = 32 - FRAMESIZE_SHIFT;
 static const uintptr_t FRAMESIZE_MASK = (1 << FRAMESIZE_BITS) - 1;
 
 // Ion frames have a few important numbers associated with them:
 //      Local depth:    The number of bytes required to spill local variables.
 //      Argument depth: The number of bytes required to push arguments and make
 //                      a function call.
-//      Slack:          A frame may temporarily use extra stack to resolve cycles.
+//      Slack:          A frame may temporarily use extra stack to resolve
+//                      cycles.
 //
 // The (local + argument) depth determines the "fixed frame size". The fixed
 // frame size is the distance between the stack pointer and the frame header.
 // Thus, fixed >= (local + argument).
 //
 // In order to compress guards, we create shared jump tables that recover the
 // script from the stack and recover a snapshot pointer based on which jump was
 // taken. Thus, we create a jump table for each fixed frame size.
@@ -664,20 +665,22 @@ class IonOOLNativeExitFrameLayout
     inline Value* thisp() {
         return reinterpret_cast<Value*>(&loThis_);
     }
     inline uintptr_t argc() const {
         return argc_;
     }
 };
 
-// ProxyGetProperty(JSContext* cx, HandleObject proxy, HandleId id, MutableHandleValue vp)
-// ProxyCallProperty(JSContext* cx, HandleObject proxy, HandleId id, MutableHandleValue vp)
-// ProxySetProperty(JSContext* cx, HandleObject proxy, HandleId id, MutableHandleValue vp,
-//                  bool strict)
+// ProxyGetProperty(JSContext* cx, HandleObject proxy, HandleId id,
+//                  MutableHandleValue vp)
+// ProxyCallProperty(JSContext* cx, HandleObject proxy, HandleId id,
+//                   MutableHandleValue vp)
+// ProxySetProperty(JSContext* cx, HandleObject proxy, HandleId id,
+//                  MutableHandleValue vp, bool strict)
 class IonOOLProxyExitFrameLayout
 {
   protected: // only to silence a clang warning about unused private fields
     ExitFooterFrame footer_;
     ExitFrameLayout exit_;
 
     // The proxy object.
     JSObject* proxy_;
@@ -891,27 +894,29 @@ class DirectWasmJitCallFrameLayout
   public:
     static ExitFrameType Type() { return ExitFrameType::DirectWasmJitCall; }
 };
 
 class ICStub;
 
 class JitStubFrameLayout : public CommonFrameLayout
 {
+    /* clang-format off */
     // Info on the stack
     //
     // --------------------
     // |JitStubFrameLayout|
     // +------------------+
     // | - Descriptor     | => Marks end of FrameType::IonJS
     // | - returnaddres   |
     // +------------------+
     // | - StubPtr        | => First thing pushed in a stub only when the stub will do
     // --------------------    a vmcall. Else we cannot have JitStubFrame. But technically
     //                         not a member of the layout.
+    /* clang-format on */
 
   public:
     static size_t Size() {
         return sizeof(JitStubFrameLayout);
     }
 
     static inline int reverseOffsetOfStubPtr() {
         return -int(sizeof(void*));
@@ -920,30 +925,32 @@ class JitStubFrameLayout : public Common
     inline ICStub* maybeStubPtr() {
         uint8_t* fp = reinterpret_cast<uint8_t*>(this);
         return *reinterpret_cast<ICStub**>(fp + reverseOffsetOfStubPtr());
     }
 };
 
 class BaselineStubFrameLayout : public JitStubFrameLayout
 {
+    /* clang-format off */
     // Info on the stack
     //
     // -------------------------
     // |BaselineStubFrameLayout|
     // +-----------------------+
     // | - Descriptor          | => Marks end of FrameType::BaselineJS
     // | - returnaddres        |
     // +-----------------------+
     // | - StubPtr             | => First thing pushed in a stub only when the stub will do
     // +-----------------------+    a vmcall. Else we cannot have BaselineStubFrame.
     // | - FramePtr            | => Baseline stubs also need to push the frame ptr when doing
     // -------------------------    a vmcall.
     //                              Technically these last two variables are not part of the
     //                              layout.
+    /* clang-format on */
 
   public:
     static inline size_t Size() {
         return sizeof(BaselineStubFrameLayout);
     }
 
     static inline int reverseOffsetOfSavedFramePtr() {
         return -int(2 * sizeof(void*));
--- a/js/src/jit/JitcodeMap.cpp
+++ b/js/src/jit/JitcodeMap.cpp
@@ -1541,19 +1541,19 @@ JitcodeIonTable::findRegionEntry(uint32_
 
     // For small region lists, just search linearly.
     if (regions <= LINEAR_SEARCH_THRESHOLD) {
         JitcodeRegionEntry previousEntry = regionEntry(0);
         for (uint32_t i = 1; i < regions; i++) {
             JitcodeRegionEntry nextEntry = regionEntry(i);
             MOZ_ASSERT(nextEntry.nativeOffset() >= previousEntry.nativeOffset());
 
-            // See note in binary-search code below about why we use '<=' here instead of
-            // '<'.  Short explanation: regions are closed at their ending addresses,
-            // and open at their starting addresses.
+            // See note in binary-search code below about why we use '<=' here
+            // instead of '<'.  Short explanation: regions are closed at their
+            // ending addresses, and open at their starting addresses.
             if (nativeOffset <= nextEntry.nativeOffset()) {
                 return i-1;
             }
 
             previousEntry = nextEntry;
         }
         // If nothing found, assume it falls within last region.
         return regions - 1;
--- a/js/src/jit/JitcodeMap.h
+++ b/js/src/jit/JitcodeMap.h
@@ -1185,16 +1185,17 @@ class JitcodeGlobalTable
         Enum(JitcodeGlobalTable& table, JSRuntime* rt);
 
         void popFront();
         void removeFront();
     };
 };
 
 
+// clang-format off
 /*
  * Container class for main jitcode table.
  * The Region table's memory is structured as follows:
  *
  *      +------------------------------------------------+   |
  *      |  Region 1 Run                                  |   |
  *      |------------------------------------------------|   |
  *      |  Region 2 Run                                  |   |
@@ -1255,16 +1256,17 @@ class JitcodeGlobalTable
  *          - We encode (2 * scriptDepth) VarUint32s here.  Each pair of uint32s are taken
  *            as an index into the scriptList in the global table entry, and a pcOffset
  *            respectively.
  *
  *      List<NativeAndBytecodeDelta> deltaRun;
  *          - The rest of the entry is a deltaRun that stores a series of variable-length
  *            encoded NativeAndBytecodeDelta datums.
  */
+// clang-format on
 class JitcodeRegionEntry
 {
   private:
     static const unsigned MAX_RUN_LENGTH = 100;
 
   public:
     static void WriteHead(CompactBufferWriter& writer,
                           uint32_t nativeOffset, uint8_t scriptDepth);
@@ -1330,17 +1332,18 @@ class JitcodeRegionEntry
 
     static const uint32_t ENC3_PC_DELTA_MASK = 0x001ff8;
     static const int32_t ENC3_PC_DELTA_MAX = 0x1ff;
     static const int32_t ENC3_PC_DELTA_MIN = -ENC3_PC_DELTA_MAX - 1;
     static const unsigned ENC3_PC_DELTA_SHIFT = 3;
 
     //  byte 3    byte 2    byte 1    byte 0
     //  NNNN-NNNN NNNN-NNNN BBBB-BBBB BBBB-B111
-    //      Three-byte format.  nativeDelta in [0, 65535], pcDelta in [-4096, 4095]
+    //      Three-byte format.  nativeDelta in [0, 65535],
+    //                          pcDelta in [-4096, 4095]
     static const uint32_t ENC4_MASK = 0x7;
     static const uint32_t ENC4_MASK_VAL = 0x7;
 
     static const uint32_t ENC4_NATIVE_DELTA_MAX = 0xffff;
     static const unsigned ENC4_NATIVE_DELTA_SHIFT = 16;
 
     static const uint32_t ENC4_PC_DELTA_MASK = 0x0000fff8;
     static const int32_t ENC4_PC_DELTA_MAX = 0xfff;
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -3609,17 +3609,18 @@ MUrsh::fallible() const
         return false;
     }
     return !range() || !range()->hasInt32Bounds();
 }
 
 static bool
 SafelyCoercesToDouble(MDefinition* op)
 {
-    // Strings and symbols are unhandled -- visitToDouble() doesn't support them yet.
+    // Strings and symbols are unhandled -- visitToDouble() doesn't support
+    // them yet.
     // Null is unhandled -- ToDouble(null) == 0, but (0 == null) is false.
     return SimpleArithOperand(op) && !op->mightBeType(MIRType::Null);
 }
 
 MIRType
 MCompare::inputType()
 {
     switch(compareType_) {
--- a/js/src/jit/OptimizationTracking.h
+++ b/js/src/jit/OptimizationTracking.h
@@ -186,16 +186,17 @@ class UniqueTrackedOptimizations
 
     MOZ_MUST_USE bool sortByFrequency(JSContext* cx);
     bool sorted() const { return !sorted_.empty(); }
     uint32_t count() const { MOZ_ASSERT(sorted()); return sorted_.length(); }
     const SortedVector& sortedVector() const { MOZ_ASSERT(sorted()); return sorted_; }
     uint8_t indexOf(const TrackedOptimizations* optimizations) const;
 };
 
+/* clang-format off */
 // A compact table of tracked optimization information. Pictorially,
 //
 //    +------------------------------------------------+
 //    |  Region 1                                      |  |
 //    |------------------------------------------------|  |
 //    |  Region 2                                      |  |
 //    |------------------------------------------------|  |-- PayloadR of list-of-list of
 //    |               ...                              |  |   range triples (see below)
@@ -243,16 +244,17 @@ class UniqueTrackedOptimizations
 //    | Optimization attempts 1                        |  |
 //    |   uint32_t entryOffset = size(PayloadA)        |  |
 //    +------------------------------------------------+  |-- Table
 //    |   ...                                          |  |
 //    +------------------------------------------------+  |
 //    | Optimization attempts N                        |  |
 //    |   uint32_t entryOffset                         |  |
 //    +------------------------------------------------+
+/* clang-format on */
 //
 // Abstractly, each region in the PayloadR section is a list of triples of the
 // following, in order of ascending startOffset:
 //
 //     (startOffset, endOffset, optimization attempts index)
 //
 // The range of [startOffset, endOffset) is the native machine code offsets
 // for which the optimization attempts referred to by the index applies.
--- a/js/src/jit/arm/Architecture-arm.h
+++ b/js/src/jit/arm/Architecture-arm.h
@@ -279,16 +279,17 @@ class FloatRegisters
     static const uint32_t Total = 48;
     static const uint32_t TotalDouble = 16;
     static const uint32_t TotalSingle = 32;
     static const uint32_t Allocatable = 45;
     // There are only 32 places that we can put values.
     static const uint32_t TotalPhys = 32;
     static uint32_t ActualTotalPhys();
 
+    /* clang-format off */
     // ARM float registers overlap in a way that for 1 double registers, in the
     // range d0-d15, we have 2 singles register in the range s0-s31. d16-d31
     // have no single register aliases.  The aliasing rule state that d{n}
     // aliases s{2n} and s{2n+1}, for n in [0 .. 15].
     //
     // The register set is used to represent either allocatable register or live
     // registers. The register maps d0-d15 and s0-s31 to a single bit each. The
     // registers d16-d31 are not used at the moment.
@@ -310,16 +311,17 @@ class FloatRegisters
     //
     // (*) Note that d{n} bit is set, but is not available because s{2n+1} bit
     // is not set, which is required as d{n} dominates s{2n+1}. The d{n} bit is
     // set, because s{2n} is aligned.
     //
     //        |        d{n}       |
     //        | s{2n+1} |  s{2n}  |
     //
+    /* clang-format on */
     typedef uint64_t SetType;
     static const SetType AllSingleMask = (1ull << TotalSingle) - 1;
     static const SetType AllDoubleMask = ((1ull << TotalDouble) - 1) << TotalSingle;
     static const SetType AllMask = AllDoubleMask | AllSingleMask;
 
     // d15 is the ScratchFloatReg.
     static const SetType NonVolatileDoubleMask =
          ((1ULL << d8) |
@@ -552,20 +554,20 @@ class VFPRegister
     //   s0.alignedOrDominatedAliasedSet() == s0 | d0.
     //   s1.alignedOrDominatedAliasedSet() == s1.
     //   d0.alignedOrDominatedAliasedSet() == s0 | s1 | d0.
     //
     // This way the Allocatable register set does not have to do any arithmetics
     // to know if a register is available or not, as we have the following
     // relations:
     //
-    //   d0.alignedOrDominatedAliasedSet() ==
-    //       s0.alignedOrDominatedAliasedSet() | s1.alignedOrDominatedAliasedSet()
+    //  d0.alignedOrDominatedAliasedSet() ==
+    //      s0.alignedOrDominatedAliasedSet() | s1.alignedOrDominatedAliasedSet()
     //
-    //   s0.alignedOrDominatedAliasedSet() & s1.alignedOrDominatedAliasedSet() == 0
+    //  s0.alignedOrDominatedAliasedSet() & s1.alignedOrDominatedAliasedSet() == 0
     //
     SetType alignedOrDominatedAliasedSet() const {
         if (isSingle()) {
             if (code_ % 2 != 0) {
                 return SetType(1) << code_;
             }
             return (SetType(1) << code_) | (SetType(1) << (32 + code_ / 2));
         }
@@ -631,16 +633,17 @@ VFPRegister::AllocatableAsIndexableSet<R
     // is enough to convert an allocatable set into a set of register list all
     // single register available.
     return set & FloatRegisters::AllSingleMask;
 }
 
 template <> inline VFPRegister::SetType
 VFPRegister::AllocatableAsIndexableSet<RegTypeName::Float64>(SetType set)
 {
+    /* clang-format off */
     // An allocatable float register set is represented as follow:
     //
     // uuuu uuuu uuuu uuuu dddd dddd dddd dddd ssss ssss ssss ssss ssss ssss ssss ssss
     //                     ^                 ^ ^                                     ^
     //                     '-- d15      d0 --' '-- s31                          s0 --'
     //
     //     ...0...00... : s{2n}, s{2n+1} and d{n} are not available
     //     ...1...01... : s{2n} is available
@@ -651,16 +654,17 @@ VFPRegister::AllocatableAsIndexableSet<R
     // are available as an indexable bit set. This implies that iff a double bit
     // is set in the returned set, then the register is available.
     //
     // To do so, this functions converts the 32 bits set of single registers
     // into a 16 bits set of equivalent double registers. Then, we mask out
     // double registers which do not have all the single register that compose
     // them. As d{n} bit is set when s{2n} is available, we only need to take
     // s{2n+1} into account.
+    /* clang-format on */
 
     // Convert  s7s6s5s4 s3s2s1s0  into  s7s5s3s1, for all s0-s31.
     SetType s2d = AllocatableAsIndexableSet<RegTypeName::Float32>(set);
     static_assert(FloatRegisters::TotalSingle == 32, "Wrong mask");
     s2d = (0xaaaaaaaa & s2d) >> 1; // Filter s{2n+1} registers.
     // Group adjacent bits as follow:
     //     0.0.s3.s1 == ((0.s3.0.s1) >> 1 | (0.s3.0.s1)) & 0b0011;
     s2d = ((s2d >> 1) | s2d) & 0x33333333; // 0a0b --> 00ab
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -3118,38 +3118,44 @@ BufferInstructionIterator::maybeSkipAuto
     if (InstIsBNop<BufferInstructionIterator>(*this)) {
         return next();
     }
     return cur();
 }
 
 // Cases to be handled:
 // 1) no pools or branches in sight => return this+1
-// 2) branch to next instruction => return this+2, because a nop needed to be inserted into the stream.
-// 3) this+1 is an artificial guard for a pool => return first instruction after the pool
+// 2) branch to next instruction => return this+2, because a nop needed to be
+//    inserted into the stream.
+// 3) this+1 is an artificial guard for a pool => return first instruction
+//    after the pool
 // 4) this+1 is a natural guard => return the branch
-// 5) this is a branch, right before a pool => return first instruction after the pool
+// 5) this is a branch, right before a pool => return first instruction after
+//    the pool
 // in assembly form:
 // 1) add r0, r0, r0 <= this
 //    add r1, r1, r1 <= returned value
 //    add r2, r2, r2
 //
 // 2) add r0, r0, r0 <= this
 //    b foo
 //    foo:
 //    add r2, r2, r2 <= returned value
 //
 // 3) add r0, r0, r0 <= this
 //    b after_pool;
-//    .word 0xffff0002  # bit 15 being 0 indicates that the branch was not requested by the assembler
-//    0xdeadbeef        # the 2 indicates that there is 1 pool entry, and the pool header
+//    .word 0xffff0002  # bit 15 being 0 indicates that the branch was not
+//                      # requested by the assembler
+//    0xdeadbeef        # the 2 indicates that there is 1 pool entry, and the
+//                      # pool header
 //    add r4, r4, r4 <= returned value
 // 4) add r0, r0, r0 <= this
 //    b after_pool  <= returned value
-//    .word 0xffff8002  # bit 15 being 1 indicates that the branch was requested by the assembler
+//    .word 0xffff8002  # bit 15 being 1 indicates that the branch was
+//                      # requested by the assembler
 //    0xdeadbeef
 //    add r4, r4, r4
 // 5) b after_pool  <= this
 //    .word 0xffff8002  # bit 15 has no bearing on the returned value
 //    0xdeadbeef
 //    add r4, r4, r4  <= returned value
 
 Instruction*
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -6617,17 +6617,18 @@ MacroAssemblerARM::emitUnalignedLoad(con
     // make the first instruction fault if any of them is going to fault.  Hence
     // byte loads must be issued from high addresses toward low addresses (or we
     // must emit metadata for each load).
     //
     // So for a four-byte load from address x we will emit an eight-instruction
     // sequence:
     //
     //   ldrsb [x+3], tmp           // note signed load *if appropriate*
-    //   lsl dest, tmp lsl 24       // move high byte + sign bits into place; clear low bits
+    //   lsl dest, tmp lsl 24       // move high byte + sign bits into place;
+    //                              // clear low bits
     //   ldrb [x+2], tmp            // note unsigned load
     //   or dest, dest, tmp lsl 16  // add another byte
     //   ldrb [x+1], tmp            // ...
     //   or dest, dest, tmp lsl 8
     //   ldrb [x], tmp
     //   or dest, dest, tmp
 
     ScratchRegisterScope scratch(asMasm());
--- a/js/src/jit/arm/Simulator-arm.h
+++ b/js/src/jit/arm/Simulator-arm.h
@@ -137,17 +137,18 @@ class Simulator
     // Disassemble one instruction.
     // "call disasm(instr)"
     void disasm(SimInstruction* instr);
 
     // Disassemble n instructions starting at instr.
     // "call disasm(instr, 3)"
     void disasm(SimInstruction* instr, size_t n);
 
-    // Skip backwards m instructions before starting, then disassemble n instructions.
+    // Skip backwards m instructions before starting, then disassemble n
+    // instructions.
     // "call disasm(instr, 3, 7)"
     void disasm(SimInstruction* instr, size_t m, size_t n);
 
     uintptr_t* addressOfStackLimit();
 
     // Accessors for register state. Reading the pc value adheres to the ARM
     // architecture specification and is off by a 8 from the currently executing
     // instruction.
--- a/js/src/jit/arm/Trampoline-arm.cpp
+++ b/js/src/jit/arm/Trampoline-arm.cpp
@@ -95,18 +95,18 @@ struct EnterJITStack
     JSObject* scopeChain;
     size_t numStackValues;
     Value* vp;
 };
 
 /*
  * This method generates a trampoline for a c++ function with the following
  * signature:
- *   void enter(void* code, int argc, Value* argv, InterpreterFrame* fp, CalleeToken
- *              calleeToken, JSObject* scopeChain, Value* vp)
+ *   void enter(void* code, int argc, Value* argv, InterpreterFrame* fp,
+ *              CalleeToken calleeToken, JSObject* scopeChain, Value* vp)
  *   ...using standard EABI calling convention
  */
 void
 JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm)
 {
     enterJITOffset_ = startTrampolineCode(masm);
 
     const Address slot_token(sp, offsetof(EnterJITStack, token));
@@ -173,17 +173,18 @@ JitRuntime::generateEnterJIT(JSContext* 
     // At the end the register r4, is a pointer to the stack where the first
     // argument is expected by the Jit frame.
     //
     aasm->as_sub(r4, sp, O2RegImmShift(r1, LSL, 3));    // r4 = sp - argc*8
     aasm->as_bic(r4, r4, Imm8(JitStackAlignment - 1));
     // r4 is now the aligned on the bottom of the list of arguments.
     static_assert(sizeof(JitFrameLayout) % JitStackAlignment == 0,
       "No need to consider the JitFrameLayout for aligning the stack");
-    // sp' = ~(JitStackAlignment - 1) & (sp - argc * sizeof(Value)) - sizeof(JitFrameLayout)
+    // sp' = ~(JitStackAlignment - 1) & (sp - argc * sizeof(Value))
+    //       - sizeof(JitFrameLayout)
     aasm->as_sub(sp, r4, Imm8(sizeof(JitFrameLayout)));
 
     // Get a copy of the number of args to use as a decrement counter, also set
     // the zero condition code.
     aasm->as_mov(r5, O2Reg(r1), SetCC);
 
     // Loop over arguments, copying them from an unknown buffer onto the Ion
     // stack so they can be accessed from JIT'ed code.
@@ -1259,17 +1260,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.ma_add(scratch2, scratch1, scratch3);
         masm.add32(Imm32(RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
--- a/js/src/jit/arm64/Trampoline-arm64.cpp
+++ b/js/src/jit/arm64/Trampoline-arm64.cpp
@@ -17,17 +17,18 @@
 #include "jit/MacroAssembler-inl.h"
 #include "jit/SharedICHelpers-inl.h"
 
 using namespace js;
 using namespace js::jit;
 
 /* This method generates a trampoline on ARM64 for a c++ function with
  * the following signature:
- *   bool blah(void* code, int argc, Value* argv, JSObject* scopeChain, Value* vp)
+ *   bool blah(void* code, int argc, Value* argv,
+ *             JSObject* scopeChain, Value* vp)
  *   ...using standard AArch64 calling convention
  */
 void
 JitRuntime::generateEnterJIT(JSContext* cx, MacroAssembler& masm)
 {
     enterJITOffset_ = startTrampolineCode(masm);
 
     const Register reg_code      = IntArgReg0; // EnterJitData::jitcode.
@@ -963,17 +964,18 @@ JitRuntime::generateProfilerExitFrameTai
 
         // returning directly to an IonJS frame.  Store return addr to frame
         // in lastProfilingCallSite.
         masm.loadPtr(Address(masm.getStackPointer(), JitFrameLayout::offsetOfReturnAddress()),
                      scratch2);
         masm.storePtr(scratch2, lastProfilingCallSite);
 
         // Store return frame in lastProfilingFrame.
-        // scratch2 := masm.getStackPointer() + Descriptor.size*1 + JitFrameLayout::Size();
+        // scratch2 := masm.getStackPointer() + Descriptor.size*1 +
+        //             JitFrameLayout::Size();
         masm.Add(ARMRegister(scratch2, 64), masm.GetStackPointer64(), ARMRegister(scratch1, 64));
         masm.syncStackPtr();
         masm.addPtr(Imm32(JitFrameLayout::Size()), scratch2, scratch2);
         masm.storePtr(scratch2, lastProfilingFrame);
         masm.ret();
     }
 
     //
@@ -1079,17 +1081,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.addPtr(scratch2, scratch1, scratch3);
         masm.add32(Imm32(RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -125,31 +125,33 @@ static constexpr Register RegExpTesterLa
 static constexpr uint32_t CodeAlignment = 8;
 
 // This boolean indicates whether we support SIMD instructions flavoured for
 // this architecture or not. Rather than a method in the LIRGenerator, it is
 // here such that it is accessible from the entire codebase. Once full support
 // for SIMD is reached on all tier-1 platforms, this constant can be deleted.
 static constexpr bool SupportsSimd = false;
 
+/* clang-format off */
 // MIPS instruction types
 //                +---------------------------------------------------------------+
 //                |    6      |    5    |    5    |    5    |    5    |    6      |
 //                +---------------------------------------------------------------+
 // Register type  |  Opcode   |    Rs   |    Rt   |    Rd   |    Sa   | Function  |
 //                +---------------------------------------------------------------+
 //                |    6      |    5    |    5    |               16              |
 //                +---------------------------------------------------------------+
 // Immediate type |  Opcode   |    Rs   |    Rt   |    2's complement constant    |
 //                +---------------------------------------------------------------+
 //                |    6      |                        26                         |
 //                +---------------------------------------------------------------+
 // Jump type      |  Opcode   |                    jump_target                    |
 //                +---------------------------------------------------------------+
 //                31 bit                                                      bit 0
+/* clang-format on */
 
 // MIPS instruction encoding constants.
 static const uint32_t OpcodeShift = 26;
 static const uint32_t OpcodeBits = 6;
 static const uint32_t RSShift = 21;
 static const uint32_t RSBits = 5;
 static const uint32_t RTShift = 16;
 static const uint32_t RTBits = 5;
--- a/js/src/jit/mips32/Trampoline-mips32.cpp
+++ b/js/src/jit/mips32/Trampoline-mips32.cpp
@@ -1249,17 +1249,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.as_addu(scratch3, scratch2, scratch1);
         masm.add32(Imm32(RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
--- a/js/src/jit/mips64/Trampoline-mips64.cpp
+++ b/js/src/jit/mips64/Trampoline-mips64.cpp
@@ -451,21 +451,22 @@ JitRuntime::generateArgumentsRectifier(M
     masm.add32(Imm32(JitStackValueAlignment - 1 /* for padding */ + 1 /* for |this| */), numArgsReg);
     masm.add32(t2, numArgsReg);
     masm.and32(Imm32(~(JitStackValueAlignment - 1)), numArgsReg);
 
     // Load the number of |undefined|s to push into t1.
     masm.as_dsubu(t1, numArgsReg, s3);
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]] <- sp <- t2
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ] <- sp <- t2
     // '------ s3 -------'
     //
     // Rectifier frame:
-    // [undef] [undef] [undef] [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]]
+    // [undef] [undef] [undef] [arg2] [arg1] [this] [ [argc] [callee]
+    //                                                [descr] [raddr] ]
     // '-------- t1 ---------' '------- s3 -------'
 
     // Copy number of actual arguments into numActArgsReg
     masm.loadPtr(Address(StackPointer, RectifierFrameLayout::offsetOfNumActualArgs()),
                  numActArgsReg);
 
 
     masm.moveValue(UndefinedValue(), ValueOperand(t0));
@@ -524,21 +525,22 @@ JitRuntime::generateArgumentsRectifier(M
         // Again, 1 for |this|
         BaseIndex newTargetDest(StackPointer, t3, TimesEight, sizeof(Value));
         masm.storeValue(newTarget, newTargetDest);
 
         masm.bind(&notConstructing);
     }
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]] <- t2
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ] <- t2
     //
     //
     // Rectifier frame:
-    // [undef] [undef] [undef] [arg2] [arg1] [this] <- sp [[argc] [callee] [descr] [raddr]]
+    // [undef] [undef] [undef] [arg2] [arg1] [this] <- sp [ [argc] [callee]
+    //                                                      [descr] [raddr] ]
 
     // Construct sizeDescriptor.
     masm.subPtr(StackPointer, t2);
     masm.makeFrameDescriptor(t2, FrameType::Rectifier, JitFrameLayout::Size());
 
     // Construct JitFrameLayout.
     masm.subPtr(Imm32(3 * sizeof(uintptr_t)), StackPointer);
     // Push actual arguments.
@@ -1200,17 +1202,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.as_daddu(scratch3, scratch2, scratch1);
         masm.addPtr(Imm32(RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
--- a/js/src/jit/x64/Trampoline-x64.cpp
+++ b/js/src/jit/x64/Trampoline-x64.cpp
@@ -403,21 +403,22 @@ JitRuntime::generateArgumentsRectifier(M
     masm.addl(Imm32(JitStackValueAlignment - 1 /* for padding */ + 1 /* for |this| */), rcx);
     masm.addl(rdx, rcx);
     masm.andl(Imm32(~(JitStackValueAlignment - 1)), rcx);
 
     // Load the number of |undefined|s to push into %rcx.
     masm.subq(r8, rcx);
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]] <- rsp <- r9
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ] <- rsp <- r9
     // '------ #r8 -------'
     //
     // Rectifier frame:
-    // [undef] [undef] [undef] [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]]
+    // [undef] [undef] [undef] [arg2] [arg1] [this] [ [argc] [callee]
+    //                                                [descr] [raddr] ]
     // '------- #rcx --------' '------ #r8 -------'
 
     // Copy the number of actual arguments into rdx. Use lea to subtract 1 for
     // |this|.
     masm.lea(Operand(r8, -1), rdx);
 
     masm.moveValue(UndefinedValue(), ValueOperand(r10));
 
@@ -470,21 +471,22 @@ JitRuntime::generateArgumentsRectifier(M
         BaseIndex newTargetDest(rsp, r11, TimesEight, sizeof(Value));
         masm.storeValue(newTarget, newTargetDest);
 
         masm.bind(&notConstructing);
     }
 
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]] <- r9
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ] <- r9
     //
     //
     // Rectifier frame:
-    // [undef] [undef] [undef] [arg2] [arg1] [this] <- rsp [[argc] [callee] [descr] [raddr]]
+    // [undef] [undef] [undef] [arg2] [arg1] [this] <- rsp [ [argc] [callee]
+    //                                                       [descr] [raddr] ]
     //
 
     // Construct descriptor.
     masm.subq(rsp, r9);
     masm.makeFrameDescriptor(r9, FrameType::Rectifier, JitFrameLayout::Size());
 
     // Construct JitFrameLayout.
     masm.push(rdx); // numActualArgs
@@ -1140,17 +1142,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.lea(Operand(scratch2, scratch1, TimesOne, RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
         // frame.
--- a/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
+++ b/js/src/jit/x86-shared/BaseAssembler-x86-shared.h
@@ -4502,31 +4502,35 @@ threeByteOpImmSimd("vblendps", VEX_PD, O
             switch (ty) {
               case VEX_PS: break;
               case VEX_PD: prefix(PRE_SSE_66); break;
               case VEX_SS: prefix(PRE_SSE_F3); break;
               case VEX_SD: prefix(PRE_SSE_F2); break;
             }
         }
 
+        /* clang-format off */
+        //
         // Word-sized operands / no operand instruction formatters.
         //
         // In addition to the opcode, the following operand permutations are supported:
         //   * None - instruction takes no operands.
         //   * One register - the low three bits of the RegisterID are added into the opcode.
         //   * Two registers - encode a register form ModRm (for all ModRm formats, the reg field is passed first, and a GroupOpcodeID may be passed in its place).
         //   * Three argument ModRM - a register, and a register and an offset describing a memory operand.
         //   * Five argument ModRM - a register, and a base register, an index, scale, and offset describing a memory operand.
         //
         // For 32-bit x86 targets, the address operand may also be provided as a
         // void*.  On 64-bit targets REX prefixes will be planted as necessary,
         // where high numbered registers are used.
         //
         // The twoByteOp methods plant two-byte Intel instructions sequences
         // (first opcode byte 0x0F).
+        //
+        /* clang-format on */
 
         void oneByteOp(OneByteOpcodeID opcode)
         {
             m_buffer.ensureSpace(MaxInstructionSize);
             m_buffer.putByteUnchecked(opcode);
         }
 
         void oneByteOp(OneByteOpcodeID opcode, RegisterID reg)
--- a/js/src/jit/x86/Trampoline-x86.cpp
+++ b/js/src/jit/x86/Trampoline-x86.cpp
@@ -354,17 +354,17 @@ JitRuntime::generateInvalidator(MacroAss
 }
 
 void
 JitRuntime::generateArgumentsRectifier(MacroAssembler& masm)
 {
     argumentsRectifierOffset_ = startTrampolineCode(masm);
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]] <- esp
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ] <- esp
 
     // Load argc.
     masm.loadPtr(Address(esp, RectifierFrameLayout::offsetOfNumActualArgs()), esi);
 
     // Load the number of |undefined|s to push into %ecx.
     masm.loadPtr(Address(esp, RectifierFrameLayout::offsetOfCalleeToken()), eax);
     masm.mov(eax, ecx);
     masm.andl(Imm32(CalleeTokenMask), ecx);
@@ -395,33 +395,34 @@ JitRuntime::generateArgumentsRectifier(M
     masm.andl(Imm32(~(JitStackValueAlignment - 1)), ecx);
     masm.subl(esi, ecx);
 
     // Copy the number of actual arguments into edx.
     masm.mov(esi, edx);
 
     masm.moveValue(UndefinedValue(), ValueOperand(ebx, edi));
 
-    // NOTE: The fact that x86 ArgumentsRectifier saves the FramePointer is relied upon
-    // by the baseline bailout code.  If this changes, fix that code!  See
-    // BaselineJIT.cpp/BaselineStackBuilder::calculatePrevFramePtr, and
-    // BaselineJIT.cpp/InitFromBailout.  Check for the |#if defined(JS_CODEGEN_X86)| portions.
+    // NOTE: The fact that x86 ArgumentsRectifier saves the FramePointer is
+    // relied upon by the baseline bailout code.  If this changes, fix that
+    // code!  See BaselineJIT.cpp/BaselineStackBuilder::calculatePrevFramePtr,
+    // and BaselineJIT.cpp/InitFromBailout. Check for the
+    // |#if defined(JS_CODEGEN_X86)| portions.
     masm.push(FramePointer);
     masm.movl(esp, FramePointer); // Save %esp.
     masm.push(FramePointer /* padding */);
 
     // Caller:
-    // [arg2] [arg1] [this] [[argc] [callee] [descr] [raddr]]
+    // [arg2] [arg1] [this] [ [argc] [callee] [descr] [raddr] ]
     // '-- #esi ---'
     //
     // Rectifier frame:
     // [ebp'] <- ebp [padding] <- esp [undef] [undef] [arg2] [arg1] [this]
     //                                '--- #ecx ----' '-- #esi ---'
     //
-    // [[argc] [callee] [descr] [raddr]]
+    // [ [argc] [callee] [descr] [raddr] ]
 
     // Push undefined.
     {
         Label undefLoopTop;
         masm.bind(&undefLoopTop);
 
         masm.push(ebx); // type(undefined);
         masm.push(edi); // payload(undefined);
@@ -1164,17 +1165,18 @@ JitRuntime::generateProfilerExitFrameTai
         Label notIonFrame;
         masm.branch32(Assembler::NotEqual, scratch3, Imm32(FrameType::IonJS), &notIonFrame);
 
         // Handle Rectifier <- IonJS
         // scratch3 := RectFrame[ReturnAddr]
         masm.loadPtr(Address(scratch2, RectifierFrameLayout::offsetOfReturnAddress()), scratch3);
         masm.storePtr(scratch3, lastProfilingCallSite);
 
-        // scratch3 := RectFrame + Rect-Descriptor.Size + RectifierFrameLayout::Size()
+        // scratch3 := RectFrame + Rect-Descriptor.Size +
+        //             RectifierFrameLayout::Size()
         masm.lea(Operand(scratch2, scratch1, TimesOne, RectifierFrameLayout::Size()), scratch3);
         masm.storePtr(scratch3, lastProfilingFrame);
         masm.ret();
 
         masm.bind(&notIonFrame);
 
         // Check for either BaselineStub or a CppToJSJit/WasmToJSJit entry
         // frame.
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -815,19 +815,19 @@ ReleaseAssertObjectHasNoWrappers(JSConte
  *     changed into wrappers for `target`, extending the illusion to those
  *     compartments as well.
  *
  * During navigation, we use the above technique to transplant the WindowProxy
  * into the new Window's compartment.
  *
  * A few rules:
  *
- * -   `origobj` and `target` must be two distinct objects of the same `JSClass`.
- *     Some classes may not support transplantation; WindowProxy objects and DOM
- *     nodes are OK.
+ * -   `origobj` and `target` must be two distinct objects of the same
+ *     `JSClass`.  Some classes may not support transplantation; WindowProxy
+ *     objects and DOM nodes are OK.
  *
  * -   `target` should be created specifically to be passed to this function.
  *     There must be no existing cross-compartment wrappers for it; ideally
  *     there shouldn't be any pointers to it at all, except the one passed in.
  *
  * -   `target` shouldn't be used afterwards. Instead, `JS_TransplantObject`
  *     returns a pointer to the transplanted object, which might be `target`
  *     but might be some other object in the same compartment. Use that.
@@ -2019,17 +2019,17 @@ JS_IsNative(JSObject* obj)
 JS_PUBLIC_API void
 JS::AssertObjectBelongsToCurrentThread(JSObject* obj)
 {
     JSRuntime* rt = obj->compartment()->runtimeFromAnyThread();
     MOZ_RELEASE_ASSERT(CurrentThreadCanAccessRuntime(rt));
 }
 
 
-/*** Standard internal methods *******************************************************************/
+/*** Standard internal methods **********************************************/
 
 JS_PUBLIC_API bool
 JS_GetPrototype(JSContext* cx, HandleObject obj, MutableHandleObject result)
 {
     cx->check(obj);
     return GetPrototype(cx, obj, result);
 }
 
@@ -3113,30 +3113,31 @@ DeepFreezeSlot(JSContext* cx, const Valu
 
 JS_PUBLIC_API bool
 JS_DeepFreezeObject(JSContext* cx, HandleObject obj)
 {
     AssertHeapIsIdle();
     CHECK_THREAD(cx);
     cx->check(obj);
 
-    /* Assume that non-extensible objects are already deep-frozen, to avoid divergence. */
+    // Assume that non-extensible objects are already deep-frozen, to avoid
+    // divergence.
     bool extensible;
     if (!IsExtensible(cx, obj, &extensible)) {
         return false;
     }
     if (!extensible) {
         return true;
     }
 
     if (!FreezeObject(cx, obj)) {
         return false;
     }
 
-    /* Walk slots in obj and if any value is a non-null object, seal it. */
+    // Walk slots in obj and if any value is a non-null object, seal it.
     if (obj->isNative()) {
         RootedNativeObject nobj(cx, &obj->as<NativeObject>());
         for (uint32_t i = 0, n = nobj->slotSpan(); i < n; ++i) {
             if (!DeepFreezeSlot(cx, nobj->getSlot(i))) {
                 return false;
             }
         }
         for (uint32_t i = 0, n = nobj->getDenseInitializedLength(); i < n; ++i) {
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1861,17 +1861,20 @@ JS_IsNative(JSObject* obj);
 
 /**
  * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default
  * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]].
  */
 extern JS_PUBLIC_API JSObject*
 JS_NewObjectWithGivenProto(JSContext* cx, const JSClass* clasp, JS::Handle<JSObject*> proto);
 
-/** Creates a new plain object, like `new Object()`, with Object.prototype as [[Prototype]]. */
+/**
+ * Creates a new plain object, like `new Object()`, with Object.prototype as
+ * [[Prototype]].
+ */
 extern JS_PUBLIC_API JSObject*
 JS_NewPlainObject(JSContext* cx);
 
 /**
  * Freeze obj, and all objects it refers to, recursively. This will not recurse
  * through non-extensible objects, on the assumption that those are already
  * deep-frozen.
  */
@@ -1880,17 +1883,17 @@ JS_DeepFreezeObject(JSContext* cx, JS::H
 
 /**
  * Freezes an object; see ES5's Object.freeze(obj) method.
  */
 extern JS_PUBLIC_API bool
 JS_FreezeObject(JSContext* cx, JS::Handle<JSObject*> obj);
 
 
-/*** Property descriptors ************************************************************************/
+/*** Property descriptors ***************************************************/
 
 namespace JS {
 
 struct JS_PUBLIC_API PropertyDescriptor {
     JSObject* obj;
     unsigned attrs;
     JSGetterOp getter;
     JSSetterOp setter;
@@ -2152,17 +2155,17 @@ ObjectToCompletePropertyDescriptor(JSCon
 extern JS_PUBLIC_API bool
 FromPropertyDescriptor(JSContext* cx,
                        JS::Handle<JS::PropertyDescriptor> desc,
                        JS::MutableHandleValue vp);
 
 } // namespace JS
 
 
-/*** Standard internal methods ********************************************************************
+/*** Standard internal methods **********************************************
  *
  * The functions below are the fundamental operations on objects.
  *
  * ES6 specifies 14 internal methods that define how objects behave.  The
  * standard is actually quite good on this topic, though you may have to read
  * it a few times. See ES6 sections 6.1.7.2 and 6.1.7.3.
  *
  * When 'obj' is an ordinary object, these functions have boring standard
@@ -2733,17 +2736,17 @@ Construct(JSContext* cx, JS::HandleValue
 /**
  * Invoke a constructor, like the JS expression `new ctor(...args)`. Returns
  * the new object, or null on error.
  */
 extern JS_PUBLIC_API JSObject*
 JS_New(JSContext* cx, JS::HandleObject ctor, const JS::HandleValueArray& args);
 
 
-/*** Other property-defining functions ***********************************************************/
+/*** Other property-defining functions **************************************/
 
 extern JS_PUBLIC_API JSObject*
 JS_DefineObject(JSContext* cx, JS::HandleObject obj, const char* name,
                 const JSClass* clasp = nullptr, unsigned attrs = 0);
 
 extern JS_PUBLIC_API bool
 JS_DefineConstDoubles(JSContext* cx, JS::HandleObject obj, const JSConstDoubleSpec* cds);
 
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2549,17 +2549,18 @@ static MOZ_ALWAYS_INLINE jsid
 NON_INTEGER_ATOM_TO_JSID(JSString* atom)
 {
     MOZ_ASSERT(((size_t)atom & JSID_TYPE_MASK) == 0);
     jsid id = JSID_FROM_BITS((size_t)atom | JSID_TYPE_STRING);
     MOZ_ASSERT(js::detail::IdMatchesAtom(id, atom));
     return id;
 }
 
-/* All strings stored in jsids are atomized, but are not necessarily property names. */
+// All strings stored in jsids are atomized, but are not necessarily property
+// names.
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_ATOM(jsid id)
 {
     return JSID_IS_STRING(id);
 }
 
 static MOZ_ALWAYS_INLINE bool
 JSID_IS_ATOM(jsid id, JSAtom* atom)
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1325,20 +1325,18 @@ js::InitNumberClass(JSContext* cx, Handl
     if (!ctor) {
         return nullptr;
     }
 
     if (!LinkConstructorAndPrototype(cx, ctor, numberProto)) {
         return nullptr;
     }
 
-    /*
-     * Our NaN must be one particular canonical value, because we rely on NaN
-     * encoding for our value representation.  See Value.h.
-     */
+    // Our NaN must be one particular canonical value, because we rely on NaN
+    // encoding for our value representation.  See Value.h.
     static const JSConstDoubleSpec number_constants[] = {
         // clang-format off
         {"NaN",               GenericNaN()               },
         {"POSITIVE_INFINITY", mozilla::PositiveInfinity<double>() },
         {"NEGATIVE_INFINITY", mozilla::NegativeInfinity<double>() },
         {"MAX_VALUE",         1.7976931348623157E+308    },
         {"MIN_VALUE",         MinNumberValue<double>()   },
         /* ES6 (April 2014 draft) 20.1.2.6 */
@@ -1346,61 +1344,62 @@ js::InitNumberClass(JSContext* cx, Handl
         /* ES6 (April 2014 draft) 20.1.2.10 */
         {"MIN_SAFE_INTEGER", -9007199254740991,          },
         /* ES6 (May 2013 draft) 15.7.3.7 */
         {"EPSILON", 2.2204460492503130808472633361816e-16},
         {0,0}
         // clang-format on
     };
 
-    /* Add numeric constants (MAX_VALUE, NaN, &c.) to the Number constructor. */
+    // Add numeric constants (MAX_VALUE, NaN, &c.) to the Number constructor.
     if (!JS_DefineConstDoubles(cx, ctor, number_constants)) {
         return nullptr;
     }
 
     if (!DefinePropertiesAndFunctions(cx, ctor, nullptr, number_static_methods)) {
         return nullptr;
     }
 
     if (!DefinePropertiesAndFunctions(cx, numberProto, nullptr, number_methods)) {
         return nullptr;
     }
 
     if (!JS_DefineFunctions(cx, global, number_functions)) {
         return nullptr;
     }
 
-    /* Number.parseInt should be the same function object as global parseInt. */
+    // Number.parseInt should be the same function object as global parseInt.
     RootedId parseIntId(cx, NameToId(cx->names().parseInt));
     JSFunction* parseInt = DefineFunction(cx, global, parseIntId, num_parseInt, 2,
                                           JSPROP_RESOLVING);
     if (!parseInt) {
         return nullptr;
     }
     RootedValue parseIntValue(cx, ObjectValue(*parseInt));
     if (!DefineDataProperty(cx, ctor, parseIntId, parseIntValue, 0)) {
         return nullptr;
     }
 
-    /* Number.parseFloat should be the same function object as global parseFloat. */
+    // Number.parseFloat should be the same function object as global
+    // parseFloat.
     RootedId parseFloatId(cx, NameToId(cx->names().parseFloat));
     JSFunction* parseFloat = DefineFunction(cx, global, parseFloatId, num_parseFloat, 1,
                                             JSPROP_RESOLVING);
     if (!parseFloat) {
         return nullptr;
     }
     RootedValue parseFloatValue(cx, ObjectValue(*parseFloat));
     if (!DefineDataProperty(cx, ctor, parseFloatId, parseFloatValue, 0)) {
         return nullptr;
     }
 
     RootedValue valueNaN(cx, cx->runtime()->NaNValue);
     RootedValue valueInfinity(cx, cx->runtime()->positiveInfinityValue);
 
-    /* ES5 15.1.1.1, 15.1.1.2 */
+    // ES5 15.1.1.1, 15.1.1.2
     if (!NativeDefineDataProperty(cx, global, cx->names().NaN, valueNaN,
                                   JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_RESOLVING) ||
         !NativeDefineDataProperty(cx, global, cx->names().Infinity, valueInfinity,
                                   JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_RESOLVING))
     {
         return nullptr;
     }
 
--- a/js/src/proxy/ScriptedProxyHandler.cpp
+++ b/js/src/proxy/ScriptedProxyHandler.cpp
@@ -159,19 +159,19 @@ IsCompatiblePropertyDescriptor(JSContext
 // Get the [[ProxyHandler]] of a scripted proxy.
 /* static */ JSObject*
 ScriptedProxyHandler::handlerObject(const JSObject* proxy)
 {
     MOZ_ASSERT(proxy->as<ProxyObject>().handler() == &ScriptedProxyHandler::singleton);
     return proxy->as<ProxyObject>().reservedSlot(ScriptedProxyHandler::HANDLER_EXTRA).toObjectOrNull();
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.9 GetMethod,
-// reimplemented for proxy handler trap-getting to produce better error
-// messages.
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 7.3.9 GetMethod, reimplemented for proxy handler trap-getting to produce
+// better error messages.
 static bool
 GetProxyTrap(JSContext* cx, HandleObject handler, HandlePropertyName name, MutableHandleValue func)
 {
     // Steps 2, 5.
     if (!GetProperty(cx, handler, handler, name, func)) {
         return false;
     }
 
@@ -194,17 +194,18 @@ GetProxyTrap(JSContext* cx, HandleObject
 
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_TRAP, bytes.get());
         return false;
     }
 
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.1 Proxy.[[GetPrototypeOf]].
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.1 Proxy.[[GetPrototypeOf]].
 bool
 ScriptedProxyHandler::getPrototype(JSContext* cx, HandleObject proxy,
                                    MutableHandleObject protop) const
 {
     // Steps 1-3.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -272,17 +273,18 @@ ScriptedProxyHandler::getPrototype(JSCon
         return false;
     }
 
     // Step 13.
     protop.set(handlerProto.toObjectOrNull());
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.2 Proxy.[[SetPrototypeOf]].
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.2 Proxy.[[SetPrototypeOf]].
 bool
 ScriptedProxyHandler::setPrototype(JSContext* cx, HandleObject proxy, HandleObject proto,
                                    ObjectOpResult& result) const
 {
     // Steps 1-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -371,17 +373,18 @@ ScriptedProxyHandler::setImmutableProtot
     if (!target) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
         return false;
     }
 
     return SetImmutablePrototype(cx, target, succeeded);
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.4 Proxy.[[PreventExtensions]]()
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.4 Proxy.[[PreventExtensions]]()
 bool
 ScriptedProxyHandler::preventExtensions(JSContext* cx, HandleObject proxy,
                                         ObjectOpResult& result) const
 {
     // Steps 1-3.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -432,17 +435,18 @@ ScriptedProxyHandler::preventExtensions(
         // Step 9.
         return result.succeed();
     }
 
     // Also step 9.
     return result.fail(JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE);
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.3 Proxy.[[IsExtensible]]()
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.3 Proxy.[[IsExtensible]]()
 bool
 ScriptedProxyHandler::isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) const
 {
     // Steps 1-3.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
         return false;
@@ -487,17 +491,18 @@ ScriptedProxyHandler::isExtensible(JSCon
        return false;
     }
 
     // Step 10.
     *extensible = booleanTrapResult;
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.5 Proxy.[[GetOwnProperty]](P)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.5 Proxy.[[GetOwnProperty]](P)
 bool
 ScriptedProxyHandler::getOwnPropertyDescriptor(JSContext* cx, HandleObject proxy, HandleId id,
                                                MutableHandle<PropertyDescriptor> desc) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -609,17 +614,18 @@ ScriptedProxyHandler::getOwnPropertyDesc
     }
 
     // Step 18.
     desc.set(resultDesc);
     desc.object().set(proxy);
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.6 Proxy.[[DefineOwnProperty]](P, Desc)
 bool
 ScriptedProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, HandleId id,
                                      Handle<PropertyDescriptor> desc, ObjectOpResult& result) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -909,17 +915,18 @@ ScriptedProxyHandler::ownPropertyKeys(JS
         RootedId id(cx, uncheckedResultKeys.all().front());
         return js::Throw(cx, id, JSMSG_CANT_REPORT_NEW);
     }
 
     // Step 23.
     return props.appendAll(trapResult);
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.10 Proxy.[[Delete]](P)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.10 Proxy.[[Delete]](P)
 bool
 ScriptedProxyHandler::delete_(JSContext* cx, HandleObject proxy, HandleId id,
                               ObjectOpResult& result) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -979,17 +986,18 @@ ScriptedProxyHandler::delete_(JSContext*
         JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, JSMSG_CANT_DELETE, bytes.get());
         return false;
     }
 
     // Steps 11,13.
     return result.succeed();
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.7 Proxy.[[HasProperty]](P)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.7 Proxy.[[HasProperty]](P)
 bool
 ScriptedProxyHandler::has(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
         return false;
@@ -1052,17 +1060,18 @@ ScriptedProxyHandler::has(JSContext* cx,
         }
     }
 
     // Step 10.
     *bp = booleanTrapResult;
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.8 Proxy.[[GetP]](P, Receiver)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.8 Proxy.[[GetP]](P, Receiver)
 bool
 ScriptedProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver, HandleId id,
                           MutableHandleValue vp) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -1133,17 +1142,18 @@ ScriptedProxyHandler::get(JSContext* cx,
         }
     }
 
     // Step 11.
     vp.set(trapResult);
     return true;
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.9 Proxy.[[Set]](P, V, Receiver)
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.9 Proxy.[[Set]](P, V, Receiver)
 bool
 ScriptedProxyHandler::set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v,
                           HandleValue receiver, ObjectOpResult& result) const
 {
     // Steps 2-4.
     RootedObject handler(cx, ScriptedProxyHandler::handlerObject(proxy));
     if (!handler) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_PROXY_REVOKED);
@@ -1423,17 +1433,18 @@ const ScriptedProxyHandler ScriptedProxy
 
 bool
 IsRevokedScriptedProxy(JSObject* obj)
 {
     obj = CheckedUnwrap(obj);
     return obj && IsScriptedProxy(obj) && !obj->as<ProxyObject>().target();
 }
 
-// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 9.5.14 ProxyCreate.
+// ES8 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 9.5.14 ProxyCreate.
 static bool
 ProxyCreate(JSContext* cx, CallArgs& args, const char* callerName)
 {
     if (args.length() < 2) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
                                   callerName, "1", "s");
         return false;
     }
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -9871,17 +9871,18 @@ dom_constructor(JSContext* cx, unsigned 
 
     args.rval().setObject(*domObj);
     return true;
 }
 
 static bool
 InstanceClassHasProtoAtDepth(const Class* clasp, uint32_t protoID, uint32_t depth)
 {
-    /* There's only a single (fake) DOM object in the shell, so just return true. */
+    // There's only a single (fake) DOM object in the shell, so just return
+    // true.
     return true;
 }
 
 class ScopedFileDesc
 {
     intptr_t fd_;
   public:
     enum LockType { READ_LOCK, WRITE_LOCK };
--- a/js/src/shell/jsoptparse.cpp
+++ b/js/src/shell/jsoptparse.cpp
@@ -360,31 +360,33 @@ OptionParser::handleArg(size_t argc, cha
 
     switch (arg->kind) {
       case OptionKindString:
         arg->asStringOption()->value = argv[*i];
         nextArgument += 1;
         return Okay;
       case OptionKindMultiString:
       {
-        /* Don't advance the next argument -- there can only be one (final) variadic argument. */
+        // Don't advance the next argument -- there can only be one (final)
+        // variadic argument.
         StringArg value(argv[*i], *i);
         return arg->asMultiStringOption()->strings.append(value) ? Okay : Fail;
       }
       default:
         MOZ_CRASH("unhandled argument kind");
     }
 }
 
 OptionParser::Result
 OptionParser::parseArgs(int inputArgc, char** argv)
 {
     MOZ_ASSERT(inputArgc >= 0);
     size_t argc = inputArgc;
-    /* Permit a "no more options" capability, like |--| offers in many shell interfaces. */
+    // Permit a "no more options" capability, like |--| offers in many shell
+    // interfaces.
     bool optionsAllowed = true;
 
     for (size_t i = 1; i < argc; ++i) {
         char* arg = argv[i];
         Result r;
         /* Note: solo dash option is actually a 'stdin' argument. */
         if (arg[0] == '-' && arg[1] != '\0' && optionsAllowed) {
             /* Option. */
--- a/js/src/vm/ArrayBufferObject-inl.h
+++ b/js/src/vm/ArrayBufferObject-inl.h
@@ -2,17 +2,18 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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/. */
 
 #ifndef vm_ArrayBufferObject_inl_h
 #define vm_ArrayBufferObject_inl_h
 
-/* Utilities and common inline code for ArrayBufferObject and SharedArrayBufferObject */
+// Utilities and common inline code for ArrayBufferObject and
+// SharedArrayBufferObject.
 
 #include "vm/ArrayBufferObject.h"
 
 #include "js/Value.h"
 
 #include "vm/SharedArrayObject.h"
 #include "vm/SharedMem.h"
 
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -638,18 +638,18 @@ ArrayBufferObject::changeContents(JSCont
  *                                           SLOP
  * \_____________________________________________________________________/
  *                         MAPPED
  *
  * Invariants:
  *  - length only increases
  *  - 0 <= length <= maxSize (if present) <= boundsCheckLimit <= mappedSize
  *  - on ARM boundsCheckLimit must be a valid ARM immediate.
- *  - if maxSize is not specified, boundsCheckLimit/mappedSize may grow. They are
- *    otherwise constant.
+ *  - if maxSize is not specified, boundsCheckLimit/mappedSize may grow. They
+ *    are otherwise constant.
  *
  * NOTE: For asm.js on non-x64 we guarantee that
  *
  * length == maxSize == boundsCheckLimit == mappedSize
  *
  * That is, signal handlers will not be invoked, since they cannot emulate
  * asm.js accesses on non-x64 architectures.
  *
--- a/js/src/vm/BytecodeUtil.cpp
+++ b/js/src/vm/BytecodeUtil.cpp
@@ -2521,17 +2521,18 @@ js::DecompileArgument(JSContext* cx, int
     }
 
     return ValueToSource(cx, v);
 }
 
 extern bool
 js::IsValidBytecodeOffset(JSContext* cx, JSScript* script, size_t offset)
 {
-    // This could be faster (by following jump instructions if the target is <= offset).
+    // This could be faster (by following jump instructions if the target
+    // is <= offset).
     for (BytecodeRange r(cx, script); !r.empty(); r.popFront()) {
         size_t here = r.frontOffset();
         if (here >= offset) {
             return here == offset;
         }
     }
     return false;
 }
--- a/js/src/vm/BytecodeUtil.h
+++ b/js/src/vm/BytecodeUtil.h
@@ -250,17 +250,18 @@ GET_UINT32_INDEX(const jsbytecode* pc)
 }
 
 static MOZ_ALWAYS_INLINE void
 SET_UINT32_INDEX(jsbytecode* pc, uint32_t index)
 {
     SET_UINT32(pc, index);
 }
 
-/* Index limit is determined by SN_4BYTE_OFFSET_FLAG, see frontend/BytecodeEmitter.h. */
+// Index limit is determined by SN_4BYTE_OFFSET_FLAG, see
+// frontend/BytecodeEmitter.h.
 static const unsigned INDEX_LIMIT_LOG2  = 31;
 static const uint32_t INDEX_LIMIT       = uint32_t(1) << INDEX_LIMIT_LOG2;
 
 static inline jsbytecode
 ARGC_HI(uint16_t argc)
 {
     return UINT16_HI(argc);
 }
--- a/js/src/vm/Caches.h
+++ b/js/src/vm/Caches.h
@@ -203,17 +203,18 @@ class NewObjectCache
         uintptr_t hash = (uintptr_t(clasp) ^ uintptr_t(key)) + size_t(kind);
         return hash % mozilla::ArrayLength(entries);
     }
 
     bool lookup(const Class* clasp, gc::Cell* key, gc::AllocKind kind, EntryIndex* pentry) {
         *pentry = makeIndex(clasp, key, kind);
         Entry* entry = &entries[*pentry];
 
-        /* N.B. Lookups with the same clasp/key but different kinds map to different entries. */
+        // N.B. Lookups with the same clasp/key but different kinds map to
+        // different entries.
         return entry->clasp == clasp && entry->key == key;
     }
 
     void fill(EntryIndex entry_, const Class* clasp, gc::Cell* key, gc::AllocKind kind,
               NativeObject* obj) {
         MOZ_ASSERT(unsigned(entry_) < mozilla::ArrayLength(entries));
         MOZ_ASSERT(entry_ == makeIndex(clasp, key, kind));
         Entry* entry = &entries[entry_];
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -70,17 +70,17 @@ using mozilla::MakeScopeExit;
 using mozilla::Maybe;
 using mozilla::Some;
 using mozilla::Nothing;
 using mozilla::AsVariant;
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 
 
-/*** Forward declarations, ClassOps and Classes **************************************************/
+/*** Forward declarations, ClassOps and Classes *****************************/
 
 static void DebuggerFrame_finalize(FreeOp* fop, JSObject* obj);
 static void DebuggerFrame_trace(JSTracer* trc, JSObject* obj);
 static void DebuggerEnv_trace(JSTracer* trc, JSObject* obj);
 static void DebuggerObject_trace(JSTracer* trc, JSObject* obj);
 static void DebuggerScript_trace(JSTracer* trc, JSObject* obj);
 static void DebuggerSource_trace(JSTracer* trc, JSObject* obj);
 
@@ -227,17 +227,17 @@ static const ClassOps DebuggerSource_cla
 static const Class DebuggerSource_class = {
     "Source",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSOURCE_COUNT),
     &DebuggerSource_classOps
 };
 
 
-/*** Utils ***************************************************************************************/
+/*** Utils ******************************************************************/
 
 /*
  * If fun is an interpreted function, remove any async function/generator
  * wrapper and return the underlying scripted function. Otherwise, return fun
  * unchanged.
  *
  * Async functions are implemented as native functions wrapped around a scripted
  * function. JSScripts hold ordinary inner JSFunctions in their object arrays,
@@ -559,17 +559,17 @@ RequireGlobalObject(JSContext* cx, Handl
         }
         return false;
     }
 
     return true;
 }
 
 
-/*** Breakpoints *********************************************************************************/
+/*** Breakpoints ************************************************************/
 
 BreakpointSite::BreakpointSite(Type type)
   : type_(type), enabledCount(0)
 {
 }
 
 void
 BreakpointSite::inc(FreeOp* fop)
@@ -690,17 +690,17 @@ WasmBreakpointSite::recompile(FreeOp* fo
 void
 WasmBreakpointSite::destroyIfEmpty(FreeOp* fop)
 {
     if (isEmpty()) {
         debug->destroyBreakpointSite(fop, offset);
     }
 }
 
-/*** Debugger hook dispatch **********************************************************************/
+/*** Debugger hook dispatch *************************************************/
 
 Debugger::Debugger(JSContext* cx, NativeObject* dbg)
   : object(dbg),
     debuggees(cx->zone()),
     uncaughtExceptionHook(nullptr),
     enabled(true),
     allowUnobservedAsmJS(false),
     collectCoverageInfo(false),
@@ -1592,17 +1592,17 @@ Debugger::unwrapPropertyDescriptor(JSCon
         }
         desc.setSetterObject(set);
     }
 
     return true;
 }
 
 
-/*** Debuggee resumption values and debugger error handling **************************************/
+/*** Debuggee resumption values and debugger error handling *****************/
 
 static bool
 GetResumptionProperty(JSContext* cx, HandleObject obj, HandlePropertyName name, ResumeMode namedMode,
                       ResumeMode& resumeMode, MutableHandleValue vp, int* hits)
 {
     bool found;
     if (!HasProperty(cx, obj, name, &found)) {
         return false;
@@ -1897,17 +1897,17 @@ Debugger::processHandlerResult(Maybe<Aut
     ResumeMode resumeMode = ResumeMode::Continue;
     if (!ParseResumptionValue(cx, rootRv, resumeMode, vp)) {
         return handleUncaughtException(ar, vp, maybeThisv, frame);
     }
     return leaveDebugger(ar, frame, maybeThisv, CallUncaughtExceptionHook::Yes, resumeMode, vp);
 }
 
 
-/*** Debuggee completion values ******************************************************************/
+/*** Debuggee completion values *********************************************/
 
 /* static */ void
 Debugger::resultToCompletion(JSContext* cx, bool ok, const Value& rv,
                              ResumeMode* resumeMode, MutableHandleValue value)
 {
     MOZ_ASSERT_IF(ok, !cx->isExceptionPending());
 
     if (ok) {
@@ -1977,17 +1977,17 @@ Debugger::receiveCompletionValue(Maybe<A
     RootedValue value(cx);
     resultToCompletion(cx, ok, val, &resumeMode, &value);
     ar.reset();
     return wrapDebuggeeValue(cx, &value) &&
            newCompletionValue(cx, resumeMode, value, vp);
 }
 
 
-/*** Firing debugger hooks ***********************************************************************/
+/*** Firing debugger hooks **************************************************/
 
 static bool
 CallMethodIfPresent(JSContext* cx, HandleObject obj, const char* name, size_t argc, Value* argv,
                     MutableHandleValue rval)
 {
     rval.setUndefined();
     JSAtom* atom = Atomize(cx, name, strlen(name));
     if (!atom) {
@@ -2658,17 +2658,17 @@ Debugger::slowPathPromiseHook(JSContext*
     }
 
     // Promise hooks are infallible and we ignore errors from uncaught
     // exceptions by design.
     MOZ_ASSERT(resumeMode == ResumeMode::Continue);
 }
 
 
-/*** Debugger code invalidation for observing execution ******************************************/
+/*** Debugger code invalidation for observing execution *********************/
 
 class MOZ_RAII ExecutionObservableRealms : public Debugger::ExecutionObservableSet
 {
     HashSet<Realm*> realms_;
     HashSet<Zone*> zones_;
 
   public:
     explicit ExecutionObservableRealms(JSContext* cx
@@ -3194,17 +3194,17 @@ Debugger::updateObservesAsmJSOnDebuggees
             continue;
         }
 
         realm->updateDebuggerObservesAsmJS();
     }
 }
 
 
-/*** Allocations Tracking *************************************************************************/
+/*** Allocations Tracking ***************************************************/
 
 /* static */ bool
 Debugger::cannotTrackAllocations(const GlobalObject& global)
 {
     auto existingCallback = global.realm()->getAllocationMetadataBuilder();
     return existingCallback && existingCallback != &SavedStacks::metadataBuilder;
 }
 
@@ -3290,17 +3290,17 @@ Debugger::removeAllocationsTrackingForAl
         Debugger::removeAllocationsTracking(*r.front().get());
     }
 
     allocationsLog.clear();
 }
 
 
 
-/*** Debugger JSObjects **************************************************************************/
+/*** Debugger JSObjects *****************************************************/
 
 void
 Debugger::traceCrossCompartmentEdges(JSTracer* trc)
 {
     generatorFrames.traceCrossCompartmentEdges<DebuggerFrame_trace>(trc);
     objects.traceCrossCompartmentEdges<DebuggerObject_trace>(trc);
     environments.traceCrossCompartmentEdges<DebuggerEnv_trace>(trc);
     scripts.traceCrossCompartmentEdges<DebuggerScript_trace>(trc);
@@ -3346,18 +3346,18 @@ Debugger::traceIncomingCrossCompartmentE
         if (!zone->isCollecting() || state == gc::State::Compact) {
             dbg->traceCrossCompartmentEdges(trc);
         }
     }
 }
 
 /*
  * This method has two tasks:
- *   1. Mark Debugger objects that are unreachable except for debugger hooks that
- *      may yet be called.
+ *   1. Mark Debugger objects that are unreachable except for debugger hooks
+ *      that may yet be called.
  *   2. Mark breakpoint handlers.
  *
  * This happens during the iterative part of the GC mark phase. This method
  * returns true if it has to mark anything; GC calls it repeatedly until it
  * returns false.
  */
 /* static */ bool
 Debugger::markIteratively(GCMarker* marker)
@@ -5788,17 +5788,17 @@ const JSFunctionSpec Debugger::methods[]
 };
 
 const JSFunctionSpec Debugger::static_methods[] {
     JS_FN("isCompilableUnit", Debugger::isCompilableUnit, 1, 0),
     JS_FN("recordReplayProcessKind", Debugger::recordReplayProcessKind, 0, 0),
     JS_FS_END
 };
 
-/*** Debugger.Script *****************************************************************************/
+/*** Debugger.Script ********************************************************/
 
 // Get the Debugger.Script referent as bare Cell. This should only be used for
 // GC operations like tracing. Please use GetScriptReferent below.
 static inline gc::Cell*
 GetScriptReferentCell(JSObject* obj)
 {
     MOZ_ASSERT(obj->getClass() == &DebuggerScript_class);
     return static_cast<gc::Cell*>(obj->as<NativeObject>().getPrivate());
@@ -7772,17 +7772,17 @@ static const JSFunctionSpec DebuggerScri
     JS_FN("clearBreakpoint", DebuggerScript_clearBreakpoint, 1, 0),
     JS_FN("clearAllBreakpoints", DebuggerScript_clearAllBreakpoints, 0, 0),
     JS_FN("isInCatchScope", DebuggerScript_isInCatchScope, 1, 0),
     JS_FN("getOffsetsCoverage", DebuggerScript_getOffsetsCoverage, 0, 0),
     JS_FS_END
 };
 
 
-/*** Debugger.Source *****************************************************************************/
+/*** Debugger.Source ********************************************************/
 
 // For internal use only.
 static inline NativeObject*
 GetSourceReferentRawObject(JSObject* obj)
 {
     MOZ_ASSERT(obj->getClass() == &DebuggerSource_class);
     return static_cast<NativeObject*>(obj->as<NativeObject>().getPrivate());
 }
@@ -8365,17 +8365,17 @@ static const JSPropertySpec DebuggerSour
     JS_PS_END
 };
 
 static const JSFunctionSpec DebuggerSource_methods[] = {
     JS_FS_END
 };
 
 
-/*** Debugger.Frame ******************************************************************************/
+/*** Debugger.Frame *********************************************************/
 
 ScriptedOnStepHandler::ScriptedOnStepHandler(JSObject* object)
   : object_(object)
 {
     MOZ_ASSERT(object_->isCallable());
 }
 
 JSObject*
@@ -9325,17 +9325,18 @@ DebuggerFrame::olderGetter(JSContext* cx
     if (!DebuggerFrame::getOlder(cx, frame, &result)) {
         return false;
     }
 
     args.rval().setObjectOrNull(result);
     return true;
 }
 
-/* The getter used for each element of frame.arguments. See DebuggerFrame_getArguments. */
+// The getter used for each element of frame.arguments.
+// See DebuggerFrame_getArguments.
 static bool
 DebuggerArguments_getArg(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     int32_t i = args.callee().as<JSFunction>().getExtendedSlot(0).toInt32();
 
     // Check that the this value is an Arguments object.
     RootedObject argsobj(cx, NonNullObject(cx, args.thisv()));
@@ -9682,17 +9683,17 @@ const JSPropertySpec DebuggerFrame::prop
 
 const JSFunctionSpec DebuggerFrame::methods_[] = {
     JS_FN("eval", DebuggerFrame::evalMethod, 1, 0),
     JS_FN("evalWithBindings", DebuggerFrame::evalWithBindingsMethod, 1, 0),
     JS_FS_END
 };
 
 
-/*** Debugger.Object *****************************************************************************/
+/*** Debugger.Object ********************************************************/
 
 void
 DebuggerObject_trace(JSTracer* trc, JSObject* obj)
 {
     // There is a barrier on private pointers, so the Unbarriered marking
     // is okay.
     if (JSObject* referent = (JSObject*) obj->as<NativeObject>().getPrivate()) {
         TraceManuallyBarrieredCrossCompartmentEdge(trc, obj, &referent,
@@ -11976,17 +11977,17 @@ DebuggerObject::getScriptedProxyHandler(
     if(!unwrapped) {
         result.set(nullptr);
         return true;
     }
     return dbg->wrapDebuggeeObject(cx, unwrapped, result);
 }
 
 
-/*** Debugger.Environment ************************************************************************/
+/*** Debugger.Environment ***************************************************/
 
 void
 DebuggerEnv_trace(JSTracer* trc, JSObject* obj)
 {
     // There is a barrier on private pointers, so the Unbarriered marking
     // is okay.
     if (Env* referent = (JSObject*) obj->as<NativeObject>().getPrivate()) {
         TraceManuallyBarrieredCrossCompartmentEdge(trc, obj, &referent,
@@ -12572,17 +12573,17 @@ DebuggerEnvironment::setVariable(JSConte
             return false;
         }
     }
 
     return true;
 }
 
 
-/*** JS::dbg::Builder ****************************************************************************/
+/*** JS::dbg::Builder *******************************************************/
 
 Builder::Builder(JSContext* cx, js::Debugger* debugger)
   : debuggerObject(cx, debugger->toJSObject().get()),
     debugger(debugger)
 { }
 
 
 #if DEBUG
@@ -12649,32 +12650,32 @@ Builder::newObject(JSContext* cx)
 
     RootedPlainObject obj(cx, NewBuiltinClassInstance<PlainObject>(cx));
 
     // If the allocation failed, this will return a false Object, as the spec promises.
     return Object(cx, *this, obj);
 }
 
 
-/*** JS::dbg::AutoEntryMonitor ******************************************************************/
+/*** JS::dbg::AutoEntryMonitor **********************************************/
 
 AutoEntryMonitor::AutoEntryMonitor(JSContext* cx)
   : cx_(cx),
     savedMonitor_(cx->entryMonitor)
 {
     cx->entryMonitor = this;
 }
 
 AutoEntryMonitor::~AutoEntryMonitor()
 {
     cx_->entryMonitor = savedMonitor_;
 }
 
 
-/*** Glue ****************************************************************************************/
+/*** Glue *******************************************************************/
 
 extern JS_PUBLIC_API bool
 JS_DefineDebuggerObject(JSContext* cx, HandleObject obj)
 {
     RootedNativeObject
         objProto(cx),
         debugCtor(cx),
         debugProto(cx),
@@ -12830,17 +12831,17 @@ js::CheckDebuggeeThing(JSObject* obj, bo
 {
     if (Realm* realm = JS::GetObjectRealmOrNull(obj)) {
         CheckDebuggeeThingRealm(realm, invisibleOk);
     }
 }
 #endif // DEBUG
 
 
-/*** JS::dbg::GarbageCollectionEvent **************************************************************/
+/*** JS::dbg::GarbageCollectionEvent ****************************************/
 
 namespace JS {
 namespace dbg {
 
 /* static */ GarbageCollectionEvent::Ptr
 GarbageCollectionEvent::Create(JSRuntime* rt, ::js::gcstats::Statistics& stats, uint64_t gcNumber)
 {
     auto data = MakeUnique<GarbageCollectionEvent>(gcNumber);
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -146,26 +146,27 @@ class DebuggerWeakMap : private WeakMap<
 
     explicit DebuggerWeakMap(JSContext* cx)
         : Base(cx),
           zoneCounts(cx->zone()),
           compartment(cx->compartment())
     { }
 
   public:
-    /* Expose those parts of HashMap public interface that are used by Debugger methods. */
+    // Expose those parts of HashMap public interface that are used by Debugger
+    // methods.
 
     typedef typename Base::Entry Entry;
     typedef typename Base::Ptr Ptr;
     typedef typename Base::AddPtr AddPtr;
     typedef typename Base::Range Range;
     typedef typename Base::Enum Enum;
     typedef typename Base::Lookup Lookup;
 
-    /* Expose WeakMap public interface */
+    // Expose WeakMap public interface.
 
     using Base::lookup;
     using Base::lookupForAdd;
     using Base::remove;
     using Base::all;
     using Base::trace;
 
     template<typename KeyInput, typename ValueInput>
@@ -580,38 +581,39 @@ class Debugger : private mozilla::Linked
     typedef DebuggerWeakMap<JSScript*> ScriptWeakMap;
     ScriptWeakMap scripts;
 
     using LazyScriptWeakMap = DebuggerWeakMap<LazyScript*>;
     LazyScriptWeakMap lazyScripts;
 
     using LazyScriptVector = JS::GCVector<LazyScript*>;
 
-    /* The map from debuggee source script objects to their Debugger.Source instances. */
+    // The map from debuggee source script objects to their Debugger.Source
+    // instances.
     typedef DebuggerWeakMap<JSObject*, true> SourceWeakMap;
     SourceWeakMap sources;
 
-    /* The map from debuggee objects to their Debugger.Object instances. */
+    // The map from debuggee objects to their Debugger.Object instances.
     typedef DebuggerWeakMap<JSObject*> ObjectWeakMap;
     ObjectWeakMap objects;
 
-    /* The map from debuggee Envs to Debugger.Environment instances. */
+    // The map from debuggee Envs to Debugger.Environment instances.
     ObjectWeakMap environments;
 
-    /* The map from WasmInstanceObjects to synthesized Debugger.Script instances. */
+    // The map from WasmInstanceObjects to synthesized Debugger.Script
+    // instances.
     typedef DebuggerWeakMap<WasmInstanceObject*> WasmInstanceWeakMap;
     WasmInstanceWeakMap wasmInstanceScripts;
 
-    /* The map from WasmInstanceObjects to synthesized Debugger.Source instances. */
+    // The map from WasmInstanceObjects to synthesized Debugger.Source
+    // instances.
     WasmInstanceWeakMap wasmInstanceSources;
 
-    /*
-     * Keep track of tracelogger last drained identifiers to know if there are
-     * lost events.
-     */
+    // Keep track of tracelogger last drained identifiers to know if there are
+    // lost events.
 #ifdef NIGHTLY_BUILD
     uint32_t traceLoggerLastDrainedSize;
     uint32_t traceLoggerLastDrainedIteration;
 #endif
     uint32_t traceLoggerScriptedCallsLastDrainedSize;
     uint32_t traceLoggerScriptedCallsLastDrainedIteration;
 
     class QueryBase;
@@ -933,17 +935,17 @@ class Debugger : private mozilla::Linked
 
     Zone* zone() const { return toJSObject()->zone(); }
 
     bool hasMemory() const;
     DebuggerMemory& memory() const;
 
     WeakGlobalObjectSet::Range allDebuggees() const { return debuggees.all(); }
 
-    /*********************************** Methods for interaction with the GC. */
+    /*** Methods for interaction with the GC. *******************************/
 
     /*
      * A Debugger object is live if:
      *   * the Debugger JSObject is live (Debugger::trace handles this case); OR
      *   * it is in the middle of dispatching an event (the event dispatching
      *     code roots it in this case); OR
      *   * it is enabled, and it is debugging at least one live compartment,
      *     and at least one of the following is true:
@@ -1059,17 +1061,17 @@ class Debugger : private mozilla::Linked
     // this is *not* equivalent to the promise resolution (ie, the promise's fate
     // getting locked in) because you can resolve a promise with another pending
     // promise, in which case neither promise has settled yet.
     //
     // This should never be called on the same promise more than once, because a
     // promise can only make the transition from unsettled to settled once.
     static inline void onPromiseSettled(JSContext* cx, Handle<PromiseObject*> promise);
 
-    /************************************* Functions for use by Debugger.cpp. */
+    /*** Functions for use by Debugger.cpp. *********************************/
 
     inline bool observesEnterFrame() const;
     inline bool observesNewScript() const;
     inline bool observesNewGlobalObject() const;
     inline bool observesGlobal(GlobalObject* global) const;
     bool observesFrame(AbstractFramePtr frame) const;
     bool observesFrame(const FrameIter& iter) const;
     bool observesScript(JSScript* script) const;
--- a/js/src/vm/EnvironmentObject.h
+++ b/js/src/vm/EnvironmentObject.h
@@ -26,30 +26,31 @@ typedef Handle<ModuleObject*> HandleModu
 
 /*
  * Return a shape representing the static scope containing the variable
  * accessed by the ALIASEDVAR op at 'pc'.
  */
 extern Shape*
 EnvironmentCoordinateToEnvironmentShape(JSScript* script, jsbytecode* pc);
 
-/* Return the name being accessed by the given ALIASEDVAR op. */
+// Return the name being accessed by the given ALIASEDVAR op.
 extern PropertyName*
 EnvironmentCoordinateName(EnvironmentCoordinateNameCache& cache, JSScript* script, jsbytecode* pc);
 
-/* Return the function script accessed by the given ALIASEDVAR op, or nullptr. */
+// Return the function script accessed by the given ALIASEDVAR op, or nullptr.
 extern JSScript*
 EnvironmentCoordinateFunctionScript(JSScript* script, jsbytecode* pc);
 
 
-/*** Environment objects *****************************************************/
+/*** Environment objects ****************************************************/
 
 
-/*** Environment objects *****************************************************/
+/*** Environment objects ****************************************************/
 
+// clang-format off
 /*
  * [SMDOC] Environment Objects
  *
  * About environments
  * ------------------
  *
  * (See also: ecma262 rev c7952de (19 Aug 2016) 8.1 "Lexical Environments".)
  *
@@ -252,16 +253,17 @@ EnvironmentCoordinateFunctionScript(JSSc
  *       |
  *   WithEnvironmentObject wrapping e1
  *       |
  *   WithEnvironmentObject wrapping e0
  *       |
  *   LexicalEnvironmentObject
  *
  */
+// clang-format on
 
 class EnvironmentObject : public NativeObject
 {
   protected:
     // The enclosing environment. Either another EnvironmentObject, a
     // GlobalObject, or a non-syntactic environment object.
     static const uint32_t ENCLOSING_ENV_SLOT = 0;
 
@@ -689,17 +691,17 @@ class RuntimeLexicalErrorObject : public
                                              unsigned errorNumber);
 
     unsigned errorNumber() {
         return getReservedSlot(ERROR_SLOT).toInt32();
     }
 };
 
 
-/*****************************************************************************/
+/****************************************************************************/
 
 // A environment iterator describes the active environments starting from an
 // environment, scope pair. This pair may be derived from the current point of
 // execution in a frame. If derived in such a fashion, the EnvironmentIter
 // tracks whether the current scope is within the extent of this initial
 // frame.  Here, "frame" means a single activation of: a function, eval, or
 // global code.
 class MOZ_RAII EnvironmentIter
@@ -875,17 +877,17 @@ class LiveEnvironmentVal
     Scope* scope() const { return scope_; }
 
     void updateFrame(AbstractFramePtr frame) { frame_ = frame; }
 
     bool needsSweep();
 };
 
 
-/*****************************************************************************/
+/****************************************************************************/
 
 /*
  * Debug environment objects
  *
  * The debugger effectively turns every opcode into a potential direct eval.
  * Naively, this would require creating a EnvironmentObject for every
  * call/block scope and using JSOP_GETALIASEDVAR for every access. To optimize
  * this, the engine assumes there is no debugger and optimizes scope access
--- a/js/src/vm/GeckoProfiler.cpp
+++ b/js/src/vm/GeckoProfiler.cpp
@@ -120,19 +120,18 @@ GeckoProfilerRuntime::enable(bool enable
 
     /* Toggle Gecko Profiler-related jumps on baseline jitcode.
      * The call to |ReleaseAllJITCode| above will release most baseline jitcode, but not
      * jitcode for scripts with active frames on the stack.  These scripts need to have
      * their profiler state toggled so they behave properly.
      */
     jit::ToggleBaselineProfiling(rt, enabled);
 
-    /* Update lastProfilingFrame to point to the top-most JS jit-frame currently on
-     * stack.
-     */
+    // Update lastProfilingFrame to point to the top-most JS jit-frame currently
+    // on stack.
     if (cx->jitActivation) {
         // Walk through all activations, and set their lastProfilingFrame appropriately.
         if (enabled) {
             Activation* act = cx->activation();
             void* lastProfilingFrame = GetTopProfilingJitFrame(act);
 
             jit::JitActivation* jitActivation = cx->jitActivation;
             while (jitActivation) {
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -615,17 +615,18 @@ InternalCall(JSContext* cx, const AnyInv
 }
 
 bool
 js::CallFromStack(JSContext* cx, const CallArgs& args)
 {
     return InternalCall(cx, static_cast<const AnyInvokeArgs&>(args));
 }
 
-// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.12 Call.
+// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 7.3.12 Call.
 bool
 js::Call(JSContext* cx, HandleValue fval, HandleValue thisv, const AnyInvokeArgs& args,
          MutableHandleValue rval)
 {
     // Explicitly qualify these methods to bypass AnyInvokeArgs's deliberate
     // shadowing.
     args.CallArgs::setCallee(fval);
     args.CallArgs::setThis(thisv);
@@ -1847,18 +1848,19 @@ PowOperation(JSContext* cx, MutableHandl
     return true;
 }
 
 static MOZ_ALWAYS_INLINE bool
 SetObjectElementOperation(JSContext* cx, HandleObject obj, HandleId id, HandleValue value,
                           HandleValue receiver, bool strict,
                           JSScript* script = nullptr, jsbytecode* pc = nullptr)
 {
-    // receiver != obj happens only at super[expr], where we expect to find the property
-    // People probably aren't building hashtables with |super| anyway.
+    // receiver != obj happens only at super[expr], where we expect to find the
+    // property. People probably aren't building hashtables with |super|
+    // anyway.
     TypeScript::MonitorAssign(cx, obj, id);
 
     if (obj->isNative() && JSID_IS_INT(id)) {
         uint32_t length = obj->as<NativeObject>().getDenseInitializedLength();
         int32_t i = JSID_TO_INT(id);
         if ((uint32_t)i >= length) {
             // Annotate script if provided with information (e.g. baseline)
             if (script && script->hasBaselineScript() && IsSetElemPC(pc)) {
@@ -2687,17 +2689,17 @@ CASE(JSOP_BINDNAME)
     ReservedRooted<JSObject*> envChain(&rootObject0);
     if (op == JSOP_BINDNAME || script->hasNonSyntacticScope()) {
         envChain.set(REGS.fp()->environmentChain());
     } else {
         envChain.set(&REGS.fp()->global().lexicalEnvironment());
     }
     ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS.pc));
 
-    /* Assigning to an undeclared name adds a property to the global object. */
+    // Assigning to an undeclared name adds a property to the global object.
     ReservedRooted<JSObject*> env(&rootObject1);
     if (!LookupNameUnqualified(cx, name, envChain, &env)) {
         goto error;
     }
 
     PUSH_OBJECT(*env);
 
     static_assert(JSOP_BINDNAME_LENGTH == JSOP_BINDGNAME_LENGTH,
--- a/js/src/vm/Interpreter.h
+++ b/js/src/vm/Interpreter.h
@@ -63,17 +63,18 @@ InternalCallOrConstruct(JSContext* cx, c
  * getter/setter calls.
  */
 extern bool
 CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter, MutableHandleValue rval);
 
 extern bool
 CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter, HandleValue rval);
 
-// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93 7.3.12 Call(F, V, argumentsList).
+// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
+// 7.3.12 Call(F, V, argumentsList).
 // All parameters are required, hopefully forcing callers to be careful not to
 // (say) blindly pass callee as |newTarget| when a different value should have
 // been passed.  Behavior is unspecified if any element of |args| isn't initialized.
 //
 // |rval| is written to *only* after |fval| and |thisv| have been consumed, so
 // |rval| *may* alias either argument.
 extern bool
 Call(JSContext* cx, HandleValue fval, HandleValue thisv, const AnyInvokeArgs& args,
--- a/js/src/vm/Iteration.cpp
+++ b/js/src/vm/Iteration.cpp
@@ -185,35 +185,37 @@ static bool
 EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags,
                           MutableHandle<IdSet> visited, AutoIdVector* props,
                           Handle<UnboxedPlainObject*> unboxed = nullptr)
 {
     bool enumerateSymbols;
     if (flags & JSITER_SYMBOLSONLY) {
         enumerateSymbols = true;
     } else {
-        /* Collect any dense elements from this object. */
+        // Collect any dense elements from this object.
         size_t firstElemIndex = props->length();
         size_t initlen = pobj->getDenseInitializedLength();
         const Value* vp = pobj->getDenseElements();
         bool hasHoles = false;
         for (size_t i = 0; i < initlen; ++i, ++vp) {
             if (vp->isMagic(JS_ELEMENTS_HOLE)) {
                 hasHoles = true;
             } else {
-                /* Dense arrays never get so large that i would not fit into an integer id. */
+                // Dense arrays never get so large that i would not fit into an
+                // integer id.
                 if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i),
                                                    /* enumerable = */ true, flags, visited, props))
                 {
                     return false;
                 }
             }
         }
 
-        /* Collect any typed array or shared typed array elements from this object. */
+        // Collect any typed array or shared typed array elements from this
+        // object.
         if (pobj->is<TypedArrayObject>()) {
             size_t len = pobj->as<TypedArrayObject>().length();
             for (size_t i = 0; i < len; i++) {
                 if (!Enumerate<CheckForDuplicates>(cx, pobj, INT_TO_JSID(i),
                                                    /* enumerable = */ true, flags, visited, props))
                 {
                     return false;
                 }
@@ -588,17 +590,18 @@ js::GetPropertyKeys(JSContext* cx, Handl
     return Snapshot(cx, obj,
                     flags & (JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS | JSITER_SYMBOLSONLY),
                     props);
 }
 
 static inline void
 RegisterEnumerator(ObjectRealm& realm, NativeIterator* ni)
 {
-    /* Register non-escaping native enumerators (for-in) with the current context. */
+    // Register non-escaping native enumerators (for-in) with the current
+    // context.
     ni->link(realm.enumerators);
 
     MOZ_ASSERT(!ni->isActive());
     ni->markActive();
 }
 
 static PropertyIteratorObject*
 NewPropertyIteratorObject(JSContext* cx)
@@ -1107,17 +1110,17 @@ Realm::createIterResultTemplateObject(JS
     MOZ_ASSERT(shape->previous()->slot() == Realm::IterResultObjectValueSlot &&
                shape->previous()->propidRef() == NameToId(cx->names().value));
     MOZ_ASSERT(shape->slot() == Realm::IterResultObjectDoneSlot &&
                shape->propidRef() == NameToId(cx->names().done));
 
     return templateObject;
 }
 
-/*** Iterator objects ****************************************************************************/
+/*** Iterator objects *******************************************************/
 
 size_t
 PropertyIteratorObject::sizeOfMisc(mozilla::MallocSizeOf mallocSizeOf) const
 {
     return mallocSizeOf(getPrivate());
 }
 
 void
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -868,17 +868,18 @@ struct JSContext : public JS::RootingCon
     }
     void* addressOfJitStackLimit() {
         return &jitStackLimit;
     }
     void* addressOfJitStackLimitNoInterrupt() {
         return &jitStackLimitNoInterrupt;
     }
 
-    /* Futex state, used by Atomics.wait() and Atomics.wake() on the Atomics object */
+    // Futex state, used by Atomics.wait() and Atomics.wake() on the Atomics
+    // object.
     js::FutexThread fx;
 
     // Buffer for OSR from baseline to Ion. To avoid holding on to this for
     // too long, it's also freed in EnterBaseline (after returning from JIT code).
     js::ThreadData<uint8_t*> osrTempData_;
 
     uint8_t* allocateOsrTempData(size_t size);
     void freeOsrTempData();
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -1090,17 +1090,18 @@ js::FunctionToString(JSContext* cx, Hand
         if (!script->appendSourceDataForToString(cx, out)) {
             return nullptr;
         }
     } else if (!isToSource) {
         // For the toString() output the source representation must match
         // NativeFunction when no source text is available.
         //
         // NativeFunction:
-        //   function PropertyName[~Yield,~Await]opt ( FormalParameters[~Yield,~Await] ) { [native code] }
+        //   function PropertyName[~Yield,~Await]opt (
+        //      FormalParameters[~Yield,~Await] ) { [native code] }
         //
         // Additionally, if |fun| is a well-known intrinsic object and is not
         // identified as an anonymous function, the portion of the returned
         // string that would be matched by IdentifierName must be the initial
         // value of the name property of |fun|.
 
         auto hasGetterOrSetterPrefix = [](JSAtom* name) {
             auto hasGetterOrSetterPrefix = [](const auto* chars) {
--- a/js/src/vm/JSFunction.h
+++ b/js/src/vm/JSFunction.h
@@ -921,36 +921,31 @@ ThrowTypeErrorBehavior(JSContext* cx);
  * Most functions do not have these extensions, but enough do that efficient
  * storage is required (no malloc'ed reserved slots).
  */
 class FunctionExtended : public JSFunction
 {
   public:
     static const unsigned NUM_EXTENDED_SLOTS = 2;
 
-    /* Arrow functions store their lexical new.target in the first extended slot. */
+    // Arrow functions store their lexical new.target in the first extended
+    // slot.
     static const unsigned ARROW_NEWTARGET_SLOT = 0;
 
     static const unsigned METHOD_HOMEOBJECT_SLOT = 0;
 
-    /*
-     * Exported asm.js/wasm functions store their WasmInstanceObject in the
-     * first slot.
-     */
+    // Exported asm.js/wasm functions store their WasmInstanceObject in the
+    // first slot.
     static const unsigned WASM_INSTANCE_SLOT = 0;
 
-    /*
-     * wasm/asm.js exported functions store the wasm::TlsData pointer of their
-     * instance.
-     */
+    // wasm/asm.js exported functions store the wasm::TlsData pointer of their
+    // instance.
     static const unsigned WASM_TLSDATA_SLOT = 1;
 
-    /*
-     * asm.js module functions store their WasmModuleObject in the first slot.
-     */
+    // asm.js module functions store their WasmModuleObject in the first slot.
     static const unsigned ASMJS_MODULE_SLOT = 0;
 
 
     static inline size_t offsetOfExtendedSlot(unsigned which) {
         MOZ_ASSERT(which < NUM_EXTENDED_SLOTS);
         return offsetof(FunctionExtended, extendedSlots) + which * sizeof(GCPtrValue);
     }
     static inline size_t offsetOfArrowNewTargetSlot() {
--- a/js/src/vm/JSObject.cpp
+++ b/js/src/vm/JSObject.cpp
@@ -286,17 +286,17 @@ js::Throw(JSContext* cx, HandleId id, un
     } else {
         JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, errorNumber, bytes.get());
     }
 
     return false;
 }
 
 
-/*** PropertyDescriptor operations and DefineProperties ******************************************/
+/*** PropertyDescriptor operations and DefineProperties *********************/
 
 static const char js_getter_str[] = "getter";
 static const char js_setter_str[] = "setter";
 
 static Result<>
 CheckCallable(JSContext* cx, JSObject* obj, const char* fieldName)
 {
     if (obj && !obj->isCallable()) {
@@ -491,22 +491,23 @@ js::ReadPropertyDescriptors(JSContext* c
             !descs.append(desc))
         {
             return false;
         }
     }
     return true;
 }
 
-/*** Seal and freeze *****************************************************************************/
+/*** Seal and freeze ********************************************************/
 
 static unsigned
 GetSealedOrFrozenAttributes(unsigned attrs, IntegrityLevel level)
 {
-    /* Make all attributes permanent; if freezing, make data attributes read-only. */
+    // Make all attributes permanent; if freezing, make data attributes
+    // read-only.
     if (level == IntegrityLevel::Frozen && !(attrs & (JSPROP_GETTER | JSPROP_SETTER))) {
         return JSPROP_PERMANENT | JSPROP_READONLY;
     }
     return JSPROP_PERMANENT;
 }
 
 /* ES6 draft rev 29 (6 Dec 2014) 7.3.13. */
 bool
@@ -2868,17 +2869,17 @@ js::GetPrototypeIfOrdinary(JSContext* cx
         return js::Proxy::getPrototypeIfOrdinary(cx, obj, isOrdinary, protop);
     }
 
     *isOrdinary = true;
     protop.set(obj->staticPrototype());
     return true;
 }
 
-/*** ES6 standard internal methods ***************************************************************/
+/*** ES6 standard internal methods ******************************************/
 
 bool
 js::SetPrototype(JSContext* cx, HandleObject obj, HandleObject proto, JS::ObjectOpResult& result)
 {
     // The proxy trap subsystem fully handles prototype-setting for proxies
     // with dynamic [[Prototype]]s.
     if (obj->hasDynamicPrototype()) {
         MOZ_ASSERT(obj->is<ProxyObject>());
@@ -3150,17 +3151,17 @@ js::DefineDataElement(JSContext* cx, Han
 {
     RootedId id(cx);
     if (!IndexToId(cx, index, &id)) {
         return false;
     }
     return DefineDataProperty(cx, obj, id, value, attrs);
 }
 
-/*** SpiderMonkey nonstandard internal methods ***************************************************/
+/*** SpiderMonkey nonstandard internal methods ******************************/
 
 // Mark an object as having an immutable prototype
 //
 // NOTE: This does not correspond to the SetImmutablePrototype ECMAScript
 //       method.
 bool
 js::SetImmutablePrototype(JSContext* cx, HandleObject obj, bool* succeeded)
 {
@@ -3244,17 +3245,17 @@ js::DefineFunctions(JSContext* cx, Handl
         if (!DefineFunctionFromSpec(cx, obj, fs, fs->flags, intrinsic)) {
             return false;
         }
     }
     return true;
 }
 
 
-/*** ToPrimitive *************************************************************/
+/*** ToPrimitive ************************************************************/
 
 /*
  * Gets |obj[id]|.  If that value's not callable, returns true and stores an
  * object value in *vp.  If it's callable, calls it with no arguments and |obj|
  * as |this|, returning the result in *vp.
  *
  * This is a mini-abstraction for ES6 draft rev 36 (2015 Mar 17),
  * 7.1.1, second algorithm (OrdinaryToPrimitive), steps 5.a-c.
@@ -3662,17 +3663,17 @@ GetObjectSlotNameFunctor::operator()(JS:
         } else if (JSID_IS_SYMBOL(propid)) {
             snprintf(buf, bufsize, "**SYMBOL KEY**");
         } else {
             snprintf(buf, bufsize, "**FINALIZED ATOM KEY**");
         }
     }
 }
 
-/*** Debugging routines **************************************************************************/
+/*** Debugging routines *****************************************************/
 
 #if defined(DEBUG) || defined(JS_JITSPEW)
 
 /*
  * Routines to print out values during debugging.  These are FRIEND_API to help
  * the debugger find them and to support temporarily hacking js::Dump* calls
  * into other code.
  */
--- a/js/src/vm/JSObject.h
+++ b/js/src/vm/JSObject.h
@@ -28,17 +28,17 @@ namespace js {
 using PropertyDescriptorVector = JS::GCVector<JS::PropertyDescriptor>;
 class GCMarker;
 class Nursery;
 
 namespace gc {
 class RelocationOverlay;
 } // namespace gc
 
-/******************************************************************************/
+/****************************************************************************/
 
 class GlobalObject;
 class NewObjectCache;
 
 enum class IntegrityLevel {
     Sealed,
     Frozen
 };
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -1202,17 +1202,17 @@ js::NativeLookupOwnProperty(JSContext* c
 template bool
 js::NativeLookupOwnProperty<CanGC>(JSContext* cx, HandleNativeObject obj, HandleId id,
                                    MutableHandle<PropertyResult> propp);
 
 template bool
 js::NativeLookupOwnProperty<NoGC>(JSContext* cx, NativeObject* const& obj, const jsid& id,
                                   FakeMutableHandle<PropertyResult> propp);
 
-/*** [[DefineOwnProperty]] ***********************************************************************/
+/*** [[DefineOwnProperty]] **************************************************/
 
 static MOZ_ALWAYS_INLINE bool
 CallAddPropertyHook(JSContext* cx, HandleNativeObject obj, HandleId id, HandleValue value)
 {
     JSAddPropertyOp addProperty = obj->getClass()->getAddProperty();
     if (MOZ_UNLIKELY(addProperty)) {
         MOZ_ASSERT(!cx->helperThread());
 
@@ -2167,17 +2167,17 @@ js::AddOrUpdateSparseElementHelper(JSCon
     // We don't know exactly what this object looks like, hit the slowpath.
     RootedValue receiver(cx, ObjectValue(*obj));
     JS::ObjectOpResult result;
     return SetProperty(cx, obj, id, v, receiver, result) &&
            result.checkStrictErrorOrWarning(cx, obj, id, strict);
 }
 
 
-/*** [[HasProperty]] *****************************************************************************/
+/*** [[HasProperty]] ********************************************************/
 
 // ES6 draft rev31 9.1.7.1 OrdinaryHasProperty
 bool
 js::NativeHasProperty(JSContext* cx, HandleNativeObject obj, HandleId id, bool* foundp)
 {
     RootedNativeObject pobj(cx, obj);
     Rooted<PropertyResult> prop(cx);
 
@@ -2223,17 +2223,17 @@ js::NativeHasProperty(JSContext* cx, Han
             return HasProperty(cx, protoRoot, id, foundp);
         }
 
         pobj = &proto->as<NativeObject>();
     }
 }
 
 
-/*** [[GetOwnPropertyDescriptor]] ****************************************************************/
+/*** [[GetOwnPropertyDescriptor]] *******************************************/
 
 bool
 js::NativeGetOwnPropertyDescriptor(JSContext* cx, HandleNativeObject obj, HandleId id,
                                    MutableHandle<PropertyDescriptor> desc)
 {
     Rooted<PropertyResult> prop(cx);
     if (!NativeLookupOwnProperty<CanGC>(cx, obj, id, &prop)) {
         return false;
@@ -2286,17 +2286,17 @@ js::NativeGetOwnPropertyDescriptor(JSCon
     }
 
     desc.object().set(obj);
     desc.assertComplete();
     return true;
 }
 
 
-/*** [[Get]] *************************************************************************************/
+/*** [[Get]] ****************************************************************/
 
 static inline bool
 CallGetter(JSContext* cx, HandleObject obj, HandleValue receiver, HandleShape shape,
            MutableHandleValue vp)
 {
     MOZ_ASSERT(!shape->hasDefaultGetter());
 
     if (shape->hasGetterValue()) {
@@ -2500,17 +2500,18 @@ GetNonexistentProperty(JSContext* cx, Ha
     if (!bytes) {
         return false;
     }
 
     return JS_ReportErrorFlagsAndNumberUTF8(cx, flags, GetErrorMessage, nullptr,
                                             JSMSG_UNDEFINED_PROP, bytes.get());
 }
 
-/* The NoGC version of GetNonexistentProperty, present only to make types line up. */
+// The NoGC version of GetNonexistentProperty, present only to make types line
+// up.
 bool
 GetNonexistentProperty(JSContext* cx, const jsid& id, IsNameLookup nameLookup,
                        FakeMutableHandle<Value> vp)
 {
     return false;
 }
 
 static inline bool
@@ -2696,17 +2697,17 @@ js::GetNameBoundInEnvironment(JSContext*
     RootedValue receiver(cx, ObjectValue(*env));
     if (env->getOpsGetProperty()) {
         return GeneralizedGetProperty(cx, env, id, receiver, NameLookup, vp);
     }
     return NativeGetPropertyInline<CanGC>(cx, env.as<NativeObject>(), receiver, id, NameLookup, vp);
 }
 
 
-/*** [[Set]] *************************************************************************************/
+/*** [[Set]] ****************************************************************/
 
 static bool
 MaybeReportUndeclaredVarAssignment(JSContext* cx, HandleId id)
 {
     unsigned flags;
     {
         jsbytecode* pc;
         JSScript* script = cx->currentScript(&pc, JSContext::AllowCrossRealm::Allow);
@@ -3102,17 +3103,17 @@ js::NativeSetElement(JSContext* cx, Hand
 {
     RootedId id(cx);
     if (!IndexToId(cx, index, &id)) {
         return false;
     }
     return NativeSetProperty<Qualified>(cx, obj, id, v, receiver, result);
 }
 
-/*** [[Delete]] **********************************************************************************/
+/*** [[Delete]] *************************************************************/
 
 // ES6 draft rev31 9.1.10 [[Delete]]
 bool
 js::NativeDeleteProperty(JSContext* cx, HandleNativeObject obj, HandleId id,
                          ObjectOpResult& result)
 {
     // Steps 2-3.
     Rooted<PropertyResult> prop(cx);
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1113,17 +1113,18 @@ class NativeObject : public ShapedObject
         initSlot(index, v);
     }
 
     MOZ_ALWAYS_INLINE void setReservedSlot(uint32_t index, const Value& v) {
         MOZ_ASSERT(index < JSSLOT_FREE(getClass()));
         setSlot(index, v);
     }
 
-    /* For slots which are known to always be fixed, due to the way they are allocated. */
+    // For slots which are known to always be fixed, due to the way they are
+    // allocated.
 
     HeapSlot& getFixedSlotRef(uint32_t slot) {
         MOZ_ASSERT(slotIsFixed(slot));
         return fixedSlots()[slot];
     }
 
     const Value& getFixedSlot(uint32_t slot) const {
         MOZ_ASSERT(slotIsFixed(slot));
@@ -1547,17 +1548,17 @@ NativeObject::privateWriteBarrierPre(voi
 {
     JS::shadow::Zone* shadowZone = this->shadowZoneFromAnyThread();
     if (shadowZone->needsIncrementalBarrier() && *oldval && getClass()->hasTrace()) {
         getClass()->doTrace(shadowZone->barrierTracer(), this);
     }
 }
 
 
-/*** Standard internal methods *******************************************************************/
+/*** Standard internal methods **********************************************/
 
 /*
  * These functions should follow the algorithms in ES6 draft rev 29 section 9.1
  * ("Ordinary Object Internal Methods"). It's an ongoing project.
  *
  * Many native objects are not "ordinary" in ES6, so these functions also have
  * to serve some of the special needs of Functions (9.2, 9.3, 9.4.1), Arrays
  * (9.4.2), Strings (9.4.3), and so on.
@@ -1650,17 +1651,17 @@ NativeSetProperty(JSContext* cx, HandleN
 extern bool
 NativeSetElement(JSContext* cx, HandleNativeObject obj, uint32_t index, HandleValue v,
                  HandleValue receiver, ObjectOpResult& result);
 
 extern bool
 NativeDeleteProperty(JSContext* cx, HandleNativeObject obj, HandleId id, ObjectOpResult& result);
 
 
-/*** SpiderMonkey nonstandard internal methods ***************************************************/
+/*** SpiderMonkey nonstandard internal methods ******************************/
 
 template <AllowGC allowGC>
 extern bool
 NativeLookupOwnProperty(JSContext* cx,
                         typename MaybeRooted<NativeObject*, allowGC>::HandleType obj,
                         typename MaybeRooted<jsid, allowGC>::HandleType id,
                         typename MaybeRooted<PropertyResult, allowGC>::MutableHandleType propp);
 
--- a/js/src/vm/ObjectOperations.h
+++ b/js/src/vm/ObjectOperations.h
@@ -245,17 +245,17 @@ PutProperty(JSContext* cx, JS::Handle<JS
 inline bool
 DeleteProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
                JS::ObjectOpResult& result);
 
 inline bool
 DeleteElement(JSContext* cx, JS::Handle<JSObject*> obj, uint32_t index,
               JS::ObjectOpResult& result);
 
-/*** SpiderMonkey nonstandard internal methods ***************************************************/
+/*** SpiderMonkey nonstandard internal methods ******************************/
 
 /**
  * If |obj| (underneath any functionally-transparent wrapper proxies) has as
  * its [[GetPrototypeOf]] trap the ordinary [[GetPrototypeOf]] behavior defined
  * for ordinary objects, set |*isOrdinary = true| and store |obj|'s prototype
  * in |result|.  Otherwise set |*isOrdinary = false|.  In case of error, both
  * outparams have unspecified value.
  */
--- a/js/src/vm/PIC.h
+++ b/js/src/vm/PIC.h
@@ -147,29 +147,32 @@ struct ForOfPIC
      * A ForOfPIC chain holds the following:
      *
      *  Array.prototype (arrayProto_)
      *      To ensure that the incoming array has the standard proto.
      *
      *  Array.prototype's shape (arrayProtoShape_)
      *      To ensure that Array.prototype has not been modified.
      *
-     *  ArrayIterator.prototype (arrayIteratorProto_)
-     *  ArrayIterator.prototype's shape (arrayIteratorProtoShape_)
+     *  ArrayIterator.prototype
+     *  ArrayIterator.prototype's shape
+     *      (arrayIteratorProto_, arrayIteratorProtoShape_)
      *      To ensure that an ArrayIterator.prototype has not been modified.
      *
-     *  Array.prototype's slot number for @@iterator (arrayProtoIteratorSlot_)
-     *  Array.prototype's canonical value for @@iterator (canonicalIteratorFunc_)
+     *  Array.prototype's slot number for @@iterator
+     *  Array.prototype's canonical value for @@iterator
+     *      (arrayProtoIteratorSlot_, canonicalIteratorFunc_)
      *      To quickly retrieve and ensure that the iterator constructor
      *      stored in the slot has not changed.
      *
-     *  ArrayIterator.prototype's slot number for 'next' (arrayIteratorProtoNextSlot_)
-     *  ArrayIterator.prototype's canonical value for 'next' (canonicalNextFunc_)
-     *      To quickly retrieve and ensure that the 'next' method for ArrayIterator
-     *      objects has not changed.
+     *  ArrayIterator.prototype's slot number for 'next'
+     *  ArrayIterator.prototype's canonical value for 'next'
+     *      (arrayIteratorProtoNextSlot_, canonicalNextFunc_)
+     *      To quickly retrieve and ensure that the 'next' method for
+     *      ArrayIterator objects has not changed.
      */
     class Chain : public BaseChain
     {
       private:
         // Pointer to canonical Array.prototype and ArrayIterator.prototype
         GCPtrNativeObject arrayProto_;
         GCPtrNativeObject arrayIteratorProto_;
 
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -194,17 +194,18 @@ class RegExpObject : public NativeObject
  * Parse regexp flags. Report an error and return false if an invalid
  * sequence of flags is encountered (repeat/invalid flag).
  *
  * N.B. flagStr must be rooted.
  */
 bool
 ParseRegExpFlags(JSContext* cx, JSString* flagStr, RegExpFlag* flagsOut);
 
-/* Assuming GetBuiltinClass(obj) is ESClass::RegExp, return a RegExpShared for obj. */
+// Assuming GetBuiltinClass(obj) is ESClass::RegExp, return a RegExpShared for
+// obj.
 inline RegExpShared*
 RegExpToShared(JSContext* cx, HandleObject obj)
 {
     if (obj->is<RegExpObject>()) {
         return RegExpObject::getShared(cx, obj.as<RegExpObject>());
     }
 
     return Proxy::regexp_toShared(cx, obj);
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -227,17 +227,18 @@ JSRuntime::init(JSContext* cx, uint32_t 
 
     UniquePtr<Zone> atomsZone = MakeUnique<Zone>(this);
     if (!atomsZone || !atomsZone->init(true)) {
         return false;
     }
 
     gc.atomsZone = atomsZone.release();
 
-    /* The garbage collector depends on everything before this point being initialized. */
+    // The garbage collector depends on everything before this point being
+    // initialized.
     gcInitialized = true;
 
     if (!InitRuntimeNumberState(this)) {
         return false;
     }
 
     js::ResetTimeZoneInternal(ResetTimeZoneMode::DontResetIfOffsetUnchanged);
 
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -634,17 +634,18 @@ intrinsic_DefineDataProperty(JSContext* 
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 intrinsic_DefineProperty(JSContext* cx, unsigned argc, Value* vp)
 {
-    // _DefineProperty(object, propertyKey, attributes, valueOrGetter, setter, strict)
+    // _DefineProperty(object, propertyKey, attributes,
+    //                 valueOrGetter, setter, strict)
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 6);
     MOZ_ASSERT(args[0].isObject());
     MOZ_ASSERT(args[1].isString() || args[1].isNumber() || args[1].isSymbol());
     MOZ_RELEASE_ASSERT(args[2].isInt32());
     MOZ_ASSERT(args[5].isBoolean());
 
     RootedObject obj(cx, &args[0].toObject());
--- a/js/src/vm/Shape.h
+++ b/js/src/vm/Shape.h
@@ -353,30 +353,29 @@ class ShapeTable {
         entryCount_++;
         MOZ_ASSERT(entryCount_ + removedCount_ <= capacity());
     }
     void incRemovedCount() {
         removedCount_++;
         MOZ_ASSERT(entryCount_ + removedCount_ <= capacity());
     }
 
-    /* By definition, hashShift = HASH_BITS - log2(capacity). */
+    // By definition, hashShift = HASH_BITS - log2(capacity).
     uint32_t capacity() const { return JS_BIT(HASH_BITS - hashShift_); }
 
-    /* Whether we need to grow.  We want to do this if the load factor is >= 0.75 */
+    // Whether we need to grow.  We want to do this if the load factor
+    // is >= 0.75
     bool needsToGrow() const {
         uint32_t size = capacity();
         return entryCount_ + removedCount_ >= size - (size >> 2);
     }
 
-    /*
-     * Try to grow the table.  On failure, reports out of memory on cx
-     * and returns false.  This will make any extant pointers into the
-     * table invalid.  Don't call this unless needsToGrow() is true.
-     */
+    // Try to grow the table.  On failure, reports out of memory on cx
+    // and returns false.  This will make any extant pointers into the
+    // table invalid.  Don't call this unless needsToGrow() is true.
     bool grow(JSContext* cx);
 };
 
 // Ensures no shape tables are purged in the current zone.
 class MOZ_RAII AutoKeepShapeTables
 {
     JSContext* cx_;
     bool prev_;
@@ -775,17 +774,18 @@ class Shape : public gc::TenuredCell
     static inline Shape* searchNoHashify(Shape* start, jsid id);
 
     void removeFromDictionary(NativeObject* obj);
     void insertIntoDictionary(GCPtrShape* dictp);
 
     inline void initDictionaryShape(const StackShape& child, uint32_t nfixed,
                                     GCPtrShape* dictp);
 
-    /* Replace the base shape of the last shape in a non-dictionary lineage with base. */
+    // Replace the base shape of the last shape in a non-dictionary lineage with
+    // base.
     static Shape* replaceLastProperty(JSContext* cx, StackBaseShape& base,
                                       TaggedProto proto, HandleShape shape);
 
     /*
      * This function is thread safe if every shape in the lineage of |shape|
      * is thread local, which is the case when we clone the entire shape
      * lineage in preparation for converting an object to dictionary mode.
      */
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -2300,17 +2300,17 @@ class NonBuiltinFrameIter : public Frame
 
     NonBuiltinFrameIter& operator++() {
         FrameIter::operator++();
         settle();
         return *this;
     }
 };
 
-/* A filtering of the ScriptFrameIter to only stop at non-self-hosted scripts. */
+// A filtering of the ScriptFrameIter to only stop at non-self-hosted scripts.
 class NonBuiltinScriptFrameIter : public ScriptFrameIter
 {
     void settle();
 
   public:
     explicit NonBuiltinScriptFrameIter(JSContext* cx,
                                        ScriptFrameIter::DebuggerEvalOption debuggerEvalOption =
                                        ScriptFrameIter::FOLLOW_DEBUGGER_EVAL_PREV_LINK)
--- a/js/src/vm/StringType.cpp
+++ b/js/src/vm/StringType.cpp
@@ -2160,17 +2160,17 @@ JSString::fillWithRepresentatives(JSCont
     }
 
     MOZ_ASSERT(index == 44);
 
     return true;
 }
 
 
-/*** Conversions *********************************************************************************/
+/*** Conversions ************************************************************/
 
 UniqueChars
 js::EncodeLatin1(JSContext* cx, JSString* str)
 {
     JSLinearString* linear = str->ensureLinear(cx);
     if (!linear) {
         return nullptr;
     }
--- a/js/src/vm/StringType.h
+++ b/js/src/vm/StringType.h
@@ -43,16 +43,17 @@ namespace js {
 class StaticStrings;
 class PropertyName;
 
 /* The buffer length required to contain any unsigned 32-bit integer. */
 static const size_t UINT32_CHAR_BUFFER_LENGTH = sizeof("4294967295") - 1;
 
 } /* namespace js */
 
+// clang-format off
 /*
  * [SMDOC] JavaScript Strings
  *
  * Conceptually, a JS string is just an array of chars and a length. This array
  * of chars may or may not be null-terminated and, if it is, the null character
  * is not included in the length.
  *
  * To improve performance of common operations, the following optimizations are
@@ -94,19 +95,19 @@ static const size_t UINT32_CHAR_BUFFER_L
  *  - To avoid comparing O(n) string equality comparison, strings can be
  *    canonicalized to "atoms" (JSAtom) such that there is a single atom with a
  *    given (length,chars).
  *
  *  - To avoid copying all strings created through the JSAPI, an "external"
  *    string (JSExternalString) can be created whose chars are managed by the
  *    JSAPI client.
  *
- *  - To avoid using two bytes per character for every string, string characters
- *    are stored as Latin1 instead of TwoByte if all characters are representable
- *    in Latin1.
+ *  - To avoid using two bytes per character for every string, string
+ *    characters are stored as Latin1 instead of TwoByte if all characters are
+ *    representable in Latin1.
  *
  *  - To avoid slow conversions from strings to integer indexes, we cache 16 bit
  *    unsigned indexes on strings representing such numbers.
  *
  * Although all strings share the same basic memory layout, we can conceptually
  * arrange them into a hierarchy of operations/invariants and represent this
  * hierarchy in C++ with classes:
  *
@@ -155,16 +156,17 @@ static const size_t UINT32_CHAR_BUFFER_L
  * is used as key in a JS Map/Set.
  *
  * Derived string types can be queried from ancestor types via isX() and
  * retrieved with asX() debug-only-checked casts.
  *
  * The ensureX() operations mutate 'this' in place to effectively the type to be
  * at least X (e.g., ensureLinear will change a JSRope to be a JSFlatString).
  */
+// clang-format on
 
 class JSString : public js::gc::Cell
 {
   protected:
     static const size_t NUM_INLINE_CHARS_LATIN1   = 2 * sizeof(void*) / sizeof(JS::Latin1Char);
     static const size_t NUM_INLINE_CHARS_TWO_BYTE = 2 * sizeof(void*) / sizeof(char16_t);
 
     /* Fields only apply to string types commented on the right. */
@@ -1161,18 +1163,18 @@ class JSFatInlineString : public JSInlin
                                               -1 /* null terminator */;
 
     template <typename CharT>
     inline CharT* init(size_t length);
 
     template<typename CharT>
     static bool lengthFits(size_t length);
 
-    /* Only called by the GC for strings with the AllocKind::FAT_INLINE_STRING kind. */
-
+    // Only called by the GC for strings with the AllocKind::FAT_INLINE_STRING
+    // kind.
     MOZ_ALWAYS_INLINE void finalize(js::FreeOp* fop);
 };
 
 static_assert(sizeof(JSFatInlineString) % js::gc::CellAlignBytes == 0,
               "fat inline strings shouldn't waste space up to the next cell "
               "boundary");
 
 class JSExternalString : public JSLinearString
@@ -1187,33 +1189,29 @@ class JSExternalString : public JSLinear
     static inline JSExternalString* new_(JSContext* cx, const char16_t* chars, size_t length,
                                          const JSStringFinalizer* fin);
 
     const JSStringFinalizer* externalFinalizer() const {
         MOZ_ASSERT(JSString::isExternal());
         return d.s.u3.externalFinalizer;
     }
 
-    /*
-     * External chars are never allocated inline or in the nursery, so we can
-     * safely expose this without requiring an AutoCheckCannotGC argument.
-     */
+    // External chars are never allocated inline or in the nursery, so we can
+    // safely expose this without requiring an AutoCheckCannotGC argument.
     const char16_t* twoByteChars() const {
         return rawTwoByteChars();
     }
 
-    /* Only called by the GC for strings with the AllocKind::EXTERNAL_STRING kind. */
-
+    // Only called by the GC for strings with the AllocKind::EXTERNAL_STRING
+    // kind.
     inline void finalize(js::FreeOp* fop);
 
-    /*
-     * Free the external chars and allocate a new buffer, converting this to a
-     * flat string (which still lives in an AllocKind::EXTERNAL_STRING
-     * arena).
-     */
+    // Free the external chars and allocate a new buffer, converting this to a
+    // flat string (which still lives in an AllocKind::EXTERNAL_STRING
+    // arena).
     JSFlatString* ensureFlat(JSContext* cx);
 
 #if defined(DEBUG) || defined(JS_JITSPEW)
     void dumpRepresentation(js::GenericPrinter& out, int indent) const;
 #endif
 };
 
 static_assert(sizeof(JSExternalString) == sizeof(JSString),
@@ -1687,17 +1685,17 @@ HasSubstringAt(JSLinearString* text, JSL
  * Computes |str|'s substring for the range [beginInt, beginInt + lengthInt).
  * Negative, overlarge, swapped, etc. |beginInt| and |lengthInt| are forbidden
  * and constitute API misuse.
  */
 JSString*
 SubstringKernel(JSContext* cx, HandleString str, int32_t beginInt, int32_t lengthInt);
 
 
-/*** Conversions *********************************************************************************/
+/*** Conversions ************************************************************/
 
 /*
  * Convert a string to a printable C string.
  *
  * Asserts if the input contains any non-ASCII characters.
  */
 UniqueChars
 EncodeAscii(JSContext* cx, JSString* str);
--- a/js/src/vm/TraceLogging.h
+++ b/js/src/vm/TraceLogging.h
@@ -39,19 +39,19 @@ namespace jit {
  * and/or the start and stop of an event. This is implemented with as low
  * overhead as possible to not interfere with running.
  *
  * Logging something is done in 3 stages.
  * 1) Get the tracelogger of the current thread. cx may be omitted, in which
  *    case it will be fetched from TLS.
  *     - TraceLoggerForCurrentThread(cx);
  *
- * 2) Optionally create a TraceLoggerEvent for the text that needs to get logged. This
- *    step takes some time, so try to do this beforehand, outside the hot
- *    path and don't do unnecessary repetitions, since it will cripple
+ * 2) Optionally create a TraceLoggerEvent for the text that needs to get
+ *    logged. This step takes some time, so try to do this beforehand, outside
+ *    the hot path and don't do unnecessary repetitions, since it will cripple
  *    performance.
  *     - TraceLoggerEvent event(logger, "foo");
  *
  *    There are also some predefined events. They are located in
  *    TraceLoggerTextId. They don't require to create an TraceLoggerEvent and
  *    can also be used as an argument to these functions.
  *
  * 3) Log the occurrence of a single event:
@@ -85,19 +85,22 @@ class TraceLoggerEvent {
   private:
     class EventPayloadOrTextId {
 
         /**
          * Payload can be a pointer to a TraceLoggerEventPayload* or a
          * TraceLoggerTextId. The last bit decides how to read the payload.
          *
          * payload_ = [                   | 0 ]
-         *            ------------------------  = TraceLoggerEventPayload* (incl. last bit)
+         *             -----------------------
+         *             TraceLoggerEventPayload* (incl. last bit)
+         *
          * payload_ = [                   | 1 ]
-         *             -------------------      = TraceLoggerTextId (excl. last bit)
+         *             -------------------
+         *             TraceLoggerTextId (excl. last bit)
          */
         uintptr_t payload_;
 
       public:
         EventPayloadOrTextId()
           : payload_(0)
         { }
 
--- a/js/src/vm/TraceLoggingGraph.h
+++ b/js/src/vm/TraceLoggingGraph.h
@@ -8,16 +8,17 @@
 #define TraceLoggingGraph_h
 
 #include "mozilla/MemoryReporting.h"
 
 #include "js/TypeDecls.h"
 #include "vm/MutexIDs.h"
 #include "vm/TraceLoggingTypes.h"
 
+// clang-format off
 /*
  * The output of a tracelogging session is saved in /tmp/tl-data.json.
  * The format of that file is a JS array per tracelogger (=thread), with a map
  * containing:
  *  - dict:   Name of the file containing a json table with the log text.
  *            All other files only contain a index to this table when logging.
  *  - events: Name of the file containing a flat list of log events saved
  *            in binary format.
@@ -28,17 +29,18 @@
  *  - treeFormat: The format used to encode the tree. By default "64,64,31,1,32".
  *                There are currently no other formats to save the tree.
  *     - 64,64,31,1,32 signifies how many bytes are used for the different
  *       parts of the tree.
  *       => 64 bits: Time Stamp Counter of start of event.
  *       => 64 bits: Time Stamp Counter of end of event.
  *       => 31 bits: Index to dict file containing the log text.
  *       =>  1 bit:  Boolean signifying if this entry has children.
- *                   When true, the child can be found just right after this entry.
+ *                   When true, the child can be found just right after this
+ *                   entry.
  *       => 32 bits: Containing the ID of the next event on the same depth
  *                   or 0 if there isn't an event on the same depth anymore.
  *
  *        /-> The position in the file. Id is this divided by size of entry.
  *        |   So in this case this would be 1 (192bits per entry).
  *        |                              /-> Indicates there are children. The
  *        |                              |   first child is located at current
  *        |                              |   ID + 1. So 1 + 1 in this case: 2.
@@ -55,16 +57,17 @@
  *                      /----------------------------------\
  *                      |                                  |
  *       0xC0: [start, end, dictId, 0, 2]      0x180 [start, end, dictId, 1, 0]
  *                                                      |
  *                                  /----------------------------------\
  *                                  |                                  |
  *         0x240: [start, end, dictId, 0, 4]    0x300 [start, end, dictId, 0, 0]
  */
+// clang-format on
 
 namespace js {
 void DestroyTraceLoggerGraphState();
 size_t SizeOfTraceLogGraphState(mozilla::MallocSizeOf mallocSizeOf);
 } // namespace js
 
 class TraceLoggerGraphState
 {
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -3716,17 +3716,18 @@ js::TypeMonitorResult(JSContext* cx, JSS
     InferSpew(ISpewOps, "bytecodeType: %p %05zu: %s",
               script, script->pcToOffset(pc), TypeSet::TypeString(type).get());
     types->addType(sweep, cx, type);
 }
 
 void
 js::TypeMonitorResult(JSContext* cx, JSScript* script, jsbytecode* pc, const js::Value& rval)
 {
-    /* Allow the non-TYPESET scenario to simplify stubs used in compound opcodes. */
+    // Allow the non-TYPESET scenario to simplify stubs used in compound
+    // opcodes.
     if (!(CodeSpec[*pc].format & JOF_TYPESET)) {
         return;
     }
 
     if (!script->hasBaselineScript()) {
         return;
     }
 
--- a/js/src/vm/TypeSet.h
+++ b/js/src/vm/TypeSet.h
@@ -470,20 +470,24 @@ class TypeSet
         return flags & TYPE_FLAG_NON_CONSTANT_PROPERTY;
     }
     bool definiteProperty() const { return flags & TYPE_FLAG_DEFINITE_MASK; }
     unsigned definiteSlot() const {
         MOZ_ASSERT(definiteProperty());
         return (flags >> TYPE_FLAG_DEFINITE_SHIFT) - 1;
     }
 
-    /* Join two type sets into a new set. The result should not be modified further. */
+    // Join two type sets into a new set. The result should not be modified
+    // further.
     static TemporaryTypeSet* unionSets(TypeSet* a, TypeSet* b, LifoAlloc* alloc);
-    /* Return the intersection of the 2 TypeSets. The result should not be modified further */
+
+    // Return the intersection of the 2 TypeSets. The result should not be
+    // modified further.
     static TemporaryTypeSet* intersectSets(TemporaryTypeSet* a, TemporaryTypeSet* b, LifoAlloc* alloc);
+
     /*
      * Returns a copy of TypeSet a excluding/removing the types in TypeSet b.
      * TypeSet b can only contain primitives or be any object. No support for
      * specific objects. The result should not be modified further.
      */
     static TemporaryTypeSet* removeSet(TemporaryTypeSet* a, TemporaryTypeSet* b, LifoAlloc* alloc);
 
     /* Add a type to this set using the specified allocator. */
@@ -866,36 +870,36 @@ class TemporaryTypeSet : public TypeSet
     /*
      * Get the typed array type of all objects in this set, or Scalar::MaxTypedArrayViewType.
      * If there is such a common type and sharedness is not nullptr then
      * *sharedness is set to what we know about the sharedness of the memory.
      */
     Scalar::Type getTypedArrayType(CompilerConstraintList* constraints,
                                    TypedArraySharedness* sharedness = nullptr);
 
-    /* Whether all objects have JSCLASS_IS_DOMJSCLASS set. */
+    // Whether all objects have JSCLASS_IS_DOMJSCLASS set.
     bool isDOMClass(CompilerConstraintList* constraints, DOMObjectKind* kind);
 
-    /* Whether clasp->isCallable() is true for one or more objects in this set. */
+    // Whether clasp->isCallable() is true for one or more objects in this set.
     bool maybeCallable(CompilerConstraintList* constraints);
 
-    /* Whether clasp->emulatesUndefined() is true for one or more objects in this set. */
+    // Whether clasp->emulatesUndefined() is true for one or more objects in
+    // this set.
     bool maybeEmulatesUndefined(CompilerConstraintList* constraints);
 
-    /* Get the single value which can appear in this type set, otherwise nullptr. */
+    // Get the single value which can appear in this type set, otherwise
+    // nullptr.
     JSObject* maybeSingleton();
     ObjectKey* maybeSingleObject();
 
-    /* Whether any objects in the type set needs a barrier on id. */
+    // Whether any objects in the type set needs a barrier on id.
     bool propertyNeedsBarrier(CompilerConstraintList* constraints, jsid id);
 
-    /*
-     * Whether this set contains all types in other, except (possibly) the
-     * specified type.
-     */
+    // Whether this set contains all types in other, except (possibly) the
+    // specified type.
     bool filtersType(const TemporaryTypeSet* other, Type type) const;
 
     enum DoubleConversion
     {
         /* All types in the set should use eager double conversion. */
         AlwaysConvertToDoubles,
 
         /* Some types in the set should use eager double conversion. */
--- a/js/src/vm/UbiNodeCensus.cpp
+++ b/js/src/vm/UbiNodeCensus.cpp
@@ -29,17 +29,17 @@ CountDeleter::operator()(CountBase* ptr)
     }
 
     // Downcast to our true type and destruct, as guided by our CountType
     // pointer.
     ptr->destruct();
     js_free(ptr);
 }
 
-/*** Count Types ***********************************************************************************/
+/*** Count Types ************************************************************/
 
 // The simplest type: just count everything.
 class SimpleCount : public CountType {
 
     struct Count : CountBase {
         size_t totalBytes_;
 
         explicit Count(SimpleCount& count)
@@ -1129,17 +1129,17 @@ ByFilename::report(JSContext* cx, CountB
         return false;
     }
 
     report.setObject(*obj);
     return true;
 }
 
 
-/*** Census Handler *******************************************************************************/
+/*** Census Handler *********************************************************/
 
 JS_PUBLIC_API bool
 CensusHandler::operator() (BreadthFirst<CensusHandler>& traversal,
                            Node origin, const Edge& edge,
                            NodeData* referentData, bool first)
 {
     // We're only interested in the first time we reach edge.referent, not
     // in every edge arriving at that node.
@@ -1165,17 +1165,17 @@ CensusHandler::operator() (BreadthFirst<
         return rootCount->count(mallocSizeOf, referent);
     }
 
     traversal.abandonReferent();
     return true;
 }
 
 
-/*** Parsing Breakdowns ***************************************************************************/
+/*** Parsing Breakdowns *****************************************************/
 
 static CountTypePtr
 ParseChildBreakdown(JSContext* cx, HandleObject breakdown, PropertyName* prop)
 {
     RootedValue v(cx);
     if (!GetProperty(cx, breakdown, breakdown, prop, &v)) {
         return nullptr;
     }
--- a/js/src/wasm/WasmBuiltins.cpp
+++ b/js/src/wasm/WasmBuiltins.cpp
@@ -422,18 +422,18 @@ TruncateDoubleToInt64(double input)
         return 0x8000000000000000;
     }
     return int64_t(input);
 }
 
 static uint64_t
 TruncateDoubleToUint64(double input)
 {
-    // Note: UINT64_MAX is not representable in double. It is actually UINT64_MAX + 1.
-    // Therefore also sending the failure value.
+    // Note: UINT64_MAX is not representable in double. It is actually
+    // UINT64_MAX + 1.  Therefore also sending the failure value.
     if (input >= double(UINT64_MAX) || input <= -1.0 || IsNaN(input)) {
         return 0x8000000000000000;
     }
     return uint64_t(input);
 }
 
 static int64_t
 SaturatingTruncateDoubleToInt64(double input)
@@ -909,18 +909,18 @@ PopulateTypedNatives(TypedNativeToFuncPt
 #undef FOR_EACH_UNARY_NATIVE
 #undef FOR_EACH_BINARY_NATIVE
 
 // ============================================================================
 // Process-wide builtin thunk set
 //
 // Thunks are inserted between wasm calls and the C++ callee and achieve two
 // things:
-//  - bridging the few differences between the internal wasm ABI and the external
-//    native ABI (viz. float returns on x86 and soft-fp ARM)
+//  - bridging the few differences between the internal wasm ABI and the
+//    external native ABI (viz. float returns on x86 and soft-fp ARM)
 //  - executing an exit prologue/epilogue which in turn allows any profiling
 //    iterator to see the full stack up to the wasm operation that called out
 //
 // Thunks are created for two kinds of C++ callees, enumerated above:
 //  - SymbolicAddress: for statically compiled calls in the wasm module
 //  - Imported JS builtins: optimized calls to imports
 //
 // All thunks are created up front, lazily, when the first wasm module is
--- a/js/src/wasm/WasmIonCompile.cpp
+++ b/js/src/wasm/WasmIonCompile.cpp
@@ -1025,17 +1025,18 @@ class FunctionCompiler
 
         uint32_t stackBytes = call->abi_.stackBytesConsumedSoFar();
         if (call->childClobbers_) {
             call->spIncrement_ = AlignBytes(call->maxChildStackBytes_, WasmStackAlignment);
             for (MWasmStackArg* stackArg : call->stackArgs_) {
                 stackArg->incrementOffset(call->spIncrement_);
             }
 
-            // If instanceArg_ is not initialized then instanceArg_.kind() != ABIArg::Stack
+            // If instanceArg_ is not initialized then
+            // instanceArg_.kind() != ABIArg::Stack
             if (call->instanceArg_.kind() == ABIArg::Stack) {
                 call->instanceArg_ = ABIArg(call->instanceArg_.offsetFromArgBase() +
                                             call->spIncrement_);
             }
 
             stackBytes += call->spIncrement_;
         } else {
             call->spIncrement_ = 0;
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -645,18 +645,19 @@ MachExceptionHandlerThread()
         // the kernel. The kernel is waiting for us to reply with instructions.
         // Our default is the "not handled" reply (by setting the RetCode field
         // of the reply to KERN_FAILURE) which tells the kernel to continue
         // searching at the process and system level. If this is an asm.js
         // expected exception, we handle it and return KERN_SUCCESS.
         bool handled = HandleMachException(request);
         kern_return_t replyCode = handled ? KERN_SUCCESS : KERN_FAILURE;
 
-        // This magic incantation to send a reply back to the kernel was derived
-        // from the exc_server generated by 'mig -v /usr/include/mach/mach_exc.defs'.
+        // This magic incantation to send a reply back to the kernel was
+        // derived from the exc_server generated by
+        // 'mig -v /usr/include/mach/mach_exc.defs'.
         __Reply__exception_raise_t reply;
         reply.Head.msgh_bits = MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(request.body.Head.msgh_bits), 0);
         reply.Head.msgh_size = sizeof(reply);
         reply.Head.msgh_remote_port = request.body.Head.msgh_remote_port;
         reply.Head.msgh_local_port = MACH_PORT_NULL;
         reply.Head.msgh_id = request.body.Head.msgh_id + 100;
         reply.NDR = NDR_record;
         reply.RetCode = replyCode;
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -1254,17 +1254,17 @@ GenerateImportInterpExit(MacroAssembler&
     static const MIRType typeArray[] = { MIRType::Pointer,   // Instance*
                                          MIRType::Pointer,   // funcImportIndex
                                          MIRType::Int32,     // argc
                                          MIRType::Pointer }; // argv
     MIRTypeVector invokeArgTypes;
     MOZ_ALWAYS_TRUE(invokeArgTypes.append(typeArray, ArrayLength(typeArray)));
 
     // At the point of the call, the stack layout shall be (sp grows to the left):
-    //   | stack args | padding | Value argv[] | padding | retaddr | caller stack args |
+    //  | stack args | padding | argv[] | padding | retaddr | caller stack args |
     // The padding between stack args and argv ensures that argv is aligned. The
     // padding between argv and retaddr ensures that sp is aligned.
     unsigned argOffset = AlignBytes(StackArgBytes(invokeArgTypes), sizeof(double));
     unsigned argBytes = Max<size_t>(1, fi.funcType().args().length()) * sizeof(Value);
     unsigned framePushed = StackDecrementForCall(ABIStackAlignment,
                                                  sizeof(Frame),  // pushed by prologue
                                                  argOffset + argBytes);
 
--- a/netwerk/base/SimpleChannelParent.cpp
+++ b/netwerk/base/SimpleChannelParent.cpp
@@ -34,16 +34,23 @@ SimpleChannelParent::SetParentListener(H
 NS_IMETHODIMP
 SimpleChannelParent::NotifyTrackingProtectionDisabled()
 {
   // Nothing to do.
   return NS_OK;
 }
 
 NS_IMETHODIMP
+SimpleChannelParent::NotifyCookieAllowed()
+{
+  // Nothing to do.
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 SimpleChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   // Nothing to do.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SimpleChannelParent::NotifyTrackingResource(bool aIsThirdParty)
--- a/netwerk/base/nsIParentChannel.idl
+++ b/netwerk/base/nsIParentChannel.idl
@@ -30,16 +30,22 @@ interface nsIParentChannel : nsIStreamLi
 
   /**
    * Called to notify the HttpChannelChild that tracking protection was
    * disabled for this load.
    */
   [noscript] void notifyTrackingProtectionDisabled();
 
   /**
+   * Called to notify the HttpChannelChild that cookie has been allowed for
+   * this load.
+   */
+  [noscript] void notifyCookieAllowed();
+
+  /**
    * Called to notify the HttpChannelChild that cookie has been blocked for
    * this load.
    */
   [noscript] void notifyTrackingCookieBlocked(in uint32_t aRejectedReason);
 
    /**
    * Called to set matched information when URL matches SafeBrowsing list.
    * @param aList
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2264,16 +2264,17 @@ nsCookieService::SetCookieStringInternal
     if (aIsForeign) {
       NotifyThirdParty(aHostURI, false, aChannel);
     }
     return; // Stop here
   case STATUS_REJECTED_WITH_ERROR:
     return;
   case STATUS_ACCEPTED: // Fallthrough
   case STATUS_ACCEPT_SESSION:
+    NotifyAccepted(aChannel);
     if (aIsForeign) {
       NotifyThirdParty(aHostURI, true, aChannel);
     }
     break;
   default:
     break;
   }
 
@@ -2283,27 +2284,37 @@ nsCookieService::SetCookieStringInternal
   while (SetCookieInternal(aHostURI, key, requireHostMatch, cookieStatus,
                            aCookieHeader, serverTime, aFromHttp, aChannel)) {
     // document.cookie can only set one cookie at a time
     if (!aFromHttp)
       break;
   }
 }
 
+void
+nsCookieService::NotifyAccepted(nsIChannel* aChannel)
+{
+  AntiTrackingCommon::NotifyBlockingDecision(aChannel,
+                                             AntiTrackingCommon::BlockingDecision::eAllow,
+                                             0);
+}
+
 // notify observers that a cookie was rejected due to the users' prefs.
 void
 nsCookieService::NotifyRejected(nsIURI *aHostURI, nsIChannel* aChannel,
                                 uint32_t aRejectedReason)
 {
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   if (os) {
     os->NotifyObservers(aHostURI, "cookie-rejected", nullptr);
   }
 
-  AntiTrackingCommon::NotifyRejection(aChannel, aRejectedReason);
+  AntiTrackingCommon::NotifyBlockingDecision(aChannel,
+                                             AntiTrackingCommon::BlockingDecision::eBlock,
+                                             aRejectedReason);
 }
 
 // notify observers that a third-party cookie was accepted/rejected
 // if the cookie issuer is unknown, it defaults to "?"
 void
 nsCookieService::NotifyThirdParty(nsIURI *aHostURI, bool aIsAccepted, nsIChannel *aChannel)
 {
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -314,16 +314,17 @@ class nsCookieService final : public nsI
     static bool                   CheckPrefixes(nsCookieAttributes &aCookie, bool aSecureRequest);
     static bool                   GetExpiry(nsCookieAttributes &aCookie, int64_t aServerTime, int64_t aCurrentTime);
     void                          RemoveAllFromMemory();
     already_AddRefed<nsIArray>    PurgeCookies(int64_t aCurrentTimeInUsec);
     bool                          FindCookie(const nsCookieKey& aKey, const nsCString& aHost, const nsCString& aName, const nsCString& aPath, nsListIter &aIter);
     bool                          FindSecureCookie(const nsCookieKey& aKey, nsCookie* aCookie);
     void                          FindStaleCookies(nsCookieEntry *aEntry, int64_t aCurrentTime, const mozilla::Maybe<bool> &aIsSecure, nsTArray<nsListIter>& aOutput, uint32_t aLimit);
     void                          TelemetryForEvictingStaleCookie(nsCookie* aEvicted, int64_t oldestCookieTime);
+    void                          NotifyAccepted(nsIChannel* aChannel);
     void                          NotifyRejected(nsIURI *aHostURI, nsIChannel* aChannel, uint32_t aRejectedReason);
     void                          NotifyThirdParty(nsIURI *aHostURI, bool aAccepted, nsIChannel *aChannel);
     void                          NotifyChanged(nsISupports *aSubject, const char16_t *aData, bool aOldCookieIsSession = false, bool aFromHttp = false);
     void                          NotifyPurged(nsICookie2* aCookie);
     already_AddRefed<nsIArray>    CreatePurgeList(nsICookie2* aCookie);
     void                          CreateOrUpdatePurgeList(nsIArray** aPurgeList, nsICookie2* aCookie);
     void                          UpdateCookieOldestTime(DBState* aDBState, nsCookie* aCookie);
 
--- a/netwerk/protocol/data/DataChannelParent.cpp
+++ b/netwerk/protocol/data/DataChannelParent.cpp
@@ -34,16 +34,23 @@ DataChannelParent::SetParentListener(Htt
 NS_IMETHODIMP
 DataChannelParent::NotifyTrackingProtectionDisabled()
 {
     // Nothing to do.
     return NS_OK;
 }
 
 NS_IMETHODIMP
+DataChannelParent::NotifyCookieAllowed()
+{
+    // Nothing to do.
+    return NS_OK;
+}
+
+NS_IMETHODIMP
 DataChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
     // Nothing to do.
     return NS_OK;
 }
 
 NS_IMETHODIMP
 DataChannelParent::NotifyTrackingResource(bool aIsThirdParty)
--- a/netwerk/protocol/file/FileChannelParent.cpp
+++ b/netwerk/protocol/file/FileChannelParent.cpp
@@ -34,16 +34,23 @@ FileChannelParent::SetParentListener(Htt
 NS_IMETHODIMP
 FileChannelParent::NotifyTrackingProtectionDisabled()
 {
   // Nothing to do.
   return NS_OK;
 }
 
 NS_IMETHODIMP
+FileChannelParent::NotifyCookieAllowed()
+{
+  // Nothing to do.
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 FileChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   // Nothing to do.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FileChannelParent::NotifyTrackingResource(bool aIsThirdParty)
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -573,16 +573,23 @@ FTPChannelParent::SetParentListener(Http
 NS_IMETHODIMP
 FTPChannelParent::NotifyTrackingProtectionDisabled()
 {
   // One day, this should probably be filled in.
   return NS_OK;
 }
 
 NS_IMETHODIMP
+FTPChannelParent::NotifyCookieAllowed()
+{
+  // One day, this should probably be filled in.
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 FTPChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   // One day, this should probably be filled in.
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FTPChannelParent::NotifyTrackingResource(bool aIsThirdParty)
--- a/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
+++ b/netwerk/protocol/http/HttpBackgroundChannelChild.cpp
@@ -344,16 +344,31 @@ HttpBackgroundChannelChild::RecvNotifyTr
   // NotifyTrackingProtectionDisabled has no order dependency to OnStartRequest.
   // It this be handled as soon as possible
   mChannelChild->ProcessNotifyTrackingProtectionDisabled();
 
   return IPC_OK();
 }
 
 IPCResult
+HttpBackgroundChannelChild::RecvNotifyCookieAllowed()
+{
+  LOG(("HttpBackgroundChannelChild::RecvNotifyCookieAllowed [this=%p]\n", this));
+  MOZ_ASSERT(OnSocketThread());
+
+  if (NS_WARN_IF(!mChannelChild)) {
+    return IPC_OK();
+  }
+
+  mChannelChild->ProcessNotifyCookieAllowed();
+
+  return IPC_OK();
+}
+
+IPCResult
 HttpBackgroundChannelChild::RecvNotifyTrackingCookieBlocked(const uint32_t& aRejectedReason)
 {
   LOG(("HttpBackgroundChannelChild::RecvNotifyTrackingCookieBlocked [this=%p]\n", this));
   MOZ_ASSERT(OnSocketThread());
 
   if (NS_WARN_IF(!mChannelChild)) {
     return IPC_OK();
   }
--- a/netwerk/protocol/http/HttpBackgroundChannelChild.h
+++ b/netwerk/protocol/http/HttpBackgroundChannelChild.h
@@ -60,16 +60,18 @@ protected:
   IPCResult RecvFlushedForDiversion() override;
 
   IPCResult RecvDivertMessages() override;
 
   IPCResult RecvOnStartRequestSent() override;
 
   IPCResult RecvNotifyTrackingProtectionDisabled() override;
 
+  IPCResult RecvNotifyCookieAllowed() override;
+
   IPCResult RecvNotifyTrackingCookieBlocked(const uint32_t& aRejectedReason) override;
 
   IPCResult RecvNotifyTrackingResource(const bool& aIsThirdParty) override;
 
   IPCResult RecvSetClassifierMatchedInfo(const ClassifierInfo& info) override;
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
--- a/netwerk/protocol/http/HttpBackgroundChannelParent.cpp
+++ b/netwerk/protocol/http/HttpBackgroundChannelParent.cpp
@@ -375,16 +375,45 @@ HttpBackgroundChannelParent::OnNotifyTra
 
     return NS_SUCCEEDED(rv);
   }
 
   return SendNotifyTrackingProtectionDisabled();
 }
 
 bool
+HttpBackgroundChannelParent::OnNotifyCookieAllowed()
+{
+  LOG(("HttpBackgroundChannelParent::OnNotifyCookieAllowed [this=%p]\n", this));
+  AssertIsInMainProcess();
+
+  if (NS_WARN_IF(!mIPCOpened)) {
+    return false;
+  }
+
+  if (!IsOnBackgroundThread()) {
+    MutexAutoLock lock(mBgThreadMutex);
+    RefPtr<HttpBackgroundChannelParent> self = this;
+    nsresult rv = mBackgroundThread->Dispatch(
+      NS_NewRunnableFunction(
+        "net::HttpBackgroundChannelParent::OnNotifyCookieAllowed",
+        [self]() {
+          self->OnNotifyCookieAllowed();
+        }),
+      NS_DISPATCH_NORMAL);
+
+    MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
+
+    return NS_SUCCEEDED(rv);
+  }
+
+  return SendNotifyCookieAllowed();
+}
+
+bool
 HttpBackgroundChannelParent::OnNotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   LOG(("HttpBackgroundChannelParent::OnNotifyTrackingCookieBlocked [this=%p]\n", this));
   AssertIsInMainProcess();
 
   if (NS_WARN_IF(!mIPCOpened)) {
     return false;
   }
--- a/netwerk/protocol/http/HttpBackgroundChannelParent.h
+++ b/netwerk/protocol/http/HttpBackgroundChannelParent.h
@@ -64,16 +64,19 @@ public:
 
   // To send FlushedForDiversion and DivertMessages messages
   // over background channel.
   bool OnDiversion();
 
   // To send NotifyTrackingProtectionDisabled message over background channel.
   bool OnNotifyTrackingProtectionDisabled();
 
+  // To send NotifyCookieAllowed message over background channel.
+  bool OnNotifyCookieAllowed();
+
   // To send NotifyTrackingCookieBlocked message over background channel.
   bool OnNotifyTrackingCookieBlocked(uint32_t aRejectedReason);
 
   // To send NotifyTrackingResource message over background channel.
   bool OnNotifyTrackingResource(bool aIsThirdParty);
 
   // To send SetClassifierMatchedInfo message over background channel.
   bool OnSetClassifierMatchedInfo(const nsACString& aList,
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -2046,28 +2046,49 @@ HttpChannelChild::ProcessNotifyTrackingP
       "nsChannelClassifier::NotifyTrackingProtectionDisabled",
       [self]() {
         nsChannelClassifier::NotifyTrackingProtectionDisabled(self);
       }),
     NS_DISPATCH_NORMAL);
 }
 
 void
+HttpChannelChild::ProcessNotifyCookieAllowed()
+{
+  LOG(("HttpChannelChild::ProcessNotifyCookieAllowed [this=%p]\n", this));
+  MOZ_ASSERT(OnSocketThread());
+
+  RefPtr<HttpChannelChild> self = this;
+  nsCOMPtr<nsIEventTarget> neckoTarget = GetNeckoTarget();
+  neckoTarget->Dispatch(
+    NS_NewRunnableFunction(
+      "nsChannelClassifier::NotifyBlockingDecision",
+      [self]() {
+        AntiTrackingCommon::NotifyBlockingDecision(self,
+                                                   AntiTrackingCommon::BlockingDecision::eAllow,
+                                                   0);
+      }),
+    NS_DISPATCH_NORMAL);
+}
+
+void
 HttpChannelChild::ProcessNotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   LOG(("HttpChannelChild::ProcessNotifyTrackingCookieBlocked [this=%p]\n", this));
   MOZ_ASSERT(OnSocketThread());
 
   RefPtr<HttpChannelChild> self = this;
   nsCOMPtr<nsIEventTarget> neckoTarget = GetNeckoTarget();
   neckoTarget->Dispatch(
     NS_NewRunnableFunction(
       "nsChannelClassifier::NotifyTrackingCookieBlocked",
       [self, aRejectedReason]() {
-        AntiTrackingCommon::NotifyRejection(self, aRejectedReason);
+        AntiTrackingCommon::NotifyBlockingDecision(self,
+                                                   AntiTrackingCommon::BlockingDecision::eBlock,
+                                                   aRejectedReason);
       }),
     NS_DISPATCH_NORMAL);
 }
 
 void
 HttpChannelChild::ProcessNotifyTrackingResource(bool aIsThirdParty)
 {
   LOG(("HttpChannelChild::ProcessNotifyTrackingResource thirdparty=%d "
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -254,16 +254,17 @@ private:
   void ProcessOnStopRequest(const nsresult& aStatusCode,
                             const ResourceTimingStruct& aTiming,
                             const nsHttpHeaderArray& aResponseTrailers);
   void ProcessOnProgress(const int64_t& aProgress, const int64_t& aProgressMax);
   void ProcessOnStatus(const nsresult& aStatus);
   void ProcessFlushedForDiversion();
   void ProcessDivertMessages();
   void ProcessNotifyTrackingProtectionDisabled();
+  void ProcessNotifyCookieAllowed();
   void ProcessNotifyTrackingCookieBlocked(uint32_t aRejectedReason);
   void ProcessNotifyTrackingResource(bool aIsThirdParty);
   void ProcessSetClassifierMatchedInfo(const nsCString& aList,
                                        const nsCString& aProvider,
                                        const nsCString& aFullHash);
 
   // Return true if we need to tell the parent the size of unreported received
   // data
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1899,16 +1899,27 @@ HttpChannelParent::NotifyTrackingProtect
   if (!mIPCClosed) {
     MOZ_ASSERT(mBgParent);
     Unused << NS_WARN_IF(!mBgParent->OnNotifyTrackingProtectionDisabled());
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
+HttpChannelParent::NotifyCookieAllowed()
+{
+  LOG(("HttpChannelParent::NotifyCookieAllowed [this=%p]\n", this));
+  if (!mIPCClosed) {
+    MOZ_ASSERT(mBgParent);
+    Unused << NS_WARN_IF(!mBgParent->OnNotifyCookieAllowed());
+  }
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 HttpChannelParent::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   LOG(("HttpChannelParent::NotifyTrackingCookieBlocked [this=%p]\n", this));
   if (!mIPCClosed) {
     MOZ_ASSERT(mBgParent);
     Unused << NS_WARN_IF(!mBgParent->OnNotifyTrackingCookieBlocked(aRejectedReason));
   }
   return NS_OK;
--- a/netwerk/protocol/http/PHttpBackgroundChannel.ipdl
+++ b/netwerk/protocol/http/PHttpBackgroundChannel.ipdl
@@ -51,16 +51,19 @@ child:
 
   // Child should resume processing the ChannelEventQueue, i.e. diverting any
   // OnDataAvailable and OnStopRequest messages in the queue back to the parent.
   async DivertMessages();
 
   // Tell the child that tracking protection was disabled for this load.
   async NotifyTrackingProtectionDisabled();
 
+  // Tell the child that cookies are allowed for this load.
+  async NotifyCookieAllowed();
+
   // Tell the child that tracking cookies are blocked for this load.
   async NotifyTrackingCookieBlocked(uint32_t aRejectedReason);
 
   // Tell the child that the resource being loaded is on the tracking
   // protection list.
   async NotifyTrackingResource(bool aIsThirdParty);
 
   // Tell the child information of matched URL againts SafeBrowsing list
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -827,22 +827,28 @@ nsHttpChannel::CheckFastBlocked()
 nsresult
 nsHttpChannel::ConnectOnTailUnblock()
 {
     nsresult rv;
 
     LOG(("nsHttpChannel::ConnectOnTailUnblock [this=%p]\n", this));
 
     bool isTrackingResource = mIsThirdPartyTrackingResource; // is atomic
-    if (isTrackingResource && CheckFastBlocked()) {
-        AntiTrackingCommon::NotifyRejection(this,
-                                            nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
-        Unused << AsyncAbort(NS_ERROR_TRACKING_ANNOTATION_URI);
-        CloseCacheEntry(false);
-        return NS_OK;
+    if (isTrackingResource) {
+        bool engageFastBlock = CheckFastBlocked();
+        AntiTrackingCommon::NotifyBlockingDecision(this,
+                                                   engageFastBlock ?
+                                                     AntiTrackingCommon::BlockingDecision::eBlock :
+                                                     AntiTrackingCommon::BlockingDecision::eAllow,
+                                                   nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+        if (engageFastBlock) {
+          Unused << AsyncAbort(NS_ERROR_TRACKING_ANNOTATION_URI);
+          CloseCacheEntry(false);
+          return NS_OK;
+        }
     }
 
     // Consider opening a TCP connection right away.
     SpeculativeConnect();
 
     // open a cache entry for this channel...
     bool isHttps = false;
     rv = mURI->SchemeIs("https", &isHttps);
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -203,16 +203,20 @@ nsSecureBrowserUIImpl::CheckForBlockedCo
 
   if (docShell->GetHasForeignCookiesBeenBlocked()) {
     mState |= STATE_COOKIES_BLOCKED_FOREIGN;
   }
 
   if (docShell->GetHasAllCookiesBeenBlocked()) {
     mState |= STATE_COOKIES_BLOCKED_ALL;
   }
+
+  if (docShell->GetHasCookiesLoaded()) {
+    mState |= STATE_COOKIES_LOADED;
+  }
 }
 
 // Helper function to determine if the given URI can be considered secure.
 // Essentially, only "https" URIs can be considered secure. However, the URI we
 // have may be e.g. view-source:https://example.com or
 // wyciwyg://https://example.com, in which case we have to evaluate the
 // innermost URI.
 static nsresult
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -1789,17 +1789,17 @@ SpecialPowersAPI.prototype = {
     // for some non-e10s mochi tests, |window| is null whereas |content.window|
     // works fine.  So we take whatever is non-null!
     xferable.init(this._getDocShell(typeof(window) == "undefined" ? this.mm.content.window : window)
                       .QueryInterface(Ci.nsILoadContext));
     xferable.addDataFlavor(flavor);
     Services.clipboard.getData(xferable, whichClipboard);
     var data = {};
     try {
-      xferable.getTransferData(flavor, data, {});
+      xferable.getTransferData(flavor, data);
     } catch (e) {}
     data = data.value || null;
     if (data == null)
       return "";
 
     return data.QueryInterface(Ci.nsISupportsString).data;
   },
 
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -224,17 +224,18 @@ CheckContentBlockingAllowList(nsIHttpCha
   return false;
 }
 
 void
 ReportBlockingToConsole(nsPIDOMWindowOuter* aWindow, nsIURI* aURI,
                         uint32_t aRejectedReason)
 {
   MOZ_ASSERT(aWindow && aURI);
-  MOZ_ASSERT(aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
+  MOZ_ASSERT(aRejectedReason == 0 ||
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
              aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
 
   nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
   if (NS_WARN_IF(!docShell)) {
     return;
@@ -512,17 +513,17 @@ AntiTrackingCommon::AddFirstPartyStorage
   const uint32_t blockReason = nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER;
   if ((aReason != eOpenerAfterUserInteraction ||
        nsContentUtils::IsURIInPrefList(trackingURI,
          "privacy.restrict3rdpartystorage.userInteractionRequiredForHosts")) &&
       !HasUserInteraction(trackingPrincipal)) {
     LOG_SPEC(("Tracking principal (%s) hasn't been interacted with before, "
               "refusing to add a first-party storage permission to access it",
               _spec), trackingURI);
-    NotifyRejection(aParentWindow, blockReason);
+    NotifyBlockingDecision(aParentWindow, BlockingDecision::eBlock, blockReason);
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> pwin = GetTopWindow(parentWindow);
   if (!pwin) {
     LOG(("Couldn't get the top window"));
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);
   }
@@ -1256,36 +1257,51 @@ AntiTrackingCommon::IsOnContentBlockingA
   if (!aIsAllowListed) {
     LOG(("No user override found"));
   }
 
   return NS_OK;
 }
 
 /* static */ void
-AntiTrackingCommon::NotifyRejection(nsIChannel* aChannel,
-                                    uint32_t aRejectedReason)
+AntiTrackingCommon::NotifyBlockingDecision(nsIChannel* aChannel,
+                                           BlockingDecision aDecision,
+                                           uint32_t aRejectedReason)
 {
-  MOZ_ASSERT(aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
+  MOZ_ASSERT(aRejectedReason == 0 ||
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
              aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+  MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
+             aDecision == BlockingDecision::eAllow);
 
   if (!aChannel) {
     return;
   }
 
+  // When we allow loads, collapse all cookie related reason codes into STATE_COOKIES_LOADED.
+  bool sendCookieLoadedNotification = false;
+  if (aRejectedReason != nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT) {
+    sendCookieLoadedNotification = true;
+  }
+
   // Can be called in EITHER the parent or child process.
   nsCOMPtr<nsIParentChannel> parentChannel;
   NS_QueryNotificationCallbacks(aChannel, parentChannel);
   if (parentChannel) {
     // This channel is a parent-process proxy for a child process request.
     // Tell the child process channel to do this instead.
-    parentChannel->NotifyTrackingCookieBlocked(aRejectedReason);
+    if (aDecision == BlockingDecision::eBlock) {
+      parentChannel->NotifyTrackingCookieBlocked(aRejectedReason);
+    } else {
+      // Ignore the code related to fastblock
+      parentChannel->NotifyCookieAllowed();
+    }
     return;
   }
 
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil = services::GetThirdPartyUtil();
   if (!thirdPartyUtil) {
     return;
   }
 
@@ -1297,32 +1313,48 @@ AntiTrackingCommon::NotifyRejection(nsIC
   nsCOMPtr<nsPIDOMWindowOuter> pwin = nsPIDOMWindowOuter::From(win);
   if (!pwin) {
     return;
   }
 
   nsCOMPtr<nsIURI> uri;
   aChannel->GetURI(getter_AddRefs(uri));
 
-  pwin->NotifyContentBlockingState(aRejectedReason, aChannel, true, uri);
+  if (aDecision == BlockingDecision::eBlock) {
+    pwin->NotifyContentBlockingState(aRejectedReason, aChannel, true, uri);
 
-  ReportBlockingToConsole(pwin, uri, aRejectedReason);
+    ReportBlockingToConsole(pwin, uri, aRejectedReason);
+  }
+
+  if (sendCookieLoadedNotification) {
+    pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
+                                     aChannel, false, uri);
+  }
 }
 
 /* static */ void
-AntiTrackingCommon::NotifyRejection(nsPIDOMWindowInner* aWindow,
-                                    uint32_t aRejectedReason)
+AntiTrackingCommon::NotifyBlockingDecision(nsPIDOMWindowInner* aWindow,
+                                           BlockingDecision aDecision,
+                                           uint32_t aRejectedReason)
 {
   MOZ_ASSERT(aWindow);
-  MOZ_ASSERT(aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
+  MOZ_ASSERT(aRejectedReason == 0 ||
+             aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL ||
              aRejectedReason == nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN ||
              aRejectedReason == nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT);
+  MOZ_ASSERT(aDecision == BlockingDecision::eBlock ||
+             aDecision == BlockingDecision::eAllow);
 
+  // When we allow loads, collapse all cookie related reason codes into STATE_COOKIES_LOADED.
+  bool sendCookieLoadedNotification = false;
+  if (aRejectedReason != nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT) {
+    sendCookieLoadedNotification = true;
+  }
 
   nsCOMPtr<nsPIDOMWindowOuter> pwin = GetTopWindow(aWindow);
   if (!pwin) {
     return;
   }
 
   nsPIDOMWindowInner* inner = pwin->GetCurrentInnerWindow();
   if (!inner) {
@@ -1338,19 +1370,26 @@ AntiTrackingCommon::NotifyRejection(nsPI
   }
 
   nsIDocument* document = aWindow->GetExtantDoc();
   if (!document) {
     return;
   }
   nsIURI* uri = document->GetDocumentURI();
 
-  pwin->NotifyContentBlockingState(aRejectedReason, channel, true, uri);
+  if (aDecision == BlockingDecision::eBlock) {
+    pwin->NotifyContentBlockingState(aRejectedReason, channel, true, uri);
 
-  ReportBlockingToConsole(pwin, uri, aRejectedReason);
+    ReportBlockingToConsole(pwin, uri, aRejectedReason);
+  }
+
+  if (sendCookieLoadedNotification) {
+    pwin->NotifyContentBlockingState(nsIWebProgressListener::STATE_COOKIES_LOADED,
+                                     channel, false, uri);
+  }
 }
 
 /* static */ void
 AntiTrackingCommon::StoreUserInteractionFor(nsIPrincipal* aPrincipal)
 {
   if (XRE_IsParentProcess()) {
     nsCOMPtr<nsIURI> uri;
     Unused << aPrincipal->GetURI(getter_AddRefs(uri));
--- a/toolkit/components/antitracking/AntiTrackingCommon.h
+++ b/toolkit/components/antitracking/AntiTrackingCommon.h
@@ -125,28 +125,38 @@ public:
 
   // Check whether a top window URI is on the content blocking allow list.
   static nsresult
   IsOnContentBlockingAllowList(nsIURI* aTopWinURI,
                                bool aIsPrivateBrowsing,
                                ContentBlockingAllowListPurpose aPurpose,
                                bool& aIsAllowListed);
 
+  enum class BlockingDecision {
+    eBlock,
+    eAllow,
+  };
+
   // This method can be called on the parent process or on the content process.
   // The notification is propagated to the child channel if aChannel is a parent
   // channel proxy.
   //
+  // aDecision can be eBlock if we have decided to block some content, or eAllow
+  // if we have decided to allow the content through.
+  //
   // aRejectedReason must be one of these values:
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL
   //  * nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN
   //  * nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT
   static void
-  NotifyRejection(nsIChannel* aChannel, uint32_t aRejectedReason);
+  NotifyBlockingDecision(nsIChannel* aChannel, BlockingDecision aDecision,
+                         uint32_t aRejectedReason);
 
   static void
-  NotifyRejection(nsPIDOMWindowInner* aWindow, uint32_t aRejectedReason);
+  NotifyBlockingDecision(nsPIDOMWindowInner* aWindow, BlockingDecision aDecision,
+                         uint32_t aRejectedReason);
 };
 
 } // namespace mozilla
 
 #endif // mozilla_antitrackingservice_h
--- a/toolkit/components/antitracking/test/browser/browser_subResources.js
+++ b/toolkit/components/antitracking/test/browser/browser_subResources.js
@@ -152,39 +152,64 @@ add_task(async function() {
     });
 
   await fetch("https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/subResources.sjs?result&what=script")
     .then(r => r.text())
     .then(text => {
       is(text, 1, "One cookie received received for scripts.");
     });
 
+  let expectTrackerBlocked = (item, blocked) => {
+    is(item[0], Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER,
+       "Correct blocking type reported");
+    is(item[1], blocked,
+       "Correct blocking status reported");
+    ok(item[2] >= 1,
+       "Correct repeat count reported");
+  };
+
+  let expectTrackerFound = item => {
+    is(item[0], Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT,
+       "Correct blocking type reported");
+    is(item[1], true,
+       "Correct blocking status reported");
+    ok(item[2] >= 1,
+       "Correct repeat count reported");
+  };
+
+  let expectCookiesLoaded = item => {
+    is(item[0], Ci.nsIWebProgressListener.STATE_COOKIES_LOADED,
+       "Correct blocking type reported");
+    is(item[1], true,
+       "Correct blocking status reported");
+    ok(item[2] >= 1,
+       "Correct repeat count reported");
+  };
+
   let log = JSON.parse(await browser.getContentBlockingLog());
   for (let trackerOrigin in log) {
     is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
     let originLog = log[trackerOrigin];
-    is(originLog.length, 3, "We should have 3 entries in the compressed log");
-    is(originLog[0][0], Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT,
-       "Correct blocking type reported");
-    is(originLog[0][1], true,
-       "Correct blocking status reported");
-    ok(originLog[0][2] >= 1,
-       "Correct repeat count reported");
-    is(originLog[1][0], Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER,
-       "Correct blocking type reported");
-    is(originLog[1][1], true,
-       "Correct blocking status reported");
-    is(originLog[1][2], 6,
-       "Correct repeat count reported");
-    is(originLog[2][0], Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER,
-       "Correct blocking type reported");
-    is(originLog[2][1], false,
-       "Correct blocking status reported");
-    ok(originLog[2][2] >= 1,
-       "Correct repeat count reported");
+    is(originLog.length, 16, "We should have 16 entries in the compressed log");
+    expectTrackerFound(originLog[0]);
+    expectCookiesLoaded(originLog[1]);
+    expectTrackerBlocked(originLog[2], true);
+    expectCookiesLoaded(originLog[3]);
+    expectTrackerBlocked(originLog[4], true);
+    expectCookiesLoaded(originLog[5]);
+    expectTrackerBlocked(originLog[6], true);
+    expectCookiesLoaded(originLog[7]);
+    expectTrackerBlocked(originLog[8], true);
+    expectCookiesLoaded(originLog[9]);
+    expectTrackerBlocked(originLog[10], true);
+    expectCookiesLoaded(originLog[11]);
+    expectTrackerBlocked(originLog[12], true);
+    expectCookiesLoaded(originLog[13]);
+    expectTrackerBlocked(originLog[14], false);
+    expectCookiesLoaded(originLog[15]);
   }
 
   info("Removing the tab");
   BrowserTestUtils.removeTab(tab);
 });
 
 add_task(async function() {
   info("Cleaning up.");
--- a/toolkit/components/antitracking/test/browser/head.js
+++ b/toolkit/components/antitracking/test/browser/head.js
@@ -361,20 +361,26 @@ this.AntiTracking = {
                "When not blocking, old state should not have had the " +
                "STATE_COOKIES_BLOCKED_TRACKER bit");
             // Ensure that if there is something in the content blocking log, it's only
             // STATE_LOADED_TRACKING_CONTENT notifications.
             for (let trackerOrigin in contentBlockingLog) {
               let originLog = contentBlockingLog[trackerOrigin];
               for (let i = 0; i < originLog.length; ++i) {
                 let item = originLog[i];
-                is(item[0], Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT,
-                   "Correct blocking type must be reported");
-                is(item[1], true, "Correct blocking status reported");
-                ok(item[2] >= 1, "Correct repeat count reported");
+                switch (item[0]) {
+                case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT:
+                  is(item[1], true, "Correct blocking status reported");
+                  ok(item[2] >= 1, "Correct repeat count reported");
+                  break;
+                case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED:
+                  is(item[1], true, "Correct blocking status reported");
+                  ok(item[2] >= 1, "Correct repeat count reported");
+                  break;
+                }
               }
             }
           }
         },
       };
       win.gBrowser.addProgressListener(listener);
 
       info("Creating a new tab");
@@ -544,30 +550,21 @@ this.AntiTracking = {
           if (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER) {
             ++cookieBlocked;
           }
           let contentBlockingLog = {};
           try {
             contentBlockingLog = JSON.parse(contentBlockingLogJSON);
           } catch (e) {
           }
-          // If this is the first cookie to be blocked, our state should have
-          // just changed, otherwise it should have previously contained the
-          // STATE_COOKIES_BLOCKED_TRACKER bit too.
           if (cookieBlocked) {
-            if (cookieBlocked == 1) {
-              is(oldState & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER, 0,
-                 "When blocking the first cookie, old state should not have had the " +
-                 "STATE_COOKIES_BLOCKED_TRACKER bit");
-            }
-
             for (let trackerOrigin in contentBlockingLog) {
               is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
               let originLog = contentBlockingLog[trackerOrigin];
-              ok(originLog.length > 1, "We should have at least two items in the log");
+              ok(originLog.length >= 1, "We should have at least two items in the log");
               for (let i = 0; i < originLog.length; ++i) {
                 let item = originLog[i];
                 switch (item[0]) {
                 case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT:
                   is(item[1], true, "Correct blocking status reported");
                   ok(item[2] >= 1, "Correct repeat count reported");
                   break;
                 case Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT:
@@ -579,16 +576,20 @@ this.AntiTracking = {
                   break;
                 case Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER:
                   if (item[1]) {
                     ok(item[2] >= 1, "Correct repeat count reported");
                   } else {
                     is(item[2], 1, "Correct repeat count reported");
                   }
                   break;
+                case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED:
+                  is(item[1], true, "Correct blocking status reported");
+                  ok(item[2] >= 1, "Correct repeat count reported");
+                  break;
                 }
               }
             }
             // Can't assert the number of tracker origins because we may get 0
             // for web progress navigations coming from the window opening...
           }
         },
       };
@@ -692,40 +693,47 @@ this.AntiTracking = {
           if (expectedBlockingNotifications && cookieBlocked) {
             if (cookieBlocked == 1) {
               is(oldState & expectedBlockingNotifications, 0,
                  "When blocking the first cookie, old state should not have had " +
                  "one of the blocking flag bit");
             }
 
             for (let trackerOrigin in contentBlockingLog) {
-              is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
               let originLog = contentBlockingLog[trackerOrigin];
-              ok(originLog.length > 1, "We should have at least two items in the log");
+              ok(originLog.length >= 1, "We should have at least two items in the log");
               for (let i = 0; i < originLog.length; ++i) {
                 let item = originLog[i];
                 switch (item[0]) {
                 case Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT:
+                  is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
                   is(item[1], true, "Correct blocking status reported");
                   ok(item[2] >= 1, "Correct repeat count reported");
                   break;
                 case Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT:
+                  is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
                   if (item[1]) {
                     ok(item[2] >= 1, "Correct repeat count reported");
                   } else {
                     // This branch is needed here because of the tests that use the storage
                     // access API to gain storage access.
                     is(item[2], 1, "Correct repeat count reported");
                   }
                   break;
                 case Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER:
+                  is(trackerOrigin, TEST_3RD_PARTY_DOMAIN, "Correct tracker origin must be reported");
                   // We can expect 1 or more repeat count whether or not blocking has happened,
                   // so nothing to assert on item[1].
                   ok(item[2] >= 1, "Correct repeat count reported");
                   break;
+                case Ci.nsIWebProgressListener.STATE_COOKIES_LOADED:
+                  // The trackerOrigin here is sometimes TEST_DOMAIN, sometimes TEST_3RD_PARTY_DOMAIN.
+                  is(item[1], true, "Correct blocking status reported");
+                  ok(item[2] >= 1, "Correct repeat count reported");
+                  break;
                 }
               }
             }
             // Can't assert the number of tracker origins because we may get 0
             // for web progress navigations coming from the window opening...
           }
         },
       };
--- a/toolkit/modules/Finder.jsm
+++ b/toolkit/modules/Finder.jsm
@@ -606,18 +606,17 @@ function GetClipboardSearchString(aLoadC
     let trans = Cc["@mozilla.org/widget/transferable;1"]
                   .createInstance(Ci.nsITransferable);
     trans.init(aLoadContext);
     trans.addDataFlavor("text/unicode");
 
     Clipboard.getData(trans, Ci.nsIClipboard.kFindClipboard);
 
     let data = {};
-    let dataLen = {};
-    trans.getTransferData("text/unicode", data, dataLen);
+    trans.getTransferData("text/unicode", data);
     if (data.value) {
       data = data.value.QueryInterface(Ci.nsISupportsString);
       searchString = data.toString();
     }
   } catch (ex) {}
 
   return searchString;
 }
--- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm
@@ -86,18 +86,17 @@ function convertHTMLToPlainText(html) {
   var converter = Cc["@mozilla.org/widget/htmlformatconverter;1"].
                   createInstance(Ci.nsIFormatConverter);
 
   var input = Cc["@mozilla.org/supports-string;1"].
               createInstance(Ci.nsISupportsString);
   input.data = html.replace(/\n/g, "<br>");
 
   var output = {};
-  converter.convert("text/html", input, input.data.length, "text/unicode",
-                    output, {});
+  converter.convert("text/html", input, "text/unicode", output);
 
   if (output.value instanceof Ci.nsISupportsString)
     return output.value.data.replace(/\r\n/g, "\n");
   return html;
 }
 
 async function getAddonsToCache(aIds) {
   let types = Preferences.get(PREF_GETADDONS_CACHE_TYPES) || DEFAULT_CACHE_TYPES;
--- a/uriloader/base/nsIWebProgressListener.idl
+++ b/uriloader/base/nsIWebProgressListener.idl
@@ -322,16 +322,17 @@ interface nsIWebProgressListener : nsISu
    *   Rejected because cookie policy blocks all cookies.
    *
    * STATE_COOKIES_BLOCKED_FOREIGN
    *   Rejected because cookie policy blocks 3rd party cookies.
    *
    * STATE_BLOCKED_SLOW_TRACKING_CONTENT
    *   Rejected because of the FastBlock feature.
    */
+  const unsigned long STATE_COOKIES_LOADED                = 0x00008000;
   const unsigned long STATE_COOKIES_BLOCKED_BY_PERMISSION = 0x10000000;
   const unsigned long STATE_COOKIES_BLOCKED_TRACKER       = 0x20000000;
   const unsigned long STATE_COOKIES_BLOCKED_ALL           = 0x40000000;
   const unsigned long STATE_COOKIES_BLOCKED_FOREIGN       = 0x00000080;
   const unsigned long STATE_BLOCKED_SLOW_TRACKING_CONTENT = 0x00000040;
 
   /**
    * Notification indicating the state has changed for one of the requests
--- a/uriloader/exthandler/nsExternalProtocolHandler.cpp
+++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp
@@ -417,16 +417,22 @@ NS_IMETHODIMP nsExtProtocolChannel::SetP
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::NotifyTrackingProtectionDisabled()
 {
   // nothing to do
   return NS_OK;
 }
 
+NS_IMETHODIMP nsExtProtocolChannel::NotifyCookieAllowed()
+{
+  // nothing to do
+  return NS_OK;
+}
+
 NS_IMETHODIMP nsExtProtocolChannel::NotifyTrackingCookieBlocked(uint32_t aRejectedReason)
 {
   // nothing to do
   return NS_OK;
 }
 
 NS_IMETHODIMP nsExtProtocolChannel::SetClassifierMatchedInfo(const nsACString& aList,
                                                              const nsACString& aProvider,
--- a/widget/android/nsClipboard.cpp
+++ b/widget/android/nsClipboard.cpp
@@ -28,19 +28,17 @@ nsClipboard::nsClipboard()
 NS_IMETHODIMP
 nsClipboard::SetData(nsITransferable *aTransferable,
                      nsIClipboardOwner *anOwner, int32_t aWhichClipboard)
 {
   if (aWhichClipboard != kGlobalClipboard)
     return NS_ERROR_NOT_IMPLEMENTED;
 
   nsCOMPtr<nsISupports> tmp;
-  uint32_t len;
-  nsresult rv  = aTransferable->GetTransferData(kUnicodeMime, getter_AddRefs(tmp),
-                                                &len);
+  nsresult rv  = aTransferable->GetTransferData(kUnicodeMime, getter_AddRefs(tmp));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsISupportsString> supportsString = do_QueryInterface(tmp);
   // No support for non-text data
   NS_ENSURE_TRUE(supportsString, NS_ERROR_NOT_IMPLEMENTED);
   nsAutoString buffer;
   supportsString->GetData(buffer);
 
   java::Clipboard::SetText(java::GeckoAppShell::GetApplicationContext(),
@@ -68,18 +66,17 @@ nsClipboard::GetData(nsITransferable *aT
   rv = dataWrapper->SetData(buffer);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If our data flavor has already been added, this will fail. But we don't care
   aTransferable->AddDataFlavor(kUnicodeMime);
 
   nsCOMPtr<nsISupports> nsisupportsDataWrapper =
     do_QueryInterface(dataWrapper);
-  rv = aTransferable->SetTransferData(kUnicodeMime, nsisupportsDataWrapper,
-                                      buffer.Length() * sizeof(char16_t));
+  rv = aTransferable->SetTransferData(kUnicodeMime, nsisupportsDataWrapper);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsClipboard::EmptyClipboard(int32_t aWhichClipboard)
 {
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -6246,25 +6246,23 @@ provideDataForType:(NSString*)aType
         for (uint32_t i = 0; i < transferableCount; i++) {
           nsCOMPtr<nsITransferable> item =
             do_QueryElementAt(gDraggedTransferables, i);
           if (!item) {
             NS_ERROR("no transferable");
             continue;
           }
 
-          item->SetTransferData(kFilePromiseDirectoryMime, macLocalFile,
-                                sizeof(nsIFile*));
+          item->SetTransferData(kFilePromiseDirectoryMime, macLocalFile);
 
           // Now request the kFilePromiseMime data, which will invoke the data
           // provider. If successful, the file will have been created.
           nsCOMPtr<nsISupports> fileDataPrimitive;
-          uint32_t dataSize = 0;
           item->GetTransferData(kFilePromiseMime,
-                                getter_AddRefs(fileDataPrimitive), &dataSize);
+                                getter_AddRefs(fileDataPrimitive));
         }
         CFRelease(urlRef);
         CFRelease(pboardRef);
 
         [aPasteboard setPropertyList:[pasteboardOutputDict valueForKey:curType]
                              forType:curType];
       }
     }
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -234,17 +234,17 @@ nsClipboard::TransferableFromPasteboard(
            (clipboardDataPtrNoBOM[0] == 0xFFFE))) {
         dataLength -= sizeof(char16_t);
         clipboardDataPtrNoBOM += 1;
       }
 
       nsCOMPtr<nsISupports> genericDataWrapper;
       nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr, clipboardDataPtrNoBOM, dataLength,
                                                  getter_AddRefs(genericDataWrapper));
-      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper, dataLength);
+      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper);
       free(clipboardDataPtr);
       break;
     }
     else if (flavorStr.EqualsLiteral(kCustomTypesMime)) {
       NSString* type =
         [cocoaPasteboard availableTypeFromArray:
           [NSArray arrayWithObject:
             [UTIHelper stringFromPboardType:kMozCustomTypesPboardType]]];
@@ -264,17 +264,17 @@ nsClipboard::TransferableFromPasteboard(
         return NS_ERROR_OUT_OF_MEMORY;
       }
       [pasteboardData getBytes:clipboardDataPtr];
 
       nsCOMPtr<nsISupports> genericDataWrapper;
       nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr, clipboardDataPtr, dataLength,
                                                  getter_AddRefs(genericDataWrapper));
 
-      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper, dataLength);
+      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper);
       free(clipboardDataPtr);
     }
     else if (flavorStr.EqualsLiteral(kJPEGImageMime) ||
              flavorStr.EqualsLiteral(kJPGImageMime) ||
              flavorStr.EqualsLiteral(kPNGImageMime) ||
              flavorStr.EqualsLiteral(kGIFImageMime)) {
       // Figure out if there's data on the pasteboard we can grab (sanity check)
       NSString* type =
@@ -331,17 +331,17 @@ nsClipboard::TransferableFromPasteboard(
       bool successfullyConverted = CGImageDestinationFinalize(dest);
 
       if (successfullyConverted) {
         // Put the converted data in a form Gecko can understand
         nsCOMPtr<nsIInputStream> byteStream;
         NS_NewByteInputStream(getter_AddRefs(byteStream), (const char*)[encodedData bytes],
                                    [encodedData length], NS_ASSIGNMENT_COPY);
   
-        aTransferable->SetTransferData(flavorStr.get(), byteStream, sizeof(nsIInputStream*));
+        aTransferable->SetTransferData(flavorStr.get(), byteStream);
       }
 
       if (dest)
         CFRelease(dest);
       if (source)
         CFRelease(source);
       
       if (successfullyConverted)
@@ -384,20 +384,19 @@ nsClipboard::GetNativeClipboardData(nsIT
   // transferable. Otherwise clear it because it isn't relevant any more.
   if (mCachedClipboard == aWhichClipboard &&
       mChangeCount == [cocoaPasteboard changeCount]) {
     if (mTransferable) {
       for (uint32_t i = 0; i < flavors.Length(); i++) {
         nsCString& flavorStr = flavors[i];
 
         nsCOMPtr<nsISupports> dataSupports;
-        uint32_t dataSize = 0;
-        rv = mTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(dataSupports), &dataSize);
+        rv = mTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(dataSupports));
         if (NS_SUCCEEDED(rv)) {
-          aTransferable->SetTransferData(flavorStr.get(), dataSupports, dataSize);
+          aTransferable->SetTransferData(flavorStr.get(), dataSupports);
           return NS_OK; // maybe try to fill in more types? Is there a point?
         }
       }
     }
   } else {
     EmptyClipboard(aWhichClipboard);
   }
 
@@ -512,19 +511,18 @@ nsClipboard::PasteboardDictFromTransfera
   for (uint32_t i = 0; i < flavors.Length(); i++) {
     nsCString& flavorStr = flavors[i];
 
     MOZ_LOG(sCocoaLog, LogLevel::Info, ("writing out clipboard data of type %s (%d)\n", flavorStr.get(), i));
 
     NSString *pboardType = nil;
 
     if (nsClipboard::IsStringType(flavorStr, &pboardType)) {
-      uint32_t dataSize = 0;
       nsCOMPtr<nsISupports> genericDataWrapper;
-      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericDataWrapper), &dataSize);
+      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericDataWrapper));
       if (NS_FAILED(rv)) {
         [pboardType release];
         continue;
       }
 
       nsAutoString data;
       if (nsCOMPtr<nsISupportsString> text = do_QueryInterface(genericDataWrapper)) {
         text->GetData(data);
@@ -537,19 +535,18 @@ nsClipboard::PasteboardDictFromTransfera
         nativeString = [NSString string];
 
       // be nice to Carbon apps, normalize the receiver's contents using Form C.
       nativeString = [nativeString precomposedStringWithCanonicalMapping];
 
       [pasteboardOutputDict setObject:nativeString forKey:pboardType];
     }
     else if (flavorStr.EqualsLiteral(kCustomTypesMime)) {
-      uint32_t dataSize = 0;
       nsCOMPtr<nsISupports> genericDataWrapper;
-      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericDataWrapper), &dataSize);
+      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericDataWrapper));
       if (NS_FAILED(rv)) {
         continue;
       }
 
       nsAutoCString data;
       if (nsCOMPtr<nsISupportsCString> text = do_QueryInterface(genericDataWrapper)) {
         text->GetData(data);
       }
@@ -559,19 +556,18 @@ nsClipboard::PasteboardDictFromTransfera
         NSString* customType =
           [UTIHelper stringFromPboardType:kMozCustomTypesPboardType];
         [pasteboardOutputDict setObject:nativeData forKey:customType];
       }
     }
     else if (flavorStr.EqualsLiteral(kPNGImageMime) || flavorStr.EqualsLiteral(kJPEGImageMime) ||
              flavorStr.EqualsLiteral(kJPGImageMime) || flavorStr.EqualsLiteral(kGIFImageMime) ||
              flavorStr.EqualsLiteral(kNativeImageMime)) {
-      uint32_t dataSize = 0;
       nsCOMPtr<nsISupports> transferSupports;
-      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(transferSupports), &dataSize);
+      aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(transferSupports));
 
       nsCOMPtr<imgIContainer> image(do_QueryInterface(transferSupports));
       if (!image) {
         NS_WARNING("Image isn't an imgIContainer in transferable");
         continue;
       }
 
       RefPtr<SourceSurface> surface =
@@ -608,19 +604,18 @@ nsClipboard::PasteboardDictFromTransfera
       NSString* tiffType =
         [UTIHelper stringFromPboardType:NSPasteboardTypeTIFF];
       [pasteboardOutputDict setObject:(NSMutableData*)tiffData
                                forKey:tiffType];
       if (tiffData)
         CFRelease(tiffData);
     }
     else if (flavorStr.EqualsLiteral(kFileMime)) {
-      uint32_t len = 0;
       nsCOMPtr<nsISupports> genericFile;
-      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericFile), &len);
+      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericFile));
       if (NS_FAILED(rv)) {
         continue;
       }
 
       nsCOMPtr<nsIFile> file(do_QueryInterface(genericFile));
       if (!file) {
         continue;
       }
@@ -646,35 +641,34 @@ nsClipboard::PasteboardDictFromTransfera
         [UTIHelper stringFromPboardType:
           (NSString*)kPasteboardTypeFilePromiseContent];
       [pasteboardOutputDict setObject:[NSArray arrayWithObject:@""]
                                forKey:urlPromise];
       [pasteboardOutputDict setObject:[NSArray arrayWithObject:@""]
                                forKey:urlPromiseContent];
     }
     else if (flavorStr.EqualsLiteral(kURLMime)) {
-      uint32_t len = 0;
       nsCOMPtr<nsISupports> genericURL;
-      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericURL), &len);
+      rv = aTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(genericURL));
       nsCOMPtr<nsISupportsString> urlObject(do_QueryInterface(genericURL));
 
       nsAutoString url;
       urlObject->GetData(url);
 
       NSString* nativeTitle = nil;
 
       // A newline embedded in the URL means that the form is actually URL +
       // title. This embedding occurs in nsDragService::GetData.
       int32_t newlinePos = url.FindChar(char16_t('\n'));
       if (newlinePos >= 0) {
         url.Truncate(newlinePos);
 
         nsAutoString urlTitle;
         urlObject->GetData(urlTitle);
-        urlTitle.Mid(urlTitle, newlinePos + 1, len - (newlinePos + 1));
+        urlTitle.Mid(urlTitle, newlinePos + 1, urlTitle.Length() - (newlinePos + 1));
 
         nativeTitle =
           [NSString stringWithCharacters:
             reinterpret_cast<const unichar*>(urlTitle.get())
                                   length:urlTitle.Length()];
       }
       // The Finder doesn't like getting random binary data aka
       // Unicode, so change it into an escaped URL containing only
--- a/widget/cocoa/nsDragService.mm
+++ b/widget/cocoa/nsDragService.mm
@@ -388,20 +388,19 @@ nsDragService::GetData(nsITransferable* 
   // when the drag started if possible
   if (mDataItems) {
     nsCOMPtr<nsITransferable> currentTransferable = do_QueryElementAt(mDataItems, aItemIndex);
     if (currentTransferable) {
       for (uint32_t i = 0; i < flavors.Length(); i++) {
         nsCString& flavorStr = flavors[i];
 
         nsCOMPtr<nsISupports> dataSupports;
-        uint32_t dataSize = 0;
-        rv = currentTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(dataSupports), &dataSize);
+        rv = currentTransferable->GetTransferData(flavorStr.get(), getter_AddRefs(dataSupports));
         if (NS_SUCCEEDED(rv)) {
-          aTransferable->SetTransferData(flavorStr.get(), dataSupports, dataSize);
+          aTransferable->SetTransferData(flavorStr.get(), dataSupports);
           return NS_OK; // maybe try to fill in more types? Is there a point?
         }
       }
     }
   }
 
   // now check the actual clipboard for data
   for (uint32_t i = 0; i < flavors.Length(); i++) {
@@ -438,17 +437,17 @@ nsDragService::GetData(nsITransferable* 
       clipboardDataPtr[stringLength] = 0; // null terminate
 
       nsCOMPtr<nsIFile> file;
       rv = NS_NewLocalFile(nsDependentString(clipboardDataPtr), true, getter_AddRefs(file));
       free(clipboardDataPtr);
       if (NS_FAILED(rv))
         continue;
 
-      aTransferable->SetTransferData(flavorStr.get(), file, dataLength);
+      aTransferable->SetTransferData(flavorStr.get(), file);
       
       break;
     }
     else if (flavorStr.EqualsLiteral(kCustomTypesMime)) {
       NSString* availableType =
         [item availableTypeFromArray:
           [NSArray arrayWithObject:kMozCustomTypesPboardType]];
       if (!availableType || !IsValidType(availableType, false)) {
@@ -465,17 +464,17 @@ nsDragService::GetData(nsITransferable* 
         return NS_ERROR_OUT_OF_MEMORY;
       }
       [pasteboardData getBytes:clipboardDataPtr];
 
       nsCOMPtr<nsISupports> genericDataWrapper;
       nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr, clipboardDataPtr, dataLength,
                                                  getter_AddRefs(genericDataWrapper));
 
-      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper, sizeof(nsIInputStream*));
+      aTransferable->SetTransferData(flavorStr.get(), genericDataWrapper);
       free(clipboardDataPtr);