merge autoland to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 12 Oct 2017 23:55:22 +0200
changeset 428469 46a75c66bb512d652dd883435afe242c22be9ac3
parent 428410 98247fbf95c260786361e12ad924c4370885f686 (current diff)
parent 428468 122829e5d814262274b43cf62894fe5e1433cc6f (diff)
child 428470 25aad10380b10b6efa50c2b4d97245f078d870a0
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersmerge, merge
milestone58.0a1
merge autoland to mozilla-central. r=merge a=merge MozReview-Commit-ID: 6jFAhVr6aqT
browser/base/content/test/general/browser_bug585558.js
devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm_dollar.js
devtools/client/webconsole/new-console-output/test/mochitest/test-bug-621644-jsterm-dollar.html
dom/media/doctor/DDLogClass.cpp
dom/media/doctor/DDLogClass.h
layout/reftests/css-mediaqueries/system-metrics-1-ref.html
layout/reftests/css-mediaqueries/system-metrics-1.html
mobile/android/app/src/main/res/drawable-hdpi/find_prev.png
mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png
mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png
mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png
mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png
mobile/android/app/src/main/res/drawable-xhdpi/find_prev.png
mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png
mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default.9.png
mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png
mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed.9.png
mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1341,17 +1341,16 @@ var gBrowserInit = {
       if (width < TARGET_WIDTH && height < TARGET_HEIGHT) {
         document.documentElement.setAttribute("sizemode", "maximized");
       }
     }
 
     if (!window.toolbar.visible) {
       // adjust browser UI for popups
       gURLBar.setAttribute("readonly", "true");
-      gURLBar.setAttribute("enablehistory", "false");
     }
 
     // Misc. inits.
     TabletModeUpdater.init();
     CombinedStopReload.ensureInitialized();
     gPrivateBrowsingUI.init();
     BrowserPageActions.init();
     gAccessibilityServiceIndicator.init();
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -774,17 +774,16 @@
                      autocompletesearch="unifiedcomplete"
                      autocompletesearchparam="enable-actions"
                      autocompletepopup="PopupAutoCompleteRichResult"
                      completeselectedindex="true"
                      shrinkdelay="250"
                      tabscrolling="true"
                      showcommentcolumn="true"
                      showimagecolumn="true"
-                     enablehistory="true"
                      newlines="stripsurroundingwhitespace"
                      ontextentered="this.handleCommand(param);"
                      ontextreverted="return this.handleRevert();"
                      pageproxystate="invalid">
               <!-- Use onclick instead of normal popup= syntax since the popup
                    code fires onmousedown, and hence eats our favicon drag events. -->
               <box id="identity-box" role="button"
                    align="center"
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -6409,17 +6409,17 @@
       <field name="mTabstripWidth">0</field>
 
       <field name="mTabstrip">
         document.getAnonymousElementByAttribute(this, "anonid", "arrowscrollbox");
       </field>
 
       <field name="_firstTab">null</field>
       <field name="_lastTab">null</field>
-      <field name="_afterSelectedTab">null</field>
+      <field name="_beforeSelectedTab">null</field>
       <field name="_beforeHoveredTab">null</field>
       <field name="_afterHoveredTab">null</field>
       <field name="_hoveredTab">null</field>
       <field name="restoreTabsButton">
         document.getAnonymousElementByAttribute(this, "anonid", "restore-tabs-button");
       </field>
       <field name="_restoreTabsButtonWrapperWidth">0</field>
       <field name="windowUtils">
@@ -6542,35 +6542,35 @@
         <body><![CDATA[
           let visibleTabs = this.tabbrowser.visibleTabs;
 
           if (!visibleTabs.length)
             return;
 
           let selectedIndex = visibleTabs.indexOf(this.selectedItem);
 
-          let lastVisible = visibleTabs.length - 1;
-
-          if (this._afterSelectedTab)
-            this._afterSelectedTab.removeAttribute("afterselected-visible");
-          if (this.selectedItem.closing || selectedIndex == lastVisible) {
-            this._afterSelectedTab = null;
+          if (this._beforeSelectedTab) {
+            this._beforeSelectedTab.removeAttribute("beforeselected-visible");
+          }
+
+          if (this.selectedItem.closing || selectedIndex == 0) {
+            this._beforeSelectedTab = null;
           } else {
-            this._afterSelectedTab = visibleTabs[selectedIndex + 1];
-            this._afterSelectedTab.setAttribute("afterselected-visible",
-                                                "true");
+            this._beforeSelectedTab = visibleTabs[selectedIndex - 1];
+            this._beforeSelectedTab.setAttribute("beforeselected-visible",
+                                                 "true");
           }
 
           if (this._firstTab)
             this._firstTab.removeAttribute("first-visible-tab");
           this._firstTab = visibleTabs[0];
           this._firstTab.setAttribute("first-visible-tab", "true");
           if (this._lastTab)
             this._lastTab.removeAttribute("last-visible-tab");
-          this._lastTab = visibleTabs[lastVisible];
+          this._lastTab = visibleTabs[visibleTabs.length - 1];
           this._lastTab.setAttribute("last-visible-tab", "true");
 
           let hoveredTab = this._hoveredTab;
           if (hoveredTab) {
             hoveredTab._mouseleave();
           }
           hoveredTab = this.querySelector("tab:hover");
           if (hoveredTab) {
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -222,18 +222,16 @@ skip-if = toolkit != "cocoa" # Because o
 [browser_bug580638.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug580956.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug581242.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug581253.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_bug585558.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug585785.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug585830.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug590206.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug592338.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -15,13 +15,14 @@ skip-if = !e10s # Tab spinner is e10s on
 skip-if = os == 'mac'
 [browser_navigatePinnedTab.js]
 [browser_new_file_whitelisted_http_tab.js]
 skip-if = !e10s # Test only relevant for e10s.
 [browser_new_web_tab_in_file_process_pref.js]
 skip-if = !e10s # Pref and test only relevant for e10s.
 [browser_opened_file_tab_navigated_to_web.js]
 [browser_overflowScroll.js]
+[browser_positional_attributes.js]
 [browser_preloadedBrowser_zoom.js]
 [browser_reload_deleted_file.js]
 [browser_tabswitch_updatecommands.js]
 [browser_viewsource_of_data_URI_in_file_process.js]
 [browser_open_newtab_start_observer_notification.js]
rename from browser/base/content/test/general/browser_bug585558.js
rename to browser/base/content/test/tabs/browser_positional_attributes.js
--- a/browser/base/content/test/general/browser_bug585558.js
+++ b/browser/base/content/test/tabs/browser_positional_attributes.js
@@ -7,108 +7,103 @@ var tabs = [];
 function addTab(aURL) {
   tabs.push(gBrowser.addTab(aURL, {skipAnimation: true}));
 }
 
 function testAttrib(elem, attrib, attribValue, msg) {
   is(elem.hasAttribute(attrib), attribValue, msg);
 }
 
-function test() {
-  waitForExplicitFinish();
-
+add_task(async function setup() {
   is(gBrowser.tabs.length, 1, "one tab is open initially");
 
-  // Add several new tabs in sequence, hiding some, to ensure that the
-  // correct attributes get set
-
   addTab("http://mochi.test:8888/#0");
   addTab("http://mochi.test:8888/#1");
   addTab("http://mochi.test:8888/#2");
   addTab("http://mochi.test:8888/#3");
+});
 
+// Add several new tabs in sequence, hiding some, to ensure that the
+// correct attributes get set
+add_task(async function test() {
   gBrowser.selectedTab = gBrowser.tabs[0];
+
   testAttrib(gBrowser.tabs[0], "first-visible-tab", true,
              "First tab marked first-visible-tab!");
   testAttrib(gBrowser.tabs[4], "last-visible-tab", true,
              "Fifth tab marked last-visible-tab!");
   testAttrib(gBrowser.tabs[0], "selected", true, "First tab marked selected!");
-  testAttrib(gBrowser.tabs[0], "afterselected-visible", false,
-             "First tab not marked afterselected-visible!");
-  testAttrib(gBrowser.tabs[1], "afterselected-visible", true,
-             "Second tab marked afterselected-visible!");
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", false,
+             "First tab not marked beforeselected-visible!");
+
+  gBrowser.selectedTab = gBrowser.tabs[2];
+
+  testAttrib(gBrowser.tabs[2], "selected", true, "Third tab marked selected!");
+  testAttrib(gBrowser.tabs[1], "beforeselected-visible", true,
+             "Second tab marked beforeselected-visible!");
+
   gBrowser.hideTab(gBrowser.tabs[1]);
-  executeSoon(test_hideSecond);
-}
 
-function test_hideSecond() {
-  testAttrib(gBrowser.tabs[2], "afterselected-visible", true,
-             "Third tab marked afterselected-visible!");
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", true,
+             "First tab marked beforeselected-visible!");
+
   gBrowser.showTab(gBrowser.tabs[1])
-  executeSoon(test_showSecond);
-}
+
+  testAttrib(gBrowser.tabs[1], "beforeselected-visible", true,
+             "Second tab marked beforeselected-visible!");
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", false,
+             "First tab not marked beforeselected-visible!");
 
-function test_showSecond() {
-  testAttrib(gBrowser.tabs[1], "afterselected-visible", true,
-             "Second tab marked afterselected-visible!");
-  testAttrib(gBrowser.tabs[2], "afterselected-visible", false,
-             "Third tab not marked as afterselected-visible!");
   gBrowser.selectedTab = gBrowser.tabs[1];
+
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", true,
+             "First tab marked beforeselected-visible!");
+
   gBrowser.hideTab(gBrowser.tabs[0]);
-  executeSoon(test_hideFirst);
-}
 
-function test_hideFirst() {
   testAttrib(gBrowser.tabs[0], "first-visible-tab", false,
               "Hidden first tab not marked first-visible-tab!");
   testAttrib(gBrowser.tabs[1], "first-visible-tab", true,
               "Second tab marked first-visible-tab!");
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", false,
+             "First tab not marked beforeselected-visible!");
+
   gBrowser.showTab(gBrowser.tabs[0]);
-  executeSoon(test_showFirst);
-}
 
-function test_showFirst() {
   testAttrib(gBrowser.tabs[0], "first-visible-tab", true,
              "First tab marked first-visible-tab!");
-  gBrowser.selectedTab = gBrowser.tabs[2];
-  testAttrib(gBrowser.tabs[3], "afterselected-visible", true,
-             "Fourth tab marked afterselected-visible!");
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", true,
+             "First tab marked beforeselected-visible!");
 
-  gBrowser.moveTabTo(gBrowser.selectedTab, 1);
-  executeSoon(test_movedLower);
-}
+  gBrowser.moveTabTo(gBrowser.selectedTab, 3);
 
-function test_movedLower() {
-  testAttrib(gBrowser.tabs[2], "afterselected-visible", true,
-             "Third tab marked afterselected-visible!");
-  test_hoverOne();
-}
+  testAttrib(gBrowser.tabs[2], "beforeselected-visible", true,
+             "Third tab marked beforeselected-visible!");
+});
 
-function test_hoverOne() {
+add_task(function test_hoverOne() {
+  gBrowser.selectedTab = gBrowser.tabs[0];
   EventUtils.synthesizeMouseAtCenter(gBrowser.tabs[4], { type: "mousemove" });
   testAttrib(gBrowser.tabs[3], "beforehovered", true, "Fourth tab marked beforehovered");
   EventUtils.synthesizeMouseAtCenter(gBrowser.tabs[3], { type: "mousemove" });
   testAttrib(gBrowser.tabs[2], "beforehovered", true, "Third tab marked beforehovered!");
   testAttrib(gBrowser.tabs[2], "afterhovered", false, "Third tab not marked afterhovered!");
   testAttrib(gBrowser.tabs[4], "afterhovered", true, "Fifth tab marked afterhovered!");
   testAttrib(gBrowser.tabs[4], "beforehovered", false, "Fifth tab not marked beforehovered!");
   testAttrib(gBrowser.tabs[0], "beforehovered", false, "First tab not marked beforehovered!");
   testAttrib(gBrowser.tabs[0], "afterhovered", false, "First tab not marked afterhovered!");
   testAttrib(gBrowser.tabs[1], "beforehovered", false, "Second tab not marked beforehovered!");
   testAttrib(gBrowser.tabs[1], "afterhovered", false, "Second tab not marked afterhovered!");
   testAttrib(gBrowser.tabs[3], "beforehovered", false, "Fourth tab not marked beforehovered!");
   testAttrib(gBrowser.tabs[3], "afterhovered", false, "Fourth tab not marked afterhovered!");
-  gBrowser.removeTab(tabs.pop());
-  executeSoon(test_hoverStatePersistence);
-}
+});
 
-function test_hoverStatePersistence() {
-  // Test that the afterhovered and beforehovered attributes are still there when
-  // a tab is selected and then unselected again. See bug 856107.
-
+// Test that the afterhovered and beforehovered attributes are still there when
+// a tab is selected and then unselected again. See bug 856107.
+add_task(function test_hoverStatePersistence() {
   function assertState() {
     testAttrib(gBrowser.tabs[0], "beforehovered", true, "First tab still marked beforehovered!");
     testAttrib(gBrowser.tabs[0], "afterhovered", false, "First tab not marked afterhovered!");
     testAttrib(gBrowser.tabs[2], "afterhovered", true, "Third tab still marked afterhovered!");
     testAttrib(gBrowser.tabs[2], "beforehovered", false, "Third tab not marked afterhovered!");
     testAttrib(gBrowser.tabs[1], "beforehovered", false, "Second tab not marked beforehovered!");
     testAttrib(gBrowser.tabs[1], "afterhovered", false, "Second tab not marked afterhovered!");
     testAttrib(gBrowser.tabs[3], "beforehovered", false, "Fourth tab not marked beforehovered!");
@@ -117,37 +112,35 @@ function test_hoverStatePersistence() {
 
   gBrowser.selectedTab = gBrowser.tabs[3];
   EventUtils.synthesizeMouseAtCenter(gBrowser.tabs[1], { type: "mousemove" });
   assertState();
   gBrowser.selectedTab = gBrowser.tabs[1];
   assertState();
   gBrowser.selectedTab = gBrowser.tabs[3];
   assertState();
-  executeSoon(test_pinning);
-}
+});
 
-function test_pinning() {
+add_task(function test_pinning() {
+  gBrowser.removeTab(tabs.pop());
   gBrowser.selectedTab = gBrowser.tabs[3];
   testAttrib(gBrowser.tabs[3], "last-visible-tab", true,
              "Fourth tab marked last-visible-tab!");
   testAttrib(gBrowser.tabs[3], "selected", true, "Fourth tab marked selected!");
-  testAttrib(gBrowser.tabs[3], "afterselected-visible", false,
-             "Fourth tab not marked afterselected-visible!");
+  testAttrib(gBrowser.tabs[2], "beforeselected-visible", true,
+             "Third tab marked beforeselected-visible!");
   // Causes gBrowser.tabs to change indices
   gBrowser.pinTab(gBrowser.tabs[3]);
   testAttrib(gBrowser.tabs[3], "last-visible-tab", true,
              "Fourth tab marked last-visible-tab!");
-  testAttrib(gBrowser.tabs[1], "afterselected-visible", true,
-             "Second tab marked afterselected-visible!");
   testAttrib(gBrowser.tabs[0], "first-visible-tab", true,
              "First tab marked first-visible-tab!");
+  testAttrib(gBrowser.tabs[2], "beforeselected-visible", false,
+             "Third tab not marked beforeselected-visible!");
   testAttrib(gBrowser.tabs[0], "selected", true, "First tab marked selected!");
   gBrowser.selectedTab = gBrowser.tabs[1];
-  testAttrib(gBrowser.tabs[2], "afterselected-visible", true,
-             "Third tab marked afterselected-visible!");
-  test_cleanUp();
-}
+  testAttrib(gBrowser.tabs[0], "beforeselected-visible", true,
+             "First tab marked beforeselected-visible!");
+});
 
-function test_cleanUp() {
+add_task(function cleanup() {
   tabs.forEach(gBrowser.removeTab, gBrowser);
-  finish();
-}
+});
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -43,20 +43,20 @@ file, You can obtain one at http://mozil
                       xbl:inherits="tooltiptext=inputtooltiptext,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
         </xul:hbox>
         <xul:image anonid="urlbar-go-button"
                    class="urlbar-go-button urlbar-icon"
                    onclick="gURLBar.handleCommand(event);"
                    tooltiptext="&goEndCap.tooltip;"
                    xbl:inherits="pageproxystate,parentfocused=focused,usertyping"/>
         <xul:dropmarker anonid="historydropmarker"
-                        class="autocomplete-history-dropmarker urlbar-history-dropmarker urlbar-icon"
+                        class="urlbar-history-dropmarker urlbar-icon chromeclass-toolbar-additional"
                         tooltiptext="&urlbar.openHistoryPopup.tooltip;"
                         allowevents="true"
-                        xbl:inherits="open,enablehistory,parentfocused=focused,usertyping"/>
+                        xbl:inherits="open,parentfocused=focused,usertyping"/>
         <children includes="hbox"/>
       </xul:hbox>
       <xul:popupset anonid="popupset"
                     class="autocomplete-result-popupset"/>
       <children includes="toolbarbutton"/>
     </content>
 
     <implementation implements="nsIObserver, nsIDOMEventListener">
@@ -124,16 +124,26 @@ file, You can obtain one at http://mozil
               "gURLBar.select(); goDoCommand('cmd_paste'); gURLBar.handleCommand();");
           cxmenu.insertBefore(pasteAndGo, insertLocation.nextSibling);
         }
 
         this.popup.addEventListener("popupshowing", () => {
           this._enableOrDisableOneOffSearches();
         }, {capturing: true, once: true});
 
+        // history dropmarker open state
+        this.popup.addEventListener("popupshowing", () => {
+          this.setAttribute("open", "true");
+        });
+        this.popup.addEventListener("popuphidden", () => {
+          requestAnimationFrame(() => {
+            this.removeAttribute("open");
+          });
+        });
+
         // The autocomplete controller uses heuristic on some internal caches
         // to handle cases like backspace, autofill or repeated searches.
         // Ensure to clear those internal caches when switching tabs.
         gBrowser.tabContainer.addEventListener("TabSelect", this);
       ]]></constructor>
 
       <destructor><![CDATA[
         this._prefs.removeObserver("", this);
@@ -1506,20 +1516,26 @@ file, You can obtain one at http://mozil
             this._pressedNoActionKeys.has(event.keyCode)) {
           this._pressedNoActionKeys.delete(event.keyCode);
           if (this._pressedNoActionKeys.size == 0)
             this._clearNoActions();
         }
       ]]></handler>
 
       <handler event="mousedown"><![CDATA[
-        // Eventually show the opt-out notification even if the location bar is
-        // empty, focused, and the user clicks on it.
-        if (event.button == 0 && this.focused && this.textValue == "") {
-          this.maybeShowSearchSuggestionsNotificationOnFocus(true);
+        if (event.button == 0) {
+          if (event.originalTarget.getAttribute("anonid") == "historydropmarker") {
+            this.toggleHistoryPopup();
+          }
+
+          // Eventually show the opt-out notification even if the location bar is
+          // empty, focused, and the user clicks on it.
+          if (this.focused && this.textValue == "") {
+            this.maybeShowSearchSuggestionsNotificationOnFocus(true);
+          }
         }
       ]]></handler>
 
       <handler event="focus"><![CDATA[
         if (event.originalTarget == this.inputField) {
           this._hideURLTooltip();
           this.formatValue();
           if (this.getAttribute("pageproxystate") != "valid") {
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -443,16 +443,21 @@ function openLinkIn(url, where, params) 
     targetBrowser.loadURIWithFlags(url, {
       triggeringPrincipal: aTriggeringPrincipal,
       flags,
       referrerURI: aNoReferrer ? null : aReferrerURI,
       referrerPolicy: aReferrerPolicy,
       postData: aPostData,
       userContextId: aUserContextId
     });
+
+    // Don't focus the content area if focus is in the address bar and we're
+    // loading the New Tab page.
+    focusUrlBar = w.document.activeElement == w.gURLBar.inputField &&
+                  w.isBlankPageURL(url);
     break;
   case "tabshifted":
     loadInBackground = !loadInBackground;
     // fall through
   case "tab":
     focusUrlBar = !loadInBackground && w.isBlankPageURL(url);
 
     let tabUsedForLoad = w.gBrowser.loadOneTab(url, {
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -339,16 +339,17 @@ this.PanelMultiView = class {
     });
   }
 
   destructor() {
     // Guard against re-entrancy.
     if (!this.node)
       return;
 
+    this._cleanupTransitionPhase();
     if (this._ephemeral)
       this.hideAllViewsExcept(null);
     let mainView = this._mainView;
     if (mainView) {
       if (this._panelViewCache)
         this._panelViewCache.appendChild(mainView);
       mainView.removeAttribute("mainview");
     }
@@ -738,35 +739,46 @@ this.PanelMultiView = class {
         // to transition, so we make sure to do all the work on the transform
         // transition-end, because that is guaranteed to happen.
         if (ev.target != this._viewStack || ev.propertyName != "transform")
           return;
         this._viewContainer.removeEventListener("transitionend", details.listener);
         delete details.listener;
         resolve();
       });
+      this._viewContainer.addEventListener("transitioncancel", details.cancelListener = ev => {
+        if (ev.target != this._viewStack)
+          return;
+        this._viewContainer.removeEventListener("transitioncancel", details.cancelListener);
+        delete details.cancelListener;
+        resolve();
+      });
     });
 
     details.phase = TRANSITION_PHASES.END;
 
     await this._cleanupTransitionPhase(details);
   }
 
   /**
    * Attempt to clean up the attributes and properties set by `_transitionViews`
    * above. Which attributes and properties depends on the phase the transition
    * was left from - normally that'd be `TRANSITION_PHASES.END`.
+   *
+   * @param {Object} details Dictionary object containing details of the transition
+   *                         that should be cleaned up after. Defaults to the most
+   *                         recent details.
    */
   async _cleanupTransitionPhase(details = this._transitionDetails) {
-    // Make sure to only clean up a phase from the most recent transition.
-    if (!this._transitionDetails || details != this._transitionDetails)
+    if (!details || !this.node)
       return;
 
-    let {phase, previousViewNode, viewNode, reverse, resolve, listener, anchor} = this._transitionDetails;
-    this._transitionDetails = null;
+    let {phase, previousViewNode, viewNode, reverse, resolve, listener, cancelListener, anchor} = details;
+    if (details == this._transitionDetails)
+      this._transitionDetails = null;
 
     // Do the things we _always_ need to do whenever the transition ends or is
     // interrupted.
     this.hideAllViewsExcept(viewNode);
     previousViewNode.removeAttribute("in-transition");
     viewNode.removeAttribute("in-transition");
     if (reverse)
       this._resetKeyNavigation(previousViewNode);
@@ -796,16 +808,18 @@ this.PanelMultiView = class {
       deepestNode.style.removeProperty("border-inline-start");
       this._viewStack.style.removeProperty("transition");
     }
     if (phase >= TRANSITION_PHASES.TRANSITION) {
       this._viewStack.style.removeProperty("transform");
       viewNode.style.removeProperty("width");
       if (listener)
         this._viewContainer.removeEventListener("transitionend", listener);
+      if (cancelListener)
+        this._viewContainer.removeEventListener("transitioncancel", cancelListener);
       if (resolve)
         resolve();
     }
     if (phase >= TRANSITION_PHASES.END) {
       // We force 'display: none' on the previous view node to make sure that it
       // doesn't cause an annoying flicker whilst resetting the styles above.
       previousViewNode.style.display = "none";
       await BrowserUtils.promiseLayoutFlushed(this.document, "layout", () => {});
--- a/browser/components/search/test/browser.ini
+++ b/browser/components/search/test/browser.ini
@@ -18,16 +18,17 @@ support-files =
 [browser_483086.js]
 [browser_addEngine.js]
 [browser_amazon.js]
 [browser_bing.js]
 [browser_contextmenu.js]
 [browser_contextSearchTabPosition.js]
 skip-if = os == "mac" # bug 967013
 [browser_ddg.js]
+[browser_eBay.js]
 [browser_google.js]
 skip-if = artifact # bug 1315953
 [browser_google_codes.js]
 skip-if = artifact # bug 1315953
 [browser_google_nocodes.js]
 skip-if = artifact # bug 1315953
 [browser_google_behavior.js]
 skip-if = artifact # bug 1315953
new file mode 100644
--- /dev/null
+++ b/browser/components/search/test/browser_eBay.js
@@ -0,0 +1,71 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/*
+ * Test eBay search plugin URLs
+ */
+
+"use strict";
+
+const BROWSER_SEARCH_PREF = "browser.search.";
+
+function test() {
+  let engine = Services.search.getEngineByName("eBay");
+  ok(engine, "eBay");
+
+  let base = "https://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=20004&campid=5338192028&customid=&mpre=https://www.ebay.com/sch/foo";
+  let url;
+
+  // Test search URLs (including purposes).
+  url = engine.getSubmission("foo").uri.spec;
+  is(url, base, "Check search URL for 'foo'");
+
+  // Check all other engine properties.
+  const EXPECTED_ENGINE = {
+    name: "eBay",
+    alias: null,
+    description: "eBay - Online auctions",
+    searchForm: "https://www.ebay.com/",
+    hidden: false,
+    wrappedJSObject: {
+      "_iconURL": "resource://search-plugins/images/ebay.ico",
+      _urls: [
+        {
+          type: "text/html",
+          method: "GET",
+          template: "https://rover.ebay.com/rover/1/711-53200-19255-0/1",
+          params: [
+            {
+              name: "ff3",
+              value: "4",
+              purpose: undefined,
+            },
+            {
+              name: "toolid",
+              value: "20004",
+              purpose: undefined,
+            },
+            {
+              name: "campid",
+              value: "5338192028",
+              purpose: undefined,
+            },
+            {
+              name: "customid",
+              value: "",
+              purpose: undefined,
+            },
+            {
+              name: "mpre",
+              value: "https://www.ebay.com/sch/{searchTerms}",
+              purpose: undefined,
+            },
+          ],
+          mozparams: {},
+        },
+      ],
+    },
+  };
+
+  isSubObjectOf(EXPECTED_ENGINE, engine, "eBay");
+}
--- a/browser/components/search/test/browser_searchEngine_behaviors.js
+++ b/browser/components/search/test/browser_searchEngine_behaviors.js
@@ -33,16 +33,26 @@ const SEARCH_ENGINE_DETAILS = [{
   codes: {
     context: "&t=ffcm",
     keyword: "&t=ffab",
     newTab: "&t=ffnt",
     submission: "&t=ffsb",
   },
   name: "DuckDuckGo",
 }, {
+  alias: "e",
+  baseURL: "https://rover.ebay.com/rover/1/711-53200-19255-0/1?ff3=4&toolid=20004&campid=5338192028&customid=&mpre=https://www.ebay.com/sch/foo",
+  codes: {
+    context: "",
+    keyword: "",
+    newTab: "",
+    submission: "",
+  },
+  name: "eBay",
+}, {
 // TODO: Google is tested in browser_google_behaviors.js - we can't test it here
 // yet because of bug 1315953.
 //   alias: "g",
 //   baseURL: "https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8",
 //   codes: {
 //     context: "",
 //     keyword: "",
 //     newTab: "",
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -3967,23 +3967,21 @@ var SessionStoreInternal = {
     WINDOW_HIDEABLE_FEATURES.forEach(function(aItem) {
       aWindow[aItem].visible = hidden.indexOf(aItem) == -1;
     });
 
     if (aWinData.isPopup) {
       this._windows[aWindow.__SSi].isPopup = true;
       if (aWindow.gURLBar) {
         aWindow.gURLBar.readOnly = true;
-        aWindow.gURLBar.setAttribute("enablehistory", "false");
       }
     } else {
       delete this._windows[aWindow.__SSi].isPopup;
       if (aWindow.gURLBar) {
         aWindow.gURLBar.readOnly = false;
-        aWindow.gURLBar.setAttribute("enablehistory", "true");
       }
     }
 
     aWindow.setTimeout(() => {
       this.restoreDimensions(aWindow,
         +(aWinData.width || 0),
         +(aWinData.height || 0),
         "screenX" in aWinData ? +aWinData.screenX : NaN,
--- a/browser/components/sessionstore/test/browser_495495.js
+++ b/browser/components/sessionstore/test/browser_495495.js
@@ -18,29 +18,25 @@ function test() {
         let state2 = ss.getWindowState(newWin);
 
         function testState(state, expected, callback) {
           let win = openDialog(location, "_blank", "chrome,all,dialog=no");
           promiseWindowLoaded(win).then(() => {
 
             is(win.gURLBar.readOnly, false,
                "URL bar should not be read-only before setting the state");
-            is(win.gURLBar.getAttribute("enablehistory"), "true",
-               "URL bar autocomplete should be enabled before setting the state");
             ss.setWindowState(win, state, true);
             is(win.gURLBar.readOnly, expected.readOnly,
                "URL bar read-only state should be restored correctly");
-            is(win.gURLBar.getAttribute("enablehistory"), expected.enablehistory,
-               "URL bar autocomplete state should be restored correctly");
 
             BrowserTestUtils.closeWindow(win).then(callback);
           });
         }
 
         BrowserTestUtils.closeWindow(newWin).then(() => {
-          testState(state1, {readOnly: false, enablehistory: "true"}, function() {
-            testState(state2, {readOnly: true, enablehistory: "false"}, finish);
+          testState(state1, {readOnly: false}, function() {
+            testState(state2, {readOnly: true}, finish);
           });
         });
       });
     });
   });
 }
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -93,16 +93,17 @@
 #if BUILD_FASTER
     locale/browser/searchplugins/               (searchplugins/*.xml)
     locale/browser/searchplugins/list.json      (search/list.json)
 #else
     locale/browser/searchplugins/               (.deps/generated_@AB_CD@/*.xml)
     locale/browser/searchplugins/list.json      (.deps/generated_@AB_CD@/list.json)
 #endif
     locale/browser/searchplugins/images/amazon.ico     (searchplugins/images/amazon.ico)
+    locale/browser/searchplugins/images/ebay.ico       (searchplugins/images/ebay.ico)
     locale/browser/searchplugins/images/wikipedia.ico  (searchplugins/images/wikipedia.ico)
     locale/browser/searchplugins/images/yahoo.ico      (searchplugins/images/yahoo.ico)
     locale/browser/searchplugins/images/yandex-en.ico  (searchplugins/images/yandex-en.ico)
     locale/browser/searchplugins/images/yandex-ru.ico  (searchplugins/images/yandex-ru.ico)
 % locale browser-region @AB_CD@ %locale/browser-region/
     locale/browser-region/region.properties        (%chrome/browser-region/region.properties)
 # the following files are browser-specific overrides
     locale/browser/netError.dtd                (%chrome/overrides/netError.dtd)
--- a/browser/locales/search/list.json
+++ b/browser/locales/search/list.json
@@ -4,17 +4,19 @@
       "google", "yahoo", "amazondotcom", "bing", "ddg", "twitter", "wikipedia"
     ]
   },
   "regionOverrides": {
     "US": {
       "google": "google-nocodes"
     },
     "CA": {
-      "google": "google-nocodes"
+      "google": "google-nocodes",
+      "ebay": "ebay-ca",
+      "ebay-fr": "ebay-ca"
     },
     "KZ": {
       "google": "google-nocodes"
     },
     "BY": {
       "google": "google-nocodes"
     },
     "RU": {
@@ -26,23 +28,50 @@
     "CN": {
       "google": "google-nocodes"
     },
     "TW": {
       "google": "google-nocodes"
     },
     "HK": {
       "google": "google-nocodes"
+    },
+    "AT": {
+      "ebay-de": "ebay-at"
+    },
+    "AU": {
+      "ebay": "ebay-au",
+      "ebay-uk": "ebay-au"
+    },
+    "BE": {
+      "ebay": "ebay-be",
+      "ebay-nl": "ebay-be",
+      "ebay-fr": "ebay-be"
+    },
+    "CH": {
+      "ebay": "ebay-ch",
+      "ebay-de": "ebay-ch",
+      "ebay-fr": "ebay-ch"
+    },
+    "IE": {
+      "ebay": "ebay-ie",
+      "ebay-uk": "ebay-ie"
+    },
+    "NL": {
+      "ebay": "ebay-nl"
+    },
+    "GB": {
+      "ebay": "ebay-gb"
     }
   },
   "locales": {
     "en-US": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo", "amazondotcom", "bing", "ddg", "twitter", "wikipedia"
+          "google", "yahoo", "amazondotcom", "bing", "ddg", "ebay", "twitter", "wikipedia"
         ]
       },
       "experimental-hidden": {
         "visibleDefaultEngines": [
           "yahoo-en-CA", "yandex-en"
         ]
       }
     },
@@ -58,17 +87,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "amazondotcom", "ddg", "wikipedia-af"
         ]
       }
     },
     "an": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-es", "bing", "wikipedia-an", "ddg", "twitter"
+          "google", "yahoo-es", "bing", "ebay-es", "wikipedia-an", "ddg", "twitter"
         ]
       }
     },
     "ar": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "amazondotcom", "ddg", "wikipedia-ar"
         ]
@@ -79,17 +108,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo-in", "amazondotcom", "ddg", "wikipedia-as"
         ]
       }
     },
     "ast": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-es", "bing", "diccionariu-alla", "ddg", "wikipedia-ast"
+          "google", "yahoo-es", "bing", "diccionariu-alla", "ddg", "ebay-es", "wikipedia-ast"
         ]
       }
     },
     "az": {
       "default": {
         "visibleDefaultEngines": [
           "google", "amazondotcom", "azerdict", "bing", "ddg", "wikipedia-az", "yandex-az"
         ]
@@ -121,31 +150,31 @@
         "visibleDefaultEngines": [
           "google", "yahoo-in", "amazondotcom", "bing", "ddg", "rediff", "wikipedia-bn"
         ]
       }
     },
     "br": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-france", "amazon-france", "ddg", "freelang", "klask", "wikipedia-br"
+          "google", "yahoo-france", "amazon-france", "ddg", "ebay-fr", "freelang", "klask", "wikipedia-br"
         ]
       }
     },
     "bs": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "ddg", "olx", "twitter", "wikipedia-bs"
         ]
       }
     },
     "ca": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "bing", "diec2", "ddg", "twitter", "wikipedia-ca"
+          "google", "bing", "diec2", "ddg", "ebay-es", "twitter", "wikipedia-ca"
         ]
       }
     },
     "cak": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo-espanol", "bing", "amazondotcom", "ddg", "wikipedia-es"
         ]
@@ -156,52 +185,52 @@
         "visibleDefaultEngines": [
           "google", "seznam-cz", "ddg", "heureka-cz", "mapy-cz", "wikipedia-cz"
         ]
       }
     },
     "cy": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-en-GB", "amazon-en-GB", "ddg", "palasprint", "termau", "wikipedia-cy"
+          "google", "yahoo-en-GB", "amazon-en-GB", "ddg", "ebay-uk", "palasprint", "termau", "wikipedia-cy"
         ]
       }
     },
     "da": {
       "default": {
         "visibleDefaultEngines": [
           "google", "bing", "amazon-en-GB", "ddg", "wikipedia-da"
         ]
       }
     },
     "de": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-de", "amazondotcom-de", "bing", "ddg", "leo_ende_de", "wikipedia-de"
+          "google", "yahoo-de", "amazondotcom-de", "bing", "ddg", "ebay-de", "leo_ende_de", "wikipedia-de"
         ]
       }
     },
     "dsb": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "leo_ende_de", "wikipedia-dsb"
+          "google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-dsb"
         ]
       }
     },
     "el": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "amazon-en-GB", "bing", "ddg", "wikipedia-el"
         ]
       }
     },
     "en-GB": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-en-GB", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "twitter", "wikipedia"
+          "google", "yahoo-en-GB", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "twitter", "wikipedia"
         ]
       },
       "experimental-hidden": {
         "visibleDefaultEngines": [
           "yandex-en"
         ]
       }
     },
@@ -231,17 +260,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo-cl", "bing", "drae", "ddg", "mercadolibre-cl", "wikipedia-es"
         ]
       }
     },
     "es-ES": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-es", "bing", "drae", "ddg", "twitter", "wikipedia-es"
+          "google", "yahoo-es", "bing", "drae", "ddg", "ebay-es", "twitter", "wikipedia-es"
         ]
       }
     },
     "es-MX": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo-mx", "bing", "ddg", "mercadolibre-mx", "wikipedia-es"
         ]
@@ -252,17 +281,17 @@
         "visibleDefaultEngines": [
           "google", "neti-ee", "ddg", "osta-ee", "wikipedia-et", "eki-ee"
         ]
       }
     },
     "eu": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo", "bing", "amazon-en-GB", "ddg", "elebila", "wikipedia-eu"
+          "google", "yahoo", "bing", "amazon-en-GB", "ddg", "ebay-es", "elebila", "wikipedia-eu"
         ]
       }
     },
     "fa": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "amazondotcom", "bing", "ddg", "wikipedia-fa"
         ]
@@ -280,45 +309,45 @@
         "visibleDefaultEngines": [
           "google", "yahoo-fi", "bing", "bookplus-fi", "ddg", "wikipedia-fi"
         ]
       }
     },
     "fr": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-france", "bing", "amazon-france", "ddg", "cnrtl-tlfi-fr", "wikipedia-fr"
+          "google", "yahoo-france", "bing", "amazon-france", "ddg", "ebay-fr", "cnrtl-tlfi-fr", "wikipedia-fr"
         ]
       }
     },
     "fy-NL": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-fy-NL", "bing", "bolcom-fy-NL", "ddg", "marktplaats-fy-NL", "wikipedia-fy-NL"
+          "google", "yahoo-fy-NL", "bing", "bolcom-fy-NL", "ddg", "ebay-nl", "marktplaats-fy-NL", "wikipedia-fy-NL"
         ]
       }
     },
     "ga-IE": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-en-GB", "amazon-en-GB", "ddg", "tearma", "twitter", "wikipedia-ga-IE"
+          "google", "yahoo-en-GB", "amazon-en-GB", "ddg", "ebay-ie", "tearma", "twitter", "wikipedia-ga-IE"
         ]
       }
     },
     "gd": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-en-GB", "faclair-beag", "amazon-en-GB", "bbc-alba", "ddg", "wikipedia-gd"
+          "google", "yahoo-en-GB", "amazon-en-GB", "bbc-alba", "ddg", "ebay-uk", "faclair-beag", "wikipedia-gd"
         ]
       }
     },
     "gl": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-es", "amazon-en-GB", "ddg", "wikipedia-gl"
+          "google", "yahoo-es", "amazon-en-GB", "ddg", "ebay-es", "wikipedia-gl"
         ]
       }
     },
     "gn": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo-es", "bing", "amazondotcom", "ddg", "twitter", "wikipedia-gn"
         ]
@@ -350,17 +379,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo", "amazon-en-GB", "bing", "ddg", "eudict", "twitter", "wikipedia-hr"
         ]
       }
     },
     "hsb": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "leo_ende_de", "wikipedia-hsb"
+          "google", "yahoo-de", "bing", "amazondotcom-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-hsb"
         ]
       }
     },
     "hu": {
       "default": {
         "visibleDefaultEngines": [
           "google", "ddg", "sztaki-en-hu", "vatera", "wikipedia-hu"
         ]
@@ -392,17 +421,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "amazondotcom", "ddg", "leit-is", "wikipedia-is"
         ]
       }
     },
     "it": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-it", "bing", "amazon-it", "ddg", "hoepli", "wikipedia-it"
+          "google", "yahoo-it", "bing", "amazon-it", "ddg", "ebay-it", "hoepli", "wikipedia-it"
         ]
       }
     },
     "ja-JP-mac": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "twitter-ja", "wikipedia-ja", "ddg"
         ]
@@ -455,17 +484,17 @@
         "visibleDefaultEngines": [
           "google", "ddg", "naver-kr", "danawa-kr", "daum-kr", "wikipedia-kr"
         ]
       }
     },
     "lij": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-it", "bing", "amazon-it", "ddg", "paroledigenova-lij", "wikipedia-lij"
+          "google", "yahoo-it", "bing", "amazon-it", "ddg", "ebay-it", "paroledigenova-lij", "wikipedia-lij"
         ]
       }
     },
     "lo": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "ddg", "wikipedia-lo", "twitter"
         ]
@@ -546,17 +575,17 @@
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "ddg", "twitter", "wikipedia-ne"
         ]
       }
     },
     "nl": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "bing", "bolcom-nl", "ddg", "marktplaats-nl", "wikipedia-nl"
+          "google", "bing", "bolcom-nl", "ddg", "ebay-nl", "marktplaats-nl", "wikipedia-nl"
         ]
       }
     },
     "nn-NO": {
       "default": {
         "visibleDefaultEngines": [
           "google", "bing", "amazon-en-GB", "ddg", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NN"
         ]
@@ -595,17 +624,17 @@
         "visibleDefaultEngines": [
           "google", "amazon-en-GB", "ddg", "priberam", "sapo", "wikipedia-pt"
         ]
       }
     },
     "rm": {
       "default": {
         "visibleDefaultEngines": [
-          "google", "yahoo-ch", "bing", "ddg", "leo_ende_de-rm", "pledarigrond", "wikipedia-rm"
+          "google", "yahoo-ch", "bing", "ddg", "ebay-ch", "leo_ende_de-rm", "pledarigrond", "wikipedia-rm"
         ]
       }
     },
     "ro": {
       "default": {
         "visibleDefaultEngines": [
           "google", "yahoo", "bing", "amazondotcom", "ddg", "wikipediaro"
         ]
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-at.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5221-53469-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.at/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.at/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-au.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/705-53470-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.com.au/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.com.au/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-be.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1553-53471-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.befr.ebay.be/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.at/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-ca.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/706-53473-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.ca/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.ca/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-ch.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5222-53480-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.ch/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.ch/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-de.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/707-53477-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.de/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.de/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-es.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1185-53479-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.es/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.es/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-fr.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/709-53476-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.fr/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.fr/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-ie.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/5282-53468-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.ie/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.ie/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-it.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/724-53478-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.it/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.it/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-nl.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/1346-53482-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.nl/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.nl/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay-uk.xml
@@ -0,0 +1,19 @@
+<!-- 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/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/710-53481-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.co.uk/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.co.uk/</SearchForm>
+</SearchPlugin>
+
+
new file mode 100644
--- /dev/null
+++ b/browser/locales/searchplugins/ebay.xml
@@ -0,0 +1,17 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online auctions</Description>
+<Image width="16" height="16">resource://search-plugins/images/ebay.ico</Image>
+<Url type="text/html" method="GET" template="https://rover.ebay.com/rover/1/711-53200-19255-0/1" resultdomain="ebay.com">
+  <Param name="ff3" value="4"/>
+  <Param name="toolid" value="20004"/>
+  <Param name="campid" value="5338192028"/>
+  <Param name="customid" value=""/>
+  <Param name="mpre" value="https://www.ebay.com/sch/{searchTerms}" />
+</Url>
+<SearchForm>https://www.ebay.com/</SearchForm>
+</SearchPlugin>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..92d0d46e60c8eb3742277512594a6def0019d08d
GIT binary patch
literal 1128
zc$@)f1ef~&0096301yxW009690ILB2044wc03aX$009690G9#)0MP*e0EtjeM-2)Z
z3IG5A4M|8uQUCw|5C8xG5C{eU001BJ|6u?C0dh%1K~y-6m69=X6G0F~U(d9(5|r`U
zc+0Rvs2re#ghWLtRY<0kbEwdbd<S2`Hz0(9l5AYwlF{rm!N``^tc>|l_w=9Nzk3FD
zU_2gMp68b5xs666+r?`|S(Y}R&l{JDqIjCfbUL-!Y}QJiOeX&p84ia#NrS=QubR9)
zIk`K$34!n5zH+!%v<fV)esFyFhJM!H3iP0%y6QY{T-wv?MqWMeAm{Ht7=Sn9()aoF
z?h6auhZ^>?Uz~mXOqneR(QzYi+B=}a-3jQcPB#Ts)6)$9tN=Yo)lSCim!2{Mh*UW8
zo}l7!8z&lU6PXaqAcmCJ0r7!#fLb9$$6ACsK(t8QIM{l*4@)BEw6%O6?E<$8x^?pi
zR7FxiL`A?Uh=NZJ)Pwf`5p@o);Kbo#8bX&Lb@3LtV2!OVVB_5COO{tge+_kXtVFo}
zZB!VL8q1N>#>@WfzGzrH>MjwtrBqIuWAfl5{VyI};#2Sk%dUCo_ZIT;00000NkvXX
zu0mjfiBL{Q4GJ0x0000DNk~Le0000W0000W2nGNE0CReJ^Z)<?UP(kjR9J=Wma$UX
zKoEw%y*oK)T*OI+Ny3aWLqWPU>C#a70n$;ygwiw2(52EN<qh%-c?Rk*q#zCqSf|?*
zLbhWh%NQIQ{^oRZtKEP9+g%A(z;HO!?d@#^6wowH_3-deSMhZxWLc)YUT+fEd#~R6
z$=*4q$H&L(A+oo(Hwjdi?Ql3$=bQpM7z`ekM3!X=XuscYb)2SYBgvKFoU5{13NzQ#
z3e#qgWtoN$*x%n@Ha<s3M*tig9Nb@p-QC@#vzbHHDfh!nyWI)>e!uFFg^-<{okpV&
z0w*UY0Bmh-VXdVoipg4Geh+YZdP)d^G)?i|Hxpnrc^?d|MYwLb4UvTgm!`Y$d?UG}
z&O;?@Xdxg!K76db0;iFY^?ZK+m9ymKjn^A@;sEH{KYai6g|vIdIQ}c90mcH~IxjdE
zgKHq*($2G*;AKILtjG1<fZv1|Z%7m%7L37~-=v$4cU_1zX<Q4u@)j!=+fZsQ*Xcnb
zLas`VArYZK%B+ignti2&Iv_9(5Y=#1qjfGq$RmXqAfnbF#dNKdn!YeYMyrgW%y<Ec
zS=$Auf>!G-0=FFNjO;7G+4c@!Ya51Qafhv)K%(nZpswuakhjd3`w^IdHT7=(TMaaI
z!K2r}GFTgd#4I-(T+&b|j))ag&i%SUWGonmwUAhVh&6_50aujI4lT{3Ia7CD)PJv>
zDkE|<9|0X;ZWyT{78i^zlyik~oc*;B49c|_E`x9-imm--g1mK!#+pNe5)poOo;PqW
u@!J2wa$D{KgC%m&(uz-iL{9`BoxoqgO7D9`o)|;`0000<MNUMnLSTXdh59W3
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -152,35 +152,29 @@ menuitem.bookmark-item {
   list-style-image: url("chrome://global/skin/icons/Restore.gif");
 }
 #close-button {
   list-style-image: url("chrome://global/skin/icons/Close.gif");
 }
 
 /* Location bar */
 
-#urlbar {
-  /* override textbox[enablehistory="true"] styling: */
-  background-color: -moz-field;
-}
-
 %include ../shared/urlbar-searchbar.inc.css
 
 #urlbar:not(:-moz-lwtheme):not([focused="true"]),
 .searchbar-textbox:not(:-moz-lwtheme):not([focused="true"]) {
   border-color: ThreeDShadow;
 }
 
 #urlbar[focused="true"],
 .searchbar-textbox[focused="true"] {
   border-color: Highlight;
 }
 
 .urlbar-textbox-container {
-  -moz-appearance: none;
   -moz-box-align: stretch;
 }
 
 /* ::::: URL Bar Zoom Reset Button ::::: */
 @keyframes urlbar-zoom-reset-pulse {
   0% {
     transform: scale(0);
   }
@@ -549,22 +543,27 @@ html|span.ac-emphasize-text-url {
   margin-bottom: calc(-1 * var(--tab-toolbar-navbar-overlap));
 }
 
 #TabsToolbar:not(:-moz-lwtheme) {
   -moz-appearance: menubar;
   color: -moz-menubartext;
 }
 
-#nav-bar,
-#toolbar-menubar:not([autohide="true"]):not(:-moz-lwtheme):-moz-system-metric(menubar-drag),
-#TabsToolbar:not(:-moz-lwtheme):-moz-system-metric(menubar-drag) {
+#nav-bar {
   -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
 }
 
+@media (-moz-menubar-drag) {
+  #toolbar-menubar:not([autohide="true"]):not(:-moz-lwtheme),
+  #TabsToolbar:not(:-moz-lwtheme) {
+    -moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
+  }
+}
+
 .tabbrowser-tab:focus > .tab-stack > .tab-content {
   outline: 1px dotted;
   outline-offset: -6px;
 }
 
 #context_reloadTab {
   list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
 }
--- a/browser/themes/linux/places/organizer.css
+++ b/browser/themes/linux/places/organizer.css
@@ -3,18 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 /* Toolbar */
 #placesToolbar {
   -moz-appearance: menubar;
 }
 
-#placesToolbar:-moz-system-metric(menubar-drag) {
-  -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
+@media (-moz-menubar-drag) {
+  #placesToolbar {
+    -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
+  }
 }
 
 #placesToolbar > toolbarbutton {
   color: -moz-menubartext;
 }
 
 #placesToolbar > toolbarbutton:hover {
   color: ButtonText;
--- a/browser/themes/shared/tabs.inc.css
+++ b/browser/themes/shared/tabs.inc.css
@@ -454,28 +454,16 @@ tabbrowser {
 
 .tab-background[selected=true] {
   border-top-color: var(--tabs-border);
   background-color: var(--toolbar-bgcolor);
   background-image: var(--toolbar-bgimage);
   background-repeat: repeat-x;
 }
 
-/* Hide the selected tab's start border when it's adjacent to the window border
-   or to .titlebar-placeholder[type="pre-tabs"] which has its own border. */
-%ifdef CAN_DRAW_IN_TITLEBAR
-%define tabContainerAsFirstChild .titlebar-placeholder[type="pre-tabs"] + #tabbrowser-tabs
-%else
-%define tabContainerAsFirstChild #tabbrowser-tabs:first-child
-%endif
-@tabContainerAsFirstChild@:not([overflow=true]) > .tabbrowser-tab[first-visible-tab] > .tab-stack > .tab-background[selected=true],
-@tabContainerAsFirstChild@ > .tabbrowser-tab[first-visible-tab][pinned] > .tab-stack > .tab-background[selected=true] {
-  border-inline-start-style: none;
-}
-
 .tab-line[selected=true] {
   background-color: var(--tab-line-color);
 }
 
 /*
  * LightweightThemeConsumer will set the current lightweight theme's header
  * image to the lwt-header-image variable, used in each of the following rulesets.
  */
@@ -515,19 +503,26 @@ tabbrowser {
 
 #TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]) {
   background-color: rgba(255,255,255,.2);
 }
 
 /* Pinned tabs */
 
 /* Pinned tab separators need position: absolute when positioned (during overflow). */
-#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before {
+#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::after {
   height: 100%;
   position: absolute;
+  top: 0;
+  right: 0;
+}
+
+#tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]:-moz-locale-dir(rtl)::after {
+  right: unset;
+  left: 0;
 }
 
 .tabbrowser-tab:-moz-any([image], [pinned]) > .tab-stack > .tab-content[attention]:not([selected="true"]),
 .tabbrowser-tab > .tab-stack > .tab-content[pinned][titlechanged]:not([selected="true"]) {
   background-image: url(chrome://browser/skin/tabbrowser/indicator-tab-attention.svg);
   background-position: center bottom calc(-4px + var(--tab-toolbar-navbar-overlap));
   background-repeat: no-repeat;
 }
@@ -568,49 +563,45 @@ tabbrowser {
                                 transparent calc(100% - 5px));
   border-image-slice: 1;
   opacity: 0.3;
 }
 
 %ifdef CAN_DRAW_IN_TITLEBAR
 %ifdef MENUBAR_CAN_AUTOHIDE
 :root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] ~ #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab::after,
-:root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] ~ #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab::before,
 %else
 :root[tabsintitlebar]:not([extradragspace]) .tabbrowser-tab::after,
-:root[tabsintitlebar]:not([extradragspace]) .tabbrowser-tab::before,
 %endif
 %endif
 /* Show full height tab separators on hover. */
-.tabbrowser-tab:hover::before,
-.tabbrowser-tab[last-visible-tab]:hover::after,
-#tabbrowser-tabs:not([movingtab]) > .tabbrowser-tab[afterhovered]::before {
+.tabbrowser-tab:hover::after,
+#tabbrowser-tabs:not([movingtab]) > .tabbrowser-tab[beforehovered]::after {
   border-image: linear-gradient(transparent calc(1px + var(--tabs-top-border-width)),
                                 currentColor calc(1px + var(--tabs-top-border-width)),
                                 currentColor calc(100% - 1px),
                                 transparent calc(100% - 1px));
   border-image-slice: 1;
 }
 
 /* Show full height tab separators on selected tabs. */
-#tabbrowser-tabs:not([movingtab]) > .tabbrowser-tab[afterselected]::before,
-.tabbrowser-tab[visuallyselected]::before,
+#tabbrowser-tabs:not([movingtab]) > .tabbrowser-tab[beforeselected-visible]::after,
+#tabbrowser-tabs[movingtab] > .tabbrowser-tab[visuallyselected]::before,
 .tabbrowser-tab[visuallyselected]::after {
   border-color: var(--tabs-border);
   border-image: linear-gradient(transparent 1px,
                                 var(--tabs-border) 1px,
                                 var(--tabs-border) calc(100% - 1px - var(--tab-toolbar-navbar-overlap)),
                                 transparent calc(100% - 1px - var(--tab-toolbar-navbar-overlap))) 1 !important;
   opacity: 1;
 }
 
-.tabbrowser-tab:not([first-visible-tab])::before,
-#tabbrowser-tabs:not([overflow]):not([movingtab]) > .tabbrowser-tab[last-visible-tab]::after,
+.tabbrowser-tab::after,
 /* Also show separators beside the selected tab when dragging it. */
-#tabbrowser-tabs[movingtab] > .tabbrowser-tab[visuallyselected]::after {
+#tabbrowser-tabs[movingtab] > .tabbrowser-tab[visuallyselected]::before {
   content: "";
   display: -moz-box;
 }
 
 /* Tab bar scroll arrows */
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up,
 .tabbrowser-arrowscrollbox > .scrollbutton-down {
--- a/browser/themes/shared/urlbar-searchbar.inc.css
+++ b/browser/themes/shared/urlbar-searchbar.inc.css
@@ -220,16 +220,21 @@
 }
 
 .urlbar-history-dropmarker {
   -moz-appearance: none;
   list-style-image: url(chrome://global/skin/icons/arrow-dropdown-16.svg);
   transition: opacity 0.15s ease;
 }
 
+/* Avoid re-opening the popup when the dropmarker is clicked while the popup is still open. */
+.urlbar-history-dropmarker[open] {
+  pointer-events: none;
+}
+
 #urlbar[switchingtabs] > .urlbar-textbox-container > .urlbar-history-dropmarker {
   transition: none;
 }
 
 #nav-bar:not([customizing="true"]) > #nav-bar-customization-target > #urlbar-container:not(:hover) > #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
   opacity: 0;
 }
 
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -4,17 +4,17 @@
 
 @import url("chrome://global/skin/");
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 @namespace html url("http://www.w3.org/1999/xhtml");
 
 %include ../shared/browser.inc.css
 %filter substitution
-%define glassShadowColor hsla(209,67%,12%,0.35)
+%define glassShadowColor hsla(240,5%,5%,0.3)
 
 :root {
   --titlebar-text-color: currentColor;
 
   --tabs-border: threedshadow;
   --tab-line-color: highlight;
 
   --toolbar-non-lwt-bgcolor: -moz-dialog;
--- a/build/appini_header.py
+++ b/build/appini_header.py
@@ -3,40 +3,45 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 '''Parses a given application.ini file and outputs the corresponding
    StaticXREAppData structure as a C++ header file'''
 
 import ConfigParser
 import sys
 
+
 def main(output, file):
     config = ConfigParser.RawConfigParser()
     config.read(file)
     flags = set()
     try:
         if config.getint('XRE', 'EnableProfileMigrator') == 1:
             flags.add('NS_XRE_ENABLE_PROFILE_MIGRATOR')
-    except: pass
+    except:
+        pass
     try:
         if config.getint('Crash Reporter', 'Enabled') == 1:
             flags.add('NS_XRE_ENABLE_CRASH_REPORTER')
-    except: pass
-    appdata = dict(("%s:%s" % (s, o), config.get(s, o)) for s in config.sections() for o in config.options(s))
+    except:
+        pass
+    appdata = dict(("%s:%s" % (s, o), config.get(s, o))
+                   for s in config.sections() for o in config.options(s))
     appdata['flags'] = ' | '.join(flags) if flags else '0'
-    appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata else 'NULL'
+    appdata['App:profile'] = ('"%s"' % appdata['App:profile']
+                              if 'App:profile' in appdata else 'NULL')
     expected = ('App:vendor', 'App:name', 'App:remotingname', 'App:version', 'App:buildid',
                 'App:id', 'Gecko:minversion', 'Gecko:maxversion')
     missing = [var for var in expected if var not in appdata]
     if missing:
         print >>sys.stderr, \
             "Missing values in %s: %s" % (file, ', '.join(missing))
         sys.exit(1)
 
-    if not 'Crash Reporter:serverurl' in appdata:
+    if 'Crash Reporter:serverurl' not in appdata:
         appdata['Crash Reporter:serverurl'] = ''
 
     output.write('''#include "mozilla/XREAppData.h"
              static const mozilla::StaticXREAppData sAppData = {
                  "%(App:vendor)s",
                  "%(App:name)s",
                  "%(App:remotingname)s",
                  "%(App:version)s",
@@ -45,13 +50,14 @@ def main(output, file):
                  NULL, // copyright
                  %(flags)s,
                  "%(Gecko:minversion)s",
                  "%(Gecko:maxversion)s",
                  "%(Crash Reporter:serverurl)s",
                  %(App:profile)s
              };''' % appdata)
 
+
 if __name__ == '__main__':
     if len(sys.argv) != 1:
         main(sys.stdout, sys.argv[1])
     else:
         print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -204,17 +204,17 @@ def build_one_stage(cc, cxx, asm, ld, ar
     if libtool is not None:
         cmake_args += ["-DCMAKE_LIBTOOL=%s" % slashify_path(libtool)]
     if osx_cross_compile:
         cmake_args += ["-DCMAKE_SYSTEM_NAME=Darwin",
                        "-DCMAKE_SYSTEM_VERSION=10.10",
                        "-DLLVM_ENABLE_THREADS=OFF",
                        "-DLIBCXXABI_LIBCXX_INCLUDES=%s" % libcxx_include_dir,
                        "-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
-                       "-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")),
+                       "-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")), # noqa
                        "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
                        "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
                        "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY",
                        "-DCMAKE_MACOSX_RPATH=@executable_path",
                        "-DCMAKE_OSX_ARCHITECTURES=x86_64",
                        "-DDARWIN_osx_ARCHS=x86_64",
                        "-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin11"]
     build_package(build_dir, cmake_args)
@@ -253,18 +253,19 @@ def get_tool(config, key):
 
 # This function is intended to be called on the final build directory when
 # building clang-tidy.  Its job is to remove all of the files which won't
 # be used for clang-tidy to reduce the download size.  Currently when this
 # function finishes its job, it will leave final_dir with a layout like this:
 #
 # clang/
 #   bin/
+#     clang-apply-replacements
+#     clang-format
 #     clang-tidy
-#     clang-apply-replacements
 #   include/
 #     * (nothing will be deleted here)
 #   lib/
 #     clang/
 #       4.0.0/
 #         include/
 #           * (nothing will be deleted here)
 #   share/
@@ -278,17 +279,17 @@ def prune_final_dir_for_clang_tidy(final
         if os.path.basename(f) not in dirs:
             raise Exception("Found unknown file %s in the final directory" % f)
         if not os.path.isdir(f):
             raise Exception("Expected %s to be a directory" % f)
 
     # In bin/, only keep clang-tidy and clang-apply-replacements. The last one
     # is used to auto-fix some of the issues detected by clang-tidy.
     re_clang_tidy = re.compile(
-        r"^clang-(tidy|apply-replacements)(\.exe)?$", re.I)
+        r"^clang-(apply-replacements|format|tidy)(\.exe)?$", re.I)
     for f in glob.glob("%s/bin/*" % final_dir):
         if re_clang_tidy.search(os.path.basename(f)) is None:
             delete(f)
 
     # Keep include/ intact.
 
     # In lib/, only keep lib/clang/N.M.O/include.
     re_ver_num = re.compile(r"^\d+\.\d+\.\d+$", re.I)
@@ -385,17 +386,18 @@ if __name__ == "__main__":
     if "stages" in config:
         stages = int(config["stages"])
         if stages not in (1, 2, 3):
             raise ValueError("We only know how to build 1, 2, or 3 stages")
     build_type = "Release"
     if "build_type" in config:
         build_type = config["build_type"]
         if build_type not in ("Release", "Debug", "RelWithDebInfo", "MinSizeRel"):
-            raise ValueError("We only know how to do Release, Debug, RelWithDebInfo or MinSizeRel builds")
+            raise ValueError("We only know how to do Release, Debug, RelWithDebInfo or "
+                             "MinSizeRel builds")
     build_libcxx = False
     if "build_libcxx" in config:
         build_libcxx = config["build_libcxx"]
         if build_libcxx not in (True, False):
             raise ValueError("Only boolean values are accepted for build_libcxx.")
     build_clang_tidy = False
     if "build_clang_tidy" in config:
         build_clang_tidy = config["build_clang_tidy"]
@@ -497,17 +499,18 @@ if __name__ == "__main__":
         extra_cflags = ["-static-libgcc"]
         extra_cxxflags = ["-static-libgcc", "-static-libstdc++"]
         extra_cflags2 = ["-fPIC"]
         extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
         extra_asmflags = []
         extra_ldflags = []
 
         if 'LD_LIBRARY_PATH' in os.environ:
-            os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH'])
+            os.environ['LD_LIBRARY_PATH'] = ('%s/lib64/:%s' %
+                                             (gcc_dir, os.environ['LD_LIBRARY_PATH']))
         else:
             os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
     elif is_windows():
         extra_cflags = []
         extra_cxxflags = []
         # clang-cl would like to figure out what it's supposed to be emulating
         # by looking at an MSVC install, but we don't really have that here.
         # Force things on.
--- a/build/buildconfig.py
+++ b/build/buildconfig.py
@@ -1,13 +1,12 @@
 # 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/.
 
-import os
 import sys
 from mozbuild.base import MozbuildObject
 from mozbuild.backend.configenvironment import PartialConfigEnvironment
 
 config = MozbuildObject.from_environment()
 partial_config = PartialConfigEnvironment(config.topobjdir)
 
 for var in ('topsrcdir', 'topobjdir'):
--- a/build/checksums.py
+++ b/build/checksums.py
@@ -8,16 +8,17 @@ from __future__ import with_statement
 from optparse import OptionParser
 import logging
 import os
 try:
     import hashlib
 except:
     hashlib = None
 
+
 def digest_file(filename, digest, chunk_size=1024):
     '''Produce a checksum for the file specified by 'filename'.  'filename'
     is a string path to a file that is opened and read in this function.  The
     checksum algorithm is specified by 'digest' and is a valid OpenSSL
     algorithm.  If the digest used is not valid or Python's hashlib doesn't
     work, the None object will be returned instead.  The size of blocks
     that this function will read from the file object it opens based on
     'filename' can be specified by 'chunk_size', which defaults to 1K'''
@@ -45,17 +46,17 @@ def digest_file(filename, digest, chunk_
 
 def process_files(files, output_filename, digests, strip):
     '''This function takes a list of file names, 'files'.  It will then
     compute the checksum for each of the files by opening the files.
     Once each file is read and its checksum is computed, this function
     will write the information to the file specified by 'output_filename'.
     The path written in the output file will have anything specified by 'strip'
     removed from the path.  The output file is closed before returning nothing
-    The algorithm to compute checksums with can be specified by 'digests' 
+    The algorithm to compute checksums with can be specified by 'digests'
     and needs to be a list of valid OpenSSL algorithms.
 
     The output file is written in the format:
         <hash> <algorithm> <filesize> <filepath>
     Example:
         d1fa09a<snip>e4220 sha1 14250744 firefox-4.0b6pre.en-US.mac64.dmg
     '''
 
@@ -80,16 +81,17 @@ def process_files(files, output_filename
                         short_file = file[len(strip):]
                         short_file = short_file.lstrip('/')
                     else:
                         short_file = file
                     print >>output, '%s %s %s %s' % (hash, digest,
                                                      os.path.getsize(file),
                                                      short_file)
 
+
 def setup_logging(level=logging.DEBUG):
     '''This function sets up the logging module using a speficiable logging
     module logging level.  The default log level is DEBUG.
 
     The output is in the format:
         <level> - <message>
     Example:
         DEBUG - Finished reading in file
@@ -98,16 +100,17 @@ def setup_logging(level=logging.DEBUG):
     logger = logging.getLogger('checksums.py')
     logger.setLevel(logging.DEBUG)
     handler = logging.StreamHandler()
     handler.setLevel(level)
     formatter = logging.Formatter("%(levelname)s - %(message)s")
     handler.setFormatter(formatter)
     logger.addHandler(handler)
 
+
 def main():
     '''This is a main function that parses arguments, sets up logging
     and generates a checksum file'''
     # Parse command line arguments
     parser = OptionParser()
     parser.add_option('-d', '--digest', help='checksum algorithm to use',
                       action='append', dest='digests')
     parser.add_option('-o', '--output', help='output file to use',
@@ -117,42 +120,43 @@ def main():
                       action='store_true', dest='verbose', default=False)
     parser.add_option('-q', '--quiet', help='Be quiet', action='store_true',
                       dest='quiet', default=False)
     parser.add_option('-s', '--strip',
                       help='strip this path from the filenames',
                       dest='strip', default=os.getcwd())
     options, args = parser.parse_args()
 
-    #Figure out which logging level to use
+    # Figure out which logging level to use
     if options.verbose:
         loglevel = logging.DEBUG
     elif options.quiet:
         loglevel = logging.ERROR
     else:
         loglevel = logging.INFO
 
-    #Set up logging
+    # Set up logging
     setup_logging(loglevel)
     logger = logging.getLogger('checksums.py')
 
     # Validate the digest type to use
     if not options.digests:
         options.digests = ['sha1']
     try:
         for digest in options.digests:
             hashlib.new(digest)
-    except ValueError, ve:
+    except ValueError as ve:
         logger.error('Could not create a "%s" hash object (%s)' %
                      (digest, ve.args[0]))
         exit(1)
 
     # Validate the files to checksum
     files = []
     for i in args:
         if os.path.exists(i):
             files.append(i)
         else:
             logger.info('File "%s" was not found on the filesystem' % i)
     process_files(files, options.outfile, options.digests, options.strip)
 
+
 if __name__ == '__main__':
     main()
--- a/build/gen_test_packages_manifest.py
+++ b/build/gen_test_packages_manifest.py
@@ -4,17 +4,17 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import json
 
 from argparse import ArgumentParser
 
 ALL_HARNESSES = [
-    'common', # Harnesses without a specific package will look here.
+    'common',  # Harnesses without a specific package will look here.
     'mochitest',
     'reftest',
     'xpcshell',
     'cppunittest',
     'jittest',
     'mozbase',
     'web-platform',
     'talos',
@@ -34,20 +34,23 @@ PACKAGE_SPECIFIED_HARNESSES = [
 
 # These packages are not present for every build configuration.
 OPTIONAL_PACKAGES = [
     'gtest',
 ]
 
 
 def parse_args():
-    parser = ArgumentParser(description='Generate a test_packages.json file to tell automation which harnesses require which test packages.')
+    parser = ArgumentParser(
+        description="Generate a test_packages.json file to tell automation which harnesses "
+        "require which test packages.")
     parser.add_argument("--common", required=True,
                         action="store", dest="tests_common",
-                        help="Name of the \"common\" archive, a package to be used by all harnesses.")
+                        help="Name of the \"common\" archive, a package to be used by all "
+                        "harnesses.")
     parser.add_argument("--jsshell", required=True,
                         action="store", dest="jsshell",
                         help="Name of the jsshell zip.")
     for harness in PACKAGE_SPECIFIED_HARNESSES:
         parser.add_argument("--%s" % harness, required=True,
                             action="store", dest=harness,
                             help="Name of the %s zip." % harness)
     for harness in OPTIONAL_PACKAGES:
@@ -74,13 +77,14 @@ def generate_package_data(args):
     harness_requirements['jittest'].append(jsshell)
     for harness in PACKAGE_SPECIFIED_HARNESSES + OPTIONAL_PACKAGES:
         pkg_name = getattr(args, harness, None)
         if pkg_name is None:
             continue
         harness_requirements[harness].append(pkg_name)
     return harness_requirements
 
+
 if __name__ == '__main__':
     args = parse_args()
     packages_data = generate_package_data(args)
     with open(args.destfile, 'w') as of:
         json.dump(packages_data, of, indent=4)
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -101,17 +101,19 @@ CATEGORIES = {
     },
     'misc': {
         'short': 'Potpourri',
         'long': 'Potent potables and assorted snacks.',
         'priority': 10,
     },
     'disabled': {
         'short': 'Disabled',
-        'long': 'The disabled commands are hidden by default. Use -v to display them. These commands are unavailable for your current context, run "mach <command>" to see why.',
+        'long': 'The disabled commands are hidden by default. Use -v to display them. '
+        'These commands are unavailable for your current context, '
+        'run "mach <command>" to see why.',
         'priority': 0,
     }
 }
 
 
 # We submit data to telemetry approximately every this many mach invocations
 TELEMETRY_SUBMISSION_FREQUENCY = 10
 
@@ -201,17 +203,17 @@ def bootstrap(topsrcdir, mozilla_dir=Non
             system=platform.system(),
             version=platform.version(),
         ))
 
         if platform.system() == 'Linux':
             dist = list(platform.linux_distribution())
             data['system']['linux_distribution'] = dist
         elif platform.system() == 'Windows':
-            win32_ver=list((platform.win32_ver())),
+            win32_ver = list((platform.win32_ver())),
             data['system']['win32_ver'] = win32_ver
         elif platform.system() == 'Darwin':
             # mac version is a special Cupertino snowflake
             r, v, m = platform.mac_ver()
             data['system']['mac_ver'] = [r, list(v), m]
 
         with open(os.path.join(outgoing_dir, str(uuid.uuid4()) + '.json'),
                   'w') as f:
@@ -255,17 +257,17 @@ def bootstrap(topsrcdir, mozilla_dir=Non
         if random.randint(1, TELEMETRY_SUBMISSION_FREQUENCY) != 1:
             return
 
         with open(os.devnull, 'wb') as devnull:
             subprocess.Popen([sys.executable,
                               os.path.join(topsrcdir, 'build',
                                            'submit_telemetry_data.py'),
                               get_state_dir()[0]],
-                              stdout=devnull, stderr=devnull)
+                             stdout=devnull, stderr=devnull)
 
     def populate_context(context, key=None):
         if key is None:
             return
         if key == 'state_dir':
             state_dir, is_environ = get_state_dir()
             if is_environ:
                 if not os.path.exists(state_dir):
@@ -306,17 +308,17 @@ def bootstrap(topsrcdir, mozilla_dir=Non
     if not driver.settings_paths:
         # default global machrc location
         driver.settings_paths.append(get_state_dir()[0])
     # always load local repository configuration
     driver.settings_paths.append(mozilla_dir)
 
     for category, meta in CATEGORIES.items():
         driver.define_category(category, meta['short'], meta['long'],
-            meta['priority'])
+                               meta['priority'])
 
     repo = resolve_repository()
 
     for path in MACH_MODULES:
         # Sparse checkouts may not have all mach_commands.py files. Ignore
         # errors from missing files.
         try:
             driver.load_commands_from_file(os.path.join(mozilla_dir, path))
new file mode 100644
--- /dev/null
+++ b/build/moz.configure/.flake8
@@ -0,0 +1,5 @@
+[flake8]
+# F821: undefined name
+#       This is the moz.configure style
+ignore = F821
+
--- a/build/moz.configure/android-ndk.configure
+++ b/build/moz.configure/android-ndk.configure
@@ -6,28 +6,31 @@
 
 
 js_option('--with-android-ndk', nargs=1,
           help='location where the Android NDK can be found')
 
 js_option('--with-android-toolchain', nargs=1,
           help='location of the Android toolchain')
 
+
 @depends(target)
 def min_android_version(target):
     if target.cpu in ['aarch64', 'x86_64', 'mips64']:
         # 64-bit support was added in API 21.
         return '21'
     return '9'
 
+
 js_option('--with-android-version',
           nargs=1,
           help='android platform version',
           default=min_android_version)
 
+
 @depends('--with-android-version', min_android_version, '--help')
 @imports(_from='__builtin__', _import='ValueError')
 def android_version(value, min_version, _):
     if not value:
         # Someone has passed --without-android-version.
         die('--with-android-version cannot be disabled.')
 
     try:
@@ -36,31 +39,35 @@ def android_version(value, min_version, 
         die('--with-android-version expects an integer value')
 
     if version < int(min_version):
         die('--with-android-version must be at least %s (got %s)',
             min_version, value[0])
 
     return version
 
+
 add_old_configure_assignment('android_version', android_version)
 
+
 @depends('--with-android-ndk', build_project, '--help')
 def ndk(value, build_project, help):
     if help:
         return
     if build_project == 'mobile/android' and not value:
         die('You must specify --with-android-ndk=/path/to/ndk when '
             'building mobile/android')
     if value:
         return value[0]
 
+
 set_config('ANDROID_NDK', ndk)
 add_old_configure_assignment('android_ndk', ndk)
 
+
 @depends(ndk)
 @checking('for android ndk version')
 @imports(_from='__builtin__', _import='open')
 def ndk_version(ndk):
     if not ndk:
         # Building 'js/src' for non-Android.
         return
     with open(os.path.join(ndk, 'source.properties'), 'r') as f:
@@ -68,39 +75,44 @@ def ndk_version(ndk):
             if not line.startswith('Pkg.Revision'):
                 continue
             (_, version) = line.split('=')
             if version:
                 return version.strip()
             die('Unexpected Pkg.Revision line in source.properties')
     die('Cannot determine NDK version from source.properties')
 
+
 @depends(ndk_version)
 def ndk_major_version(ndk_version):
     if not ndk_version:
         # Building 'js/src' for non-Android.
         return
     (major, minor, revision) = ndk_version.split('.')
     if major:
         return major
     die('Unexpected NDK version string: ' + ndk_version)
 
-set_config('ANDROID_NDK_MAJOR_VERSION', ndk_major_version);
+
+set_config('ANDROID_NDK_MAJOR_VERSION', ndk_major_version)
+
 
 @depends(ndk_version)
 def ndk_minor_version(ndk_version):
     if not ndk_version:
         # Building 'js/src' for non-Android.
         return
     (major, minor, revision) = ndk_version.split('.')
     if minor:
         return minor
     die('Unexpected NDK version string: ' + ndk_version)
 
-set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version);
+
+set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version)
+
 
 @depends(target, android_version, ndk, '--help')
 @checking('for android platform directory')
 @imports(_from='os.path', _import='isdir')
 def android_platform(target, android_version, ndk, _):
     if target.os != 'Android':
         return
 
@@ -126,25 +138,28 @@ def android_platform(target, android_ver
                                 'arch-%s' % target_dir_name)
 
     if not isdir(platform_dir):
         die("Android platform directory not found. With the current "
             "configuration, it should be in %s" % platform_dir)
 
     return platform_dir
 
+
 add_old_configure_assignment('android_platform', android_platform)
 
+
 @depends(android_platform)
 def extra_toolchain_flags(platform_dir):
     if not platform_dir:
         return []
     return ['-idirafter',
             os.path.join(platform_dir, 'usr', 'include')]
 
+
 @depends(target, host, ndk, '--with-android-toolchain', '--help')
 @checking('for the Android toolchain directory', lambda x: x or 'not found')
 @imports(_from='os.path', _import='isdir')
 @imports(_from='mozbuild.shellutil', _import='quote')
 def android_toolchain(target, host, ndk, toolchain, _):
     if not ndk:
         return
     if toolchain:
@@ -170,38 +185,43 @@ def android_toolchain(target, host, ndk,
             toolchain = toolchain_format % (ndk, target_base, version,
                                             host.kernel.lower(), 'x86')
             log.debug('Trying %s' % quote(toolchain))
         if isdir(toolchain):
             return toolchain
         die('You have to specify --with-android-toolchain='
             '/path/to/ndk/toolchain.')
 
+
 set_config('ANDROID_TOOLCHAIN', android_toolchain)
 
+
 @depends(target)
 def android_toolchain_prefix_base(target):
     if target.cpu == 'x86':
         # Ideally, the --target should just have the right x86 variant
         # in the first place.
         return 'i686-linux-android'
     return target.toolchain
 
+
 @depends(android_toolchain_prefix_base, android_toolchain)
 def android_toolchain_prefix(prefix_base, toolchain):
     if toolchain:
         return '%s/bin/%s-' % (toolchain, prefix_base)
 
+
 imply_option('--with-toolchain-prefix', android_toolchain_prefix,
              reason='--with-android-ndk')
 
 option(env='STLPORT_CPPFLAGS',
        nargs=1,
        help='Options compiler should pass for standard C++ library')
 
+
 @depends('STLPORT_CPPFLAGS', ndk, '--help')
 @imports(_from='os.path', _import='isdir')
 def stlport_cppflags(value, ndk, _):
     if value and len(value):
         return value
     if not ndk:
         return
 
@@ -226,25 +246,28 @@ def stlport_cppflags(value, ndk, _):
     # Add android/support/include/ for prototyping long double math
     # functions, locale-specific C library functions, multibyte support,
     # etc.
     return "-I%s -I%s -I%s" % (cxx_include,
                                os.path.join(ndk, 'sources', 'android',
                                             'support', 'include'),
                                cxxabi_include)
 
+
 add_old_configure_assignment('stlport_cppflags', stlport_cppflags)
 
+
 @depends(stlport_cppflags, android_platform, android_toolchain,
          android_toolchain_prefix_base, '--help')
 def bindgen_cflags_defaults(stlport_cppflags, android_platform, toolchain,
                             toolchain_prefix, _):
     if not stlport_cppflags:
         return
 
-    gcc_include = os.path.join(toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')
+    gcc_include = os.path.join(
+        toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')
 
     cflags_format = "%s -isystem %s -gcc-toolchain %s -I%s -I%s"
     return cflags_format % (stlport_cppflags,
                             os.path.join(android_platform, 'usr', 'include'),
                             toolchain,
                             os.path.join(gcc_include, 'include'),
                             os.path.join(gcc_include, 'include-fixed'))
--- a/build/moz.configure/checks.configure
+++ b/build/moz.configure/checks.configure
@@ -6,26 +6,29 @@
 
 # Templates implementing some generic checks.
 # ==============================================================
 
 # Declare some exceptions. This is cumbersome, but since we shouldn't need a
 # lot of them, let's stack them all here. When adding a new one, put it in the
 # _declare_exceptions template, and add it to the return statement. Then
 # destructure in the assignment below the function declaration.
+
+
 @template
 @imports(_from='__builtin__', _import='Exception')
 def _declare_exceptions():
     class FatalCheckError(Exception):
         '''An exception to throw from a function decorated with @checking.
         It will result in calling die() with the given message.
         Debugging messages emitted from the decorated function will also be
         printed out.'''
     return (FatalCheckError,)
 
+
 (FatalCheckError,) = _declare_exceptions()
 
 del _declare_exceptions
 
 # Helper to display "checking" messages
 #   @checking('for foo')
 #   def foo():
 #       return 'foo'
@@ -37,16 +40,18 @@ del _declare_exceptions
 #       return ret
 # This can be combined with e.g. @depends:
 #   @depends(some_option)
 #   @checking('for something')
 #   def check(value):
 #       ...
 # An optional callback can be given, that will be used to format the returned
 # value when displaying it.
+
+
 @template
 def checking(what, callback=None):
     def decorator(func):
         def wrapped(*args, **kwargs):
             log.info('checking %s... ', what)
             with log.queue_debug():
                 error, ret = None, None
                 try:
--- a/build/moz.configure/compile-checks.configure
+++ b/build/moz.configure/compile-checks.configure
@@ -63,28 +63,31 @@ def check_header(header, language='C++',
     set_define(header_var, have_header)
     return have_header
 
 # A convenience wrapper for check_header for checking multiple headers.
 # returns an array of the resulting checks in order corresponding to the
 # provided headers.
 # - `headers` are the headers to be checked.
 # - `kwargs` are keyword arguments passed verbatim to check_header.
+
+
 @template
 def check_headers(*headers, **kwargs):
     checks = []
     for header in headers:
         checks.append(check_header(header, **kwargs))
     return checks
 
 
 @dependable
 def warnings_cflags():
     return []
 
+
 @dependable
 def warnings_cxxflags():
     return []
 
 
 # Tests whether GCC or clang support the given warning flag, and if it is,
 # add it to the list of warning flags for the build.
 # - `warning` is the warning flag (e.g. -Wfoo)
@@ -144,11 +147,13 @@ def check_and_add_gcc_warning(warning, c
 
 # Add the given warning to the list of warning flags for the build.
 # - `warning` is the warning flag (e.g. -Wfoo)
 # - `compiler` (optional) is the compiler to add the flag for (c_compiler or
 #   cxx_compiler, from toolchain.configure). When omitted, the warning flag
 #   is added for both compilers.
 # - `when` (optional) is a @depends function or option name conditioning
 #   when the warning flag is wanted.
+
+
 @template
 def add_gcc_warning(warning, compiler=None, when=None):
     check_and_add_gcc_warning(warning, compiler, when, check=False)
--- a/build/moz.configure/compilers-util.configure
+++ b/build/moz.configure/compilers-util.configure
@@ -1,14 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+
 @template
 @imports('textwrap')
 @imports(_from='mozbuild.configure', _import='SandboxDependsFunction')
 def compiler_class(compiler, host_or_target):
     is_target = host_or_target is target
 
     class Compiler(SandboxDependsFunction):
         # Generates a test program and attempts to compile it. In case of
@@ -49,17 +50,18 @@ def compiler_class(compiler, host_or_tar
             @checking_fn
             def func(compiler, flags, extra_flags):
                 flags = flags or []
                 if is_target:
                     flags += extra_flags or []
                 flags.append('-c')
 
                 if try_invoke_compiler(
-                    compiler.wrapper + [compiler.compiler] + compiler.flags,
-                    compiler.language, source, flags,
-                    onerror=onerror) is not None:
+                        compiler.wrapper +
+                        [compiler.compiler] + compiler.flags,
+                        compiler.language, source, flags,
+                        onerror=onerror) is not None:
                     return True
 
             return func
 
     compiler.__class__ = Compiler
     return compiler
--- a/build/moz.configure/headers.configure
+++ b/build/moz.configure/headers.configure
@@ -67,27 +67,32 @@ check_headers(
 # TODO: Move these checks to file specific to --enable-project=js.
 have_perf_event_h = check_header('linux/perf_event.h',
                                  when=building_linux)
 
 js_option('--with-linux-headers',
           help='location where the Linux kernel headers can be found',
           nargs=1)
 
-passed_linux_header_flags = depends_if('--with-linux-headers')(lambda v: ['-I%s' % v[0]])
+passed_linux_header_flags = depends_if(
+    '--with-linux-headers')(lambda v: ['-I%s' % v[0]])
+
 
 @depends(try_compile(includes=['asm/unistd.h'],
                      body='return sizeof(__NR_perf_event_open);',
                      flags=passed_linux_header_flags,
                      check_msg='for perf_event_open system call'),
          when=have_perf_event_h)
 def have_perf_event_open(have_perf_event_open):
     if have_perf_event_open:
         return True
 
+
 set_config('HAVE_LINUX_PERF_EVENT_H', have_perf_event_open)
 
+
 @depends(passed_linux_header_flags, have_perf_event_open)
 def linux_headers_includes(passed_linux_header_flags, have_perf_event_open):
     if have_perf_event_open and passed_linux_header_flags:
         return passed_linux_header_flags[0]
 
+
 set_config('LINUX_HEADERS_INCLUDES', linux_headers_includes)
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -6,16 +6,18 @@
 
 include('util.configure')
 include('checks.configure')
 
 option(env='DIST', nargs=1, help='DIST directory')
 
 # Do not allow objdir == srcdir builds.
 # ==============================================================
+
+
 @depends('--help', 'DIST')
 @imports(_from='os.path', _import='exists')
 def check_build_environment(help, dist):
     topobjdir = os.path.realpath(os.path.abspath('.'))
     topsrcdir = os.path.realpath(os.path.abspath(
         os.path.join(os.path.dirname(__file__), '..', '..')))
 
     if dist:
@@ -37,17 +39,17 @@ def check_build_environment(help, dist):
             '  * Building directly in the main source directory is not allowed.\n'
             '  *\n'
             '  * To build, you must run configure from a separate directory\n'
             '  * (referred to as an object directory).\n'
             '  *\n'
             '  * If you are building with a mozconfig, you will need to change your\n'
             '  * mozconfig to point to a different object directory.\n'
             '  ***'
-        )
+            )
 
     # Check for a couple representative files in the source tree
     conflict_files = [
         '*         %s' % f for f in ('Makefile', 'config/autoconf.mk')
         if exists(os.path.join(topsrcdir, f))
     ]
     if conflict_files:
         die('  ***\n'
@@ -56,20 +58,21 @@ def check_build_environment(help, dist):
             '  *   This indicates that you previously built in the source tree.\n'
             '  *   A source tree build can confuse the separate objdir build.\n'
             '  *\n'
             '  *   To clean up the source tree:\n'
             '  *     1. cd %s\n'
             '  *     2. gmake distclean\n'
             '  ***'
             % ('\n  '.join(conflict_files), topsrcdir)
-        )
+            )
 
     return result
 
+
 set_config('TOPSRCDIR', check_build_environment.topsrcdir)
 set_config('TOPOBJDIR', check_build_environment.topobjdir)
 set_config('MOZ_BUILD_ROOT', check_build_environment.topobjdir)
 set_config('DIST', check_build_environment.dist)
 
 add_old_configure_assignment(
     '_topsrcdir', check_build_environment.topsrcdir)
 add_old_configure_assignment(
@@ -86,29 +89,33 @@ set_config('MOZ_AUTOMATION', depends_if(
 option(env='OLD_CONFIGURE', nargs=1, help='Path to the old configure script')
 
 option(env='MOZ_CURRENT_PROJECT', nargs=1, help='Current build project')
 option(env='MOZCONFIG', nargs=1, help='Mozconfig location')
 
 option('--with-external-source-dir', env='EXTERNAL_SOURCE_DIR', nargs=1,
        help='External directory containing additional build files')
 
+
 @depends('--with-external-source-dir')
 def external_source_dir(value):
     if value:
         return value[0]
 
+
 set_config('EXTERNAL_SOURCE_DIR', external_source_dir)
 add_old_configure_assignment('EXTERNAL_SOURCE_DIR', external_source_dir)
 
 # Read user mozconfig
 # ==============================================================
 # Note: the dependency on --help is only there to always read the mozconfig,
 # even when --help is passed. Without this dependency, the function wouldn't
 # be called when --help is passed, and the mozconfig wouldn't be read.
+
+
 @depends('MOZ_CURRENT_PROJECT', 'MOZCONFIG', 'OLD_CONFIGURE',
          check_build_environment, '--with-external-source-dir',
          '--help')
 @imports(_from='mozbuild.mozconfig', _import='MozconfigLoader')
 def mozconfig(current_project, mozconfig, old_configure, build_env,
               external_source_dir, help):
     if not old_configure:
         die('The OLD_CONFIGURE environment variable must be set')
@@ -138,23 +145,26 @@ def mozconfig(current_project, mozconfig
     loader = MozconfigLoader(topsrcdir)
     current_project = current_project[0] if current_project else None
     mozconfig = mozconfig[0] if mozconfig else None
     mozconfig = loader.find_mozconfig(env={'MOZCONFIG': mozconfig})
     mozconfig = loader.read_mozconfig(mozconfig, moz_build_app=current_project)
 
     return mozconfig
 
+
 set_config('MOZCONFIG', depends(mozconfig)(lambda m: m['path']))
 
 
 option(env='PYTHON', nargs=1, help='Python interpreter')
 
 # Setup python virtualenv
 # ==============================================================
+
+
 @depends('PYTHON', check_build_environment, mozconfig, '--help')
 @imports('os')
 @imports('sys')
 @imports('subprocess')
 @imports(_from='mozbuild.configure.util', _import='LineIO')
 @imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
 @imports(_from='mozbuild.virtualenv', _import='verify_python_version')
 @imports('distutils.sysconfig')
@@ -188,17 +198,18 @@ def virtualenv_python(env_python, build_
             topsrcdir, topobjdir,
             os.path.join(topobjdir, '_virtualenv'), out,
             os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
 
     if python:
         # If we're not in the virtualenv, we need the which module for
         # find_program.
         if normsep(sys.executable) != normsep(manager.python_path):
-            sys.path.append(os.path.join(topsrcdir, 'third_party', 'python', 'which'))
+            sys.path.append(os.path.join(
+                topsrcdir, 'third_party', 'python', 'which'))
         found_python = find_program(python)
         if not found_python:
             die('The PYTHON environment variable does not contain '
                 'a valid path. Cannot find %s', python)
         python = found_python
     else:
         python = sys.executable
 
@@ -217,37 +228,42 @@ def virtualenv_python(env_python, build_
         sys.exit(subprocess.call([python] + sys.argv))
 
     # We are now in the virtualenv
     if not distutils.sysconfig.get_python_lib():
         die('Could not determine python site packages directory')
 
     return python
 
+
 set_config('PYTHON', virtualenv_python)
 add_old_configure_assignment('PYTHON', virtualenv_python)
 
 # Inject mozconfig options
 # ==============================================================
 # All options defined above this point can't be injected in mozconfig_options
 # below, so collect them.
+
+
 @template
 def early_options():
     @dependable
     @imports('__sandbox__')
     def early_options():
         return set(
             option.env
             for option in __sandbox__._options.itervalues()
             if option.env
         )
     return early_options
 
+
 early_options = early_options()
 
+
 @depends(mozconfig, 'MOZ_AUTOMATION', '--help')
 # This gives access to the sandbox. Don't copy this blindly.
 @imports('__sandbox__')
 @imports('os')
 def mozconfig_options(mozconfig, automation, help):
     if mozconfig['path']:
         if 'MOZ_AUTOMATION_MOZCONFIG' in mozconfig['env']['added']:
             if not automation:
@@ -288,16 +304,18 @@ def mozconfig_options(mozconfig, automat
 # ==============================================================
 option(env='MOZILLABUILD', nargs=1,
        help='Path to Mozilla Build (Windows-only)')
 
 option(env='CONFIG_SHELL', nargs=1, help='Path to a POSIX shell')
 
 # It feels dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
 # but the end goal being that the configure script would go away...
+
+
 @depends('CONFIG_SHELL', 'MOZILLABUILD')
 @checking('for a shell')
 @imports('sys')
 def shell(value, mozillabuild):
     if value:
         return find_program(value[0])
     shell = 'sh'
     if mozillabuild:
@@ -307,16 +325,17 @@ def shell(value, mozillabuild):
     return find_program(shell)
 
 
 # Python 3
 # ========
 
 option(env='PYTHON3', nargs=1, help='Python 3 interpreter (3.5 or later)')
 
+
 @depends('PYTHON3')
 @checking('for Python 3',
           callback=lambda x: '%s (%s)' % (x.path, x.str_version) if x else 'no')
 @imports(_from='__builtin__', _import='Exception')
 @imports(_from='mozbuild.pythonutil', _import='find_python3_executable')
 @imports(_from='mozbuild.pythonutil', _import='python_executable_version')
 def python3(env_python):
     python = env_python[0] if env_python else None
@@ -343,68 +362,75 @@ def python3(env_python):
         python = python.decode('utf-8')
 
     return namespace(
         path=python,
         version=version,
         str_version='.'.join(str(v) for v in version),
     )
 
+
 set_config('PYTHON3', depends_if(python3)(lambda p: p.path))
 set_config('PYTHON3_VERSION', depends_if(python3)(lambda p: p.str_version))
 
 # Source checkout and version control integration.
 # ================================================
 
+
 @depends(check_build_environment, 'MOZ_AUTOMATION', '--help')
 @checking('for vcs source checkout')
 @imports('os')
 def vcs_checkout_type(build_env, automation, _):
     if os.path.exists(os.path.join(build_env.topsrcdir, '.hg')):
         return 'hg'
     elif os.path.exists(os.path.join(build_env.topsrcdir, '.git')):
         return 'git'
     elif automation:
         raise FatalCheckError('unable to resolve VCS type; must run '
                               'from a source checkout when MOZ_AUTOMATION '
                               'is set')
 
 # Resolve VCS binary for detected repository type.
 
+
 # TODO remove hg.exe once bug 1382940 addresses ambiguous executables case.
 hg = check_prog('HG', ('hg.exe', 'hg',), allow_missing=True,
                 when=depends(vcs_checkout_type)(lambda x: x == 'hg'))
 git = check_prog('GIT', ('git',), allow_missing=True,
                  when=depends(vcs_checkout_type)(lambda x: x == 'git'))
 
+
 @depends_if(hg)
 @checking('for Mercurial version')
 @imports('os')
 @imports('re')
 def hg_version(hg):
     # HGPLAIN in Mercurial 1.5+ forces stable output, regardless of set
     # locale or encoding.
     env = dict(os.environ)
     env['HGPLAIN'] = '1'
 
     out = check_cmd_output(hg, '--version', env=env)
 
     match = re.search(r'Mercurial Distributed SCM \(version ([^\)]+)', out)
 
     if not match:
-        raise FatalCheckError('unable to determine Mercurial version: %s' % out)
+        raise FatalCheckError(
+            'unable to determine Mercurial version: %s' % out)
 
     # The version string may be "unknown" for Mercurial run out of its own
     # source checkout or for bad builds. But LooseVersion handles it.
 
     return Version(match.group(1))
 
 # Resolve Mercurial config items so other checks have easy access.
 # Do NOT set this in the config because it may contain sensitive data
 # like API keys.
+
+
 @depends_all(check_build_environment, hg, hg_version)
 @imports('os')
 def hg_config(build_env, hg, version):
     env = dict(os.environ)
     env['HGPLAIN'] = '1'
 
     # Warnings may get sent to stderr. But check_cmd_output() ignores
     # stderr if exit code is 0. And the command should always succeed if
@@ -425,32 +451,35 @@ def hg_config(build_env, hg, version):
     config = {}
 
     for line in out.strip().splitlines():
         key, value = [s.strip() for s in line.split('=', 1)]
         config[key] = value
 
     return config
 
+
 @depends_if(git)
 @checking('for Git version')
 @imports('re')
 def git_version(git):
     out = check_cmd_output(git, '--version').rstrip()
 
     match = re.search('git version (.*)$', out)
 
     if not match:
         raise FatalCheckError('unable to determine Git version: %s' % out)
 
     return Version(match.group(1))
 
 # Only set VCS_CHECKOUT_TYPE if we resolved the VCS binary.
 # Require resolved VCS info when running in automation so automation's
 # environment is more well-defined.
+
+
 @depends(vcs_checkout_type, hg_version, git_version, 'MOZ_AUTOMATION')
 def exposed_vcs_checkout_type(vcs_checkout_type, hg, git, automation):
     if vcs_checkout_type == 'hg':
         if hg:
             return 'hg'
 
         if automation:
             raise FatalCheckError('could not resolve Mercurial binary info')
@@ -459,44 +488,50 @@ def exposed_vcs_checkout_type(vcs_checko
         if git:
             return 'git'
 
         if automation:
             raise FatalCheckError('could not resolve Git binary info')
     elif vcs_checkout_type:
         raise FatalCheckError('unhandled VCS type: %s' % vcs_checkout_type)
 
+
 set_config('VCS_CHECKOUT_TYPE', exposed_vcs_checkout_type)
 
 # Obtain a Repository interface for the current VCS repository.
+
+
 @depends(check_build_environment, exposed_vcs_checkout_type, hg, git)
 @imports(_from='mozversioncontrol', _import='get_repository_object')
 def vcs_repository(build_env, vcs_checkout_type, hg, git):
     if vcs_checkout_type == 'hg':
         return get_repository_object(build_env.topsrcdir, hg=hg)
     elif vcs_checkout_type == 'git':
         return get_repository_object(build_env.topsrcdir, git=git)
     elif vcs_checkout_type:
         raise FatalCheckError('unhandled VCS type: %s' % vcs_checkout_type)
 
+
 @depends_if(vcs_repository)
 @checking('for sparse checkout')
 def vcs_sparse_checkout(repo):
     return repo.sparse_checkout_present()
 
+
 set_config('VCS_SPARSE_CHECKOUT', vcs_sparse_checkout)
 
 # Host and target systems
 # ==============================================================
 option('--host', nargs=1, help='Define the system type performing the build')
 
 option('--target', nargs=1,
        help='Define the system type where the resulting executables will be '
             'used')
 
+
 @imports(_from='mozbuild.configure.constants', _import='CPU')
 @imports(_from='mozbuild.configure.constants', _import='CPU_bitness')
 @imports(_from='mozbuild.configure.constants', _import='Endianness')
 @imports(_from='mozbuild.configure.constants', _import='Kernel')
 @imports(_from='mozbuild.configure.constants', _import='OS')
 @imports(_from='__builtin__', _import='KeyError')
 @imports(_from='__builtin__', _import='ValueError')
 def split_triplet(triplet, allow_unknown=False):
@@ -659,72 +694,83 @@ def host(value, shell):
         config_guess = os.path.join(os.path.dirname(__file__), '..',
                                     'autoconf', 'config.guess')
         host = subprocess.check_output([shell, config_guess]).strip()
     else:
         host = value[0]
 
     return split_triplet(config_sub(shell, host))
 
+
 host = help_host_target | host
 
 
 @depends('--target', host, shell)
 @checking('for target system type', lambda t: t.alias)
 def target(value, host, shell):
     if not value:
         return host
     return split_triplet(config_sub(shell, value[0]))
 
+
 target = help_host_target | target
 
 
 @depends(host, target)
 @checking('whether cross compiling')
 def cross_compiling(host, target):
     return host != target
 
+
 set_config('CROSS_COMPILE', cross_compiling)
 set_define('CROSS_COMPILE', cross_compiling)
 add_old_configure_assignment('CROSS_COMPILE', cross_compiling)
 
 
 @depends(target)
 def have_64_bit(target):
     if target.bitness == 64:
         return True
 
+
 set_config('HAVE_64BIT_BUILD', have_64_bit)
 set_define('HAVE_64BIT_BUILD', have_64_bit)
 add_old_configure_assignment('HAVE_64BIT_BUILD', have_64_bit)
 
+
 @depends(host)
 def host_os_kernel_major_version(host):
     versions = host.raw_os.split('.')
     version = ''.join(x for x in versions[0] if x.isdigit())
     return version
 
+
 set_config('HOST_MAJOR_VERSION', host_os_kernel_major_version)
 
 # Autoconf needs these set
+
+
 @depends(host)
 def host_for_old_configure(host):
     return '--host=%s' % host.alias
 
+
 add_old_configure_arg(host_for_old_configure)
 
+
 @depends(target)
 def target_for_old_configure(target):
     target_alias = target.alias
     # old-configure does plenty of tests against $target and $target_os
     # and expects darwin for iOS, so make it happy.
     if target.os == 'iOS':
         target_alias = target_alias.replace('-ios', '-darwin')
     return '--target=%s' % target_alias
 
+
 add_old_configure_arg(target_for_old_configure)
 
 
 # These variables are for compatibility with the current moz.builds and
 # old-configure. Eventually, we'll want to canonicalize better.
 @depends(target)
 def target_variables(target):
     if target.kernel == 'kFreeBSD':
@@ -745,16 +791,17 @@ def target_variables(target):
 
     return namespace(
         OS_TARGET=os_target,
         OS_ARCH=os_arch,
         OS_TEST=os_test,
         INTEL_ARCHITECTURE=target.cpu in ('x86', 'x86_64') or None,
     )
 
+
 set_config('OS_TARGET', target_variables.OS_TARGET)
 add_old_configure_assignment('OS_TARGET',
                              target_variables.OS_TARGET)
 set_config('OS_ARCH', target_variables.OS_ARCH)
 add_old_configure_assignment('OS_ARCH',
                              target_variables.OS_ARCH)
 set_config('OS_TEST', target_variables.OS_TEST)
 add_old_configure_assignment('OS_TEST',
@@ -771,95 +818,114 @@ def host_variables(host):
     if host.kernel == 'kFreeBSD':
         os_arch = 'GNU_kFreeBSD'
     else:
         os_arch = host.kernel
     return namespace(
         HOST_OS_ARCH=os_arch,
     )
 
+
 set_config('HOST_CPU_ARCH', host.cpu)
 set_config('HOST_OS_ARCH', host_variables.HOST_OS_ARCH)
 add_old_configure_assignment('HOST_OS_ARCH',
                              host_variables.HOST_OS_ARCH)
 
+
 @depends(target)
 def target_is_windows(target):
     if target.kernel == 'WINNT':
         return True
 
+
 set_define('_WINDOWS', target_is_windows)
 set_define('WIN32', target_is_windows)
 set_define('XP_WIN', target_is_windows)
 set_define('XP_WIN32', target_is_windows)
 
+
 @depends(target)
 def target_is_unix(target):
     if target.kernel != 'WINNT':
         return True
 
+
 set_define('XP_UNIX', target_is_unix)
 
+
 @depends(target)
 def target_is_darwin(target):
     if target.kernel == 'Darwin':
         return True
 
+
 set_define('XP_DARWIN', target_is_darwin)
 
+
 @depends(target)
 def target_is_ios(target):
     if target.kernel == 'Darwin' and target.os == 'iOS':
         return True
 
+
 set_define('XP_IOS', target_is_ios)
 
+
 @depends(target)
 def target_is_osx(target):
     if target.kernel == 'Darwin' and target.os == 'OSX':
         return True
 
+
 set_define('XP_MACOSX', target_is_osx)
 
+
 @depends(target)
 def target_is_linux(target):
     if target.kernel == 'Linux':
         return True
 
+
 set_define('XP_LINUX', target_is_linux)
 
+
 @depends(target)
 def target_is_solaris(target):
     if target.kernel == 'SunOS':
         return True
 
+
 set_define('XP_SOLARIS', target_is_solaris)
 
 # The application/project to build
 # ==============================================================
 option('--enable-application', nargs=1, env='MOZ_BUILD_APP',
        help='Application to build. Same as --enable-project.')
 
+
 @depends('--enable-application', '--help')
 def application(app, help):
     if app:
         return app
 
+
 imply_option('--enable-project', application)
 
 
 @depends(check_build_environment, '--help')
 def default_project(build_env, help):
     if build_env.topobjdir.endswith('/js/src'):
         return 'js'
     return 'browser'
 
+
 option('--enable-project', nargs=1, default=default_project,
        help='Project to build')
 
+
 @depends('--enable-project', '--with-external-source-dir',
          check_build_environment, '--help')
 @imports(_from='os.path', _import='exists')
 def include_project_configure(project, external_source_dir, build_env, help):
     if not project:
         die('--enable-project is required.')
 
     base_dir = build_env.topsrcdir
@@ -873,16 +939,17 @@ def include_project_configure(project, e
 
 
 @depends(include_project_configure, check_build_environment, '--help')
 def build_project(include_project_configure, build_env, help):
     ret = os.path.dirname(os.path.relpath(include_project_configure,
                                           build_env.topsrcdir))
     return ret
 
+
 set_config('MOZ_BUILD_APP', build_project)
 set_define('MOZ_BUILD_APP', build_project)
 add_old_configure_assignment('MOZ_BUILD_APP', build_project)
 
 
 # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
 # The logic works like this:
 # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
@@ -903,16 +970,17 @@ def milestone(build_env, _):
         is_nightly = True
     elif 'a' not in milestone:
         is_release_or_beta = True
 
     return namespace(version=milestone,
                      is_nightly=is_nightly,
                      is_release_or_beta=is_release_or_beta)
 
+
 set_config('GRE_MILESTONE', milestone.version)
 set_config('NIGHTLY_BUILD', milestone.is_nightly)
 set_define('NIGHTLY_BUILD', milestone.is_nightly)
 add_old_configure_assignment('NIGHTLY_BUILD', milestone.is_nightly)
 set_config('RELEASE_OR_BETA', milestone.is_release_or_beta)
 set_define('RELEASE_OR_BETA', milestone.is_release_or_beta)
 add_old_configure_assignment('RELEASE_OR_BETA',
                              milestone.is_release_or_beta)
@@ -920,22 +988,24 @@ add_old_configure_assignment('RELEASE_OR
 # The app update channel is 'default' when not supplied. The value is used in
 # the application's confvars.sh (and is made available to a project specific
 # moz.configure).
 option('--enable-update-channel',
        nargs=1,
        help='Select application update channel',
        default='default')
 
+
 @depends('--enable-update-channel')
 def update_channel(channel):
     if channel[0] == '':
         return 'default'
     return channel[0].lower()
 
+
 set_config('MOZ_UPDATE_CHANNEL', update_channel)
 set_define('MOZ_UPDATE_CHANNEL', update_channel)
 add_old_configure_assignment('MOZ_UPDATE_CHANNEL', update_channel)
 
 
 # A template providing a shorthand for setting a variable. The created
 # option will only be settable with imply_option.
 # It is expected that a project-specific moz.configure will call imply_option
@@ -944,17 +1014,18 @@ add_old_configure_assignment('MOZ_UPDATE
 # will additionally cause the variable to be set using set_define and
 # add_old_configure_assignment. util.configure would be an appropriate place for
 # this, but it uses add_old_configure_assignment, which is defined in this file.
 @template
 def project_flag(env=None, set_for_old_configure=False,
                  set_as_define=False, **kwargs):
 
     if not env:
-        configure_error("A project_flag must be passed a variable name to set.")
+        configure_error(
+            "A project_flag must be passed a variable name to set.")
 
     opt = option(env=env, possible_origins=('implied',), **kwargs)
 
     @depends(opt.option)
     def option_implementation(value):
         if value:
             if len(value):
                 return value
@@ -962,22 +1033,26 @@ def project_flag(env=None, set_for_old_c
 
     set_config(env, option_implementation)
     if set_as_define:
         set_define(env, option_implementation)
     if set_for_old_configure:
         add_old_configure_assignment(env, option_implementation)
 
 # milestone.is_nightly corresponds to cases NIGHTLY_BUILD is set.
+
+
 @depends(milestone, '--help')
 def enabled_in_nightly(milestone, _):
     return milestone.is_nightly
 
 # Set the MOZ_CONFIGURE_OPTIONS variable with all the options that
 # were passed somehow (environment, command line, mozconfig)
+
+
 @dependable
 @imports(_from='mozbuild.shellutil', _import='quote')
 @imports('__sandbox__')
 def all_configure_options():
     result = []
     previous = None
     for option in __sandbox__._options.itervalues():
         # __sandbox__._options contains items for both option.name and
@@ -999,16 +1074,17 @@ def all_configure_options():
         # because we don't know their actual defaults. (Keep the conditions
         # separate for ease of understanding and ease of removal)
         elif (option.help == 'Help missing for old configure options' and
                 option in __sandbox__._raw_options):
             result.append(__sandbox__._raw_options[option])
 
     return quote(*result)
 
+
 set_config('MOZ_CONFIGURE_OPTIONS', all_configure_options)
 
 
 # This is temporary until js/src/configure and configure are merged.
 # Use instead of option() in js/moz.configure and more generally, for
 # options that are shared between configure and js/src/configure.
 @template
 def js_option(*args, **kwargs):
--- a/build/moz.configure/java.configure
+++ b/build/moz.configure/java.configure
@@ -5,58 +5,64 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 # Java detection
 # ========================================================
 option('--with-java-bin-path', nargs=1,
        help='Location of Java binaries (java, javac, jar)')
 
+
 @depends('--with-java-bin-path')
 @imports(_from='os', _import='environ')
 def java_search_paths(path):
     if path:
         # Look for javac and jar in the specified path.
         return path
     # With no path specified, look for javac and jar in $JAVA_HOME (if set)
     # and $PATH.
     if 'JAVA_HOME' in environ:
         return [os.path.join(environ['JAVA_HOME'], 'bin'),
                 environ.get('PATH', '')]
     return [environ.get('PATH')]
 
 # Finds the given java tool, failing with a custom error message if we can't
 # find it.
+
+
 @template
 def check_java_tool(tool):
     check = check_prog(tool.upper(), (tool,), paths=java_search_paths,
                        allow_missing=True)
 
     @depends(check)
     def require_tool(result):
         if result is None:
             die("The program %s was not found.  Set $JAVA_HOME to your Java "
                 "SDK directory or use '--with-java-bin-path={java-bin-dir}'"
                 % tool)
         return result
 
     return require_tool
 
+
 check_java_tool('java')
 check_java_tool('javah')
 check_java_tool('jar')
 check_java_tool('jarsigner')
 check_java_tool('keytool')
 javac = check_java_tool('javac')
 
+
 @depends(javac)
 @checking('for javac version')
 @imports('subprocess')
 def javac_version(javac):
     try:
         output = subprocess.check_output([javac, '-version'],
                                          stderr=subprocess.STDOUT).rstrip()
         version = Version(output.split(' ')[-1])
         if version < '1.8':
-            die('javac 1.8 or higher is required (found %s). Check the JAVA_HOME environment variable.' % version)
+            die('javac 1.8 or higher is required (found %s). '
+                'Check the JAVA_HOME environment variable.' % version)
         return version
     except subprocess.CalledProcessError as e:
         die('Failed to get javac version: %s', e.output)
--- a/build/moz.configure/keyfiles.configure
+++ b/build/moz.configure/keyfiles.configure
@@ -54,12 +54,11 @@ def id_and_secret_keyfile(desc, default=
             secret=secret,
         )
 
     content = keyfile(desc, help='Use the client id and secret key contained '
                                  'in the given keyfile for %s requests' % desc,
                       default=default,
                       callback=id_and_secret)
 
-
     name = desc.upper().replace(' ', '_')
     set_config('MOZ_%s_CLIENTID' % name, content.id)
     set_config('MOZ_%s_KEY' % name, content.secret)
--- a/build/moz.configure/memory.configure
+++ b/build/moz.configure/memory.configure
@@ -8,16 +8,17 @@
 @deprecated_option(env='MOZ_JEMALLOC4')
 def moz_jemalloc4(value):
     die('MOZ_JEMALLOC4 is deprecated')
 
 
 option('--enable-jemalloc', env='MOZ_MEMORY',
        help='Replace memory allocator with jemalloc')
 
+
 @depends('--enable-jemalloc', target, build_project, c_compiler)
 def jemalloc(value, target, build_project, c_compiler):
     if value.origin != 'default':
         return bool(value) or None
 
     if build_project == 'js':
         return True
 
@@ -43,27 +44,30 @@ add_old_configure_assignment('MOZ_MEMORY
 
 # Because --enable-jemalloc doesn't use a default because of the dependency
 # on the target, we can't use a js_option for it to propagate to js/src
 # through the old-configure.
 @depends(jemalloc)
 def jemalloc_for_old_configure(jemalloc):
     return '--%s-jemalloc' % ('enable' if jemalloc else 'disable')
 
+
 add_old_configure_arg(jemalloc_for_old_configure)
 
 
 option('--enable-replace-malloc',
        help='Enable ability to dynamically replace the malloc implementation')
 
+
 @depends('--enable-replace-malloc', jemalloc, milestone, build_project)
 def replace_malloc(value, jemalloc, milestone, build_project):
     # Enable on central for the debugging opportunities it adds.
     if value and not jemalloc:
         die('--enable-replace-malloc requires --enable-jemalloc')
     if value.origin != 'default':
         return bool(value) or None
     if milestone.is_nightly and jemalloc and build_project != 'js':
         return True
 
+
 set_config('MOZ_REPLACE_MALLOC', replace_malloc)
 set_define('MOZ_REPLACE_MALLOC', replace_malloc)
 add_old_configure_assignment('MOZ_REPLACE_MALLOC', replace_malloc)
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -1,23 +1,25 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+
 @imports('codecs')
 @imports('sys')
 def encoded_open(path, mode):
     encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
     return codecs.open(path, mode, encoding)
 
 
 option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
 
+
 @depends(mozconfig, 'AUTOCONF')
 @checking('for autoconf')
 @imports(_from='os.path', _import='exists')
 @imports('re')
 def autoconf(mozconfig, autoconf):
     mozconfig_autoconf = None
     if mozconfig['path']:
         make_extra = mozconfig['make_extra']
@@ -51,16 +53,17 @@ def autoconf(mozconfig, autoconf):
     if not autoconf:
         die('Could not find autoconf 2.13')
 
     if not exists(autoconf):
         die('Could not find autoconf 2.13 at %s', autoconf)
 
     return autoconf
 
+
 set_config('AUTOCONF', autoconf)
 
 
 @depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
          old_configure_assignments, build_project)
 @imports(_from='__builtin__', _import='open')
 @imports(_from='__builtin__', _import='print')
 @imports('glob')
@@ -112,18 +115,19 @@ def prepare_configure(old_configure, moz
         script = script.replace('>./config.log', '>>./config.log')
 
         with open(old_configure, 'wb') as fh:
             fh.write(script)
 
     cmd = [shell, old_configure]
     with encoded_open('old-configure.vars', 'w') as out:
         log.debug('Injecting the following to old-configure:')
+
         def inject(command):
-            print(command, file=out)
+            print(command, file=out) # noqa Python 2vs3
             log.debug('| %s', command)
 
         if mozconfig['path']:
             for key, value in mozconfig['vars']['added'].items():
                 inject("%s=%s" % (key, quote(value)))
             for key, (old, value) in mozconfig['vars']['modified'].items():
                 inject("%s=%s" % (key, quote(value)))
             for t in ('env', 'vars'):
@@ -355,17 +359,17 @@ def old_configure(prepare_configure, ext
         sys.exit(ret)
 
     raw_config = {}
     with encoded_open('config.data', 'r') as fh:
         code = compile(fh.read(), 'config.data', 'exec')
         # Every variation of the exec() function I tried led to:
         # SyntaxError: unqualified exec is not allowed in function 'main' it
         # contains a nested function with free variables
-        exec code in raw_config
+        exec code in raw_config # noqa
 
     # Ensure all the flags known to old-configure appear in the
     # @old_configure_options above.
     all_options = set(all_options)
     for flag in raw_config['flags']:
         if flag not in all_options:
             die('Missing option in `@old_configure_options` in %s: %s',
                 __file__, flag)
@@ -379,16 +383,18 @@ def old_configure(prepare_configure, ext
 # set_config is only available in the global namespace, not directly in
 # @depends functions, but we do need to enumerate the result of
 # old_configure, so we cheat.
 @imports('__sandbox__')
 def set_old_configure_config(name, value):
     __sandbox__.set_config_impl(name, value)
 
 # Same as set_old_configure_config, but for set_define.
+
+
 @imports('__sandbox__')
 def set_old_configure_define(name, value):
     __sandbox__.set_define_impl(name, value)
 
 
 @depends(old_configure)
 @imports('types')
 def post_old_configure(raw_config):
--- a/build/moz.configure/pkg.configure
+++ b/build/moz.configure/pkg.configure
@@ -1,21 +1,24 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+
 @depends('--enable-compile-environment')
 def pkg_config(compile_env):
     if compile_env:
         return ('pkg-config',)
 
+
 pkg_config = check_prog('PKG_CONFIG', pkg_config, allow_missing=True)
 
+
 @depends_if(pkg_config)
 @checking('for pkg-config version')
 @imports('subprocess')
 def pkg_config_version(pkg_config):
     return Version(check_cmd_output(pkg_config, '--version').rstrip())
 
 # Locates the given module using pkg-config.
 # - `var` determines the name of variables to set when the package is found.
@@ -24,16 +27,18 @@ def pkg_config_version(pkg_config):
 #   strings describing packages to locate, or depends function that will
 #   resolve to such a string or list of strings.
 # - `when` a depends function that will determine whether to perform
 #   any checks (default is to always perform checks).
 # - `allow_missing` If set, failure to fulfill the package description
 #   will not result in an error or logged message, and any error message
 #   will be returned to the caller.
 #   Returns `True` when the package description is fulfilled.
+
+
 @template
 def pkg_check_modules(var, package_desc, when=always,
                       allow_missing=False):
     if isinstance(package_desc, (tuple, list)):
         package_desc = ' '.join(package_desc)
     package_desc = dependable(package_desc)
 
     @depends(when, '--enable-compile-environment')
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -4,26 +4,28 @@
 # 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/.
 
 # Rust is required by `rust_compiler` below. We allow_missing here
 # to propagate failures to the better error message there.
 rustc = check_prog('RUSTC', ['rustc'], allow_missing=True)
 cargo = check_prog('CARGO', ['cargo'], allow_missing=True)
 
+
 @depends_if(rustc)
 @checking('rustc version', lambda info: info.version)
 def rustc_info(rustc):
     out = check_cmd_output(rustc, '--version', '--verbose').splitlines()
     info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
     return namespace(
         version=Version(info.get('release', '0')),
         commit=info.get('commit-hash', 'unknown'),
     )
 
+
 @depends_if(cargo)
 @checking('cargo version', lambda info: info.version)
 @imports('re')
 def cargo_info(cargo):
     out = check_cmd_output(cargo, '--version', '--verbose').splitlines()
     info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
     version = info.get('release')
     # Older versions of cargo didn't support --verbose, in which case, they
@@ -38,16 +40,17 @@ def cargo_info(cargo):
         if not m:
             die('Could not determine cargo version from output: %s', out)
         version = m.group(1)
 
     return namespace(
         version=Version(version),
     )
 
+
 @depends(rustc_info, cargo_info)
 @imports(_from='textwrap', _import='dedent')
 def rust_compiler(rustc_info, cargo_info):
     if not rustc_info:
         die(dedent('''\
         Rust compiler not found.
         To compile rust language sources, you must have 'rustc' in your path.
         See https://www.rust-lang.org/ for more information.
@@ -168,17 +171,18 @@ def rust_triple_alias(host_or_target):
         rustc_target = rust_supported_targets.per_os.get(
             (host_or_target.cpu, host_or_target_os))
 
         if rustc_target is None:
             rustc_target = rust_supported_targets.per_raw_os.get(
                 (host_or_target.cpu, host_or_target_raw_os))
 
         if rustc_target is None:
-            die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+            die("Don't know how to translate {} for rustc".format(
+                host_or_target.alias))
 
         # Check to see whether our rustc has a reasonably functional stdlib
         # for our chosen target.
         target_arg = '--target=' + rustc_target.alias
         in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs')
         out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
         os.close(out_fd)
         try:
@@ -192,16 +196,17 @@ def rust_triple_alias(host_or_target):
 
             cmd = [
                 rustc,
                 '--crate-type', 'staticlib',
                 target_arg,
                 '-o', out_path,
                 in_path,
             ]
+
             def failed():
                 die(dedent('''\
                 Cannot compile for {} with {}
                 The target may be unsupported, or you may not have
                 a rust std library for that target installed. Try:
 
                   rustup target add {}
                 '''.format(host_or_target.alias, rustc, rustc_target.alias)))
@@ -212,25 +217,28 @@ def rust_triple_alias(host_or_target):
             os.remove(in_path)
             os.remove(out_path)
 
         # This target is usable.
         return rustc_target.alias
 
     return rust_target
 
+
 rust_target_triple = rust_triple_alias(target)
 rust_host_triple = rust_triple_alias(host)
 
 set_config('RUST_TARGET', rust_target_triple)
 set_config('RUST_HOST_TARGET', rust_host_triple)
 
+
 @depends(rust_target_triple)
 def rust_target_env_name(triple):
-    return triple.upper().replace('-','_')
+    return triple.upper().replace('-', '_')
+
 
 # We need this to form various Cargo environment variables, as there is no
 # uppercase function in make, and we don't want to shell out just for
 # converting a string to uppercase.
 set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
 
 # This is used for putting source info into symbol files.
 set_config('RUSTC_COMMIT', depends(rustc_info)(lambda i: i.commit))
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -10,32 +10,35 @@ option(env='MOZ_PGO', help='Build with p
 
 set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
 add_old_configure_assignment('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
 
 # yasm detection
 # ==============================================================
 yasm = check_prog('YASM', ['yasm'], allow_missing=True)
 
+
 @depends_if(yasm)
 @checking('yasm version')
 def yasm_version(yasm):
     version = check_cmd_output(
         yasm, '--version',
         onerror=lambda: die('Failed to get yasm version.')
     ).splitlines()[0].split()[1]
     return Version(version)
 
+
 # Until we move all the yasm consumers out of old-configure.
 # bug 1257904
 add_old_configure_assignment('_YASM_MAJOR_VERSION',
                              yasm_version.major)
 add_old_configure_assignment('_YASM_MINOR_VERSION',
                              yasm_version.minor)
 
+
 @depends(yasm, target)
 def yasm_asflags(yasm, target):
     if yasm:
         asflags = {
             ('OSX', 'x86'): '-f macho32',
             ('OSX', 'x86_64'): '-f macho64',
             ('WINNT', 'x86'): '-f win32',
             ('WINNT', 'x86_64'): '-f x64',
@@ -46,43 +49,49 @@ def yasm_asflags(yasm, target):
             if target.cpu == 'x86':
                 asflags = '-f elf32'
             elif target.cpu == 'x86_64':
                 asflags = '-f elf64'
         if asflags:
             asflags += ' -rnasm -pnasm'
         return asflags
 
+
 set_config('YASM_ASFLAGS', yasm_asflags)
 
+
 @depends(yasm_asflags)
 def have_yasm(value):
     if value:
         return True
 
+
 set_config('HAVE_YASM', have_yasm)
 # Until the YASM variable is not necessary in old-configure.
 add_old_configure_assignment('YASM', have_yasm)
 
 # Android NDK
 # ==============================================================
 
+
 @depends('--disable-compile-environment', build_project, '--help')
 def compiling_android(compile_env, build_project, _):
     return compile_env and build_project in ('mobile/android', 'js')
 
+
 include('android-ndk.configure', when=compiling_android)
 
 # MacOS deployment target version
 # ==============================================================
 # This needs to happen before any compilation test is done.
 
 option('--enable-macos-target', env='MACOSX_DEPLOYMENT_TARGET', nargs=1,
        default='10.7', help='Set the minimum MacOS version needed at runtime')
 
+
 @depends('--enable-macos-target', target)
 @imports(_from='os', _import='environ')
 def macos_target(value, target):
     if value and target.os == 'OSX':
         # Ensure every compiler process we spawn uses this value.
         environ['MACOSX_DEPLOYMENT_TARGET'] = value[0]
         return value[0]
     if value and value.origin != 'default':
@@ -92,17 +101,18 @@ def macos_target(value, target):
 
 set_config('MACOSX_DEPLOYMENT_TARGET', macos_target)
 add_old_configure_assignment('MACOSX_DEPLOYMENT_TARGET', macos_target)
 
 # Xcode state
 # ===========
 
 js_option('--disable-xcode-checks',
-       help='Do not check that Xcode is installed and properly configured')
+          help='Do not check that Xcode is installed and properly configured')
+
 
 @depends(host, '--disable-xcode-checks')
 def xcode_path(host, xcode_checks):
     if host.kernel != 'Darwin' or not xcode_checks:
         return
 
     # xcode-select -p prints the path to the installed Xcode. It
     # should exit 0 and return non-empty result if Xcode is installed.
@@ -122,71 +132,83 @@ def xcode_path(host, xcode_checks):
     # Now look for the Command Line Tools.
     def no_cltools():
         die('Could not find installed Xcode Command Line Tools; '
             'run `xcode-select --install` and follow the instructions '
             'to install them then try again; if you wish to build without '
             'Xcode Command Line Tools installed, '
             'add the --disable-xcode-checks configure flag')
 
-    res = check_cmd_output('pkgutil', '--pkg-info',
-                           'com.apple.pkg.CLTools_Executables',
-                            onerror=no_cltools)
+    check_cmd_output('pkgutil', '--pkg-info',
+                     'com.apple.pkg.CLTools_Executables',
+                     onerror=no_cltools)
 
     return xcode_path
 
+
 set_config('XCODE_PATH', xcode_path)
 
 
 # Compiler wrappers
 # ==============================================================
 # Normally, we'd use js_option and automatically have those variables
 # propagated to js/src, but things are complicated by possible additional
 # wrappers in CC/CXX, and by other subconfigures that do not handle those
 # options and do need CC/CXX altered.
 option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
        help='Enable compiling with wrappers such as distcc and ccache')
 
 option('--with-ccache', env='CCACHE', nargs='?',
        help='Enable compiling with ccache')
 
+
 @depends_if('--with-ccache')
 def ccache(value):
     if len(value):
         return value
     # If --with-ccache was given without an explicit value, we default to
     # 'ccache'.
     return 'ccache'
 
+
 ccache = check_prog('CCACHE', progs=(), input=ccache)
 
 # Distinguish ccache from sccache.
+
+
 @depends_if(ccache)
 def ccache_is_sccache(ccache):
     return check_cmd_output(ccache, '--version').startswith('sccache')
 
+
 @depends(ccache, ccache_is_sccache)
 def using_ccache(ccache, ccache_is_sccache):
     return ccache and not ccache_is_sccache
 
+
 @depends_if(ccache, ccache_is_sccache)
 def using_sccache(ccache, ccache_is_sccache):
     return ccache and ccache_is_sccache
 
+
 set_config('MOZ_USING_CCACHE', using_ccache)
 set_config('MOZ_USING_SCCACHE', using_sccache)
 
-option(env='SCCACHE_VERBOSE_STATS', help='Print verbose sccache stats after build')
+option(env='SCCACHE_VERBOSE_STATS',
+       help='Print verbose sccache stats after build')
+
 
 @depends(using_sccache, 'SCCACHE_VERBOSE_STATS')
 def sccache_verbose_stats(using_sccache, verbose_stats):
     return using_sccache and bool(verbose_stats)
 
+
 set_config('SCCACHE_VERBOSE_STATS', sccache_verbose_stats)
 
+
 @depends('--with-compiler-wrapper', ccache)
 @imports(_from='mozbuild.shellutil', _import='split', _as='shell_split')
 def compiler_wrapper(wrapper, ccache):
     if wrapper:
         raw_wrapper = wrapper[0]
         wrapper = shell_split(raw_wrapper)
         wrapper_program = find_program(wrapper[0])
         if not wrapper_program:
@@ -197,68 +219,78 @@ def compiler_wrapper(wrapper, ccache):
     if ccache:
         if wrapper:
             return tuple([ccache] + wrapper)
         else:
             return (ccache,)
     elif wrapper:
         return tuple(wrapper)
 
+
 add_old_configure_assignment('COMPILER_WRAPPER', compiler_wrapper)
 
+
 @depends_if(compiler_wrapper)
 def using_compiler_wrapper(compiler_wrapper):
     return True
 
+
 set_config('MOZ_USING_COMPILER_WRAPPER', using_compiler_wrapper)
 
 
 # GC rooting and hazard analysis.
 # ==============================================================
 option(env='MOZ_HAZARD', help='Build for the GC rooting hazard analysis')
 
+
 @depends('MOZ_HAZARD')
 def hazard_analysis(value):
     if value:
         return True
 
+
 set_config('MOZ_HAZARD', hazard_analysis)
 
 
 # Cross-compilation related things.
 # ==============================================================
 js_option('--with-toolchain-prefix', env='TOOLCHAIN_PREFIX', nargs=1,
           help='Prefix for the target toolchain')
 
+
 @depends('--with-toolchain-prefix', target, cross_compiling)
 def toolchain_prefix(value, target, cross_compiling):
     if value:
         return tuple(value)
     if cross_compiling:
         return ('%s-' % target.toolchain, '%s-' % target.alias)
 
+
 @depends(toolchain_prefix, target)
 def first_toolchain_prefix(toolchain_prefix, target):
     # Pass TOOLCHAIN_PREFIX down to the build system if it was given from the
     # command line/environment (in which case there's only one value in the tuple),
     # or when cross-compiling for Android.
     if toolchain_prefix and (target.os == 'Android' or len(toolchain_prefix) == 1):
         return toolchain_prefix[0]
 
+
 set_config('TOOLCHAIN_PREFIX', first_toolchain_prefix)
 add_old_configure_assignment('TOOLCHAIN_PREFIX', first_toolchain_prefix)
 
 
 # Compilers
 # ==============================================================
 include('compilers-util.configure')
 
+
 def try_preprocess(compiler, language, source):
     return try_invoke_compiler(compiler, language, source, ['-E'])
 
+
 @imports(_from='mozbuild.configure.constants', _import='CompilerType')
 @imports(_from='mozbuild.configure.constants',
          _import='CPU_preprocessor_checks')
 @imports(_from='mozbuild.configure.constants',
          _import='kernel_preprocessor_checks')
 @imports(_from='textwrap', _import='dedent')
 def get_compiler_info(compiler, language):
     '''Returns information about the given `compiler` (command line in the
@@ -427,17 +459,18 @@ def check_compiler(compiler, language, t
                 append_flag('-std=gnu++11')
             # MSVC 2015 headers include C++14 features, but don't guard them
             # with appropriate checks.
             if info.type == 'clang-cl' and info.language_version != cxx14_version:
                 append_flag('-std=c++14')
             # GCC 4.9 indicates that it implements draft C++14 features
             # instead of the full language.
             elif info.type == 'gcc' and not \
-                (info.language_version == draft_cxx14_version or info.language_version == cxx14_version):
+                (info.language_version == draft_cxx14_version or
+                 info.language_version == cxx14_version):
                 append_flag('-std=gnu++14')
 
     # We force clang-cl to emulate Visual C++ 2015 Update 3.
     if info.type == 'clang-cl' and info.version != '19.00.24213':
         # This flag is a direct clang-cl flag that doesn't need -Xclang,
         # add it directly.
         flags.append('-fms-compatibility-version=19.00.24213')
 
@@ -477,17 +510,22 @@ def check_compiler(compiler, language, t
 
 @imports(_from='__builtin__', _import='open')
 @imports('json')
 @imports('subprocess')
 @imports('sys')
 def get_vc_paths(topsrcdir):
     def vswhere(args):
         encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
-        return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, 'replace'))
+        return json.loads(
+            subprocess.check_output([
+                os.path.join(topsrcdir, 'build/win32/vswhere.exe'),
+                '-format',
+                'json'
+            ] + args).decode(encoding, 'replace'))
 
     # Can't pass -requires with -legacy, so query each separately.
     # Legacy versions first (VS2015)
     for install in vswhere(['-legacy', '-version', '[14.0,15.0)']):
         version = Version(install['installationVersion'])
         # Skip anything older than VS2015.
         if version < '14':
             continue
@@ -496,34 +534,39 @@ def get_vc_paths(topsrcdir):
         yield (Version(install['installationVersion']), {
             'x64': [os.path.join(path, r'VC\bin\amd64')],
             # The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
             'x86': [os.path.join(path, r'VC\bin\amd64_x86'), os.path.join(path, r'VC\bin\amd64')],
         })
     # Then VS2017 and newer.
     for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
         path = install['installationPath']
-        tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
-        tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
+        tools_version = open(os.path.join(
+            path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
+        tools_path = os.path.join(
+            path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
         yield (Version(install['installationVersion']), {
             'x64': [os.path.join(tools_path, 'x64')],
             # The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
             'x86': [os.path.join(tools_path, 'x86'), os.path.join(tools_path, 'x64')],
         })
 
+
 js_option('--with-visual-studio-version', nargs=1,
           choices=('2015', '2017'),
           help='Select a specific Visual Studio version to use')
 
+
 @depends('--with-visual-studio-version')
 def vs_major_version(value):
     if value:
         return {'2015': 14,
                 '2017': 15}[value[0]]
 
+
 @depends(host, target, vs_major_version, check_build_environment, '--with-visual-studio-version')
 @imports(_from='__builtin__', _import='sorted')
 @imports(_from='operator', _import='itemgetter')
 @imports('platform')
 def vc_compiler_path(host, target, vs_major_version, env, vs_release_name):
     if host.kernel != 'WINNT':
         return
     vc_target = {
@@ -533,17 +576,18 @@ def vc_compiler_path(host, target, vs_ma
     }.get(target.cpu)
     if vc_target is None:
         return
 
     all_versions = sorted(get_vc_paths(env.topsrcdir), key=itemgetter(0))
     if not all_versions:
         return
     if vs_major_version:
-        versions = [d for (v, d) in all_versions if v.major == vs_major_version]
+        versions = [d for (v, d) in all_versions if v.major ==
+                    vs_major_version]
         if not versions:
             die('Visual Studio %s could not be found!' % vs_release_name)
         data = versions[0]
     else:
         # Choose the newest version.
         data = all_versions[-1][1]
     paths = data.get(vc_target)
     if not paths:
@@ -649,17 +693,17 @@ def compiler(language, host_or_target, c
         ('C++', host): 'HOST_CXX',
     }[language, host_or_target]
 
     default_compilers = {
         'C': lambda: default_c_compilers(host_or_target),
         'C++': lambda: default_cxx_compilers(c_compiler),
     }[language]()
 
-    what='the %s %s compiler' % (host_or_target_str, language)
+    what = 'the %s %s compiler' % (host_or_target_str, language)
 
     option(env=var, nargs=1, help='Path to %s' % what)
 
     # Handle the compiler given by the user through one of the CC/CXX/HOST_CC/
     # HOST_CXX variables.
     @depends_if(var)
     @imports(_from='itertools', _import='takewhile')
     @imports(_from='mozbuild.shellutil', _import='split', _as='shell_split')
@@ -882,29 +926,28 @@ def compiler(language, host_or_target, c
 
     def compiler_error():
         raise FatalCheckError('Failed compiling a simple %s source with %s'
                               % (language, what))
 
     valid_compiler.try_compile(check_msg='%s works' % what,
                                onerror=compiler_error)
 
-
     # Set CPP/CXXCPP for both the build system and old-configure. We don't
     # need to check this works for preprocessing, because we already relied
     # on $CC -E/$CXX -E doing preprocessing work to validate the compiler
     # in the first place.
     if host_or_target == target:
         pp_var = {
             'C': 'CPP',
             'C++': 'CXXCPP',
         }[language]
 
         preprocessor = depends_if(valid_compiler)(
-                lambda x: list(x.wrapper) + [x.compiler, '-E'] + list(x.flags))
+            lambda x: list(x.wrapper) + [x.compiler, '-E'] + list(x.flags))
 
         set_config(pp_var, preprocessor)
         add_old_configure_assignment(pp_var, preprocessor)
 
     if language == 'C':
         linker_var = {
             target: 'LD',
             host: 'HOST_LD',
@@ -937,92 +980,103 @@ host_c_compiler = compiler('C', host, ot
 host_cxx_compiler = compiler('C++', host, c_compiler=host_c_compiler,
                              other_compiler=cxx_compiler,
                              other_c_compiler=c_compiler)
 
 # Generic compiler-based conditions.
 non_msvc_compiler = depends(c_compiler)(lambda info: info.type != 'msvc')
 building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
 
+
 @depends(c_compiler)
 def msvs_version(info):
     # clang-cl emulates the same version scheme as cl. And MSVS_VERSION needs to
     # be set for GYP on Windows.
     if info.type in ('clang-cl', 'msvc'):
         if info.version >= '19.10':
             return '2017'
         elif info.version >= '19.00':
             return '2015'
 
     return ''
 
+
 set_config('MSVS_VERSION', msvs_version)
 
 include('compile-checks.configure')
 
+
 @depends(have_64_bit,
          try_compile(body='static_assert(sizeof(void *) == 8, "")',
                      check_msg='for 64-bit OS'))
 def check_have_64_bit(have_64_bit, compiler_have_64_bit):
     if have_64_bit != compiler_have_64_bit:
         configure_error('The target compiler does not agree with configure '
                         'about the target bitness.')
 
+
 option(env='BINDGEN_CFLAGS',
        nargs=1,
        default=bindgen_cflags_defaults,
        help='Options bindgen should pass to the C/C++ parser')
 
+
 @depends('BINDGEN_CFLAGS')
 @checking('bindgen cflags', lambda s: s if s and s.strip() else 'no')
 def bindgen_cflags(value):
     if value and len(value):
         # Reformat the env value for substitution into a toml list.
         flags = value[0].split()
         return ', '.join('"' + flag + '"' for flag in flags)
     return ''
 
+
 set_config('BINDGEN_CFLAGS', bindgen_cflags)
 
+
 @depends(c_compiler)
 def default_debug_flags(compiler_info):
     # Debug info is ON by default.
     if compiler_info.type in ('msvc', 'clang-cl'):
         return '-Zi'
     return '-g'
 
+
 option(env='MOZ_DEBUG_FLAGS',
        nargs=1,
        help='Debug compiler flags')
 
 imply_option('--enable-debug-symbols',
              depends_if('--enable-debug')(lambda v: v))
 
 js_option('--enable-debug-symbols',
           nargs='?',
           default=True,
           help='Enable debug symbols using the given compiler flags')
 
 set_config('MOZ_DEBUG_SYMBOLS',
            depends_if('--enable-debug-symbols')(lambda _: True))
 
+
 @depends('MOZ_DEBUG_FLAGS', '--enable-debug-symbols', default_debug_flags)
 def debug_flags(env_debug_flags, enable_debug_flags, default_debug_flags):
     # If MOZ_DEBUG_FLAGS is set, and --enable-debug-symbols is set to a value,
     # --enable-debug-symbols takes precedence. Note, the value of
     # --enable-debug-symbols may be implied by --enable-debug.
     if len(enable_debug_flags):
         return enable_debug_flags[0]
     if env_debug_flags:
         return env_debug_flags[0]
     return default_debug_flags
 
+
 set_config('MOZ_DEBUG_FLAGS', debug_flags)
 add_old_configure_assignment('MOZ_DEBUG_FLAGS', debug_flags)
 
+
 @depends(c_compiler)
 def color_cflags(info):
     # We could test compiling with flags. By why incur the overhead when
     # color support should always be present in a specific toolchain
     # version?
 
     # Code for auto-adding this flag to compiler invocations needs to
     # determine if an existing flag isn't already present. That is likely
@@ -1032,16 +1086,17 @@ def color_cflags(info):
     # before adding flags to return values.
     if info.type == 'gcc' and info.version >= '4.9.0':
         return '-fdiagnostics-color'
     elif info.type == 'clang':
         return '-fcolor-diagnostics'
     else:
         return ''
 
+
 set_config('COLOR_CFLAGS', color_cflags)
 
 # Some standard library headers (notably bionic on Android) declare standard
 # functions (e.g. getchar()) and also #define macros for those standard
 # functions.  libc++ deals with this by doing something like the following
 # (explanatory comments added):
 #
 #   #ifdef FUNC
@@ -1073,47 +1128,55 @@ set_config('COLOR_CFLAGS', color_cflags)
 # However, libc++ will only define _LIBCPP_INLINE_VISIBILITY if there is no
 # existing definition.  We can therefore define it to the empty string (since
 # we are properly managing visibility ourselves) and avoid this whole mess.
 # Note that we don't need to do this with gcc, as libc++ detects gcc and
 # effectively does the same thing we are doing here.
 #
 # _LIBCPP_ALWAYS_INLINE needs similar workarounds, since it too declares
 # hidden visibility.
+
+
 @depends(c_compiler, target)
 def libcxx_override_visibility(c_compiler, target):
     if c_compiler.type == 'clang' and target.os == 'Android':
         return ''
 
+
 set_define('_LIBCPP_INLINE_VISIBILITY', libcxx_override_visibility)
-set_define('_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49', libcxx_override_visibility)
+set_define('_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49',
+           libcxx_override_visibility)
 set_define('_LIBCPP_ALWAYS_INLINE', libcxx_override_visibility)
 set_define('_LIBCPP_ALWAYS_INLINE_EXCEPT_GCC49', libcxx_override_visibility)
 
+
 @depends(target, check_build_environment)
 def visibility_flags(target, env):
     if target.os != 'WINNT':
         if target.kernel == 'Darwin':
             return ('-fvisibility=hidden', '-fvisibility-inlines-hidden')
         return ('-I%s/system_wrappers' % os.path.join(env.dist),
                 '-include',
                 '%s/config/gcc_hidden.h' % env.topsrcdir)
 
+
 @depends(target, visibility_flags)
 def wrap_system_includes(target, visibility_flags):
     if visibility_flags and target.kernel != 'Darwin':
         return True
 
+
 set_define('HAVE_VISIBILITY_HIDDEN_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_define('HAVE_VISIBILITY_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
 set_config('VISIBILITY_FLAGS', visibility_flags)
 
+
 @depends(c_compiler)
 @imports('multiprocessing')
 @imports(_from='__builtin__', _import='min')
 def pgo_flags(compiler):
     if compiler.type in ('gcc', 'clang'):
         return namespace(
             gen_cflags=['-fprofile-generate'],
             gen_ldflags=['-fprofile-generate'],
@@ -1137,104 +1200,115 @@ def pgo_flags(compiler):
             # optimization/PGO case. I think it's probably a compiler bug,
             # but we work around it here.
             use_cflags=['-GL', '-wd4624', '-wd4952'],
             # XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
             # Probably also a compiler bug, but what can you do?
             use_ldflags=['-LTCG:PGUPDATE', cgthreads],
         )
 
+
 set_config('PROFILE_GEN_CFLAGS', pgo_flags.gen_cflags)
 set_config('PROFILE_GEN_LDFLAGS', pgo_flags.gen_ldflags)
 set_config('PROFILE_USE_CFLAGS', pgo_flags.use_cflags)
 set_config('PROFILE_USE_LDFLAGS', pgo_flags.use_ldflags)
 
 # We only want to include windows.configure when we are compiling on
 # Windows, for Windows.
+
+
 @depends(target, host)
 def is_windows(target, host):
     return host.kernel == 'WINNT' and target.kernel == 'WINNT'
 
+
 include('windows.configure', when=is_windows)
 
 # Shader Compiler for Windows (and MinGW Cross Compile)
 # ==============================================================
 
 fxc = check_prog('FXC', ('fxc.exe', 'fxc2.exe'), when=depends(target)
                  (lambda t: t.kernel == 'WINNT'))
 wine = check_prog('WINE', ['wine'], when=depends(target, host)
                   (lambda t, h: t.kernel == 'WINNT' and h.kernel == 'Linux'))
 
 # Security Hardening
 # ==============================================================
 
 option('--enable-hardening', env='MOZ_SECURITY_HARDENING',
        help='Enables security hardening compiler options')
 
+
 @depends('--enable-hardening', c_compiler)
 def security_hardening_cflags(value, c_compiler):
     if value and c_compiler.type in ['gcc', 'clang']:
         return '-fstack-protector-strong'
 
+
 add_old_configure_assignment('HARDENING_CFLAGS', security_hardening_cflags)
 imply_option('--enable-pie', depends_if('--enable-hardening')(lambda v: v))
 
 option(env='RUSTFLAGS',
        nargs=1,
        help='Rust compiler flags')
 set_config('RUSTFLAGS', depends('RUSTFLAGS')(lambda flags: flags))
 
 
 imply_option('--enable-release', mozilla_official)
 imply_option('--enable-release', depends_if('MOZ_AUTOMATION')(lambda x: True))
 
 js_option('--enable-release',
           help='Build with more conservative, release engineering-oriented '
                'options. This may slow down builds.')
 
+
 @depends('--enable-release')
 def developer_options(value):
     if not value:
         return True
 
+
 add_old_configure_assignment('DEVELOPER_OPTIONS', developer_options)
 set_config('DEVELOPER_OPTIONS', developer_options)
 
 # Linker detection
 # ==============================================================
 
+
 @depends(target)
 def is_linker_option_enabled(target):
     if target.kernel not in ('Darwin', 'WINNT', 'SunOS'):
         return True
 
 
 option('--enable-gold',
        env='MOZ_FORCE_GOLD',
        help='Enable GNU Gold Linker when it is not already the default',
        when=is_linker_option_enabled)
 
 imply_option('--enable-linker', 'gold', when='--enable-gold')
 
+
 @imports('os')
 @imports('shutil')
 def enable_gnu_linker(enable_gold_option, c_compiler, developer_options, build_env,
                       toolchain_flags, linker_name):
     # Used to check the kind of linker
     version_check = ['-Wl,--version']
     cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
     if toolchain_flags:
         cmd_base += toolchain_flags
 
     def resolve_gold():
         # Try to force the usage of gold
         targetDir = os.path.join(build_env.topobjdir, 'build', 'unix', 'gold')
 
         gold_detection_arg = '-print-prog-name=ld.gold'
-        gold = check_cmd_output(c_compiler.compiler, gold_detection_arg).strip()
+        gold = check_cmd_output(c_compiler.compiler,
+                                gold_detection_arg).strip()
         if not gold:
             return
 
         goldFullPath = find_program(gold)
         if goldFullPath is None:
             return
 
         if os.path.exists(targetDir):
@@ -1280,51 +1354,57 @@ def enable_gnu_linker(enable_gold_option
             KIND='gold'
         )
 
     # For other platforms without gold or the GNU linker
     return namespace(
         KIND='other'
     )
 
+
 js_option('--enable-linker', nargs=1,
           choices=('bfd', 'gold', 'lld', 'other'),
           help='Select the linker',
           when=is_linker_option_enabled)
 
+
 @depends('--enable-linker', c_compiler, developer_options, check_build_environment,
          extra_toolchain_flags, when=is_linker_option_enabled)
 @checking('for linker', lambda x: x.KIND)
 def select_linker(linker, c_compiler, developer_options, build_env, toolchain_flags):
     linker = linker[0] if linker else 'other'
     if linker in ('gold', 'bfd', 'other'):
         return enable_gnu_linker(linker == 'gold', c_compiler, developer_options,
                                  build_env, toolchain_flags, linker)
     if linker == 'lld':
         version_check = ['-Wl,--version']
-        cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
+        cmd_base = c_compiler.wrapper + \
+            [c_compiler.compiler] + c_compiler.flags
         lld = "-fuse-ld=" + linker
         cmd = cmd_base + [lld] + version_check
         if 'LLD' in check_cmd_output(*cmd).decode('utf-8'):
             return namespace(
                 KIND='lld',
                 LINKER_FLAG=lld,
             )
         else:
             die("Could not use lld as linker")
 
 
-set_config('LD_IS_BFD', depends(select_linker.KIND)(lambda x: x == 'bfd' or None))
+set_config('LD_IS_BFD', depends(select_linker.KIND)
+           (lambda x: x == 'bfd' or None))
 set_config('LINKER_LDFLAGS', select_linker.LINKER_FLAG)
 
 # Code Coverage
 # ==============================================================
 
 js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
-       help='Enable code coverage')
+          help='Enable code coverage')
+
 
 @depends('--enable-coverage')
 def code_coverage(value):
     if value:
         return True
 
+
 set_config('MOZ_CODE_COVERAGE', code_coverage)
 set_define('MOZ_CODE_COVERAGE', code_coverage)
--- a/build/moz.configure/util.configure
+++ b/build/moz.configure/util.configure
@@ -1,14 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
+
 @imports('sys')
 def die(*args):
     'Print an error and terminate configure.'
     log.error(*args)
     sys.exit(1)
 
 
 @imports(_from='mozbuild.configure', _import='ConfigureError')
@@ -17,16 +18,18 @@ def configure_error(message):
     Primarily for use in moz.configure templates to sanity check
     their inputs from moz.configure usage.'''
     raise ConfigureError(message)
 
 # A wrapper to obtain a process' output that returns the output generated
 # by running the given command if it exits normally, and streams that
 # output to log.debug and calls die or the given error callback if it
 # does not.
+
+
 @imports(_from='__builtin__', _import='unicode')
 @imports('subprocess')
 @imports('sys')
 @imports(_from='mozbuild.configure.util', _import='LineIO')
 @imports(_from='mozbuild.shellutil', _import='quote')
 def check_cmd_output(*args, **kwargs):
     onerror = kwargs.pop('onerror', None)
 
@@ -62,16 +65,17 @@ def check_cmd_output(*args, **kwargs):
                 log.debug('Its %s was:', desc)
                 with LineIO(lambda l: log.debug('| %s', l)) as o:
                     o.write(out)
         if onerror:
             return onerror()
         die('Command `%s` failed with exit status %d.' %
             (quote(*args), retcode))
 
+
 @imports('os')
 def is_absolute_or_relative(path):
     if os.altsep and os.altsep in path:
         return True
     return os.sep in path
 
 
 @imports(_import='mozpack.path', _as='mozpath')
@@ -83,17 +87,18 @@ def normsep(path):
 @imports(_from='ctypes', _import='wintypes')
 @imports(_from='mozbuild.configure.constants', _import='WindowsBinaryType')
 def windows_binary_type(path):
     """Obtain the type of a binary on Windows.
 
     Returns WindowsBinaryType constant.
     """
     GetBinaryTypeW = ctypes.windll.kernel32.GetBinaryTypeW
-    GetBinaryTypeW.argtypes = [wintypes.LPWSTR, wintypes.POINTER(wintypes.DWORD)]
+    GetBinaryTypeW.argtypes = [wintypes.LPWSTR,
+                               wintypes.POINTER(wintypes.DWORD)]
     GetBinaryTypeW.restype = wintypes.BOOL
 
     bin_type = wintypes.DWORD()
     res = GetBinaryTypeW(path, ctypes.byref(bin_type))
     if not res:
         die('could not obtain binary type of %s' % path)
 
     if bin_type.value == 0:
@@ -142,16 +147,17 @@ def normalize_path():
                 size = needed
 
     else:
         def normalize_path(path):
             return normsep(path)
 
     return normalize_path
 
+
 normalize_path = normalize_path()
 
 
 # Locates the given program using which, or returns the given path if it
 # exists.
 # The `paths` parameter may be passed to search the given paths instead of
 # $PATH.
 @imports(_from='which', _import='which')
@@ -359,16 +365,18 @@ def Version(v):
 # Denotes a deprecated option. Combines option() and @depends:
 # @deprecated_option('--option')
 # def option(value):
 #     ...
 # @deprecated_option() takes the same arguments as option(), except `help`.
 # The function may handle the option like a typical @depends function would,
 # but it is recommended it emits a deprecation error message suggesting an
 # alternative option to use if there is one.
+
+
 @template
 def deprecated_option(*args, **kwargs):
     assert 'help' not in kwargs
     kwargs['help'] = 'Deprecated'
     opt = option(*args, **kwargs)
 
     def decorator(func):
         @depends(opt.option)
@@ -409,16 +417,17 @@ never = dependable(False)
 # arguments.
 @template
 def depends_tmpl(eval_args_fn, *args, **kwargs):
     if kwargs:
         assert len(kwargs) == 1
         when = kwargs['when']
     else:
         when = None
+
     def decorator(func):
         @depends(*args, when=when)
         def wrapper(*args):
             if eval_args_fn(args):
                 return func(*args)
         return wrapper
     return decorator
 
@@ -439,20 +448,22 @@ def depends_all(*args, **kwargs):
 
 # Hacks related to old-configure
 # ==============================
 
 @dependable
 def old_configure_assignments():
     return []
 
+
 @dependable
 def extra_old_configure_args():
     return []
 
+
 @template
 def add_old_configure_assignment(var, value):
     var = dependable(var)
     value = dependable(value)
 
     @depends(old_configure_assignments, var, value)
     @imports(_from='mozbuild.shellutil', _import='quote')
     def add_assignment(assignments, var, value):
@@ -462,14 +473,15 @@ def add_old_configure_assignment(var, va
             assignments.append('%s=1' % var)
         elif value is False:
             assignments.append('%s=' % var)
         else:
             if isinstance(value, (list, tuple)):
                 value = quote(*value)
             assignments.append('%s=%s' % (var, quote(str(value))))
 
+
 @template
 def add_old_configure_arg(arg):
     @depends(extra_old_configure_args, arg)
     def add_arg(args, arg):
         if arg:
             args.append(arg)
--- a/build/moz.configure/windows.configure
+++ b/build/moz.configure/windows.configure
@@ -3,16 +3,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 option('--with-windows-version', nargs=1, default='603',
        help='Windows SDK version to target. Win 8.1 (603) is currently'
             'the minimum supported version.')
 
+
 @depends('--with-windows-version')
 @imports(_from='__builtin__', _import='ValueError')
 def valid_windows_version(value):
     if not value:
         die('Cannot build with --without-windows-version')
     try:
         version = int(value[0], 16)
         if version in (0x603,):
@@ -21,16 +22,17 @@ def valid_windows_version(value):
         pass
 
     die('Invalid value for --with-windows-version (%s)', value[0])
 
 
 option(env='WINDOWSSDKDIR', nargs=1,
        help='Directory containing the Windows SDK')
 
+
 @depends('WINDOWSSDKDIR', host)
 def windows_sdk_dir(value, host):
     if value:
         return value
     if host.kernel != 'WINNT':
         return ()
 
     return set(x[1] for x in get_registry_values(
@@ -39,16 +41,18 @@ def windows_sdk_dir(value, host):
 
 # The Windows SDK 8.1 and 10 have different layouts. The former has
 # $SDK/include/$subdir, while the latter has $SDK/include/$version/$subdir.
 # The vcvars* scripts don't actually care about the version, they just take
 # the last alphanumerically.
 # The $SDK/lib directories always have version subdirectories, but while the
 # versions match the one in $SDK/include for SDK 10, it's "winv6.3" for SDK
 # 8.1.
+
+
 @imports('os')
 @imports('re')
 @imports(_from='__builtin__', _import='sorted')
 @imports(_from='__builtin__', _import='WindowsError')
 def get_sdk_dirs(sdk, subdir):
     def get_dirs_containing(sdk, stem, subdir):
         base = os.path.join(sdk, stem)
         try:
@@ -84,16 +88,17 @@ def get_sdk_dirs(sdk, subdir):
         )
 
 
 @imports(_from='mozbuild.shellutil', _import='quote')
 def valid_windows_sdk_dir_result(value):
     if value:
         return '0x%04x in %s' % (value.version, quote(value.path))
 
+
 @depends(c_compiler, windows_sdk_dir, valid_windows_version, 'WINDOWSSDKDIR')
 @checking('for Windows SDK', valid_windows_sdk_dir_result)
 @imports(_from='__builtin__', _import='sorted')
 @imports(_from='textwrap', _import='dedent')
 def valid_windows_sdk_dir(compiler, windows_sdk_dir, target_version,
                           windows_sdk_dir_env):
     if windows_sdk_dir_env:
         windows_sdk_dir_env = windows_sdk_dir_env[0]
@@ -160,16 +165,17 @@ add_old_configure_assignment(
         lambda x: '0x%04X0000' % x.version if x else None))
 
 
 @imports(_from='mozbuild.shellutil', _import='quote')
 def valid_ucrt_sdk_dir_result(value):
     if value:
         return '%s in %s' % (value.version, quote(value.path))
 
+
 @depends(windows_sdk_dir, 'WINDOWSSDKDIR')
 @checking('for Universal CRT SDK', valid_ucrt_sdk_dir_result)
 @imports('os')
 @imports(_from='__builtin__', _import='sorted')
 @imports(_import='mozpack.path', _as='mozpath')
 def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env):
     if windows_sdk_dir_env:
         windows_sdk_dir_env = windows_sdk_dir_env[0]
@@ -221,17 +227,17 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, 
         raise FatalCheckError('Cannot find the Universal CRT SDK. '
                               'Please install it.')
 
     version, sdk = sdks[valid_sdks[0]]
     minimum_ucrt_version = Version('10.0.10586.0')
     if version < minimum_ucrt_version:
         raise FatalCheckError('Latest Universal CRT SDK version found %s'
                               ' and minimum required is %s.'
-                              % (version,  minimum_ucrt_version))
+                              % (version, minimum_ucrt_version))
 
     return namespace(
         path=sdk.path,
         include=sdk.include,
         lib=sdk.lib,
         version=version,
     )
 
@@ -262,17 +268,18 @@ def vc_path(c_compiler):
 @imports(_from='os.path', _import='isdir')
 def dia_sdk_dir(vc_path, c_compiler):
     if vc_path:
         if c_compiler.version < '19.10':
             path = os.path.join(os.path.dirname(vc_path), 'DIA SDK')
         else:
             # This would be easier if we had the installationPath that
             # get_vc_paths works with, since 'DIA SDK' is relative to that.
-            path = os.path.normpath(os.path.join(vc_path, r'..\..\..\..\DIA SDK'))
+            path = os.path.normpath(os.path.join(
+                vc_path, r'..\..\..\..\DIA SDK'))
         if isdir(path):
             return path
 
 
 @depends(vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
 @imports('os')
 def include_path(vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
@@ -301,16 +308,17 @@ def include_path(vc_path, windows_sdk_di
     ))
     if dia_sdk_dir:
         includes.append(os.path.join(dia_sdk_dir, 'include'))
     # Set in the environment for old-configure
     includes = os.pathsep.join(includes)
     os.environ['INCLUDE'] = includes
     return includes
 
+
 set_config('INCLUDE', include_path)
 
 
 @depends(target, c_compiler, vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
 @imports('os')
 def lib_path(target, c_compiler, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
         return
@@ -358,21 +366,23 @@ def lib_path(target, c_compiler, vc_path
         # For some reason the DIA SDK still uses the old-style targets
         # even in a newer MSVC.
         libs.append(os.path.join(dia_sdk_dir, 'lib', *old_target))
     # Set in the environment for old-configure
     libs = os.pathsep.join(libs)
     os.environ['LIB'] = libs
     return libs
 
+
 set_config('LIB', lib_path)
 
 
 option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool')
 
+
 @depends(valid_windows_sdk_dir, valid_ucrt_sdk_dir)
 @imports(_from='os', _import='environ')
 @imports('platform')
 def sdk_bin_path(valid_windows_sdk_dir, valid_ucrt_sdk_dir):
     if not valid_windows_sdk_dir:
         return
 
     vc_host = {
@@ -403,17 +413,17 @@ mt = check_prog('MT', ('mt.exe',), input
 @checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
 @imports('subprocess')
 def valid_mt(path):
     try:
         out = subprocess.check_output([path]).splitlines()
         out = '\n'.join(l for l in out
                         if 'Microsoft (R) Manifest Tool' in l)
         if out:
-              return path
+            return path
     except subprocess.CalledProcessError:
         pass
     raise FatalCheckError('%s is not Microsoft Manifest Tool')
 
 
 set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
 
 
@@ -428,12 +438,12 @@ add_old_configure_assignment('LINK', lin
 # valid_compiler().
 @depends(sdk_bin_path)
 @imports('os')
 def alter_path(sdk_bin_path):
     path = os.pathsep.join(sdk_bin_path)
     os.environ['PATH'] = path
     return path
 
+
 set_config('PATH', alter_path)
 
 check_prog('MAKECAB', ('makecab.exe',))
-
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -2,17 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # This script is used to capture the content of config.status-generated
 # files and subsequently restore their timestamp if they haven't changed.
 
 import argparse
 import errno
-import itertools
 import os
 import re
 import subprocess
 import sys
 import pickle
 
 import mozpack.path as mozpath
 
@@ -107,21 +106,20 @@ def maybe_clear_cache(data):
     for precious in PRECIOUS_VARS:
         # If there is no entry at all for that precious variable, then
         # its value is not precious for that particular configure.
         if 'ac_cv_env_%s_set' % precious not in cache:
             continue
         is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set'
         value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None
         if value != env.get(precious):
-            print 'Removing %s because of %s value change from:' \
-                % (data['cache-file'], precious)
-            print '  %s' % (value if value is not None else 'undefined')
-            print 'to:'
-            print '  %s' % env.get(precious, 'undefined')
+            print('Removing %s because of %s value change from:' % (data['cache-file'], precious))
+            print('  %s' % (value if value is not None else 'undefined'))
+            print('to:')
+            print('  %s' % env.get(precious, 'undefined'))
             os.remove(data['cache-file'])
             return True
     return False
 
 
 def split_template(s):
     """Given a "file:template" string, returns "file", "template". If the string
     is of the form "file" (without a template), returns "file", "file.in"."""
@@ -134,17 +132,16 @@ def get_config_files(data):
     # config.status in js/src never contains the output we try to scan here.
     if data['relobjdir'] == 'js/src':
         return [], []
 
     config_status = mozpath.join(data['objdir'], 'config.status')
     if not os.path.exists(config_status):
         return [], []
 
-    configure = mozpath.join(data['srcdir'], 'configure')
     config_files = []
     command_files = []
 
     # Scan the config.status output for information about configuration files
     # it generates.
     config_status_output = subprocess.check_output(
         [data['shell'], '-c', '%s --help' % config_status],
         stderr=subprocess.STDOUT).splitlines()
@@ -217,17 +214,17 @@ def prepare(srcdir, objdir, shell, args)
         'args': others,
         'shell': shell,
         'srcdir': srcdir,
         'env': environ,
     }
 
     if args.cache_file:
         data['cache-file'] = mozpath.normpath(mozpath.join(os.getcwd(),
-            args.cache_file))
+                                                           args.cache_file))
     else:
         data['cache-file'] = mozpath.join(objdir, 'config.cache')
 
     if previous_args is not None:
         data['previous-args'] = previous_args
 
     try:
         os.makedirs(objdir)
@@ -247,17 +244,17 @@ def execute_and_prefix(*args, **kwargs):
     prefix = kwargs['prefix']
     del kwargs['prefix']
     proc = subprocess.Popen(*args, stdout=subprocess.PIPE,
                             stderr=subprocess.STDOUT, **kwargs)
     while True:
         line = proc.stdout.readline()
         if not line:
             break
-        print prefix_lines(line.rstrip(), prefix)
+        print(prefix_lines(line.rstrip(), prefix))
         sys.stdout.flush()
     return proc.wait()
 
 
 def run(objdir):
     ret = 0
 
     with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
@@ -325,18 +322,18 @@ def run(objdir):
                 command += ['--%s=%s' % (kind, data[kind])]
         command += data['args']
         command += ['--cache-file=%s' % cache_file]
 
         # Pass --no-create to configure so that it doesn't run config.status.
         # We're going to run it ourselves.
         command += ['--no-create']
 
-        print prefix_lines('configuring', relobjdir)
-        print prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir)
+        print(prefix_lines('configuring', relobjdir))
+        print(prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir))
         sys.stdout.flush()
         returncode = execute_and_prefix(command, cwd=objdir, env=data['env'],
                                         prefix=relobjdir)
         if returncode:
             return returncode
 
         # Leave config.status with a new timestamp if configure is newer than
         # its original mtime.
@@ -363,35 +360,35 @@ def run(objdir):
         config_files, command_files = get_config_files(data)
         for f, t in config_files:
             if not os.path.exists(t) or \
                     os.path.getmtime(f) < os.path.getmtime(t):
                 skip_config_status = False
 
     if not skip_config_status:
         if skip_configure:
-            print prefix_lines('running config.status', relobjdir)
+            print(prefix_lines('running config.status', relobjdir))
             sys.stdout.flush()
         ret = execute_and_prefix([data['shell'], '-c', './config.status'],
                                  cwd=objdir, env=data['env'], prefix=relobjdir)
 
         for f in contents:
             f.update_time()
 
     return ret
 
 
 def subconfigure(args):
     parser = argparse.ArgumentParser()
     parser.add_argument('--list', type=str,
-        help='File containing a list of subconfigures to run')
+                        help='File containing a list of subconfigures to run')
     parser.add_argument('--skip', type=str,
-        help='File containing a list of Subconfigures to skip')
+                        help='File containing a list of Subconfigures to skip')
     parser.add_argument('subconfigures', type=str, nargs='*',
-        help='Subconfigures to run if no list file is given')
+                        help='Subconfigures to run if no list file is given')
     args, others = parser.parse_known_args(args)
     subconfigures = args.subconfigures
     if args.list:
         subconfigures.extend(open(args.list, 'rb').read().splitlines())
     if args.skip:
         skips = set(open(args.skip, 'rb').read().splitlines())
         subconfigures = [s for s in subconfigures if s not in skips]
 
--- a/build/submit_telemetry_data.py
+++ b/build/submit_telemetry_data.py
@@ -56,17 +56,17 @@ def submit_telemetry_data(statedir):
                   os.path.join(submitted, filename))
 
     session.close()
 
     # Discard submitted data that is >= 30 days old
     now = time.time()
     for filename in os.listdir(submitted):
         ctime = os.stat(os.path.join(submitted, filename)).st_ctime
-        if now - ctime >= 60*60*24*30:
+        if now - ctime >= 60 * 60 * 24 * 30:
             os.remove(os.path.join(submitted, filename))
 
     return 0
 
 
 if __name__ == '__main__':
     if len(sys.argv) != 2:
         print('usage: python submit_telemetry_data.py <statedir>')
--- a/build/upload.py
+++ b/build/upload.py
@@ -26,130 +26,139 @@
 #                  UPLOAD_PATH and the full paths of all files uploaded will
 #                  be appended to the commandline.
 #
 # All files to be uploaded should be passed as commandline arguments to this
 # script. The script takes one other parameter, --base-path, which you can use
 # to indicate that files should be uploaded including their paths relative
 # to the base path.
 
-import sys, os
+import sys
+import os
 import re
 import json
 import errno
 import hashlib
 import shutil
 from optparse import OptionParser
 from subprocess import (
     check_call,
     check_output,
     STDOUT,
     CalledProcessError,
 )
 import concurrent.futures as futures
 import redo
 
+
 def OptionalEnvironmentVariable(v):
     """Return the value of the environment variable named v, or None
     if it's unset (or empty)."""
     if v in os.environ and os.environ[v] != "":
         return os.environ[v]
     return None
 
+
 def FixupMsysPath(path):
     """MSYS helpfully translates absolute pathnames in environment variables
     and commandline arguments into Windows native paths. This sucks if you're
     trying to pass an absolute path on a remote server. This function attempts
     to un-mangle such paths."""
     if 'OSTYPE' in os.environ and os.environ['OSTYPE'] == 'msys':
         # sort of awful, find out where our shell is (should be in msys/bin)
         # and strip the first part of that path out of the other path
         if 'SHELL' in os.environ:
             sh = os.environ['SHELL']
             msys = sh[:sh.find('/bin')]
             if path.startswith(msys):
                 path = path[len(msys):]
     return path
 
+
 def WindowsPathToMsysPath(path):
     """Translate a Windows pathname to an MSYS pathname.
     Necessary because we call out to ssh/scp, which are MSYS binaries
     and expect MSYS paths."""
     # If we're not on Windows, or if we already have an MSYS path (starting
     # with '/' instead of 'c:' or something), then just return.
     if sys.platform != 'win32' or path.startswith('/'):
         return path
     (drive, path) = os.path.splitdrive(os.path.abspath(path))
-    return "/" + drive[0] + path.replace('\\','/')
+    return "/" + drive[0] + path.replace('\\', '/')
+
 
 def AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key):
     """Given optional port and ssh key values, append valid OpenSSH
     commandline arguments to the list cmdline if the values are not None."""
     if port is not None:
         cmdline.append("-P%d" % port)
     if ssh_key is not None:
         # Don't interpret ~ paths - ssh can handle that on its own
         if not ssh_key.startswith('~'):
             ssh_key = WindowsPathToMsysPath(ssh_key)
         cmdline.extend(["-o", "IdentityFile=%s" % ssh_key])
     # In case of an issue here we don't want to hang on a password prompt.
     cmdline.extend(["-o", "BatchMode=yes"])
 
+
 def DoSSHCommand(command, user, host, port=None, ssh_key=None):
     """Execute command on user@host using ssh. Optionally use
     port and ssh_key, if provided."""
     cmdline = ["ssh"]
     AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
     cmdline.extend(["%s@%s" % (user, host), command])
 
     with redo.retrying(check_output, sleeptime=10) as f:
         try:
             output = f(cmdline, stderr=STDOUT).strip()
         except CalledProcessError as e:
-            print "failed ssh command output:"
-            print '=' * 20
-            print e.output
-            print '=' * 20
+            print("failed ssh command output:")
+            print('=' * 20)
+            print(e.output)
+            print('=' * 20)
             raise
         return output
 
     raise Exception("Command %s returned non-zero exit code" % cmdline)
 
+
 def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None,
               log=False):
     """Upload file to user@host:remote_path using scp. Optionally use
     port and ssh_key, if provided."""
     if log:
-        print 'Uploading %s' % file
+        print('Uploading %s' % file)
     cmdline = ["scp"]
     AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
     cmdline.extend([WindowsPathToMsysPath(file),
                     "%s@%s:%s" % (user, host, remote_path)])
     with redo.retrying(check_call, sleeptime=10) as f:
         f(cmdline)
         return
 
     raise Exception("Command %s returned non-zero exit code" % cmdline)
 
+
 def GetBaseRelativePath(path, local_file, base_path):
     """Given a remote path to upload to, a full path to a local file, and an
     optional full path that is a base path of the local file, construct the
     full remote path to place the file in. If base_path is not None, include
     the relative path from base_path to file."""
     if base_path is None or not local_file.startswith(base_path):
         # Hack to work around OSX uploading the i386 SDK from i386/dist. Both
         # the i386 SDK and x86-64 SDK end up in the same directory this way.
         if base_path.endswith('/x86_64/dist'):
             return GetBaseRelativePath(path, local_file, base_path.replace('/x86_64/', '/i386/'))
         return path
     dir = os.path.dirname(local_file)
     # strip base_path + extra slash and make it unixy
-    dir = dir[len(base_path)+1:].replace('\\','/')
+    dir = dir[len(base_path) + 1:].replace('\\', '/')
     return path + dir
 
+
 def GetFileHashAndSize(filename):
     sha512Hash = 'UNKNOWN'
     size = 'UNKNOWN'
 
     try:
         # open in binary mode to make sure we get consistent results
         # across all platforms
         with open(filename, "rb") as f:
@@ -157,81 +166,87 @@ def GetFileHashAndSize(filename):
             sha512Hash = shaObj.hexdigest()
 
         size = os.path.getsize(filename)
     except:
         raise Exception("Unable to get filesize/hash from file: %s" % filename)
 
     return (sha512Hash, size)
 
+
 def GetMarProperties(filename):
     if not os.path.exists(filename):
         return {}
     (mar_hash, mar_size) = GetFileHashAndSize(filename)
     return {
         'completeMarFilename': os.path.basename(filename),
         'completeMarSize': mar_size,
         'completeMarHash': mar_hash,
     }
 
+
 def GetUrlProperties(output, package):
     # let's create a switch case using name-spaces/dict
     # rather than a long if/else with duplicate code
     property_conditions = [
         # key: property name, value: condition
         ('symbolsUrl', lambda m: m.endswith('crashreporter-symbols.zip') or
-                       m.endswith('crashreporter-symbols-full.zip')),
+         m.endswith('crashreporter-symbols-full.zip')),
         ('testsUrl', lambda m: m.endswith(('tests.tar.bz2', 'tests.zip'))),
         ('robocopApkUrl', lambda m: m.endswith('apk') and 'robocop' in m),
         ('jsshellUrl', lambda m: 'jsshell-' in m and m.endswith('.zip')),
         ('completeMarUrl', lambda m: m.endswith('.complete.mar')),
         ('partialMarUrl', lambda m: m.endswith('.mar') and '.partial.' in m),
         ('codeCoverageURL', lambda m: m.endswith('code-coverage-gcno.zip')),
         ('sdkUrl', lambda m: m.endswith(('sdk.tar.bz2', 'sdk.zip'))),
         ('testPackagesUrl', lambda m: m.endswith('test_packages.json')),
         ('packageUrl', lambda m: m.endswith(package)),
     ]
-    url_re = re.compile(r'''^(https?://.*?\.(?:tar\.bz2|dmg|zip|apk|rpm|mar|tar\.gz|json))$''')
+    url_re = re.compile(
+        r'''^(https?://.*?\.(?:tar\.bz2|dmg|zip|apk|rpm|mar|tar\.gz|json))$''')
     properties = {}
 
     try:
         for line in output.splitlines():
             m = url_re.match(line.strip())
             if m:
                 m = m.group(1)
                 for prop, condition in property_conditions:
                     if condition(m):
                         properties.update({prop: m})
                         break
     except IOError as e:
         if e.errno != errno.ENOENT:
             raise
-        properties = {prop: 'UNKNOWN' for prop, condition in property_conditions}
+        properties = {prop: 'UNKNOWN' for prop, condition
+                      in property_conditions}
     return properties
 
-def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None, upload_to_temp_dir=False, post_upload_command=None, package=None):
+
+def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None,
+                upload_to_temp_dir=False, post_upload_command=None, package=None):
     """Upload each file in the list files to user@host:path. Optionally pass
     port and ssh_key to the ssh commands. If base_path is not None, upload
     files including their path relative to base_path. If upload_to_temp_dir is
     True files will be uploaded to a temporary directory on the remote server.
     Generally, you should have a post upload command specified in these cases
     that can move them around to their correct location(s).
     If post_upload_command is not None, execute that command on the remote host
     after uploading all files, passing it the upload path, and the full paths to
     all files uploaded.
     If verbose is True, print status updates while working."""
     if not host or not user:
         return {}
     if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
-        print "One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
-                "defined."
+        print("One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be defined.")
         sys.exit(1)
 
     if upload_to_temp_dir:
-        path = DoSSHCommand("mktemp -d", user, host, port=port, ssh_key=ssh_key)
+        path = DoSSHCommand("mktemp -d", user, host,
+                            port=port, ssh_key=ssh_key)
     if not path.endswith("/"):
         path += "/"
     if base_path is not None:
         base_path = os.path.abspath(base_path)
     remote_files = []
     properties = {}
 
     def get_remote_path(p):
@@ -245,17 +260,18 @@ def UploadFiles(user, host, path, files,
             if not os.path.isfile(file):
                 raise IOError("File not found: %s" % file)
 
             remote_paths.add(get_remote_path(file))
 
         # If we wanted to, we could reduce the remote paths if they are a parent
         # of any entry.
         for p in sorted(remote_paths):
-            DoSSHCommand("mkdir -p " + p, user, host, port=port, ssh_key=ssh_key)
+            DoSSHCommand("mkdir -p " + p, user, host,
+                         port=port, ssh_key=ssh_key)
 
         with futures.ThreadPoolExecutor(4) as e:
             fs = []
             # Since we're uploading in parallel, the largest file should take
             # the longest to upload. So start it first.
             for file in sorted(files, key=os.path.getsize, reverse=True):
                 remote_path = get_remote_path(file)
                 fs.append(e.submit(DoSCPFile, file, remote_path, user, host,
@@ -264,59 +280,63 @@ def UploadFiles(user, host, path, files,
 
             # We need to call result() on the future otherwise exceptions could
             # get swallowed.
             for f in futures.as_completed(fs):
                 f.result()
 
         if post_upload_command is not None:
             if verbose:
-                print "Running post-upload command: " + post_upload_command
+                print("Running post-upload command: " + post_upload_command)
             file_list = '"' + '" "'.join(remote_files) + '"'
-            output = DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
+            output = DoSSHCommand('%s "%s" %s' % (
+                post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
             # We print since mozharness may parse URLs from the output stream.
-            print output
+            print(output)
             properties = GetUrlProperties(output, package)
     finally:
         if upload_to_temp_dir:
             DoSSHCommand("rm -rf %s" % path, user, host, port=port,
                          ssh_key=ssh_key)
     if verbose:
-        print "Upload complete"
+        print("Upload complete")
     return properties
 
+
 def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
     """Copy each file in the list of files to `path`.  The `base_path` argument is treated
     as it is by UploadFiles."""
     if not path.endswith("/"):
         path += "/"
     if base_path is not None:
         base_path = os.path.abspath(base_path)
     for file in files:
         file = os.path.abspath(file)
         if not os.path.isfile(file):
             raise IOError("File not found: %s" % file)
         # first ensure that path exists remotely
         target_path = GetBaseRelativePath(path, file, base_path)
         if not os.path.exists(target_path):
             os.makedirs(target_path)
         if verbose:
-            print "Copying " + file + " to " + target_path
+            print("Copying " + file + " to " + target_path)
         shutil.copy(file, target_path)
 
+
 def WriteProperties(files, properties_file, url_properties, package):
     properties = url_properties
     for file in files:
         if file.endswith('.complete.mar'):
             properties.update(GetMarProperties(file))
     with open(properties_file, 'w') as outfile:
         properties['packageFilename'] = package
         properties['uploadFiles'] = [os.path.abspath(f) for f in files]
         json.dump(properties, outfile, indent=4)
 
+
 if __name__ == '__main__':
     host = OptionalEnvironmentVariable('UPLOAD_HOST')
     user = OptionalEnvironmentVariable('UPLOAD_USER')
     path = OptionalEnvironmentVariable('UPLOAD_PATH')
     upload_to_temp_dir = OptionalEnvironmentVariable('UPLOAD_TO_TEMP')
     port = OptionalEnvironmentVariable('UPLOAD_PORT')
     if port is not None:
         port = int(port)
@@ -327,49 +347,51 @@ if __name__ == '__main__':
         if path is not None:
             path = FixupMsysPath(path)
         if post_upload_command is not None:
             post_upload_command = FixupMsysPath(post_upload_command)
 
     parser = OptionParser(usage="usage: %prog [options] <files>")
     parser.add_option("-b", "--base-path",
                       action="store",
-                      help="Preserve file paths relative to this path when uploading. If unset, all files will be uploaded directly to UPLOAD_PATH.")
+                      help="Preserve file paths relative to this path when uploading. "
+                      "If unset, all files will be uploaded directly to UPLOAD_PATH.")
     parser.add_option("--properties-file",
                       action="store",
                       help="Path to the properties file to store the upload properties.")
     parser.add_option("--package",
                       action="store",
                       help="Name of the main package.")
     (options, args) = parser.parse_args()
     if len(args) < 1:
-        print "You must specify at least one file to upload"
+        print("You must specify at least one file to upload")
         sys.exit(1)
     if not options.properties_file:
-        print "You must specify a --properties-file"
+        print("You must specify a --properties-file")
         sys.exit(1)
 
     if host == "localhost":
         if upload_to_temp_dir:
-            print "Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost"
+            print("Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost")
             sys.exit(1)
         if post_upload_command:
             # POST_UPLOAD_COMMAND is difficult to extract from the mozharness
             # scripts, so just ignore it until it's no longer used anywhere
-            print "Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost"
+            print("Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost")
 
     try:
         if host == "localhost":
             CopyFilesLocally(path, args, base_path=options.base_path,
                              package=options.package,
                              verbose=True)
         else:
 
             url_properties = UploadFiles(user, host, path, args,
                                          base_path=options.base_path, port=port, ssh_key=key,
                                          upload_to_temp_dir=upload_to_temp_dir,
                                          post_upload_command=post_upload_command,
                                          package=options.package, verbose=True)
 
-            WriteProperties(args, options.properties_file, url_properties, options.package)
-    except IOError, (strerror):
-        print strerror
+            WriteProperties(args, options.properties_file,
+                            url_properties, options.package)
+    except IOError as strerror:
+        print(strerror)
         sys.exit(1)
--- a/build/upload_generated_sources.py
+++ b/build/upload_generated_sources.py
@@ -1,17 +1,16 @@
 #!/usr/bin/env/python
 # 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/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import argparse
-from concurrent.futures import ThreadPoolExecutor
 from contextlib import contextmanager
 import gzip
 import io
 import logging
 from mozbuild.base import MozbuildObject
 from mozbuild.generated_sources import (
     get_filename_with_digest,
     get_s3_region_and_bucket,
@@ -32,16 +31,17 @@ log.setLevel(logging.INFO)
 
 @contextmanager
 def timed():
     '''
     Yield a function that provides the elapsed time in seconds since this
     function was called.
     '''
     start = time.time()
+
     def elapsed():
         return time.time() - start
     yield elapsed
 
 
 def gzip_compress(data):
     '''
     Apply gzip compression to `data` and return the result as a `BytesIO`.
@@ -71,49 +71,54 @@ def upload_worker(queue, event, bucket, 
                 return
             (name, contents) = queue.get()
             pathname = get_filename_with_digest(name, contents)
             compressed = gzip_compress(contents)
             extra_args = {
                 'ContentEncoding': 'gzip',
                 'ContentType': 'text/plain',
             }
-            log.info('Uploading "{}" ({} bytes)'.format(pathname, len(compressed.getvalue())))
+            log.info('Uploading "{}" ({} bytes)'.format(
+                pathname, len(compressed.getvalue())))
             with timed() as elapsed:
-                s3.upload_fileobj(compressed, bucket, pathname, ExtraArgs=extra_args)
-                log.info('Finished uploading "{}" in {:0.3f}s'.format(pathname, elapsed()))
+                s3.upload_fileobj(compressed, bucket,
+                                  pathname, ExtraArgs=extra_args)
+                log.info('Finished uploading "{}" in {:0.3f}s'.format(
+                    pathname, elapsed()))
             queue.task_done()
     except Exception:
         log.exception('Thread encountered exception:')
         event.set()
 
 
 def do_work(artifact, region, bucket):
     session_args = {'region_name': region}
     session = requests.Session()
     if 'TASK_ID' in os.environ:
         level = os.environ.get('MOZ_SCM_LEVEL', '1')
-        secrets_url = 'http://taskcluster/secrets/v1/secret/project/releng/gecko/build/level-{}/gecko-generated-sources-upload'.format(level)
-        log.info('Using AWS credentials from the secrets service: "{}"'.format(secrets_url))
+        secrets_url = 'http://taskcluster/secrets/v1/secret/project/releng/gecko/build/level-{}/gecko-generated-sources-upload'.format( # noqa
+            level)
+        log.info(
+            'Using AWS credentials from the secrets service: "{}"'.format(secrets_url))
         res = session.get(secrets_url)
         res.raise_for_status()
         secret = res.json()
         session_args.update(
             aws_access_key_id=secret['secret']['AWS_ACCESS_KEY_ID'],
             aws_secret_access_key=secret['secret']['AWS_SECRET_ACCESS_KEY'],
         )
     else:
         log.info('Trying to use your AWS credentials..')
 
-
     # First, fetch the artifact containing the sources.
     log.info('Fetching generated sources artifact: "{}"'.format(artifact))
     with timed() as elapsed:
         res = session.get(artifact)
-        log.info('Fetch HTTP status: {}, {} bytes downloaded in {:0.3f}s'.format(res.status_code, len(res.content), elapsed()))
+        log.info('Fetch HTTP status: {}, {} bytes downloaded in {:0.3f}s'.format(
+            res.status_code, len(res.content), elapsed()))
     res.raise_for_status()
     # Create a queue and worker threads for uploading.
     q = Queue()
     event = Event()
     log.info('Creating {} worker threads'.format(NUM_WORKER_THREADS))
     for i in range(NUM_WORKER_THREADS):
         t = Thread(target=upload_worker, args=(q, event, bucket, session_args))
         t.daemon = True
@@ -131,17 +136,17 @@ def do_work(artifact, region, bucket):
         if event.wait(0.1):
             log.error('Worker thread encountered exception, exiting...')
             break
 
 
 def main(argv):
     logging.basicConfig(format='%(levelname)s - %(threadName)s - %(message)s')
     parser = argparse.ArgumentParser(
-    description='Upload generated source files in ARTIFACT to BUCKET in S3.')
+        description='Upload generated source files in ARTIFACT to BUCKET in S3.')
     parser.add_argument('artifact',
                         help='generated-sources artifact from build task')
     args = parser.parse_args(argv)
     region, bucket = get_s3_region_and_bucket()
 
     config = MozbuildObject.from_environment()
     config._activate_virtualenv()
     config.virtualenv_manager.install_pip_package('boto3==1.4.4')
--- a/build/variables.py
+++ b/build/variables.py
@@ -6,16 +6,17 @@ from __future__ import print_function, u
 
 import os
 import subprocess
 import sys
 from datetime import datetime
 
 SOURCESTAMP_FILENAME = 'sourcestamp.txt'
 
+
 def buildid_header(output):
     buildid = os.environ.get('MOZ_BUILD_DATE')
     if buildid and len(buildid) != 14:
         print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
         buildid = None
     if not buildid:
         buildid = datetime.now().strftime('%Y%m%d%H%M%S')
     output.write("#define MOZ_BUILDID %s\n" % buildid)
@@ -40,16 +41,17 @@ def get_hg_info(workdir):
     changeset = get_hg_changeset(workdir)
 
     return repo, changeset
 
 
 def get_hg_changeset(path):
     return get_program_output('hg', '-R', path, 'parent', '--template={node}')
 
+
 def get_info_from_sourcestamp(sourcestamp_path):
     """Read the repository and changelog information from the sourcestamp
     file. This assumes that the file exists and returns the results as a list
     (either strings or None in case of error).
     """
 
     # Load the content of the file.
     lines = None
@@ -61,26 +63,28 @@ def get_info_from_sourcestamp(sourcestam
     # URL.
     if len(lines) != 2 or not lines[1].startswith('http'):
         # Just return if the file doesn't contain what we expect.
         return None, None
 
     # Return the repo and the changeset.
     return lines[1].split('/rev/')
 
+
 def source_repo_header(output):
     # We allow the source repo and changeset to be specified via the
     # environment (see configure)
     import buildconfig
     repo = buildconfig.substs.get('MOZ_SOURCE_REPO')
     changeset = buildconfig.substs.get('MOZ_SOURCE_CHANGESET')
     source = ''
 
     if not repo:
-        sourcestamp_path = os.path.join(buildconfig.topsrcdir, SOURCESTAMP_FILENAME)
+        sourcestamp_path = os.path.join(
+            buildconfig.topsrcdir, SOURCESTAMP_FILENAME)
         if os.path.exists(os.path.join(buildconfig.topsrcdir, '.hg')):
             repo, changeset = get_hg_info(buildconfig.topsrcdir)
         elif os.path.exists(sourcestamp_path):
             repo, changeset = get_info_from_sourcestamp(sourcestamp_path)
     elif not changeset:
         changeset = get_hg_changeset(buildconfig.topsrcdir)
         if not changeset:
             raise Exception('could not resolve changeset; '
--- a/build/windows_toolchain.py
+++ b/build/windows_toolchain.py
@@ -193,17 +193,17 @@ def format_manifest(manifest):
     # Trailing newline.
     sha256_lines.append(b'')
 
     return b'\n'.join(sha256_lines)
 
 
 def write_zip(zip_path, prefix=None):
     """Write toolchain data to a zip file."""
-    if isinstance(prefix, unicode):
+    if isinstance(prefix, unicode): # noqa Special case for Python 2
         prefix = prefix.encode('utf-8')
 
     with JarWriter(file=zip_path, optimize=False, compress=5) as zip:
         manifest = {}
         for p, data, mode in resolve_files_and_hash(manifest):
             print(p)
             if prefix:
                 p = mozpath.join(prefix, p)
--- a/configure.py
+++ b/configure.py
@@ -2,17 +2,16 @@
 # 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/.
 
 from __future__ import print_function, unicode_literals
 
 import codecs
 import itertools
 import os
-import subprocess
 import sys
 import textwrap
 
 
 base_dir = os.path.abspath(os.path.dirname(__file__))
 sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
 from mozbuild.configure import ConfigureSandbox
 from mozbuild.makeutil import Makefile
--- a/devtools/client/netmonitor/src/connector/firefox-data-provider.js
+++ b/devtools/client/netmonitor/src/connector/firefox-data-provider.js
@@ -9,55 +9,38 @@ const { EVENTS } = require("../constants
 const { CurlUtils } = require("devtools/client/shared/curl");
 const {
   fetchHeaders,
   formDataURI,
 } = require("../utils/request-utils");
 
 /**
  * This object is responsible for fetching additional HTTP
- * data from the backend.
+ * data from the backend over RDP protocol.
+ *
+ * The object also keeps track of RDP requests in-progress,
+ * so it's possible to determine whether all has been fetched
+ * or not.
  */
 class FirefoxDataProvider {
   constructor({webConsoleClient, actions}) {
     // Options
     this.webConsoleClient = webConsoleClient;
     this.actions = actions;
 
     // Internal properties
     this.payloadQueue = [];
-
-    // Public methods
-    this.addRequest = this.addRequest.bind(this);
-    this.updateRequest = this.updateRequest.bind(this);
+    this.rdpRequestMap = new Map();
 
-    // Internals
-    this.fetchResponseBody = this.fetchResponseBody.bind(this);
-    this.fetchRequestHeaders = this.fetchRequestHeaders.bind(this);
-    this.fetchResponseHeaders = this.fetchResponseHeaders.bind(this);
-    this.fetchPostData = this.fetchPostData.bind(this);
-    this.fetchResponseCookies = this.fetchResponseCookies.bind(this);
-    this.fetchRequestCookies = this.fetchRequestCookies.bind(this);
-    this.getPayloadFromQueue = this.getPayloadFromQueue.bind(this);
-    this.isQueuePayloadReady = this.isQueuePayloadReady.bind(this);
-    this.pushPayloadToQueue = this.pushPayloadToQueue.bind(this);
+    // Fetching data from the backend
     this.getLongString = this.getLongString.bind(this);
-    this.getNetworkRequest = this.getNetworkRequest.bind(this);
 
     // Event handlers
     this.onNetworkEvent = this.onNetworkEvent.bind(this);
     this.onNetworkEventUpdate = this.onNetworkEventUpdate.bind(this);
-    this.onRequestHeaders = this.onRequestHeaders.bind(this);
-    this.onRequestCookies = this.onRequestCookies.bind(this);
-    this.onRequestPostData = this.onRequestPostData.bind(this);
-    this.onSecurityInfo = this.onSecurityInfo.bind(this);
-    this.onResponseHeaders = this.onResponseHeaders.bind(this);
-    this.onResponseCookies = this.onResponseCookies.bind(this);
-    this.onResponseContent = this.onResponseContent.bind(this);
-    this.onEventTimings = this.onEventTimings.bind(this);
   }
 
   /**
    * Add a new network request to application state.
    *
    * @param {string} id request id
    * @param {object} data data payload will be added to application state
    */
@@ -103,49 +86,45 @@ class FirefoxDataProvider {
       responseHeaders,
       requestCookies,
       requestHeaders,
       requestPostData,
     } = data;
 
     // fetch request detail contents in parallel
     let [
-      imageObj,
+      responseContentObj,
       requestHeadersObj,
       responseHeadersObj,
       postDataObj,
       requestCookiesObj,
       responseCookiesObj,
     ] = await Promise.all([
-      this.fetchResponseBody(mimeType, responseContent),
+      this.fetchResponseContent(mimeType, responseContent),
       this.fetchRequestHeaders(requestHeaders),
       this.fetchResponseHeaders(responseHeaders),
       this.fetchPostData(requestPostData),
       this.fetchRequestCookies(requestCookies),
       this.fetchResponseCookies(responseCookies),
     ]);
 
     let payload = Object.assign({},
       data,
-      imageObj,
+      responseContentObj,
       requestHeadersObj,
       responseHeadersObj,
       postDataObj,
       requestCookiesObj,
       responseCookiesObj
     );
 
-    this.pushPayloadToQueue(id, payload);
-
-    if (this.actions.updateRequest && this.isQueuePayloadReady(id)) {
-      await this.actions.updateRequest(id, this.getPayloadFromQueue(id).payload, true);
-    }
+    this.pushRequestToQueue(id, payload);
   }
 
-  async fetchResponseBody(mimeType, responseContent) {
+  async fetchResponseContent(mimeType, responseContent) {
     let payload = {};
     if (mimeType && responseContent && responseContent.content) {
       let { encoding, text } = responseContent.content;
       let response = await this.getLongString(text);
 
       if (mimeType.includes("image/")) {
         payload.responseContentDataUri = formDataURI(mimeType, encoding, response);
       }
@@ -243,51 +222,59 @@ class FirefoxDataProvider {
   }
 
   /**
    * Access a payload item from payload queue.
    *
    * @param {string} id request id
    * @return {boolean} return a queued payload item from queue.
    */
-  getPayloadFromQueue(id) {
+  getRequestFromQueue(id) {
     return this.payloadQueue.find((item) => item.id === id);
   }
 
   /**
    * Return true if payload is ready (all data fetched from the backend)
    *
    * @param {string} id request id
    * @return {boolean} return whether a specific networkEvent has been updated completely.
    */
-  isQueuePayloadReady(id) {
-    let queuedPayload = this.getPayloadFromQueue(id);
+  isRequestPayloadReady(id) {
+    let record = this.rdpRequestMap.get(id);
+    if (!record) {
+      return false;
+    }
 
-    // TODO we should find a better solution since it might happen
-    // that eventTimings is not the last update.
-    return queuedPayload && queuedPayload.payload.eventTimings;
+    // The payload is ready when all values in the record are true.
+    // (i.e. all data received).
+    let props = Object.getOwnPropertyNames(record);
+    return props.every(prop => record[prop] === true);
   }
 
   /**
-   * Push a request payload into a queue if request doesn't exist. Otherwise update the
-   * request itself.
+   * Merge upcoming networkEventUpdate payload into existing one.
    *
    * @param {string} id request id
    * @param {object} payload request data payload
    */
-  pushPayloadToQueue(id, payload) {
-    let queuedPayload = this.getPayloadFromQueue(id);
-    if (!queuedPayload) {
+  pushRequestToQueue(id, payload) {
+    let request = this.getRequestFromQueue(id);
+    if (!request) {
       this.payloadQueue.push({ id, payload });
     } else {
       // Merge upcoming networkEventUpdate payload into existing one
-      queuedPayload.payload = Object.assign({}, queuedPayload.payload, payload);
+      request.payload = Object.assign({}, request.payload, payload);
     }
   }
 
+  cleanUpQueue(id) {
+    this.payloadQueue = this.payloadQueue.filter(
+      request => request.id != id);
+  }
+
   /**
    * Fetches the network information packet from actor server
    *
    * @param {string} id request id
    * @return {object} networkInfo data packet
    */
   getNetworkRequest(id) {
     return this.webConsoleClient.getNetworkRequest(id);
@@ -323,16 +310,24 @@ class FirefoxDataProvider {
       isXHR,
       request: {
         method,
         url,
       },
       startedDateTime,
     } = networkInfo;
 
+    // Create tracking record for this request.
+    this.rdpRequestMap.set(actor, {
+      requestHeaders: false,
+      requestCookies: false,
+      eventTimings: false,
+      responseContent: false,
+    });
+
     this.addRequest(actor, {
       cause,
       fromCache,
       fromServiceWorker,
       isXHR,
       method,
       startedDateTime,
       url,
@@ -343,177 +338,277 @@ class FirefoxDataProvider {
 
   /**
    * The "networkEventUpdate" message type handler.
    *
    * @param {string} type message type
    * @param {object} packet the message received from the server.
    * @param {object} networkInfo the network request information.
    */
-  onNetworkEventUpdate(type, { packet, networkInfo }) {
+  onNetworkEventUpdate(type, data) {
+    let { packet, networkInfo } = data;
     let { actor } = networkInfo;
+    let { updateType } = packet;
 
-    switch (packet.updateType) {
+    switch (updateType) {
       case "requestHeaders":
-        this.webConsoleClient.getRequestHeaders(actor, this.onRequestHeaders);
-        emit(EVENTS.UPDATING_REQUEST_HEADERS, actor);
+        this.requestData(actor, updateType).then(response => {
+          this.onRequestHeaders(response)
+            .then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_REQUEST_HEADERS, actor);
+        });
         break;
       case "requestCookies":
-        this.webConsoleClient.getRequestCookies(actor, this.onRequestCookies);
-        emit(EVENTS.UPDATING_REQUEST_COOKIES, actor);
+        this.requestData(actor, updateType).then(response => {
+          this.onRequestCookies(response)
+            .then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_REQUEST_COOKIES, actor);
+        });
         break;
       case "requestPostData":
-        this.webConsoleClient.getRequestPostData(actor, this.onRequestPostData);
-        emit(EVENTS.UPDATING_REQUEST_POST_DATA, actor);
+        this.requestData(actor, updateType).then(response => {
+          this.onRequestPostData(response)
+            .then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_REQUEST_POST_DATA, actor);
+        });
         break;
       case "securityInfo":
         this.updateRequest(actor, {
           securityState: networkInfo.securityInfo,
         }).then(() => {
-          this.webConsoleClient.getSecurityInfo(actor, this.onSecurityInfo);
-          emit(EVENTS.UPDATING_SECURITY_INFO, actor);
+          this.requestData(actor, updateType).then(response => {
+            this.onSecurityInfo(response)
+              .then(() => this.onDataReceived(actor, updateType));
+            emit(EVENTS.UPDATING_SECURITY_INFO, actor);
+          });
         });
         break;
       case "responseHeaders":
-        this.webConsoleClient.getResponseHeaders(actor, this.onResponseHeaders);
-        emit(EVENTS.UPDATING_RESPONSE_HEADERS, actor);
+        this.requestData(actor, updateType).then(response => {
+          this.onResponseHeaders(response)
+            .then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_RESPONSE_HEADERS, actor);
+        });
         break;
       case "responseCookies":
-        this.webConsoleClient.getResponseCookies(actor, this.onResponseCookies);
-        emit(EVENTS.UPDATING_RESPONSE_COOKIES, actor);
+        this.requestData(actor, updateType).then(response => {
+          this.onResponseCookies(response)
+            .then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_RESPONSE_COOKIES, actor);
+        });
         break;
       case "responseStart":
         this.updateRequest(actor, {
           httpVersion: networkInfo.response.httpVersion,
           remoteAddress: networkInfo.response.remoteAddress,
           remotePort: networkInfo.response.remotePort,
           status: networkInfo.response.status,
           statusText: networkInfo.response.statusText,
           headersSize: networkInfo.response.headersSize
         }).then(() => {
           emit(EVENTS.STARTED_RECEIVING_RESPONSE, actor);
         });
         break;
       case "responseContent":
-        this.webConsoleClient.getResponseContent(actor,
-          this.onResponseContent.bind(this, {
+        this.requestData(actor, updateType).then(response => {
+          this.onResponseContent({
             contentSize: networkInfo.response.bodySize,
             transferredSize: networkInfo.response.transferredSize,
             mimeType: networkInfo.response.content.mimeType
-          }));
-        emit(EVENTS.UPDATING_RESPONSE_CONTENT, actor);
+          }, response).then(() => this.onDataReceived(actor, updateType));
+          emit(EVENTS.UPDATING_RESPONSE_CONTENT, actor);
+        });
         break;
       case "eventTimings":
         this.updateRequest(actor, { totalTime: networkInfo.totalTime })
           .then(() => {
-            this.webConsoleClient.getEventTimings(actor, this.onEventTimings);
-            emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
+            this.requestData(actor, updateType).then(response => {
+              this.onEventTimings(response)
+                .then(() => this.onDataReceived(actor, updateType));
+              emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
+            });
           });
         break;
     }
   }
 
   /**
+   * Wrapper method for requesting HTTP details data from the backend.
+   *
+   * It collects all RDP requests and monitors responses, so it's
+   * possible to determine whether (and when) all requested data
+   * has been fetched from the backend.
+   *
+   * It also nicely returns a promise.
+   *
+   * @param {string} actor actor id (used as request id)
+   * @param {string} method identifier of the data we want to fetch
+   *
+   * @return {Promise} return a promise resolved when data are received.
+   */
+  requestData(actor, method) {
+    let record = this.rdpRequestMap.get(actor);
+
+    // All RDP requests related to the given actor will be collected
+    // in the same record.
+    if (!record) {
+      record = {};
+    }
+
+    // If data has been already requested return the same promise.
+    if (record.method) {
+      return record.method;
+    }
+
+    // Calculate real name of the client getter.
+    let realMethodName = "get" + method.charAt(0).toUpperCase() +
+      method.slice(1);
+
+    // Request data from the backend.
+    let promise = new Promise((resolve, reject) => {
+      if (typeof this.webConsoleClient[realMethodName] == "function") {
+        this.webConsoleClient[realMethodName](actor, response => {
+          // Resolve incoming HTTP details data-promise.
+          resolve(response);
+        });
+      } else {
+        reject(new Error("Error: No such client method!"));
+      }
+    });
+
+    // Store the promise in order to know about RDP requests
+    // in progress.
+    record[method] = promise;
+
+    return promise;
+  }
+
+  /**
+   * Executed when new data are received from the backend.
+   */
+  async onDataReceived(actor, type) {
+    let record = this.rdpRequestMap.get(actor);
+    if (record) {
+      record[type] = true;
+    }
+
+    if (this.isRequestPayloadReady(actor)) {
+      let payloadFromQueue = this.getRequestFromQueue(actor).payload;
+
+      // Clean up
+      this.cleanUpQueue(actor);
+      this.rdpRequestMap.delete(actor);
+
+      let { updateRequest } = this.actions;
+      if (updateRequest) {
+        await updateRequest(actor, payloadFromQueue, true);
+      }
+
+      emit(EVENTS.PAYLOAD_READY, actor);
+    }
+  }
+
+  /**
    * Handles additional information received for a "requestHeaders" packet.
    *
    * @param {object} response the message received from the server.
    */
   onRequestHeaders(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       requestHeaders: response
     }).then(() => {
       emit(EVENTS.RECEIVED_REQUEST_HEADERS, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "requestCookies" packet.
    *
    * @param {object} response the message received from the server.
    */
   onRequestCookies(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       requestCookies: response
     }).then(() => {
       emit(EVENTS.RECEIVED_REQUEST_COOKIES, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "requestPostData" packet.
    *
    * @param {object} response the message received from the server.
    */
   onRequestPostData(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       requestPostData: response
     }).then(() => {
       emit(EVENTS.RECEIVED_REQUEST_POST_DATA, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "securityInfo" packet.
    *
    * @param {object} response the message received from the server.
    */
   onSecurityInfo(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       securityInfo: response.securityInfo
     }).then(() => {
       emit(EVENTS.RECEIVED_SECURITY_INFO, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "responseHeaders" packet.
    *
    * @param {object} response the message received from the server.
    */
   onResponseHeaders(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       responseHeaders: response
     }).then(() => {
       emit(EVENTS.RECEIVED_RESPONSE_HEADERS, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "responseCookies" packet.
    *
    * @param {object} response the message received from the server.
    */
   onResponseCookies(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       responseCookies: response
     }).then(() => {
       emit(EVENTS.RECEIVED_RESPONSE_COOKIES, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "responseContent" packet.
    *
    * @param {object} data the message received from the server event.
    * @param {object} response the message received from the server.
    */
   onResponseContent(data, response) {
     let payload = Object.assign({ responseContent: response }, data);
-    this.updateRequest(response.from, payload).then(() => {
+    return this.updateRequest(response.from, payload).then(() => {
       emit(EVENTS.RECEIVED_RESPONSE_CONTENT, response.from);
     });
   }
 
   /**
    * Handles additional information received for a "eventTimings" packet.
    *
    * @param {object} response the message received from the server.
    */
   onEventTimings(response) {
-    this.updateRequest(response.from, {
+    return this.updateRequest(response.from, {
       eventTimings: response
     }).then(() => {
       emit(EVENTS.RECEIVED_EVENT_TIMINGS, response.from);
     });
   }
 }
 
 /**
--- a/devtools/client/netmonitor/src/constants.js
+++ b/devtools/client/netmonitor/src/constants.js
@@ -88,16 +88,19 @@ const EVENTS = {
 
   // When response content begins, updates and finishes receiving.
   STARTED_RECEIVING_RESPONSE: "NetMonitor:NetworkEventUpdating:ResponseStart",
   UPDATING_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdating:ResponseContent",
   RECEIVED_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdated:ResponseContent",
 
   // Fired once the connection is established
   CONNECTED: "connected",
+
+  // When request payload (HTTP details data) are fetched from the backend.
+  PAYLOAD_READY: "NetMonitor:PayloadReady",
 };
 
 const UPDATE_PROPS = [
   "method",
   "url",
   "remotePort",
   "remoteAddress",
   "status",
--- a/devtools/client/netmonitor/test/browser_net_copy_headers.js
+++ b/devtools/client/netmonitor/test/browser_net_copy_headers.js
@@ -9,31 +9,37 @@
 
 add_task(function* () {
   let { tab, monitor } = yield initNetMonitor(SIMPLE_URL);
   info("Starting test... ");
 
   let { document, store, windowRequire } = monitor.panelWin;
   let {
     getSortedRequests,
+    getSelectedRequest,
   } = windowRequire("devtools/client/netmonitor/src/selectors/index");
 
   let wait = waitForNetworkEvents(monitor, 1);
   tab.linkedBrowser.reload();
   yield wait;
 
   EventUtils.sendMouseEvent({ type: "mousedown" },
     document.querySelectorAll(".request-list-item")[0]);
 
   let requestItem = getSortedRequests(store.getState()).get(0);
   let { method, httpVersion, status, statusText } = requestItem;
 
   EventUtils.sendMouseEvent({ type: "contextmenu" },
     document.querySelectorAll(".request-list-item")[0]);
 
+  let selectedRequest = getSelectedRequest(store.getState());
+  is(selectedRequest, requestItem, "Proper request is selected");
+  ok(selectedRequest.requestHeaders, "Selected request should have request headers");
+  ok(selectedRequest.responseHeaders, "Selected request should have response headers");
+
   const EXPECTED_REQUEST_HEADERS = [
     `${method} ${SIMPLE_URL} ${httpVersion}`,
     "Host: example.com",
     "User-Agent: " + navigator.userAgent + "",
     "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
     "Accept-Language: " + navigator.languages.join(",") + ";q=0.5",
     "Accept-Encoding: gzip, deflate",
     "Connection: keep-alive",
--- a/devtools/client/netmonitor/test/browser_net_security-error.js
+++ b/devtools/client/netmonitor/test/browser_net_security-error.js
@@ -21,16 +21,18 @@ add_task(function* () {
   yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
     content.wrappedJSObject.performRequests(1, "https://nocert.example.com");
   });
   yield requestsDone;
 
   let securityInfoLoaded = waitForDOM(document, ".security-info-value");
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".network-details-panel-toggle"));
+
+  yield waitUntil(() => document.querySelector("#security-tab"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector("#security-tab"));
   yield securityInfoLoaded;
 
   let errormsg = document.querySelector(".security-info-value");
   isnot(errormsg.textContent, "", "Error message is not empty.");
 
   return teardown(monitor);
@@ -45,16 +47,18 @@ add_task(function* () {
       "RECEIVED_REQUEST_HEADERS",
       "UPDATING_REQUEST_COOKIES",
       "RECEIVED_REQUEST_COOKIES",
       "STARTED_RECEIVING_RESPONSE",
       "UPDATING_RESPONSE_CONTENT",
       "RECEIVED_RESPONSE_CONTENT",
       "UPDATING_EVENT_TIMINGS",
       "RECEIVED_EVENT_TIMINGS",
+      "UPDATING_SECURITY_INFO",
+      "RECEIVED_SECURITY_INFO",
     ];
 
     let promises = awaitedEvents.map((event) => {
       return monitor.panelWin.once(EVENTS[event]);
     });
 
     return Promise.all(promises);
   }
--- a/devtools/client/netmonitor/test/browser_net_simple-request-data.js
+++ b/devtools/client/netmonitor/test/browser_net_simple-request-data.js
@@ -314,16 +314,21 @@ function test() {
         SIMPLE_SJS,
         {
           time: true
         }
       );
     });
 
     expectEvent(EVENTS.RECEIVED_EVENT_TIMINGS, async () => {
+      await waitUntil(() => {
+        let requestItem = getSortedRequests(store.getState()).get(0);
+        return requestItem && requestItem.eventTimings;
+      });
+
       let requestItem = getSortedRequests(store.getState()).get(0);
 
       ok(requestItem.eventTimings,
         "There should be a eventTimings data available.");
       is(typeof requestItem.eventTimings.timings.blocked, "number",
         "The eventTimings data has an incorrect |timings.blocked| property.");
       is(typeof requestItem.eventTimings.timings.dns, "number",
         "The eventTimings data has an incorrect |timings.dns| property.");
--- a/devtools/client/netmonitor/test/browser_net_throttle.js
+++ b/devtools/client/netmonitor/test/browser_net_throttle.js
@@ -46,16 +46,21 @@ function* throttleTest(actuallyThrottle)
       resolve(response);
     });
   });
 
   let eventPromise = monitor.panelWin.once(EVENTS.RECEIVED_EVENT_TIMINGS);
   yield triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_DISABLED);
   yield eventPromise;
 
+  yield waitUntil(() => {
+    let requestItem = getSortedRequests(store.getState()).get(0);
+    return requestItem && requestItem.eventTimings;
+  });
+
   let requestItem = getSortedRequests(store.getState()).get(0);
   const reportedOneSecond = requestItem.eventTimings.timings.receive > 1000;
   if (actuallyThrottle) {
     ok(reportedOneSecond, "download reported as taking more than one second");
   } else {
     ok(!reportedOneSecond, "download reported as taking less than one second");
   }
 
--- a/devtools/client/netmonitor/test/head.js
+++ b/devtools/client/netmonitor/test/head.js
@@ -202,23 +202,23 @@ function waitForAllRequestsFinished(moni
     function maybeResolve() {
       // Have all the requests in the map finished yet?
       if (![...requests.values()].every(finished => finished)) {
         return;
       }
 
       // All requests are done - unsubscribe from events and resolve!
       window.off(EVENTS.NETWORK_EVENT, onRequest);
-      window.off(EVENTS.RECEIVED_EVENT_TIMINGS, onTimings);
+      window.off(EVENTS.PAYLOAD_READY, onTimings);
       info("All requests finished");
       resolve();
     }
 
     window.on(EVENTS.NETWORK_EVENT, onRequest);
-    window.on(EVENTS.RECEIVED_EVENT_TIMINGS, onTimings);
+    window.on(EVENTS.PAYLOAD_READY, onTimings);
   });
 }
 
 function initNetMonitor(url, enableCache) {
   info("Initializing a network monitor pane.");
 
   return Task.spawn(function* () {
     let tab = yield addTab(url);
@@ -291,32 +291,34 @@ function waitForNetworkEvents(monitor, g
   return new Promise((resolve) => {
     let panel = monitor.panelWin;
     let { windowRequire } = panel;
     let { getNetworkRequest } =
       windowRequire("devtools/client/netmonitor/src/connector/index");
     let progress = {};
     let genericEvents = 0;
     let postEvents = 0;
+    let payloadReady = 0;
     let awaitedEventsToListeners = [
       ["UPDATING_REQUEST_HEADERS", onGenericEvent],
       ["RECEIVED_REQUEST_HEADERS", onGenericEvent],
       ["UPDATING_REQUEST_COOKIES", onGenericEvent],
       ["RECEIVED_REQUEST_COOKIES", onGenericEvent],
       ["UPDATING_REQUEST_POST_DATA", onPostEvent],
       ["RECEIVED_REQUEST_POST_DATA", onPostEvent],
       ["UPDATING_RESPONSE_HEADERS", onGenericEvent],
       ["RECEIVED_RESPONSE_HEADERS", onGenericEvent],
       ["UPDATING_RESPONSE_COOKIES", onGenericEvent],
       ["RECEIVED_RESPONSE_COOKIES", onGenericEvent],
       ["STARTED_RECEIVING_RESPONSE", onGenericEvent],
       ["UPDATING_RESPONSE_CONTENT", onGenericEvent],
       ["RECEIVED_RESPONSE_CONTENT", onGenericEvent],
       ["UPDATING_EVENT_TIMINGS", onGenericEvent],
-      ["RECEIVED_EVENT_TIMINGS", onGenericEvent]
+      ["RECEIVED_EVENT_TIMINGS", onGenericEvent],
+      ["PAYLOAD_READY", onPayloadReady]
     ];
 
     function initProgressForURL(url) {
       if (progress[url]) {
         return;
       }
       progress[url] = {};
       awaitedEventsToListeners.forEach(function ([e]) {
@@ -346,32 +348,45 @@ function waitForNetworkEvents(monitor, g
         // Must have been related to reloading document to disable cache.
         // Ignore the event.
         return;
       }
       postEvents++;
       maybeResolve(event, actor, networkInfo);
     }
 
+    function onPayloadReady(event, actor) {
+      let networkInfo = getNetworkRequest(actor);
+      if (!networkInfo) {
+        // Must have been related to reloading document to disable cache.
+        // Ignore the event.
+        return;
+      }
+
+      payloadReady++;
+      maybeResolve(event, actor, networkInfo);
+    }
+
     function maybeResolve(event, actor, networkInfo) {
       info("> Network events progress: " +
         genericEvents + "/" + ((getRequests + postRequests) * 13) + ", " +
         postEvents + "/" + (postRequests * 2) + ", " +
         "got " + event + " for " + actor);
 
       let url = networkInfo.request.url;
       updateProgressForURL(url, event);
 
       // Uncomment this to get a detailed progress logging (when debugging a test)
       // info("> Current state: " + JSON.stringify(progress, null, 2));
 
       // There are 15 updates which need to be fired for a request to be
       // considered finished. The "requestPostData" packet isn't fired for
       // non-POST requests.
-      if (genericEvents >= (getRequests + postRequests) * 13 &&
+      if (payloadReady >= (getRequests + postRequests) &&
+        genericEvents >= (getRequests + postRequests) * 13 &&
         postEvents >= postRequests * 2) {
         awaitedEventsToListeners.forEach(([e, l]) => panel.off(EVENTS[e], l));
         executeSoon(resolve);
       }
     }
 
     awaitedEventsToListeners.forEach(([e, l]) => panel.on(EVENTS[e], l));
   });
--- a/devtools/client/responsive.html/index.css
+++ b/devtools/client/responsive.html/index.css
@@ -174,16 +174,17 @@ select > option.divider {
   height: 15px;
   padding-left: 0;
   width: 103px;
 }
 
 #global-dpr-selector > select {
   padding: 0 8px 0 0;
   margin-left: 2px;
+  max-width: 5em;
 }
 
 #global-dpr-selector {
   margin: 0 8px;
   -moz-user-select: none;
   color: var(--viewport-color);
   height: 15px;
 }
--- a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
+++ b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
@@ -268,17 +268,17 @@ NewConsoleOutputWrapper.prototype = {
     this.throttledDispatchTimeout = setTimeout(() => {
       this.throttledDispatchTimeout = null;
 
       store.dispatch(actions.messagesAdd(this.queuedMessageAdds));
       this.queuedMessageAdds = [];
 
       if (this.queuedMessageUpdates.length > 0) {
         this.queuedMessageUpdates.forEach(({ message, res }) => {
-          store.dispatch(actions.networkMessageUpdate(message));
+          store.dispatch(actions.networkMessageUpdate(message, null, res));
           this.jsterm.hud.emit("network-message-updated", res);
         });
         this.queuedMessageUpdates = [];
       }
       if (this.queuedRequestUpdates.length > 0) {
         this.queuedRequestUpdates.forEach(({ id, data}) => {
           store.dispatch(actions.networkUpdateRequest(id, data));
         });
--- a/devtools/client/webconsole/new-console-output/store.js
+++ b/devtools/client/webconsole/new-console-output/store.js
@@ -172,40 +172,46 @@ function enableNetProvider(hud) {
       if (!dataProvider) {
         dataProvider = new DataProvider({
           actions,
           webConsoleClient: proxy.webConsoleClient
         });
       }
 
       let type = action.type;
+      let newState = reducer(state, action);
 
-      // If network message has been opened, fetch all
-      // HTTP details from the backend.
+      // If network message has been opened, fetch all HTTP details
+      // from the backend. It can happen (especially in test) that
+      // the message is opened before all network event updates are
+      // received. The rest of updates will be handled below, see:
+      // NETWORK_MESSAGE_UPDATE action handler.
       if (type == MESSAGE_OPEN) {
         let message = getMessage(state, action.id);
         if (!message.openedOnce && message.source == "network") {
+          dataProvider.onNetworkEvent(null, message);
           message.updates.forEach(updateType => {
             dataProvider.onNetworkEventUpdate(null, {
               packet: { updateType: updateType },
               networkInfo: message,
             });
           });
         }
       }
 
       // Process all incoming HTTP details packets.
       if (type == NETWORK_MESSAGE_UPDATE) {
-        let open = getAllMessagesUiById(state).includes(action.id);
+        let actor = action.response.networkInfo.actor;
+        let open = getAllMessagesUiById(state).includes(actor);
         if (open) {
           dataProvider.onNetworkEventUpdate(null, action.response);
         }
       }
 
-      return reducer(state, action);
+      return newState;
     }
 
     return next(netProviderEnhancer, initialState, enhancer);
   };
 }
 /**
  * Helper function for releasing backend actors.
  */
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini
@@ -61,17 +61,16 @@ support-files =
   test-bug-601177-log-levels.html
   test-bug-601177-log-levels.js
   test-bug-603750-websocket.html
   test-bug-603750-websocket.js
   test-bug-609872-cd-iframe-child.html
   test-bug-609872-cd-iframe-parent.html
   test-bug-613013-console-api-iframe.html
   test-bug-618078-network-exceptions.html
-  test-bug-621644-jsterm-dollar.html
   test-bug-630733-response-redirect-headers.sjs
   test-bug-632275-getters.html
   test-bug-632347-iterators-generators.html
   test-bug-644419-log-limits.html
   test-bug-646025-console-file-location.html
   test-bug-658368-time-methods.html
   test-bug-737873-mixedcontent.html
   test-bug-752559-ineffective-iframe-sandbox-warning-inner.html
@@ -135,16 +134,17 @@ support-files =
   test-filter.html
   test-for-of.html
   test-iframe-762593-insecure-form-action.html
   test-iframe-762593-insecure-frame.html
   test-iframe1.html
   test-iframe2.html
   test-iframe3.html
   test-image.png
+  test-jsterm-dollar.html
   test-location-debugger-link-console-log.js
   test-location-debugger-link-errors.js
   test-location-debugger-link.html
   test-location-styleeditor-link-1.css
   test-location-styleeditor-link-2.css
   test-location-styleeditor-link.html
   test-mixedcontent-securityerrors.html
   test-mutation.html
@@ -195,16 +195,17 @@ skip-if = true # Bug 1406060
 skip-if = true # Bug 1406060
 [browser_console_webconsole_private_browsing.js]
 skip-if = true #	Bug 1403188
 # old console skip-if = e10s # Bug 1042253 - webconsole e10s tests
 [browser_jsterm_copy_command.js]
 skip-if = true
 subsuite = clipboard
 # old console skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts
+[browser_jsterm_dollar.js]
 [browser_jsterm_history_persist.js]
 skip-if = true # Bug 1401881
 [browser_jsterm_inspect.js]
 [browser_jsterm_no_autocompletion_on_defined_variables.js]
 skip-if = true # Bug 1401881
 [browser_netmonitor_shows_reqs_in_webconsole.js]
 [browser_webconsole.js]
 skip-if = true #	Bug 1404829
@@ -367,18 +368,16 @@ skip-if = true #	Bug 1404849
 skip-if = true #	Bug 1405350
 [browser_webconsole_jsterm.js]
 skip-if = true #	Bug 1405352
 # old console skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout)
 [browser_webconsole_jsterm_copy.js]
 subsuite = clipboard
 skip-if = true #	Bug 1404831
 # old console skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts
-[browser_webconsole_jsterm_dollar.js]
-skip-if = true #	Bug 1404843
 [browser_webconsole_keyboard_accessibility.js]
 [browser_webconsole_location_debugger_link.js]
 [browser_webconsole_location_scratchpad_link.js]
 [browser_webconsole_location_styleeditor_link.js]
 [browser_webconsole_logErrorInPage.js]
 [browser_webconsole_longstring_expand.js]
 skip-if = true #	Bug 1403448
 [browser_webconsole_longstring_hang.js]
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_console.js
@@ -192,9 +192,21 @@ function* testCPOWInspection(hud) {
 
   // Before the fix for Bug 1382833, this wouldn't resolve due to a CPOW error
   // in the ObjectActor.
   let prototypeAndProperties = yield objectClient.getPrototypeAndProperties();
 
   // Just a sanity check to make sure a valid packet came back
   is(prototypeAndProperties.prototype.class, "XBL prototype JSClass",
     "Looks like a valid response");
+
+  // The CPOW is in the _contentWindow property.
+  let cpow = prototypeAndProperties.ownProperties._contentWindow.value;
+
+  // But it's only a CPOW in e10s.
+  let e10sCheck = yield hud.jsterm.requestEvaluation(
+    "Cu.isCrossProcessWrapper(gBrowser.selectedBrowser._contentWindow)");
+  if (e10sCheck.result) {
+    is(cpow.class, "CPOW: Window", "The CPOW grip has the right class.");
+  } else {
+    is(cpow.class, "Window", "The object is not a CPOW.");
+  }
 }
rename from devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm_dollar.js
rename to devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_dollar.js
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm_dollar.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_dollar.js
@@ -1,49 +1,31 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-// See Bug 621644.
+// Test that using `$` and `$$` in jsterm call the global content functions
+// if they are defined. See Bug 621644.
 
 const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
-                 "test/test-bug-621644-jsterm-dollar.html";
+                 "new-console-output/test/mochitest/test-jsterm-dollar.html";
 
 add_task(function* () {
-  yield loadTab(TEST_URI);
-
-  let hud = yield openConsole();
-
+  let hud = yield openNewTabAndConsole(TEST_URI);
   yield test$(hud);
   yield test$$(hud);
 });
 
-function* test$(HUD) {
-  let deferred = defer();
-
-  HUD.jsterm.clearOutput();
-
-  HUD.jsterm.execute("$(document.body)", (msg) => {
-    ok(msg.textContent.indexOf("<p>") > -1,
-       "jsterm output is correct for $()");
-    deferred.resolve();
-  });
-
-  return deferred.promise;
+async function test$(hud) {
+  hud.jsterm.clearOutput();
+  const msg = await hud.jsterm.execute("$(document.body)");
+  ok(msg.textContent.includes("<p>"), "jsterm output is correct for $()");
 }
 
-function test$$(HUD) {
-  let deferred = defer();
-
-  HUD.jsterm.clearOutput();
-
-  HUD.jsterm.setInputValue();
-  HUD.jsterm.execute("$$(document)", (msg) => {
-    ok(msg.textContent.indexOf("621644") > -1,
-       "jsterm output is correct for $$()");
-    deferred.resolve();
-  });
-
-  return deferred.promise;
+async function test$$(hud) {
+  hud.jsterm.clearOutput();
+  hud.jsterm.setInputValue();
+  const msg = await hud.jsterm.execute("$$(document)");
+  ok(msg.textContent.includes("621644"), "jsterm output is correct for $$()");
 }
--- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js
+++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js
@@ -29,20 +29,22 @@ add_task(async function task() {
   const documentUrl = TEST_PATH + TEST_FILE;
   await loadDocument(documentUrl);
   info("Document loaded.");
 
   let messageNode = await waitFor(() => findMessage(hud, documentUrl));
   let urlNode = messageNode.querySelector(".url");
   info("Network message found.");
 
+  let updates = waitForNetworkUpdates(toolbox);
+
   // Expand network log
   urlNode.click();
 
-  await waitForNetworkUpdates(toolbox);
+  await updates;
   await testNetworkMessage(messageNode);
 });
 
 async function testNetworkMessage(messageNode) {
   let headersTab = messageNode.querySelector("#headers-tab");
   let cookiesTab = messageNode.querySelector("#cookies-tab");
   let paramsTab = messageNode.querySelector("#params-tab");
   let responseTab = messageNode.querySelector("#response-tab");
rename from devtools/client/webconsole/new-console-output/test/mochitest/test-bug-621644-jsterm-dollar.html
rename to devtools/client/webconsole/new-console-output/test/mochitest/test-jsterm-dollar.html
--- a/devtools/client/webconsole/test/browser_console.js
+++ b/devtools/client/webconsole/test/browser_console.js
@@ -192,9 +192,21 @@ function* testCPOWInspection(hud) {
 
   // Before the fix for Bug 1382833, this wouldn't resolve due to a CPOW error
   // in the ObjectActor.
   let prototypeAndProperties = yield objectClient.getPrototypeAndProperties();
 
   // Just a sanity check to make sure a valid packet came back
   is(prototypeAndProperties.prototype.class, "XBL prototype JSClass",
     "Looks like a valid response");
+
+  // The CPOW is in the _contentWindow property.
+  let cpow = prototypeAndProperties.ownProperties._contentWindow.value;
+
+  // But it's only a CPOW in e10s.
+  let e10sCheck = yield hud.jsterm.requestEvaluation(
+    "Cu.isCrossProcessWrapper(gBrowser.selectedBrowser._contentWindow)");
+  if (e10sCheck.result) {
+    is(cpow.class, "CPOW: Window", "The CPOW grip has the right class.");
+  } else {
+    is(cpow.class, "Window", "The object is not a CPOW.");
+  }
 }
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -78,17 +78,17 @@ ObjectActor.prototype = {
       "actor": this.actorID
     };
 
     // Check if the object has a wrapper which denies access. It may be a CPOW or a
     // security wrapper. Change the class so that this will be visible in the UI.
     let unwrapped = DevToolsUtils.unwrap(this.obj);
     if (!unwrapped) {
       if (DevToolsUtils.isCPOW(this.obj)) {
-        g.class = "CPOW: " + g.class;
+        g.class = "CPOW: " + this.obj.class;
       } else {
         g.class = "Inaccessible";
       }
       return g;
     }
 
     // Dead objects also deny access.
     if (this.obj.class == "DeadObject") {
--- a/devtools/shared/heapsnapshot/HeapSnapshot.cpp
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.cpp
@@ -142,17 +142,17 @@ struct GetOrInternStringMatcher
 
   explicit GetOrInternStringMatcher(InternedStringSet& strings) : internedStrings(strings) { }
 
   const CharT* match(const std::string* str) {
     MOZ_ASSERT(str);
     size_t length = str->length() / sizeof(CharT);
     auto tempString = reinterpret_cast<const CharT*>(str->data());
 
-    UniquePtr<CharT[], NSFreePolicy> owned(NS_strndup(tempString, length));
+    UniqueFreePtr<CharT[]> owned(NS_strndup(tempString, length));
     if (!owned || !internedStrings.append(Move(owned)))
       return nullptr;
 
     return internedStrings.back().get();
   }
 
   const CharT* match(uint64_t ref) {
     if (MOZ_LIKELY(ref < internedStrings.length())) {
--- a/devtools/shared/heapsnapshot/HeapSnapshot.h
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.h
@@ -11,39 +11,33 @@
 #include "mozilla/devtools/DeserializedNode.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/Nullable.h"
 #include "mozilla/HashFunctions.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/RefCounted.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/TimeStamp.h"
-#include "mozilla/UniquePtr.h"
+#include "mozilla/UniquePtrExtensions.h"
 
 #include "CoreDump.pb.h"
 #include "nsCOMPtr.h"
 #include "nsCRTGlue.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupports.h"
 #include "nsWrapperCache.h"
 #include "nsXPCOM.h"
 
 namespace mozilla {
 namespace devtools {
 
 class DominatorTree;
 
-struct NSFreePolicy {
-  void operator()(void* ptr) {
-    NS_Free(ptr);
-  }
-};
-
-using UniqueTwoByteString = UniquePtr<char16_t[], NSFreePolicy>;
-using UniqueOneByteString = UniquePtr<char[], NSFreePolicy>;
+using UniqueTwoByteString = UniqueFreePtr<char16_t[]>;
+using UniqueOneByteString = UniqueFreePtr<char[]>;
 
 class HeapSnapshot final : public nsISupports
                          , public nsWrapperCache
 {
   friend struct DeserializedNode;
   friend struct DeserializedEdge;
   friend struct DeserializedStackFrame;
   friend class JS::ubi::Concrete<JS::ubi::DeserializedNode>;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1255,22 +1255,24 @@ public:
       }
 
       ~SelectorCache();
 
     private:
       nsDataHashtable<nsStringHashKey, SelectorList> mTable;
   };
 
-  SelectorCache& GetSelectorCache() {
-    if (!mSelectorCache) {
-      mSelectorCache =
-        new SelectorCache(EventTargetFor(mozilla::TaskCategory::Other));
+  SelectorCache& GetSelectorCache(mozilla::StyleBackendType aBackendType) {
+    mozilla::UniquePtr<SelectorCache>& cache =
+      aBackendType == mozilla::StyleBackendType::Servo
+        ? mServoSelectorCache : mGeckoSelectorCache;
+    if (!cache) {
+      cache.reset(new SelectorCache(EventTargetFor(mozilla::TaskCategory::Other)));
     }
-    return *mSelectorCache;
+    return *cache;
   }
   // Get the root <html> element, or return null if there isn't one (e.g.
   // if the root isn't <html>)
   Element* GetHtmlElement() const;
   // Returns the first child of GetHtmlContent which has the given tag,
   // or nullptr if that doesn't exist.
   Element* GetHtmlChildElement(nsAtom* aTag);
   // Get the canonical <body> element, or return null if there isn't one (e.g.
@@ -3198,18 +3200,23 @@ protected:
   bool GetChildDocumentUseCounter(mozilla::UseCounter aUseCounter)
   {
     return mChildDocumentUseCounters[aUseCounter];
   }
 
 private:
   mutable std::bitset<eDeprecatedOperationCount> mDeprecationWarnedAbout;
   mutable std::bitset<eDocumentWarningCount> mDocWarningWarnedAbout;
-  // Lazy-initialization to have mDocGroup initialized in prior to mSelectorCache.
-  nsAutoPtr<SelectorCache> mSelectorCache;
+
+  // Lazy-initialization to have mDocGroup initialized in prior to the
+  // SelectorCaches.
+  // FIXME(emilio): We can use a single cache when all CSSOM methods are
+  // implemented for the Servo backend.
+  mozilla::UniquePtr<SelectorCache> mServoSelectorCache;
+  mozilla::UniquePtr<SelectorCache> mGeckoSelectorCache;
 
 protected:
   ~nsIDocument();
   nsPropertyTable* GetExtraPropertyTable(uint16_t aCategory);
 
   // Never ever call this. Only call GetWindow!
   virtual nsPIDOMWindowOuter* GetWindowInternal() const = 0;
 
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -2679,34 +2679,31 @@ nsINode::Length() const
 const RawServoSelectorList*
 nsINode::ParseServoSelectorList(
   const nsAString& aSelectorString,
   ErrorResult& aRv)
 {
   nsIDocument* doc = OwnerDoc();
   MOZ_ASSERT(doc->IsStyledByServo());
 
-  nsIDocument::SelectorCache& cache = doc->GetSelectorCache();
+  nsIDocument::SelectorCache& cache =
+    doc->GetSelectorCache(mozilla::StyleBackendType::Servo);
   nsIDocument::SelectorCache::SelectorList* list =
     cache.GetList(aSelectorString);
   if (list) {
     if (!*list) {
       // Invalid selector.
       aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
         NS_LITERAL_CSTRING("'") + NS_ConvertUTF16toUTF8(aSelectorString) +
         NS_LITERAL_CSTRING("' is not a valid selector")
       );
       return nullptr;
     }
 
-    // FIXME(emilio): Make this private and use `WithSelectorList` everywhere,
-    // then assert.
-    if (list->IsServo()) {
-      return list->AsServo();
-    }
+    return list->AsServo();
   }
 
   NS_ConvertUTF16toUTF8 selectorString(aSelectorString);
 
   auto* selectorList = Servo_SelectorList_Parse(&selectorString);
   if (!selectorList) {
     aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
       NS_LITERAL_CSTRING("'") + selectorString +
@@ -2718,34 +2715,31 @@ nsINode::ParseServoSelectorList(
   return selectorList;
 }
 
 nsCSSSelectorList*
 nsINode::ParseSelectorList(const nsAString& aSelectorString,
                            ErrorResult& aRv)
 {
   nsIDocument* doc = OwnerDoc();
-  nsIDocument::SelectorCache& cache = doc->GetSelectorCache();
+  nsIDocument::SelectorCache& cache =
+    doc->GetSelectorCache(mozilla::StyleBackendType::Gecko);
   nsIDocument::SelectorCache::SelectorList* list =
     cache.GetList(aSelectorString);
   if (list) {
     if (!*list) {
       // Invalid selector.
       aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
         NS_LITERAL_CSTRING("'") + NS_ConvertUTF16toUTF8(aSelectorString) +
         NS_LITERAL_CSTRING("' is not a valid selector")
       );
       return nullptr;
     }
 
-    // FIXME(emilio): Make this private and use `WithSelectorList` everywhere,
-    // then assert.
-    if (list->IsGecko()) {
-      return list->AsGecko();
-    }
+    return list->AsGecko();
   }
 
   nsCSSParser parser(doc->CSSLoader());
 
   nsCSSSelectorList* selectorList = nullptr;
   aRv = parser.ParseSelectorString(aSelectorString,
                                    doc->GetDocumentURI(),
                                    0, // XXXbz get the line number!
rename from dom/media/doctor/DDLogClass.cpp
rename to dom/media/doctor/DDLogCategory.cpp
--- a/dom/media/doctor/DDLogClass.cpp
+++ b/dom/media/doctor/DDLogCategory.cpp
@@ -1,22 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
-#include "DDLogClass.h"
+#include "DDLogCategory.h"
 
 namespace mozilla {
 
-const char* const kDDLogClassShortStrings[kDDLogClassCount] = {
+const char* const kDDLogCategoryShortStrings[kDDLogCategoryCount] = {
   "con", "dcn", "des", "lnk", "ulk", "prp", "evt", "api", "log"
 };
-const char* const kDDLogClassLongStrings[kDDLogClassCount] = {
+const char* const kDDLogCategoryLongStrings[kDDLogCategoryCount] = {
   "Construction", "Derived Construction",
   "Destruction",  "Link",
   "Unlink",       "Property",
   "Event",        "API",
   "Log"
 };
 
 } // namespace mozilla
rename from dom/media/doctor/DDLogClass.h
rename to dom/media/doctor/DDLogCategory.h
--- a/dom/media/doctor/DDLogClass.h
+++ b/dom/media/doctor/DDLogCategory.h
@@ -1,51 +1,51 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 DDLogClass_h_
-#define DDLogClass_h_
+#ifndef DDLogCategory_h_
+#define DDLogCategory_h_
 
 #include "mozilla/Assertions.h"
 #include "mozilla/DefineEnum.h"
 
 namespace mozilla {
 
-// Enum used to classify log messages.
+// Enum used to categorize log messages.
 // Those starting with '_' are for internal use only.
-MOZ_DEFINE_ENUM_CLASS(DDLogClass,
+MOZ_DEFINE_ENUM_CLASS(DDLogCategory,
                       (_Construction,
                        _DerivedConstruction,
                        _Destruction,
                        _Link,
                        _Unlink,
                        Property,
                        Event,
                        API,
                        Log));
 
 // Corresponding short strings, used as JSON property names when logs are
 // retrieved.
-extern const char* const kDDLogClassShortStrings[kDDLogClassCount];
+extern const char* const kDDLogCategoryShortStrings[kDDLogCategoryCount];
 
 inline const char*
-ToShortString(DDLogClass aClass)
+ToShortString(DDLogCategory aCategory)
 {
-  MOZ_ASSERT(static_cast<size_t>(aClass) < kDDLogClassCount);
-  return kDDLogClassShortStrings[static_cast<size_t>(aClass)];
+  MOZ_ASSERT(static_cast<size_t>(aCategory) < kDDLogCategoryCount);
+  return kDDLogCategoryShortStrings[static_cast<size_t>(aCategory)];
 }
 
 // Corresponding long strings, for use in descriptive UI.
-extern const char* const kDDLogClassLongStrings[kDDLogClassCount];
+extern const char* const kDDLogCategoryLongStrings[kDDLogCategoryCount];
 
 inline const char*
-ToLongString(DDLogClass aClass)
+ToLongString(DDLogCategory aCategory)
 {
-  MOZ_ASSERT(static_cast<size_t>(aClass) < kDDLogClassCount);
-  return kDDLogClassLongStrings[static_cast<size_t>(aClass)];
+  MOZ_ASSERT(static_cast<size_t>(aCategory) < kDDLogCategoryCount);
+  return kDDLogCategoryLongStrings[static_cast<size_t>(aCategory)];
 }
 
 } // namespace mozilla
 
-#endif // DDLogClass_h_
+#endif // DDLogCategory_h_
--- a/dom/media/doctor/DDLogMessage.cpp
+++ b/dom/media/doctor/DDLogMessage.cpp
@@ -14,30 +14,30 @@ nsCString
 DDLogMessage::Print() const
 {
   nsCString str;
   str.AppendPrintf("%" PRImi " | %f | %s[%p] | %s | %s | ",
                    mIndex.Value(),
                    ToSeconds(mTimeStamp),
                    mObject.TypeName(),
                    mObject.Pointer(),
-                   ToShortString(mClass),
+                   ToShortString(mCategory),
                    mLabel);
   AppendToString(mValue, str);
   return str;
 }
 
 nsCString
 DDLogMessage::Print(const DDLifetimes& aLifetimes) const
 {
   nsCString str;
   const DDLifetime* lifetime = aLifetimes.FindLifetime(mObject, mIndex);
   str.AppendPrintf("%" PRImi " | %f | ", mIndex.Value(), ToSeconds(mTimeStamp));
   lifetime->AppendPrintf(str);
-  str.AppendPrintf(" | %s | %s | ", ToShortString(mClass), mLabel);
+  str.AppendPrintf(" | %s | %s | ", ToShortString(mCategory), mLabel);
   if (!mValue.is<DDLogObject>()) {
     AppendToString(mValue, str);
   } else {
     const DDLifetime* lifetime2 =
       aLifetimes.FindLifetime(mValue.as<DDLogObject>(), mIndex);
     if (lifetime2) {
       lifetime2->AppendPrintf(str);
     } else {
--- a/dom/media/doctor/DDLogMessage.h
+++ b/dom/media/doctor/DDLogMessage.h
@@ -2,17 +2,17 @@
 /* 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 DDLogMessage_h_
 #define DDLogMessage_h_
 
-#include "DDLogClass.h"
+#include "DDLogCategory.h"
 #include "DDLogObject.h"
 #include "DDLogValue.h"
 #include "DDMessageIndex.h"
 #include "DDTimeStamp.h"
 #include "mozilla/Atomics.h"
 #include "nsString.h"
 
 namespace mozilla {
@@ -21,26 +21,26 @@ class DDLifetimes;
 
 // Structure containing all the information needed in each log message
 // (before and after processing).
 struct DDLogMessage
 {
   DDMessageIndex mIndex;
   DDTimeStamp mTimeStamp;
   DDLogObject mObject;
-  DDLogClass mClass;
+  DDLogCategory mCategory;
   const char* mLabel;
   DDLogValue mValue = DDLogValue{ DDNoValue{} };
 
   // Print the message. Format:
-  // "index | timestamp | object | message-class | label | value". E.g.:
+  // "index | timestamp | object | category | label | value". E.g.:
   // "29 | 5.047547 | dom::HTMLMediaElement[134073800] | lnk | decoder | MediaDecoder[136078200]"
   nsCString Print() const;
 
   // Print the message, using object information from aLifetimes. Format:
-  // "index | timestamp | object | message-class | label | value". E.g.:
+  // "index | timestamp | object | category | label | value". E.g.:
   // "29 | 5.047547 | dom::HTMLVideoElement[134073800]#1 (as dom::HTMLMediaElement) | lnk | decoder | MediaSourceDecoder[136078200]#5 (as MediaDecoder)"
   nsCString Print(const DDLifetimes& aLifetimes) const;
 };
 
 } // namespace mozilla
 
 #endif // DDLogMessage_h_
--- a/dom/media/doctor/DDMediaLogs.cpp
+++ b/dom/media/doctor/DDMediaLogs.cpp
@@ -85,17 +85,17 @@ DDMediaLogs::Shutdown(bool aPanic)
     ProcessLog();
 
     for (const DDMediaLog& mediaLog : mMediaLogs) {
       if (mediaLog.mMediaElement) {
         DDLE_INFO("---");
       }
       DDLE_INFO("--- Log for HTMLMediaElement[%p] ---", mediaLog.mMediaElement);
       for (const DDLogMessage& message : mediaLog.mMessages) {
-        DDLE_LOG(message.mClass <= DDLogClass::_Unlink
+        DDLE_LOG(message.mCategory <= DDLogCategory::_Unlink
                    ? mozilla::LogLevel::Debug
                    : mozilla::LogLevel::Info,
                  "%s",
                  message.Print(mLifetimes).get());
       }
       DDLE_DEBUG("--- End log for HTMLMediaElement[%p] ---",
                  mediaLog.mMediaElement);
     }
@@ -328,24 +328,24 @@ DDMediaLogs::ProcessBuffer()
     DDLifetime& lifetime =
       FindOrCreateLifetime(message.mObject, message.mIndex, message.mTimeStamp);
 
     // Copy the message contents (without the mValid flag) to the
     // appropriate MediaLog corresponding to the message's object lifetime.
     LogFor(lifetime.mMediaElement)
       .mMessages.AppendElement(static_cast<const DDLogMessage&>(message));
 
-    switch (message.mClass) {
-      case DDLogClass::_Construction:
+    switch (message.mCategory) {
+      case DDLogCategory::_Construction:
         // The FindOrCreateLifetime above will have set a construction time,
         // so there's nothing more we need to do here.
         MOZ_ASSERT(lifetime.mConstructionTimeStamp);
         break;
 
-      case DDLogClass::_DerivedConstruction:
+      case DDLogCategory::_DerivedConstruction:
         // The FindOrCreateLifetime above will have set a construction time.
         MOZ_ASSERT(lifetime.mConstructionTimeStamp);
         // A derived construction must come with the base object.
         MOZ_ASSERT(message.mValue.is<DDLogObject>());
         {
           const DDLogObject& base = message.mValue.as<DDLogObject>();
           DDLifetime& baseLifetime =
             FindOrCreateLifetime(base, message.mIndex, message.mTimeStamp);
@@ -365,38 +365,38 @@ DDMediaLogs::ProcessBuffer()
           baseLifetime.mDerivedObject = lifetime2->mObject;
           baseLifetime.mDerivedObjectLinkingIndex = message.mIndex;
           // Link the base and derived objects, to ensure they go to the same
           // log.
           LinkLifetimes(*lifetime2, "is-a", baseLifetime, message.mIndex);
         }
         break;
 
-      case DDLogClass::_Destruction:
+      case DDLogCategory::_Destruction:
         lifetime.mDestructionIndex = message.mIndex;
         lifetime.mDestructionTimeStamp = message.mTimeStamp;
         UnlinkLifetime(lifetime, message.mIndex);
         break;
 
-      case DDLogClass::_Link:
+      case DDLogCategory::_Link:
         MOZ_ASSERT(message.mValue.is<DDLogObject>());
         {
           const DDLogObject& child = message.mValue.as<DDLogObject>();
           DDLifetime& childLifetime =
             FindOrCreateLifetime(child, message.mIndex, message.mTimeStamp);
           // FindOrCreateLifetime could have moved `lifetime`.
           DDLifetime* lifetime2 =
             mLifetimes.FindLifetime(message.mObject, message.mIndex);
           MOZ_ASSERT(lifetime2);
           LinkLifetimes(
             *lifetime2, message.mLabel, childLifetime, message.mIndex);
         }
         break;
 
-      case DDLogClass::_Unlink:
+      case DDLogCategory::_Unlink:
         MOZ_ASSERT(message.mValue.is<DDLogObject>());
         {
           const DDLogObject& child = message.mValue.as<DDLogObject>();
           DDLifetime& childLifetime =
             FindOrCreateLifetime(child, message.mIndex, message.mTimeStamp);
           // FindOrCreateLifetime could have moved `lifetime`.
           DDLifetime* lifetime2 =
             mLifetimes.FindLifetime(message.mObject, message.mIndex);
@@ -472,17 +472,17 @@ DDMediaLogs::FulfillPromises()
         jw.IntProperty("ob", lifetime->mTag);
       } else {
         jw.StringProperty("ob",
                           nsPrintfCString(R"("%s[%p]")",
                                           message.mObject.TypeName(),
                                           message.mObject.Pointer())
                             .get());
       }
-      jw.StringProperty("cls", ToShortString(message.mClass));
+      jw.StringProperty("cat", ToShortString(message.mCategory));
       if (message.mLabel && message.mLabel[0] != '\0') {
         jw.StringProperty("lbl", message.mLabel);
       }
       if (!message.mValue.is<DDNoValue>()) {
         if (message.mValue.is<DDLogObject>()) {
           const DDLogObject& ob2 = message.mValue.as<DDLogObject>();
           DDLifetime* lifetime2 = mLifetimes.FindLifetime(ob2, message.mIndex);
           if (lifetime2) {
--- a/dom/media/doctor/DDMediaLogs.h
+++ b/dom/media/doctor/DDMediaLogs.h
@@ -31,26 +31,26 @@ public:
   ~DDMediaLogs();
 
   // Shutdown the processing thread (blocking), and free as much memory as
   // possible.
   void Panic();
 
   inline void Log(const char* aSubjectTypeName,
                   const void* aSubjectPointer,
-                  DDLogClass aClass,
+                  DDLogCategory aCategory,
                   const char* aLabel,
                   DDLogValue&& aValue)
   {
     if (mMessagesQueue.PushF(
           [&](DDLogMessage& aMessage, MessagesQueue::Index i) {
             aMessage.mIndex = i;
             aMessage.mTimeStamp = DDNow();
             aMessage.mObject.Set(aSubjectTypeName, aSubjectPointer);
-            aMessage.mClass = aClass;
+            aMessage.mCategory = aCategory;
             aMessage.mLabel = aLabel;
             aMessage.mValue = Move(aValue);
           })) {
       // Filled a buffer-full of messages, process it in another thread.
       DispatchProcessLog();
     }
   }
 
--- a/dom/media/doctor/DecoderDoctorLogger.cpp
+++ b/dom/media/doctor/DecoderDoctorLogger.cpp
@@ -152,20 +152,20 @@ DecoderDoctorLogger::RetrieveMessages(
       NS_ERROR_DOM_MEDIA_ABORT_ERR, __func__);
   }
   return sMediaLogs->RetrieveMessages(aMediaElement);
 }
 
 /* static */ void
 DecoderDoctorLogger::Log(const char* aSubjectTypeName,
                          const void* aSubjectPointer,
-                         DDLogClass aClass,
+                         DDLogCategory aCategory,
                          const char* aLabel,
                          DDLogValue&& aValue)
 {
   if (IsDDLoggingEnabled()) {
     MOZ_ASSERT(sMediaLogs);
     sMediaLogs->Log(
-      aSubjectTypeName, aSubjectPointer, aClass, aLabel, Move(aValue));
+      aSubjectTypeName, aSubjectPointer, aCategory, aLabel, Move(aValue));
   }
 }
 
 } // namespace mozilla
--- a/dom/media/doctor/DecoderDoctorLogger.h
+++ b/dom/media/doctor/DecoderDoctorLogger.h
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef DecoderDoctorLogger_h_
 #define DecoderDoctorLogger_h_
 
 #include "DDLoggedTypeTraits.h"
-#include "DDLogClass.h"
+#include "DDLogCategory.h"
 #include "DDLogValue.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/DefineEnum.h"
 #include "mozilla/MozPromise.h"
 #include "nsString.h"
 
 namespace mozilla {
 
@@ -55,278 +55,253 @@ public:
   }
 
   // Logging functions.
   //
   // All logging functions take:
   // - The object that produces the message, either as a template type (for
   //   which a specialized DDLoggedTypeTraits exists), or a pointer and a type
   //   name (needed for inner classes that cannot specialize DDLoggedTypeTraits.)
-  // - A DDLogClass defining the type of log message; some are used
+  // - A DDLogCategory defining the type of log message; some are used
   //   internally for capture the lifetime and linking of C++ objects, others
   //   are used to split messages into different domains.
   // - A label (string literal).
   // - An optional Variant value, see DDLogValue for the accepted types.
   //
   // The following `EagerLog...` functions always cause their arguments to be
   // pre-evaluated even if logging is disabled, in which case runtime could be
   // wasted. Consider using `DDLOG...` macros instead, or test
   // `IsDDLoggingEnabled()` first.
 
   template<typename Value>
   static void EagerLogValue(const char* aSubjectTypeName,
                             const void* aSubjectPointer,
-                            DDLogClass aClass,
+                            DDLogCategory aCategory,
                             const char* aLabel,
                             Value&& aValue)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        aClass,
+        aCategory,
         aLabel,
         DDLogValue{ Forward<Value>(aValue) });
   }
 
   template<typename Subject, typename Value>
   static void EagerLogValue(const Subject* aSubject,
-                            DDLogClass aClass,
+                            DDLogCategory aCategory,
                             const char* aLabel,
                             Value&& aValue)
   {
     EagerLogValue(DDLoggedTypeTraits<Subject>::Name(),
                   aSubject,
-                  aClass,
+                  aCategory,
                   aLabel,
                   Forward<Value>(aValue));
   }
 
-  // LogValue with a string literal, as they are not seen as `const char*` by
-  // Variant. Also, a literal doesn't have runtime costs, so it's cheap to call
-  // directly.
-  template<size_t N>
-  static void LogValue(const char* aSubjectTypeName,
-                       const void* aSubjectPointer,
-                       DDLogClass aClass,
-                       const char* aLabel,
-                       const char (&aLiteral)[N])
+  // EagerLogValue that can explicitly take strings, as the templated function
+  // above confuses Variant when forwarding string literals.
+  static void EagerLogValue(const char* aSubjectTypeName,
+                            const void* aSubjectPointer,
+                            DDLogCategory aCategory,
+                            const char* aLabel,
+                            const char* aValue)
   {
-    EagerLogValue(aSubjectTypeName,
-                  aSubjectPointer,
-                  aClass,
-                  aLabel,
-                  static_cast<const char*>(aLiteral));
+    Log(aSubjectTypeName,
+        aSubjectPointer,
+        aCategory,
+        aLabel,
+        DDLogValue{ aValue });
   }
 
-  template<typename Subject, size_t N>
-  static void LogValue(const Subject* aSubject,
-                       DDLogClass aClass,
-                       const char* aLabel,
-                       const char (&aLiteral)[N])
-  {
-    EagerLogValue(aSubject, aClass, aLabel, static_cast<const char*>(aLiteral));
-  }
-
-  // Same as LogValue above, but needed to be seen by DDLOG... macros.
-  template<size_t N>
-  static void EagerLogValue(const char* aSubjectTypeName,
-                            const void* aSubjectPointer,
-                            DDLogClass aClass,
+  template<typename Subject>
+  static void EagerLogValue(const Subject* aSubject,
+                            DDLogCategory aCategory,
                             const char* aLabel,
-                            const char (&aLiteral)[N])
+                            const char* aValue)
   {
-    EagerLogValue(aSubjectTypeName,
-                  aSubjectPointer,
-                  aClass,
-                  aLabel,
-                  static_cast<const char*>(aLiteral));
-  }
-
-  template<typename Subject, size_t N>
-  static void EagerLogValue(const Subject* aSubject,
-                            DDLogClass aClass,
-                            const char* aLabel,
-                            const char (&aLiteral)[N])
-  {
-    EagerLogValue(aSubject, aClass, aLabel, static_cast<const char*>(aLiteral));
+    EagerLogValue(
+      DDLoggedTypeTraits<Subject>::Name(), aSubject, aCategory, aLabel, aValue);
   }
 
   template<typename... Args>
   static void EagerLogPrintf(const char* aSubjectTypeName,
                              const void* aSubjectPointer,
-                             DDLogClass aClass,
+                             DDLogCategory aCategory,
                              const char* aLabel,
                              const char* aFormat,
                              Args&&... aArgs)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        aClass,
+        aCategory,
         aLabel,
         DDLogValue{
           nsCString{ nsPrintfCString(aFormat, Forward<Args>(aArgs)...) } });
   }
 
   template<typename Subject, typename... Args>
   static void EagerLogPrintf(const Subject* aSubject,
-                             DDLogClass aClass,
+                             DDLogCategory aCategory,
                              const char* aLabel,
                              const char* aFormat,
                              Args&&... aArgs)
   {
     EagerLogPrintf(DDLoggedTypeTraits<Subject>::Name(),
                    aSubject,
-                   aClass,
+                   aCategory,
                    aLabel,
                    aFormat,
                    Forward<Args>(aArgs)...);
   }
 
   // Special logging functions. Consider using DecoderDoctorLifeLogger to
   // automatically capture constructions & destructions.
 
   static void LogConstruction(const char* aSubjectTypeName,
                               const void* aSubjectPointer)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        DDLogClass::_Construction,
+        DDLogCategory::_Construction,
         "",
         DDLogValue{ DDNoValue{} });
   }
 
   static void LogConstructionAndBase(const char* aSubjectTypeName,
                                      const void* aSubjectPointer,
                                      const char* aBaseTypeName,
                                      const void* aBasePointer)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        DDLogClass::_DerivedConstruction,
+        DDLogCategory::_DerivedConstruction,
         "",
         DDLogValue{ DDLogObject{ aBaseTypeName, aBasePointer } });
   }
 
   template<typename B>
   static void LogConstructionAndBase(const char* aSubjectTypeName,
                                      const void* aSubjectPointer,
                                      const B* aBase)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        DDLogClass::_DerivedConstruction,
+        DDLogCategory::_DerivedConstruction,
         "",
         DDLogValue{ DDLogObject{ DDLoggedTypeTraits<B>::Name(), aBase } });
   }
 
   template<typename Subject>
   static void LogConstruction(const Subject* aSubject)
   {
     using Traits = DDLoggedTypeTraits<Subject>;
     if (!Traits::HasBase::value) {
       Log(DDLoggedTypeTraits<Subject>::Name(),
           aSubject,
-          DDLogClass::_Construction,
+          DDLogCategory::_Construction,
           "",
           DDLogValue{ DDNoValue{} });
     } else {
       Log(DDLoggedTypeTraits<Subject>::Name(),
           aSubject,
-          DDLogClass::_DerivedConstruction,
+          DDLogCategory::_DerivedConstruction,
           "",
           DDLogValue{ DDLogObject{
             DDLoggedTypeTraits<typename Traits::BaseType>::Name(),
             static_cast<const typename Traits::BaseType*>(aSubject) } });
     }
   }
 
   static void LogDestruction(const char* aSubjectTypeName,
                              const void* aSubjectPointer)
   {
     Log(aSubjectTypeName,
         aSubjectPointer,
-        DDLogClass::_Destruction,
+        DDLogCategory::_Destruction,
         "",
         DDLogValue{ DDNoValue{} });
   }
 
   template<typename Subject>
   static void LogDestruction(const Subject* aSubject)
   {
     Log(DDLoggedTypeTraits<Subject>::Name(),
         aSubject,
-        DDLogClass::_Destruction,
+        DDLogCategory::_Destruction,
         "",
         DDLogValue{ DDNoValue{} });
   }
 
   template<typename P, typename C>
   static void LinkParentAndChild(const P* aParent,
                                  const char* aLinkName,
                                  const C* aChild)
   {
     if (aChild) {
       Log(DDLoggedTypeTraits<P>::Name(),
           aParent,
-          DDLogClass::_Link,
+          DDLogCategory::_Link,
           aLinkName,
           DDLogValue{ DDLogObject{ DDLoggedTypeTraits<C>::Name(), aChild } });
     }
   }
 
   template<typename C>
   static void LinkParentAndChild(const char* aParentTypeName,
                                  const void* aParentPointer,
                                  const char* aLinkName,
                                  const C* aChild)
   {
     if (aChild) {
       Log(aParentTypeName,
           aParentPointer,
-          DDLogClass::_Link,
+          DDLogCategory::_Link,
           aLinkName,
           DDLogValue{ DDLogObject{ DDLoggedTypeTraits<C>::Name(), aChild } });
     }
   }
 
   template<typename P>
   static void LinkParentAndChild(const P* aParent,
                                  const char* aLinkName,
                                  const char* aChildTypeName,
                                  const void* aChildPointer)
   {
     if (aChildPointer) {
       Log(DDLoggedTypeTraits<P>::Name(),
           aParent,
-          DDLogClass::_Link,
+          DDLogCategory::_Link,
           aLinkName,
           DDLogValue{ DDLogObject{ aChildTypeName, aChildPointer } });
     }
   }
 
   template<typename C>
   static void UnlinkParentAndChild(const char* aParentTypeName,
                                    const void* aParentPointer,
                                    const C* aChild)
   {
     if (aChild) {
       Log(aParentTypeName,
           aParentPointer,
-          DDLogClass::_Unlink,
+          DDLogCategory::_Unlink,
           "",
           DDLogValue{ DDLogObject{ DDLoggedTypeTraits<C>::Name(), aChild } });
     }
   }
 
   template<typename P, typename C>
   static void UnlinkParentAndChild(const P* aParent, const C* aChild)
   {
     if (aChild) {
       Log(DDLoggedTypeTraits<P>::Name(),
           aParent,
-          DDLogClass::_Unlink,
+          DDLogCategory::_Unlink,
           "",
           DDLogValue{ DDLogObject{ DDLoggedTypeTraits<C>::Name(), aChild } });
     }
   }
 
   // Retrieval functions.
 
   // Enable logging, if not done already. No effect otherwise.
@@ -351,17 +326,17 @@ private:
 
   // Note that this call may block while the state is scEnabling;
   // set aDontBlock to true to avoid blocking, most importantly when the
   // caller is the one doing the enabling, this would cause an endless loop.
   static void PanicInternal(const char* aReason, bool aDontBlock);
 
   static void Log(const char* aSubjectTypeName,
                   const void* aSubjectPointer,
-                  DDLogClass aClass,
+                  DDLogCategory aCategory,
                   const char* aLabel,
                   DDLogValue&& aValue);
 
   using LogState = int;
   // Currently disabled, may be enabled on request.
   static constexpr LogState scDisabled = 0;
   // Currently enabled (logging happens), may be shutdown.
   static constexpr LogState scEnabled = 1;
@@ -394,54 +369,54 @@ public:
     DecoderDoctorLogger::LogDestruction(static_cast<const T*>(this));
   }
 };
 
 // Macros to help lazily-evaluate arguments, only after we have checked that
 // logging is enabled.
 
 // Log a single value; see DDLogValue for allowed types.
-#define DDLOG(_class, _label, _arg)                                            \
+#define DDLOG(_category, _label, _arg)                                         \
   do {                                                                         \
     if (DecoderDoctorLogger::IsDDLoggingEnabled()) {                           \
-      DecoderDoctorLogger::EagerLogValue(this, _class, _label, _arg);          \
+      DecoderDoctorLogger::EagerLogValue(this, _category, _label, _arg);       \
     }                                                                          \
   } while (0)
 // Log a single value, with an EXplicit `this`.
-#define DDLOGEX(_this, _class, _label, _arg)                                   \
+#define DDLOGEX(_this, _category, _label, _arg)                                \
   do {                                                                         \
     if (DecoderDoctorLogger::IsDDLoggingEnabled()) {                           \
-      DecoderDoctorLogger::EagerLogValue(_this, _class, _label, _arg);         \
+      DecoderDoctorLogger::EagerLogValue(_this, _category, _label, _arg);      \
     }                                                                          \
   } while (0)
 // Log a single value, with EXplicit type name and `this`.
-#define DDLOGEX2(_typename, _this, _class, _label, _arg)                       \
+#define DDLOGEX2(_typename, _this, _category, _label, _arg)                    \
   do {                                                                         \
     if (DecoderDoctorLogger::IsDDLoggingEnabled()) {                           \
       DecoderDoctorLogger::EagerLogValue(                                      \
-        _typename, _this, _class, _label, _arg);                               \
+        _typename, _this, _category, _label, _arg);                            \
     }                                                                          \
   } while (0)
 
 #ifdef DEBUG
 // Do a printf format check in DEBUG, with the downside that side-effects (from
 // evaluating the arguments) may happen twice! Who would do that anyway?
 static void inline MOZ_FORMAT_PRINTF(1, 2) DDLOGPRCheck(const char*, ...) {}
 #define DDLOGPR_CHECK(_fmt, ...) DDLOGPRCheck(_fmt, __VA_ARGS__)
 #else
 #define DDLOGPR_CHECK(_fmt, ...)
 #endif
 
 // Log a printf'd string. Discouraged, please try using DDLOG instead.
-#define DDLOGPR(_class, _label, _format, ...)                                  \
+#define DDLOGPR(_category, _label, _format, ...)                               \
   do {                                                                         \
     if (DecoderDoctorLogger::IsDDLoggingEnabled()) {                           \
       DDLOGPR_CHECK(_format, __VA_ARGS__);                                     \
       DecoderDoctorLogger::EagerLogPrintf(                                     \
-        this, _class, _label, _format, __VA_ARGS__);                           \
+        this, _category, _label, _format, __VA_ARGS__);                        \
     }                                                                          \
   } while (0)
 
 // Link a child object.
 #define DDLINKCHILD(...)                                                       \
   do {                                                                         \
     if (DecoderDoctorLogger::IsDDLoggingEnabled()) {                           \
       DecoderDoctorLogger::LinkParentAndChild(this, __VA_ARGS__);              \
--- a/dom/media/doctor/moz.build
+++ b/dom/media/doctor/moz.build
@@ -4,28 +4,28 @@
 # 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/.
 
 TEST_DIRS += [
     'gtest',
 ]
 
 EXPORTS += [
-    'DDLogClass.h',
+    'DDLogCategory.h',
     'DDLoggedTypeTraits.h',
     'DDLogObject.h',
     'DDLogValue.h',
     'DecoderDoctorDiagnostics.h',
     'DecoderDoctorLogger.h',
 ]
 
 UNIFIED_SOURCES += [
     'DDLifetime.cpp',
     'DDLifetimes.cpp',
-    'DDLogClass.cpp',
+    'DDLogCategory.cpp',
     'DDLogMessage.cpp',
     'DDLogObject.cpp',
     'DDLogUtils.cpp',
     'DDLogValue.cpp',
     'DDMediaLog.cpp',
     'DDMediaLogs.cpp',
     'DDTimeStamp.cpp',
     'DecoderDoctorDiagnostics.cpp',
--- a/dom/media/mediasource/MediaSourceDemuxer.cpp
+++ b/dom/media/mediasource/MediaSourceDemuxer.cpp
@@ -206,16 +206,22 @@ MediaSourceDemuxer::DoDetachSourceBuffer
     MonitorAutoLock mon(mMonitor);
     if (aSourceBuffer == mAudioTrack) {
       mAudioTrack = nullptr;
     }
     if (aSourceBuffer == mVideoTrack) {
       mVideoTrack = nullptr;
     }
   }
+
+  for (auto& demuxer : mDemuxers) {
+    if (demuxer->HasManager(aSourceBuffer)) {
+      demuxer->DetachManager();
+    }
+  }
   ScanSourceBuffersForContent();
 }
 
 TrackInfo*
 MediaSourceDemuxer::GetTrackInfo(TrackType aTrack)
 {
   MonitorAutoLock mon(mMonitor);
   switch (aTrack) {
@@ -340,16 +346,19 @@ void
 MediaSourceTrackDemuxer::Reset()
 {
   MOZ_ASSERT(mParent, "Called after BreackCycle()");
   RefPtr<MediaSourceTrackDemuxer> self = this;
   nsCOMPtr<nsIRunnable> task =
     NS_NewRunnableFunction("MediaSourceTrackDemuxer::Reset", [self]() {
       self->mNextSample.reset();
       self->mReset = true;
+      if (!self->mManager) {
+        return;
+      }
       self->mManager->Seek(self->mType, TimeUnit::Zero(), TimeUnit::Zero());
       {
         MonitorAutoLock mon(self->mMonitor);
         self->mNextRandomAccessPoint = self->mManager->GetNextRandomAccessPoint(
           self->mType, MediaSourceDemuxer::EOS_FUZZ);
       }
     });
   mParent->GetTaskQueue()->Dispatch(task.forget());
@@ -371,34 +380,42 @@ MediaSourceTrackDemuxer::SkipToNextRando
            mParent->GetTaskQueue(), this, __func__,
            &MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint,
            aTimeThreshold);
 }
 
 media::TimeIntervals
 MediaSourceTrackDemuxer::GetBuffered()
 {
+  if (!mManager) {
+    return media::TimeIntervals();
+  }
   return mManager->Buffered();
 }
 
 void
 MediaSourceTrackDemuxer::BreakCycles()
 {
   RefPtr<MediaSourceTrackDemuxer> self = this;
   nsCOMPtr<nsIRunnable> task =
     NS_NewRunnableFunction("MediaSourceTrackDemuxer::BreakCycles", [self]() {
       self->mParent = nullptr;
-      self->mManager = nullptr;
+      self->DetachManager();
     });
   mParent->GetTaskQueue()->Dispatch(task.forget());
 }
 
 RefPtr<MediaSourceTrackDemuxer::SeekPromise>
 MediaSourceTrackDemuxer::DoSeek(const TimeUnit& aTime)
 {
+  if (!mManager) {
+    return SeekPromise::CreateAndReject(
+      MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                  RESULT_DETAIL("manager is detached.")), __func__);
+  }
   TimeIntervals buffered = mManager->Buffered(mType);
   // Fuzz factor represents a +/- threshold. So when seeking it allows the gap
   // to be twice as big as the fuzz value. We only want to allow EOS_FUZZ gap.
   buffered.SetFuzz(MediaSourceDemuxer::EOS_FUZZ / 2);
   TimeUnit seekTime = std::max(aTime - mPreRoll, TimeUnit::Zero());
 
   if (mManager->IsEnded() && seekTime >= buffered.GetEnd()) {
     // We're attempting to seek past the end time. Cap seekTime so that we seek
@@ -436,16 +453,21 @@ MediaSourceTrackDemuxer::DoSeek(const Ti
       mManager->GetNextRandomAccessPoint(mType, MediaSourceDemuxer::EOS_FUZZ);
   }
   return SeekPromise::CreateAndResolve(seekTime, __func__);
 }
 
 RefPtr<MediaSourceTrackDemuxer::SamplesPromise>
 MediaSourceTrackDemuxer::DoGetSamples(int32_t aNumSamples)
 {
+  if (!mManager) {
+    return SamplesPromise::CreateAndReject(
+      MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                  RESULT_DETAIL("manager is detached.")), __func__);
+  }
   if (mReset) {
     // If a seek (or reset) was recently performed, we ensure that the data
     // we are about to retrieve is still available.
     TimeIntervals buffered = mManager->Buffered(mType);
     buffered.SetFuzz(MediaSourceDemuxer::EOS_FUZZ / 2);
 
     if (!buffered.Length() && mManager->IsEnded()) {
       return SamplesPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_END_OF_STREAM,
@@ -484,16 +506,21 @@ MediaSourceTrackDemuxer::DoGetSamples(in
   }
   return SamplesPromise::CreateAndResolve(samples, __func__);
 }
 
 RefPtr<MediaSourceTrackDemuxer::SkipAccessPointPromise>
 MediaSourceTrackDemuxer::DoSkipToNextRandomAccessPoint(
   const TimeUnit& aTimeThreadshold)
 {
+  if (!mManager) {
+    return SkipAccessPointPromise::CreateAndReject(
+      SkipFailureHolder(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                        RESULT_DETAIL("manager is detached.")), 0), __func__);
+  }
   uint32_t parsed = 0;
   // Ensure that the data we are about to skip to is still available.
   TimeIntervals buffered = mManager->Buffered(mType);
   buffered.SetFuzz(MediaSourceDemuxer::EOS_FUZZ / 2);
   if (buffered.ContainsWithStrictEnd(aTimeThreadshold)) {
     bool found;
     parsed = mManager->SkipToNextRandomAccessPoint(mType,
                                                    aTimeThreadshold,
@@ -504,9 +531,21 @@ MediaSourceTrackDemuxer::DoSkipToNextRan
     }
   }
   SkipFailureHolder holder(
     mManager->IsEnded() ? NS_ERROR_DOM_MEDIA_END_OF_STREAM :
                           NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA, parsed);
   return SkipAccessPointPromise::CreateAndReject(holder, __func__);
 }
 
+bool
+MediaSourceTrackDemuxer::HasManager(TrackBuffersManager* aManager) const
+{
+  return mManager == aManager;
+}
+
+void
+MediaSourceTrackDemuxer::DetachManager()
+{
+  mManager = nullptr;
+}
+
 } // namespace mozilla
--- a/dom/media/mediasource/MediaSourceDemuxer.h
+++ b/dom/media/mediasource/MediaSourceDemuxer.h
@@ -111,16 +111,19 @@ public:
 
   void BreakCycles() override;
 
   bool GetSamplesMayBlock() const override
   {
     return false;
   }
 
+  bool HasManager(TrackBuffersManager* aManager) const;
+  void DetachManager();
+
 private:
   RefPtr<SeekPromise> DoSeek(const media::TimeUnit& aTime);
   RefPtr<SamplesPromise> DoGetSamples(int32_t aNumSamples);
   RefPtr<SkipAccessPointPromise> DoSkipToNextRandomAccessPoint(
     const media::TimeUnit& aTimeThreadshold);
   already_AddRefed<MediaRawData> GetSample(MediaResult& aError);
   // Return the timestamp of the next keyframe after mLastSampleIndex.
   media::TimeUnit GetNextRandomAccessPoint();
--- a/dom/media/mediasource/SourceBuffer.cpp
+++ b/dom/media/mediasource/SourceBuffer.cpp
@@ -275,19 +275,19 @@ SourceBuffer::Detach()
   MOZ_ASSERT(NS_IsMainThread());
   MSE_DEBUG("Detach");
   if (!mMediaSource) {
     MSE_DEBUG("Already detached");
     return;
   }
   AbortBufferAppend();
   if (mTrackBuffersManager) {
-    mTrackBuffersManager->Detach();
     mMediaSource->GetDecoder()->GetDemuxer()->DetachSourceBuffer(
       mTrackBuffersManager);
+    mTrackBuffersManager->Detach();
   }
   mTrackBuffersManager = nullptr;
   mMediaSource = nullptr;
 }
 
 void
 SourceBuffer::Ended()
 {
@@ -574,21 +574,17 @@ SourceBuffer::HighestEndTime()
   return mTrackBuffersManager
          ? mTrackBuffersManager->HighestEndTime().ToSeconds()
          : 0.0;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(SourceBuffer)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SourceBuffer)
-  // Tell the TrackBuffer to end its current SourceBufferResource.
-  TrackBuffersManager* manager = tmp->mTrackBuffersManager;
-  if (manager) {
-    manager->Detach();
-  }
+  tmp->Detach();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaSource)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mBuffered)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(DOMEventTargetHelper)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SourceBuffer,
                                                   DOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaSource)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBuffered)
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -167,16 +167,29 @@ TrackBuffersManager::QueueTask(SourceBuf
   MOZ_ASSERT(OnTaskQueue());
   mQueue.Push(aTask);
   ProcessTasks();
 }
 
 void
 TrackBuffersManager::ProcessTasks()
 {
+  // A second Detach task was queued, prior the first one running, ignore it.
+  if (!GetTaskQueue()) {
+    RefPtr<SourceBufferTask> task = mQueue.Pop();
+    if (!task) {
+      return;
+    }
+    MOZ_RELEASE_ASSERT(task->GetType() == SourceBufferTask::Type::Detach,
+                       "only detach task could happen here!");
+    MSE_DEBUG("Could not process the task '%s' after detached",
+              task->GetTypeName());
+    return;
+  }
+
   MOZ_ASSERT(OnTaskQueue());
   typedef SourceBufferTask::Type Type;
 
   if (mCurrentTask) {
     // Already have a task pending. ProcessTask will be scheduled once the
     // current task complete.
     return;
   }
--- a/dom/media/mediasource/TrackBuffersManager.h
+++ b/dom/media/mediasource/TrackBuffersManager.h
@@ -456,17 +456,18 @@ private:
 
   // TaskQueue methods and objects.
   AbstractThread* GetTaskQueue() const
   {
     return mTaskQueue;
   }
   bool OnTaskQueue() const
   {
-    return !GetTaskQueue() || GetTaskQueue()->IsCurrentThreadIn();
+    MOZ_RELEASE_ASSERT(GetTaskQueue());
+    return GetTaskQueue()->IsCurrentThreadIn();
   }
   RefPtr<AutoTaskQueue> mTaskQueue;
 
   // SourceBuffer Queues and running context.
   SourceBufferTaskQueue mQueue;
   void QueueTask(SourceBufferTask* aTask);
   void ProcessTasks();
   // Set if the TrackBuffersManager is currently processing a task.
--- a/dom/push/PushManager.cpp
+++ b/dom/push/PushManager.cpp
@@ -78,17 +78,17 @@ public:
   explicit AutoFreeKeyBuffer(uint8_t** aKeyBuffer)
     : mKeyBuffer(aKeyBuffer)
   {
     MOZ_ASSERT(mKeyBuffer);
   }
 
   ~AutoFreeKeyBuffer()
   {
-    NS_Free(*mKeyBuffer);
+    free(*mKeyBuffer);
   }
 };
 
 // Copies a subscription key buffer into an array.
 nsresult
 CopySubscriptionKeyToArray(nsIPushSubscription* aSubscription,
                            const nsAString& aKeyName,
                            nsTArray<uint8_t>& aKey)
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -219,17 +219,17 @@ PushData::Binary(uint32_t* aDataLen, uin
   NS_ENSURE_ARG_POINTER(aData);
 
   *aData = nullptr;
   if (mData.IsEmpty()) {
     *aDataLen = 0;
     return NS_OK;
   }
   uint32_t length = mData.Length();
-  uint8_t* data = static_cast<uint8_t*>(NS_Alloc(length * sizeof(uint8_t)));
+  uint8_t* data = static_cast<uint8_t*>(moz_xmalloc(length * sizeof(uint8_t)));
   if (!data) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   memcpy(data, mData.Elements(), length * sizeof(uint8_t));
   *aDataLen = length;
   *aData = data;
   return NS_OK;
 }
--- a/editor/reftests/xul/input.css
+++ b/editor/reftests/xul/input.css
@@ -7,19 +7,21 @@
 }
 
 #win html|input, #win html|textarea {
   margin: 2px 4px;
   padding: 2px 3px 3px;
   padding-inline-start: 5px;
 }
 
-#win html|input:-moz-system-metric(windows-default-theme) {
-  padding: 1px 2px 2px;
-  padding-inline-start: 4px;
+@media (-moz-windows-default-theme) {
+  #win html|input {
+    padding: 1px 2px 2px;
+    padding-inline-start: 4px;
+  }
 }
 
 #linux html|input, #linux html|textarea {
   margin: 2px 4px;
   padding: 2px 5px 3px;
 }
 
 textbox[multiline="true"], html|textarea {
@@ -37,18 +39,20 @@ html|input, html|textarea {
 html|input.ac {
   padding: 0 4px !important;
 }
 
 html|input.empty {
   color: graytext;
 }
 
-:root:not(.winxp) html|input.empty:-moz-system-metric(windows-default-theme) {
-  font-style: italic;
+@media (-moz-windows-default-theme) {
+  :root:not(.winxp) html|input.empty {
+    font-style: italic;
+  }
 }
 
 html|input.num {
   text-align: end;
 }
 
 #mac html|input.num {
   margin-inline-end: 8px;
--- a/gfx/layers/wr/ScrollingLayersHelper.cpp
+++ b/gfx/layers/wr/ScrollingLayersHelper.cpp
@@ -145,25 +145,25 @@ ScrollingLayersHelper::DefineAndPushChai
   // pushed onto the WR clip stack. Note that the recursion can invalidate the
   // iterator `it`.
   DefineAndPushChain(aChain->mParent, aBuilder, aStackingContext, aAppUnitsPerDevPixel, aCache);
 
   if (!aChain->mClip.HasClip()) {
     // This item in the chain is a no-op, skip over it
     return;
   }
-  if (!clipId || aBuilder.HasMaskClip()) {
+  if (!clipId || aBuilder.HasExtraClip()) {
     // If we don't have a clip id for this chain item yet, define the clip in WR
     // and save the id
     LayoutDeviceRect clip = LayoutDeviceRect::FromAppUnits(
         aChain->mClip.GetClipRect(), aAppUnitsPerDevPixel);
     nsTArray<wr::ComplexClipRegion> wrRoundedRects;
     aChain->mClip.ToComplexClipRegions(aAppUnitsPerDevPixel, aStackingContext, wrRoundedRects);
     clipId = Some(aBuilder.DefineClip(aStackingContext.ToRelativeLayoutRect(clip), &wrRoundedRects));
-    if (!aBuilder.HasMaskClip()) {
+    if (!aBuilder.HasExtraClip()) {
       aCache[aChain] = clipId.value();
     }
   }
   // Finally, push the clip onto the WR stack
   MOZ_ASSERT(clipId);
   aBuilder.PushClip(clipId.value());
   mPushedClips.push_back(wr::ScrollOrClipId(clipId.value()));
 }
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -1513,22 +1513,22 @@ gfxFcPlatformFontList::MakePlatformFont(
                                         uint16_t aWeight,
                                         int16_t aStretch,
                                         uint8_t aStyle,
                                         const uint8_t* aFontData,
                                         uint32_t aLength)
 {
     FT_Face face = Factory::NewFTFaceFromData(nullptr, aFontData, aLength, 0);
     if (!face) {
-        NS_Free((void*)aFontData);
+        free((void*)aFontData);
         return nullptr;
     }
     if (FT_Err_Ok != FT_Select_Charmap(face, FT_ENCODING_UNICODE)) {
         Factory::ReleaseFTFace(face);
-        NS_Free((void*)aFontData);
+        free((void*)aFontData);
         return nullptr;
     }
 
     return new gfxFontconfigFontEntry(aFontName, aWeight, aStretch,
                                       aStyle, aFontData, face);
 }
 
 bool
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ b/gfx/thebes/gfxFcPlatformFontList.h
@@ -55,17 +55,17 @@ public:
 
     const uint8_t *FontData() const { return mFontData; }
 
 private:
     ~FTUserFontData()
     {
         mozilla::gfx::Factory::ReleaseFTFace(mFace);
         if (mFontData) {
-            NS_Free((void*)mFontData);
+            free((void*)mFontData);
         }
     }
 
     FT_Face        mFace;
     const uint8_t *mFontData;
 };
 
 // The names for the font entry and font classes should really
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -620,17 +620,17 @@ WebRenderAPI::RunOnRenderThread(UniquePt
 {
   auto event = reinterpret_cast<uintptr_t>(aEvent.release());
   wr_api_send_external_event(mDocHandle, event);
 }
 
 DisplayListBuilder::DisplayListBuilder(PipelineId aId,
                                        const wr::LayoutSize& aContentSize,
                                        size_t aCapacity)
-  : mMaskClipCount(0)
+  : mExtraClipCount(0)
 {
   MOZ_COUNT_CTOR(DisplayListBuilder);
   mWrState = wr_state_new(aId, aContentSize, aCapacity);
 }
 
 DisplayListBuilder::~DisplayListBuilder()
 {
   MOZ_COUNT_DTOR(DisplayListBuilder);
@@ -694,35 +694,35 @@ DisplayListBuilder::DefineClip(const wr:
   WRDL_LOG("DefineClip id=%" PRIu64 " r=%s m=%p b=%s complex=%zu\n", mWrState,
       clip_id, Stringify(aClipRect).c_str(), aMask,
       aMask ? Stringify(aMask->rect).c_str() : "none",
       aComplex ? aComplex->Length() : 0);
   return wr::WrClipId { clip_id };
 }
 
 void
-DisplayListBuilder::PushClip(const wr::WrClipId& aClipId, bool aMask)
+DisplayListBuilder::PushClip(const wr::WrClipId& aClipId, bool aExtra)
 {
   wr_dp_push_clip(mWrState, aClipId.id);
   WRDL_LOG("PushClip id=%" PRIu64 "\n", mWrState, aClipId.id);
-  if (!aMask) {
+  if (!aExtra) {
     mClipIdStack.push_back(aClipId);
   } else {
-    mMaskClipCount++;
+    mExtraClipCount++;
   }
 }
 
 void
-DisplayListBuilder::PopClip(bool aMask)
+DisplayListBuilder::PopClip(bool aExtra)
 {
   WRDL_LOG("PopClip id=%" PRIu64 "\n", mWrState, mClipIdStack.back().id);
-  if (!aMask) {
+  if (!aExtra) {
     mClipIdStack.pop_back();
   } else {
-    mMaskClipCount--;
+    mExtraClipCount--;
   }
   wr_dp_pop_clip(mWrState);
 }
 
 wr::WrStickyId
 DisplayListBuilder::DefineStickyFrame(const wr::LayoutRect& aContentRect,
                                       const wr::StickySideConstraint* aTop,
                                       const wr::StickySideConstraint* aRight,
--- a/gfx/webrender_bindings/WebRenderAPI.h
+++ b/gfx/webrender_bindings/WebRenderAPI.h
@@ -220,18 +220,18 @@ public:
                            const wr::MixBlendMode& aMixBlendMode,
                            const nsTArray<wr::WrFilterOp>& aFilters,
                            bool aIsBackfaceVisible);
   void PopStackingContext();
 
   wr::WrClipId DefineClip(const wr::LayoutRect& aClipRect,
                           const nsTArray<wr::ComplexClipRegion>* aComplex = nullptr,
                           const wr::WrImageMask* aMask = nullptr);
-  void PushClip(const wr::WrClipId& aClipId, bool aMask = false);
-  void PopClip(bool aMask = false);
+  void PushClip(const wr::WrClipId& aClipId, bool aExtra = false);
+  void PopClip(bool aExtra = false);
 
   wr::WrStickyId DefineStickyFrame(const wr::LayoutRect& aContentRect,
                                    const wr::StickySideConstraint* aTop,
                                    const wr::StickySideConstraint* aRight,
                                    const wr::StickySideConstraint* aBottom,
                                    const wr::StickySideConstraint* aLeft);
   void PushStickyFrame(const wr::WrStickyId& aStickyId);
   void PopStickyFrame();
@@ -394,36 +394,36 @@ public:
   // Returns the scroll id that was pushed just before the given scroll id. This
   // function returns Nothing() if the given scrollid has not been encountered,
   // or if it is the rootmost scroll id (and therefore has no ancestor).
   Maybe<layers::FrameMetrics::ViewID> ParentScrollIdFor(layers::FrameMetrics::ViewID aScrollId);
 
   // Try to avoid using this when possible.
   wr::WrState* Raw() { return mWrState; }
 
-  // Return true if the current clip stack has any mask type clip.
-  bool HasMaskClip() { return mMaskClipCount > 0; }
+  // Return true if the current clip stack has any extra clip.
+  bool HasExtraClip() { return mExtraClipCount > 0; }
 
 protected:
   wr::WrState* mWrState;
 
   // Track the stack of clip ids and scroll layer ids that have been pushed
   // (by PushClip and PushScrollLayer, respectively) and are still active.
   // This is helpful for knowing e.g. what the ancestor scroll id of a particular
   // scroll id is, and doing other "queries" of current state.
   std::vector<wr::WrClipId> mClipIdStack;
   std::vector<layers::FrameMetrics::ViewID> mScrollIdStack;
 
   // Track the parent scroll id of each scroll id that we encountered. A
   // Nothing() value indicates a root scroll id. We also use this structure to
   // ensure that we don't define a particular scroll layer multiple times.
   std::unordered_map<layers::FrameMetrics::ViewID, Maybe<layers::FrameMetrics::ViewID>> mScrollParents;
 
-  // The number of mask clips that are in the stack.
-  uint32_t mMaskClipCount;
+  // The number of extra clips that are in the stack.
+  uint32_t mExtraClipCount;
 
   friend class WebRenderAPI;
 };
 
 Maybe<wr::ImageFormat>
 SurfaceFormatToImageFormat(gfx::SurfaceFormat aFormat);
 
 } // namespace wr
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1863,26 +1863,27 @@ nsPresContext::SysColorChangedInternal()
   // The system color values are computed to colors in the style data,
   // so normal style data comparison is sufficient here.
   RebuildAllStyleData(nsChangeHint(0), nsRestyleHint(0));
 }
 
 void
 nsPresContext::RefreshSystemMetrics()
 {
-  // This will force the system metrics to be generated the next time they're used
+  // This will force the system metrics to be generated the next time they're
+  // used.
   nsCSSRuleProcessor::FreeSystemMetrics();
 
-  // Changes to system metrics can change media queries on them, or
-  // :-moz-system-metric selectors (which requires eRestyle_Subtree).
+  // Changes to system metrics can change media queries on them.
+  //
   // Changes in theme can change system colors (whose changes are
   // properly reflected in computed style data), system fonts (whose
   // changes are not), and -moz-appearance (whose changes likewise are
-  // not), so we need to reflow.
-  MediaFeatureValuesChanged(eRestyle_Subtree, NS_STYLE_HINT_REFLOW);
+  // not), so we need to recascade for the first, and reflow for the rest.
+  MediaFeatureValuesChanged(eRestyle_ForceDescendants, NS_STYLE_HINT_REFLOW);
 }
 
 void
 nsPresContext::UIResolutionChanged()
 {
   if (!mPendingUIResolutionChanged) {
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::UIResolutionChangedInternal",
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -114,17 +114,16 @@ enum nsLayoutPhase {
   eLayoutPhase_COUNT
 };
 #endif
 
 /* Used by nsPresContext::HasAuthorSpecifiedRules */
 #define NS_AUTHOR_SPECIFIED_BACKGROUND      (1 << 0)
 #define NS_AUTHOR_SPECIFIED_BORDER          (1 << 1)
 #define NS_AUTHOR_SPECIFIED_PADDING         (1 << 2)
-#define NS_AUTHOR_SPECIFIED_TEXT_SHADOW     (1 << 3)
 
 class nsRootPresContext;
 
 // An interface for presentation contexts. Presentation contexts are
 // objects that provide an outer context for a presentation shell.
 
 class nsPresContext : public nsISupports,
                       public mozilla::SupportsWeakPtr<nsPresContext> {
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -112,17 +112,17 @@ nsDisplayColumnRule::CreateWebRenderComm
 {
   RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull(
     gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get());
 
   static_cast<nsColumnSetFrame*>(mFrame)->
     CreateBorderRenderers(mBorderRenderers, screenRefCtx, mVisibleRect, ToReferenceFrame());
 
   if (mBorderRenderers.IsEmpty()) {
-    return false;
+    return true;
   }
 
   for (auto iter = mBorderRenderers.begin(); iter != mBorderRenderers.end(); iter++) {
     if (!iter->CanCreateWebRenderCommands()) {
       return false;
     }
   }
 
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -781,17 +781,18 @@ ConstructBorderRenderer(nsPresContext* a
                              dirtyRect,
                              joinedBorderAreaPx,
                              borderStyles,
                              borderWidths,
                              bgRadii,
                              borderColors,
                              aStyleBorder.mBorderColors.get(),
                              bgColor,
-                             !aForFrame->BackfaceIsHidden());
+                             !aForFrame->BackfaceIsHidden(),
+                             *aNeedsClip ? Some(NSRectToRect(aBorderArea, oneDevPixel)) : Nothing());
 }
 
 
 DrawResult
 nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
                                            gfxContext& aRenderingContext,
                                            nsIFrame* aForFrame,
                                            const nsRect& aDirtyRect,
@@ -921,19 +922,16 @@ nsCSSRendering::CreateBorderRendererWith
                                                    aStyleContext,
                                                    aDrawTarget,
                                                    aForFrame,
                                                    aDirtyRect,
                                                    aBorderArea,
                                                    aStyleBorder,
                                                    aSkipSides,
                                                    &needsClip);
-  if (needsClip) {
-    return Nothing();
-  }
   return Some(br);
 }
 
 static nsRect
 GetOutlineInnerRect(nsIFrame* aFrame)
 {
   nsRect* savedOutlineInnerRect =
     aFrame->GetProperty(nsIFrame::OutlineInnerRectProperty());
@@ -1061,17 +1059,18 @@ nsCSSRendering::CreateBorderRendererForO
                          dirtyRect,
                          oRect,
                          outlineStyles,
                          outlineWidths,
                          outlineRadii,
                          outlineColors,
                          nullptr,
                          bgColor,
-                         !aForFrame->BackfaceIsHidden());
+                         !aForFrame->BackfaceIsHidden(),
+                         Nothing());
 
   return Some(br);
 }
 
 void
 nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
                              gfxContext& aRenderingContext,
                              nsIFrame* aForFrame,
@@ -1137,17 +1136,18 @@ nsCSSRendering::PaintFocus(nsPresContext
                          focusRect,
                          focusRect,
                          focusStyles,
                          focusWidths,
                          focusRadii,
                          focusColors,
                          nullptr,
                          NS_RGB(255, 0, 0),
-                         true);
+                         true,
+                         Nothing());
   br.DrawBorders();
 
   PrintAsStringNewline();
 }
 
 // Thebes Border Rendering Code End
 //----------------------------------------------------------------------
 
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -171,25 +171,27 @@ nsCSSBorderRenderer::nsCSSBorderRenderer
                                          const Rect& aDirtyRect,
                                          Rect& aOuterRect,
                                          const uint8_t* aBorderStyles,
                                          const Float* aBorderWidths,
                                          RectCornerRadii& aBorderRadii,
                                          const nscolor* aBorderColors,
                                          const nsBorderColors* aCompositeColors,
                                          nscolor aBackgroundColor,
-                                         bool aBackfaceIsVisible)
+                                         bool aBackfaceIsVisible,
+                                         const Maybe<Rect>& aClipRect)
   : mPresContext(aPresContext),
     mDocument(aDocument),
     mDrawTarget(aDrawTarget),
     mDirtyRect(aDirtyRect),
     mOuterRect(aOuterRect),
     mBorderRadii(aBorderRadii),
     mBackgroundColor(aBackgroundColor),
-    mBackfaceIsVisible(aBackfaceIsVisible)
+    mBackfaceIsVisible(aBackfaceIsVisible),
+    mLocalClip(aClipRect)
 {
   PodCopy(mBorderStyles, aBorderStyles, 4);
   PodCopy(mBorderWidths, aBorderWidths, 4);
   PodCopy(mBorderColors, aBorderColors, 4);
   NS_FOR_CSS_SIDES(side) {
     if (aCompositeColors && !(*aCompositeColors)[side].IsEmpty()) {
       mCompositeColors[side] = &(*aCompositeColors)[side];
     } else {
@@ -3610,23 +3612,35 @@ nsCSSBorderRenderer::CreateWebRenderComm
   NS_FOR_CSS_SIDES(i) {
     side[i] = wr::ToBorderSide(ToDeviceColor(mBorderColors[i]), mBorderStyles[i]);
   }
 
   wr::BorderRadius borderRadius = wr::ToBorderRadius(LayerSize(mBorderRadii[0].width, mBorderRadii[0].height),
                                                      LayerSize(mBorderRadii[1].width, mBorderRadii[1].height),
                                                      LayerSize(mBorderRadii[3].width, mBorderRadii[3].height),
                                                      LayerSize(mBorderRadii[2].width, mBorderRadii[2].height));
+
+  if (mLocalClip) {
+    LayoutDeviceRect clip = LayoutDeviceRect::FromUnknownRect(mLocalClip.value());
+    wr::LayoutRect clipRect = aSc.ToRelativeLayoutRect(clip);
+    wr::WrClipId clipId = aBuilder.DefineClip(clipRect);
+    aBuilder.PushClip(clipId, true);
+  }
+
   Range<const wr::BorderSide> wrsides(side, 4);
   aBuilder.PushBorder(transformedRect,
                       transformedRect,
                       mBackfaceIsVisible,
                       wr::ToBorderWidths(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]),
                       wrsides,
                       borderRadius);
+
+  if (mLocalClip) {
+    aBuilder.PopClip(true);
+  }
 }
 
 /* static */Maybe<nsCSSBorderImageRenderer>
 nsCSSBorderImageRenderer::CreateBorderImageRenderer(nsPresContext* aPresContext,
                                                     nsIFrame* aForFrame,
                                                     const nsRect& aBorderArea,
                                                     const nsStyleBorder& aStyleBorder,
                                                     const nsRect& aDirtyRect,
--- a/layout/painting/nsCSSRenderingBorders.h
+++ b/layout/painting/nsCSSRenderingBorders.h
@@ -96,17 +96,18 @@ public:
                       const Rect& aDirtyRect,
                       Rect& aOuterRect,
                       const uint8_t* aBorderStyles,
                       const Float* aBorderWidths,
                       RectCornerRadii& aBorderRadii,
                       const nscolor* aBorderColors,
                       const nsBorderColors* aCompositeColors,
                       nscolor aBackgroundColor,
-                      bool aBackfaceIsVisible);
+                      bool aBackfaceIsVisible,
+                      const mozilla::Maybe<Rect>& aClipRect);
 
   // draw the entire border
   void DrawBorders();
 
   bool CanCreateWebRenderCommands();
   void CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                mozilla::wr::IpcResourceUpdateQueue& aResources,
                                const mozilla::layers::StackingContextHelper& aSc);
@@ -160,16 +161,17 @@ private:
 
   // calculated values
   bool mAllBordersSameStyle;
   bool mAllBordersSameWidth;
   bool mOneUnitBorder;
   bool mNoBorderRadius;
   bool mAvoidStroke;
   bool mBackfaceIsVisible;
+  mozilla::Maybe<Rect> mLocalClip;
 
   // For all the sides in the bitmask, would they be rendered
   // in an identical color and style?
   bool AreBorderSideFinalStylesSame(uint8_t aSides);
 
   // For the given style, is the given corner a solid color?
   bool IsSolidCornerStyle(uint8_t aStyle, mozilla::Corner aCorner);
 
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -688,18 +688,18 @@ fails-if(Android) != 376532-3.html 37653
 == 379178-svg.svg 379178-svg-ref.svg
 fuzzy-if(skiaContent,1,500) == 379316-1.html 379316-1-ref.html
 fails-if(Android) random-if(cocoaWidget) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy-if(winWidget,1,180) fuzzy-if(gtkWidget,1,191) fuzzy-if(skiaContent,8,500) == 379316-2.html 379316-2-ref.html # bug 379786
 == 379328-1.html 379328-1-ref.html
 == 379349-1a.xhtml 379349-1-ref.xhtml
 # fuzzy because of different border rendering approach in bug 1185636
 fuzzy(37,20) == 379349-1b.xhtml 379349-1-ref.xhtml
 fuzzy(37,20) == 379349-1c.xhtml 379349-1-ref.xhtml
-fails-if(webrender) == 379349-2a.xhtml 379349-2-ref.xhtml
-fails-if(webrender) == 379349-2b.xhtml 379349-2-ref.xhtml
+== 379349-2a.xhtml 379349-2-ref.xhtml
+== 379349-2b.xhtml 379349-2-ref.xhtml
 fuzzy-if(Android,2,140) == 379349-3a.xhtml 379349-3-ref.xhtml
 fuzzy-if(Android,2,140) == 379349-3b.xhtml 379349-3-ref.xhtml
 == 379361-1.html 379361-1-ref.html
 == 379361-2.html 379361-2-ref.html
 == 379361-3.html 379361-3-ref.html
 == 379461-1.xhtml 379461-1.html
 == 379461-2.xhtml 379461-2.html
 == 379461-3-container-xhtml.html 379461-3-container-html.html
--- a/layout/reftests/css-grid/reftest.list
+++ b/layout/reftests/css-grid/reftest.list
@@ -181,102 +181,102 @@ skip-if(Android&&isDebugBuild) == grid-r
 == grid-repeat-auto-fill-fit-005.html grid-repeat-auto-fill-fit-005-ref.html
 == grid-repeat-auto-fill-fit-006.html grid-repeat-auto-fill-fit-006-ref.html
 == grid-repeat-auto-fill-fit-007.html grid-repeat-auto-fill-fit-007-ref.html
 == grid-repeat-auto-fill-fit-008.html grid-repeat-auto-fill-fit-008-ref.html
 == grid-repeat-auto-fill-fit-009.html grid-repeat-auto-fill-fit-009-ref.html
 == grid-repeat-auto-fill-fit-010.html grid-repeat-auto-fill-fit-010-ref.html
 == grid-repeat-auto-fill-fit-011.html grid-repeat-auto-fill-fit-010-ref.html
 == grid-item-blockifying-001.html grid-item-blockifying-001-ref.html
-fails-if(webrender) == grid-fragmentation-001.html grid-fragmentation-001-ref.html
-fails-if(webrender) == grid-fragmentation-002.html grid-fragmentation-002-ref.html
-fails-if(webrender) == grid-fragmentation-003.html grid-fragmentation-003-ref.html
-fails-if(webrender) == grid-fragmentation-004.html grid-fragmentation-004-ref.html
-fails-if(webrender) == grid-fragmentation-005.html grid-fragmentation-005-ref.html
-fails-if(webrender) == grid-fragmentation-006.html grid-fragmentation-006-ref.html
-fails-if(webrender) == grid-fragmentation-007.html grid-fragmentation-007-ref.html
-fails-if(webrender) == grid-fragmentation-008.html grid-fragmentation-008-ref.html
-fails-if(webrender) == grid-fragmentation-009.html grid-fragmentation-009-ref.html
+== grid-fragmentation-001.html grid-fragmentation-001-ref.html
+== grid-fragmentation-002.html grid-fragmentation-002-ref.html
+== grid-fragmentation-003.html grid-fragmentation-003-ref.html
+== grid-fragmentation-004.html grid-fragmentation-004-ref.html
+== grid-fragmentation-005.html grid-fragmentation-005-ref.html
+== grid-fragmentation-006.html grid-fragmentation-006-ref.html
+== grid-fragmentation-007.html grid-fragmentation-007-ref.html
+== grid-fragmentation-008.html grid-fragmentation-008-ref.html
+== grid-fragmentation-009.html grid-fragmentation-009-ref.html
 == grid-fragmentation-010.html grid-fragmentation-010-ref.html
 == grid-fragmentation-011.html grid-fragmentation-011-ref.html
 == grid-fragmentation-012.html grid-fragmentation-012-ref.html
 == grid-fragmentation-013.html grid-fragmentation-013-ref.html
 == grid-fragmentation-014.html grid-fragmentation-014-ref.html
 asserts(0-10) == grid-fragmentation-015.html grid-fragmentation-015-ref.html # bug 1144852 (due to vertical writing-mode)
 == grid-fragmentation-016.html grid-fragmentation-016-ref.html
 == grid-fragmentation-017.html grid-fragmentation-017-ref.html
 == grid-fragmentation-018.html grid-fragmentation-018-ref.html
 == grid-fragmentation-019.html grid-fragmentation-019-ref.html
-fails-if(webrender) == grid-fragmentation-020.html grid-fragmentation-020-ref.html
+== grid-fragmentation-020.html grid-fragmentation-020-ref.html
 == grid-fragmentation-021.html grid-fragmentation-021-ref.html
-fails-if(webrender) == grid-fragmentation-022.html grid-fragmentation-007-ref.html
-fails-if(webrender) == grid-fragmentation-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-024.html grid-fragmentation-024-ref.html
+== grid-fragmentation-022.html grid-fragmentation-007-ref.html
+== grid-fragmentation-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-024.html grid-fragmentation-024-ref.html
 == grid-fragmentation-025.html grid-fragmentation-025-ref.html
-fails-if(webrender) == grid-fragmentation-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-026.html grid-fragmentation-026-ref.html
 == grid-fragmentation-027.html grid-fragmentation-025-ref.html
-fails-if(webrender) == grid-fragmentation-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-029.html grid-fragmentation-029-ref.html
+== grid-fragmentation-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-029.html grid-fragmentation-029-ref.html
 == grid-fragmentation-030.html grid-fragmentation-030-ref.html
-fails-if(webrender) == grid-fragmentation-031.html grid-fragmentation-031-ref.html
+== grid-fragmentation-031.html grid-fragmentation-031-ref.html
 
 # Fragmentation tests that does dynamic content removal/insertions.
 # They should give the same result as the corresponding static test.
-fails-if(webrender) == grid-fragmentation-dyn3-001.html grid-fragmentation-001-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-001.html grid-fragmentation-001-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-002.html grid-fragmentation-002-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-002.html grid-fragmentation-002-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-003.html grid-fragmentation-003-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-004.html grid-fragmentation-004-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-005.html grid-fragmentation-005-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-005.html grid-fragmentation-005-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-006.html grid-fragmentation-006-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-007.html grid-fragmentation-007-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-007.html grid-fragmentation-007-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-008.html grid-fragmentation-008-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-009.html grid-fragmentation-009-ref.html
+== grid-fragmentation-dyn3-001.html grid-fragmentation-001-ref.html
+== grid-fragmentation-dyn4-001.html grid-fragmentation-001-ref.html
+== grid-fragmentation-dyn1-002.html grid-fragmentation-002-ref.html
+== grid-fragmentation-dyn3-002.html grid-fragmentation-002-ref.html
+== grid-fragmentation-dyn3-003.html grid-fragmentation-003-ref.html
+== grid-fragmentation-dyn4-004.html grid-fragmentation-004-ref.html
+== grid-fragmentation-dyn4-005.html grid-fragmentation-005-ref.html
+== grid-fragmentation-dyn5-005.html grid-fragmentation-005-ref.html
+== grid-fragmentation-dyn1-006.html grid-fragmentation-006-ref.html
+== grid-fragmentation-dyn3-007.html grid-fragmentation-007-ref.html
+== grid-fragmentation-dyn5-007.html grid-fragmentation-007-ref.html
+== grid-fragmentation-dyn5-008.html grid-fragmentation-008-ref.html
+== grid-fragmentation-dyn3-009.html grid-fragmentation-009-ref.html
 == grid-fragmentation-dyn4-015.html grid-fragmentation-015-ref.html
 == grid-fragmentation-dyn1-015.html grid-fragmentation-015-ref.html
 == grid-fragmentation-dyn1-016.html grid-fragmentation-016-ref.html
 == grid-fragmentation-dyn5-016.html grid-fragmentation-016-ref.html
 == grid-fragmentation-dyn3-017.html grid-fragmentation-017-ref.html
 == grid-fragmentation-dyn2-018.html grid-fragmentation-018-ref.html
 == grid-fragmentation-dyn1-019.html grid-fragmentation-019-ref.html
 == grid-fragmentation-dyn2-019.html grid-fragmentation-019-ref.html
 == grid-fragmentation-dyn3-019.html grid-fragmentation-019-ref.html
 == grid-fragmentation-dyn4-019.html grid-fragmentation-019-ref.html
 == grid-fragmentation-dyn5-019.html grid-fragmentation-019-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-020.html grid-fragmentation-020-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-020.html grid-fragmentation-020-ref.html
+== grid-fragmentation-dyn1-020.html grid-fragmentation-020-ref.html
+== grid-fragmentation-dyn2-020.html grid-fragmentation-020-ref.html
 != grid-fragmentation-dyn1-021.html grid-fragmentation-021-ref.html # bug 1251799
 == grid-fragmentation-dyn2-021.html grid-fragmentation-021-ref.html
 == grid-fragmentation-dyn3-021.html grid-fragmentation-021-ref.html
 == grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.html
 == grid-fragmentation-dyn5-021.html grid-fragmentation-021-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-022.html grid-fragmentation-007-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-023.html grid-fragmentation-023-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-024.html grid-fragmentation-024-ref.html
+== grid-fragmentation-dyn2-022.html grid-fragmentation-007-ref.html
+== grid-fragmentation-dyn1-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-dyn2-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-dyn3-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-dyn4-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-dyn5-023.html grid-fragmentation-023-ref.html
+== grid-fragmentation-dyn1-024.html grid-fragmentation-024-ref.html
 == grid-fragmentation-dyn2-025.html grid-fragmentation-025-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-026.html grid-fragmentation-026-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-026.html grid-fragmentation-026-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-026.html grid-fragmentation-026-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-026.html grid-fragmentation-026-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-dyn1-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-dyn2-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-dyn3-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-dyn4-026.html grid-fragmentation-026-ref.html
+== grid-fragmentation-dyn5-026.html grid-fragmentation-026-ref.html
 == grid-fragmentation-dyn1-027.html grid-fragmentation-025-ref.html
 == grid-fragmentation-dyn2-027.html grid-fragmentation-025-ref.html
 == grid-fragmentation-dyn3-027.html grid-fragmentation-025-ref.html
 == grid-fragmentation-dyn4-027.html grid-fragmentation-025-ref.html
 == grid-fragmentation-dyn5-027.html grid-fragmentation-025-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-dyn3-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-dyn4-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-dyn5-028.html grid-fragmentation-028-ref.html
-fails-if(webrender) == grid-fragmentation-dyn1-029.html grid-fragmentation-029-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-029.html grid-fragmentation-029-ref.html
+== grid-fragmentation-dyn1-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-dyn2-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-dyn3-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-dyn4-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-dyn5-028.html grid-fragmentation-028-ref.html
+== grid-fragmentation-dyn1-029.html grid-fragmentation-029-ref.html
+== grid-fragmentation-dyn2-029.html grid-fragmentation-029-ref.html
 == grid-fragmentation-dyn2-030.html grid-fragmentation-030-ref.html
-fails-if(webrender) == grid-fragmentation-dyn2-031.html grid-fragmentation-031-ref.html
+== grid-fragmentation-dyn2-031.html grid-fragmentation-031-ref.html
 == bug1306106.html bug1306106-ref.html
 == grid-percent-intrinsic-sizing-001.html grid-percent-intrinsic-sizing-001-ref.html
--- a/layout/reftests/css-mediaqueries/reftest.list
+++ b/layout/reftests/css-mediaqueries/reftest.list
@@ -11,9 +11,8 @@ fuzzy-if(Android,8,454) == mq_print_maxh
 == mq_print_maxwidth.xhtml mq_print-ref.xhtml
 
 == mq_print_maxwidth_updown.xhtml mq_print-ref.xhtml
 == mq_print_maxheight_updown.xhtml mq_print-ref.xhtml
 == mq_print_minheight_updown.xhtml mq_print-ref.xhtml
 == mq_print_minwidth_updown.xhtml mq_print-ref.xhtml
 
 pref(layout.css.scoped-style.enabled,true) == scoped-mq-update.html scoped-mq-update-ref.html
-== system-metrics-1.html system-metrics-1-ref.html
deleted file mode 100644
--- a/layout/reftests/css-mediaqueries/system-metrics-1-ref.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-<title>test for system metric media queries (reference)</title>
-<style>
-
-p { color: green; }
-
-</style>
-<p>This text should be green.</p>
deleted file mode 100644
--- a/layout/reftests/css-mediaqueries/system-metrics-1.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<title>test for system metric media queries</title>
-<style>
-
-p { color: red; }
-
-/* Exactly one of the next two should apply */
-
-@media all and (-moz-scrollbar-end-backward) {
-  p:-moz-system-metric(scrollbar-end-backward) { color: green; }
-}
-
-@media not all and (-moz-scrollbar-end-backward) {
-  p:not(:-moz-system-metric(scrollbar-end-backward)) { color: green; }
-}
-
-/* Neither of these should apply */
-
-@media not all and (-moz-scrollbar-end-backward) {
-  p:-moz-system-metric(scrollbar-end-backward) { color: red; }
-}
-
-@media all and (-moz-scrollbar-end-backward) {
-  p:not(:-moz-system-metric(scrollbar-end-backward)) { color: red; }
-}
-
-</style>
-<p>This text should be green.</p>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/color-on-visited-text-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<style>
+  .unvisited {
+    color: blue;
+  }
+  .visited {
+    color: purple;
+  }
+  .first-line {
+    color: green;
+  }
+</style>
+<div class="first-line">Visited</div>
+<div class="first-line">Visited with span</div>
+<div class="unvisited">Visited with inner unvisited</div>
+<div class="visited">Visited with inner visited</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/color-on-visited-text-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+  a {
+    display: block;
+    text-decoration: none;
+  }
+  :link {
+    color: blue;
+  }
+  :visited {
+    color: purple;
+  }
+  .outer::first-line {
+    color: green;
+  }
+</style>
+<a class="outer" href>Visited</a>
+<a class="outer" href><span>Visited with span</span></a>
+<a class="outer" href><a href="unvisited-page.html">Visited with inner unvisited</a></a>
+<a class="outer" href><a href>Visited with inner visited</a></a>
--- a/layout/reftests/pagination/reftest.list
+++ b/layout/reftests/pagination/reftest.list
@@ -11,34 +11,34 @@
 pref(layout.css.box-decoration-break.enabled,true) == abspos-breaking-007.html abspos-breaking-007-ref.html
 pref(layout.css.box-decoration-break.enabled,true) == abspos-breaking-008.html abspos-breaking-008-ref.html
 pref(layout.css.box-decoration-break.enabled,true) == abspos-breaking-009.html abspos-breaking-009-ref.html
 pref(layout.css.box-decoration-break.enabled,true) == abspos-breaking-010.html abspos-breaking-010-ref.html
 == abspos-breaking-011.html abspos-breaking-011-ref.html
 == abspos-breaking-dynamic-001.html abspos-breaking-dynamic-001-ref.html
 == abspos-breaking-dynamic-002.html abspos-breaking-dynamic-002-ref.html
 == abspos-breaking-dynamic-003.html abspos-breaking-dynamic-003-ref.html
-fails-if(webrender) == abspos-overflow-01.xhtml abspos-overflow-01.ref.xhtml
-fails-if(webrender) == abspos-overflow-01-cols.xhtml abspos-overflow-01-cols.ref.xhtml
+== abspos-overflow-01.xhtml abspos-overflow-01.ref.xhtml
+== abspos-overflow-01-cols.xhtml abspos-overflow-01-cols.ref.xhtml
 == border-breaking-000-cols.xhtml border-breaking-000-cols.ref.xhtml
 == border-breaking-001-cols.xhtml border-breaking-001-cols.ref.xhtml
 == border-breaking-002-cols.xhtml border-breaking-002-cols.ref.xhtml
 == border-breaking-003-cols.xhtml border-breaking-003-cols.ref.xhtml
 fails == border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml
 == content-inserted-000.xhtml content-inserted-000.ref.xhtml
 == content-inserted-001.xhtml content-inserted-001.ref.xhtml
 == content-inserted-002.xhtml content-inserted-002.ref.xhtml
 == content-inserted-003.xhtml content-inserted-002.ref.xhtml
 == content-inserted-004.xhtml content-inserted-002.ref.xhtml
 == content-inserted-005.xhtml content-inserted-002.ref.xhtml
 == content-inserted-006.xhtml content-inserted-002.ref.xhtml
 == content-inserted-007.xhtml content-inserted-002.ref.xhtml
 == content-inserted-008.xhtml content-inserted-001.ref.xhtml
 == content-inserted-009.xhtml content-inserted-002.ref.xhtml
-fails-if(webrender) == dynamic-abspos-overflow-01-cols.xhtml dynamic-abspos-overflow-01-cols.ref.xhtml
+== dynamic-abspos-overflow-01-cols.xhtml dynamic-abspos-overflow-01-cols.ref.xhtml
 test-pref(layout.float-fragments-inside-column.enabled,false) fails == float-clear-000.html float-clear-000.ref.html
 test-pref(layout.float-fragments-inside-column.enabled,true) == float-clear-000.html float-clear-000.ref.html
 fails == float-clear-001.html float-clear-000.ref.html
 test-pref(layout.float-fragments-inside-column.enabled,false) fails == float-clear-002.html float-clear-000.ref.html
 test-pref(layout.float-fragments-inside-column.enabled,true) == float-clear-002.html float-clear-000.ref.html
 fails == float-clear-003.html float-clear-000.ref.html
 == float-clear-000-print.html float-clear-000-print.ref.html
 == float-clear-001-print.html float-clear-000-print.ref.html
--- a/layout/style/nsCSSPseudoClassList.h
+++ b/layout/style/nsCSSPseudoClassList.h
@@ -95,19 +95,16 @@ CSS_PSEUDO_CLASS(mozIsHTML, ":-moz-is-ht
 // a subtree of C++ anonymous content constructed by Gecko for its own
 // purposes).
 CSS_PSEUDO_CLASS(mozNativeAnonymous, ":-moz-native-anonymous",
                  CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS, "")
 
 CSS_PSEUDO_CLASS(mozUseShadowTreeRoot, ":-moz-use-shadow-tree-root",
                  CSS_PSEUDO_CLASS_ENABLED_IN_UA_SHEETS, "")
 
-// Matches anything when the specified look-and-feel metric is set
-CSS_PSEUDO_CLASS(mozSystemMetric, ":-moz-system-metric", 0, "")
-
 // -moz-locale-dir(ltr) and -moz-locale-dir(rtl) may be used
 // to match based on the locale's chrome direction
 CSS_PSEUDO_CLASS(mozLocaleDir, ":-moz-locale-dir", 0, "")
 
 // -moz-lwtheme may be used to match a document that has a lightweight theme
 CSS_PSEUDO_CLASS(mozLWTheme, ":-moz-lwtheme", 0, "")
 
 // -moz-lwtheme-brighttext matches a document that has a dark lightweight theme
--- a/layout/style/nsCSSPseudoClasses.cpp
+++ b/layout/style/nsCSSPseudoClasses.cpp
@@ -84,17 +84,16 @@ void nsCSSPseudoClasses::AddRefAtoms()
 #include "nsCSSPseudoClassList.h"
 #undef CSS_PSEUDO_CLASS
 }
 
 bool
 nsCSSPseudoClasses::HasStringArg(Type aType)
 {
   return aType == Type::lang ||
-         aType == Type::mozSystemMetric ||
          aType == Type::mozLocaleDir ||
          aType == Type::dir;
 }
 
 bool
 nsCSSPseudoClasses::HasNthPairArg(Type aType)
 {
   return aType == Type::nthChild ||
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -1745,25 +1745,16 @@ nsCSSRuleProcessor::StringPseudoMatches(
           }
         } else {
           // Selectors specifying other directions never match.
           return false;
         }
       }
       break;
 
-    case CSSPseudoClassType::mozSystemMetric:
-      {
-        RefPtr<nsAtom> metric = NS_Atomize(aString);
-        if (!nsCSSRuleProcessor::HasSystemMetric(metric)) {
-          return false;
-        }
-      }
-      break;
-
     case CSSPseudoClassType::dir:
       {
         if (aDependence) {
           EventStates states = sPseudoClassStateDependences[
             static_cast<CSSPseudoClassTypeBase>(aPseudo)];
           if (aStateMask.HasAtLeastOneOfStates(states)) {
             *aDependence = true;
             return false;
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -10502,48 +10502,35 @@ nsRuleNode::HasAuthorSpecifiedRules(Geck
     inheritBits |= NS_STYLE_INHERIT_BIT(Background);
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER)
     inheritBits |= NS_STYLE_INHERIT_BIT(Border);
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING)
     inheritBits |= NS_STYLE_INHERIT_BIT(Padding);
 
-  if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW)
-    inheritBits |= NS_STYLE_INHERIT_BIT(Text);
-
   // properties in the SIDS, whether or not we care about them
   size_t nprops = 0,
-         backgroundOffset, borderOffset, paddingOffset, textShadowOffset;
-
-  // We put the reset properties the start of the nsCSSValue array....
+         backgroundOffset, borderOffset, paddingOffset;
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
     backgroundOffset = nprops;
     nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Background);
   }
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER) {
     borderOffset = nprops;
     nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Border);
   }
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) {
     paddingOffset = nprops;
     nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Padding);
   }
 
-  // ...and the inherited properties at the end of the array.
-  size_t inheritedOffset = nprops;
-
-  if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
-    textShadowOffset = nprops;
-    nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Text);
-  }
-
   void* dataStorage = alloca(nprops * sizeof(nsCSSValue));
   AutoCSSValueArray dataArray(dataStorage, nprops);
 
   /* We're relying on the use of |styleContext| not mutating it! */
   nsRuleData ruleData(inheritBits, dataArray.get(),
                       styleContext->PresContext(), styleContext);
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
@@ -10553,20 +10540,16 @@ nsRuleNode::HasAuthorSpecifiedRules(Geck
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BORDER) {
     ruleData.mValueOffsets[eStyleStruct_Border] = borderOffset;
   }
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) {
     ruleData.mValueOffsets[eStyleStruct_Padding] = paddingOffset;
   }
 
-  if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
-    ruleData.mValueOffsets[eStyleStruct_Text] = textShadowOffset;
-  }
-
   static const nsCSSPropertyID backgroundValues[] = {
     eCSSProperty_background_color,
     eCSSProperty_background_image,
   };
 
   static const nsCSSPropertyID borderValues[] = {
     eCSSProperty_border_top_color,
     eCSSProperty_border_top_style,
@@ -10588,32 +10571,26 @@ nsRuleNode::HasAuthorSpecifiedRules(Geck
 
   static const nsCSSPropertyID paddingValues[] = {
     eCSSProperty_padding_top,
     eCSSProperty_padding_right,
     eCSSProperty_padding_bottom,
     eCSSProperty_padding_left,
   };
 
-  static const nsCSSPropertyID textShadowValues[] = {
-    eCSSProperty_text_shadow
-  };
-
   // Number of properties we care about
   size_t nValues = 0;
 
   nsCSSValue* values[MOZ_ARRAY_LENGTH(backgroundValues) +
                      MOZ_ARRAY_LENGTH(borderValues) +
-                     MOZ_ARRAY_LENGTH(paddingValues) +
-                     MOZ_ARRAY_LENGTH(textShadowValues)];
+                     MOZ_ARRAY_LENGTH(paddingValues)];
 
   nsCSSPropertyID properties[MOZ_ARRAY_LENGTH(backgroundValues) +
                            MOZ_ARRAY_LENGTH(borderValues) +
-                           MOZ_ARRAY_LENGTH(paddingValues) +
-                           MOZ_ARRAY_LENGTH(textShadowValues)];
+                           MOZ_ARRAY_LENGTH(paddingValues)];
 
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) {
     for (uint32_t i = 0, i_end = ArrayLength(backgroundValues);
          i < i_end; ++i) {
       properties[nValues] = backgroundValues[i];
       values[nValues++] = ruleData.ValueFor(backgroundValues[i]);
     }
   }
@@ -10629,24 +10606,16 @@ nsRuleNode::HasAuthorSpecifiedRules(Geck
   if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) {
     for (uint32_t i = 0, i_end = ArrayLength(paddingValues);
          i < i_end; ++i) {
       properties[nValues] = paddingValues[i];
       values[nValues++] = ruleData.ValueFor(paddingValues[i]);
     }
   }
 
-  if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) {
-    for (uint32_t i = 0, i_end = ArrayLength(textShadowValues);
-         i < i_end; ++i) {
-      properties[nValues] = textShadowValues[i];
-      values[nValues++] = ruleData.ValueFor(textShadowValues[i]);
-    }
-  }
-
   GeckoStyleContext* styleContextRef = styleContext;
 
   // We need to be careful not to count styles covered up by user-important or
   // UA-important declarations.  But we do want to catch explicit inherit
   // styling in those and check our parent style context to see whether we have
   // user styling for those properties.  Note that we don't care here about
   // inheritance due to lack of a specified value, since all the properties we
   // care about are reset properties.
@@ -10667,18 +10636,17 @@ nsRuleNode::HasAuthorSpecifiedRules(Geck
           // This is a rule whose effect we want to ignore, so if any of
           // the properties we care about were set, set them to the dummy
           // value that they'll never otherwise get.
           for (uint32_t i = 0; i < nValues; ++i) {
             nsCSSUnit unit = values[i]->GetUnit();
             if (unit != eCSSUnit_Null &&
                 unit != eCSSUnit_Dummy &&
                 unit != eCSSUnit_DummyInherit) {
-              if (unit == eCSSUnit_Inherit ||
-                  (i >= inheritedOffset && unit == eCSSUnit_Unset)) {
+              if (unit == eCSSUnit_Inherit) {
                 haveExplicitUAInherit = true;
                 values[i]->SetDummyInheritValue();
               } else {
                 values[i]->SetDummyValue();
               }
             }
           }
         } else {
--- a/layout/style/test/moz.build
+++ b/layout/style/test/moz.build
@@ -55,16 +55,18 @@ TEST_HARNESS_FILES.testing.mochitest.tes
     '/layout/reftests/css-visited/color-on-link-1-ref.html',
     '/layout/reftests/css-visited/color-on-link-1.html',
     '/layout/reftests/css-visited/color-on-link-before-1.html',
     '/layout/reftests/css-visited/color-on-text-decoration-1-ref.html',
     '/layout/reftests/css-visited/color-on-text-decoration-1.html',
     '/layout/reftests/css-visited/color-on-visited-1-ref.html',
     '/layout/reftests/css-visited/color-on-visited-1.html',
     '/layout/reftests/css-visited/color-on-visited-before-1.html',
+    '/layout/reftests/css-visited/color-on-visited-text-1-ref.html',
+    '/layout/reftests/css-visited/color-on-visited-text-1.html',
     '/layout/reftests/css-visited/column-rule-1-notref.html',
     '/layout/reftests/css-visited/column-rule-1-ref.html',
     '/layout/reftests/css-visited/column-rule-1.html',
     '/layout/reftests/css-visited/content-before-1-ref.html',
     '/layout/reftests/css-visited/content-color-on-link-before-1-ref.html',
     '/layout/reftests/css-visited/content-color-on-link-before-1.html',
     '/layout/reftests/css-visited/content-color-on-visited-before-1-ref.html',
     '/layout/reftests/css-visited/content-color-on-visited-before-1.html',
--- a/layout/style/test/test_visited_reftests.html
+++ b/layout/style/test/test_visited_reftests.html
@@ -33,16 +33,17 @@ var gTests = [
   // coloring on the TEST (first file) until the test passes.
   "== pseudo-classes-02.svg pseudo-classes-02-ref.svg",
   "needs-focus == caret-color-on-visited-1.html caret-color-on-visited-1-ref.html",
   "!= color-on-link-1-ref.html color-on-visited-1-ref.html",
   "== color-on-link-1.html color-on-link-1-ref.html",
   "== color-on-link-before-1.html color-on-link-1-ref.html",
   "== color-on-visited-1.html color-on-visited-1-ref.html",
   "== color-on-visited-before-1.html color-on-visited-1-ref.html",
+  "== color-on-visited-text-1.html color-on-visited-text-1-ref.html",
   "!= content-color-on-link-before-1-ref.html content-color-on-visited-before-1-ref.html",
   "== content-color-on-link-before-1.html content-color-on-link-before-1-ref.html",
   "== content-color-on-visited-before-1.html content-color-on-visited-before-1-ref.html",
   "== content-on-link-before-1.html content-before-1-ref.html",
   "== content-on-visited-before-1.html content-before-1-ref.html",
   "== color-on-text-decoration-1.html color-on-text-decoration-1-ref.html",
   "== color-on-bullets-1.html color-on-bullets-1-ref.html",
   // NOTE: background-color is tested by all the selector tests (and
--- a/mobile/android/app/src/main/res/layout/find_in_page_content.xml
+++ b/mobile/android/app/src/main/res/layout/find_in_page_content.xml
@@ -1,53 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+       xmlns:tools="http://schemas.android.com/tools"
+       tools:parentTag="LinearLayout"
+       tools:layout_width="match_parent"
+       tools:layout_height="wrap_content">
 
     <view class="org.mozilla.gecko.CustomEditText"
-              android:id="@+id/find_text"
-              android:layout_width="0dip"
-              android:layout_height="wrap_content"
-              android:layout_weight="1.0"
-              android:layout_marginLeft="@dimen/find_in_page_text_margin_start"
-              android:layout_marginStart="@dimen/find_in_page_text_margin_start"
-              android:layout_marginRight="@dimen/find_in_page_text_margin_end"
-              android:layout_marginEnd="@dimen/find_in_page_text_margin_end"
-              android:contentDescription="@string/find_text"
-              android:background="@drawable/url_bar_entry"
-              android:singleLine="true"
-              android:textColor="#000000"
-              android:textCursorDrawable="@null"
-              android:inputType="text"
-              android:paddingLeft="@dimen/find_in_page_text_padding_start"
-              android:paddingStart="@dimen/find_in_page_text_padding_start"
-              android:paddingRight="@dimen/find_in_page_text_padding_end"
-              android:paddingEnd="@dimen/find_in_page_text_padding_end"
-              android:textColorHighlight="@color/fennec_ui_accent"
-              android:imeOptions="actionSearch"
-              android:selectAllOnFocus="true"
-              android:gravity="center_vertical|left|start"/>
+          android:id="@+id/find_text"
+          android:layout_width="0dip"
+          android:layout_height="wrap_content"
+          android:layout_weight="1.0"
+          android:layout_marginLeft="@dimen/find_in_page_text_margin_start"
+          android:layout_marginStart="@dimen/find_in_page_text_margin_start"
+          android:layout_marginRight="@dimen/find_in_page_text_margin_end"
+          android:layout_marginEnd="@dimen/find_in_page_text_margin_end"
+          android:layout_gravity="center_vertical"
+          android:contentDescription="@string/find_text"
+          android:background="@drawable/url_bar_entry"
+          android:singleLine="true"
+          android:textColor="@color/photon_text_main"
+          android:textCursorDrawable="@null"
+          android:inputType="text"
+          android:paddingLeft="@dimen/find_in_page_text_padding_start"
+          android:paddingStart="@dimen/find_in_page_text_padding_start"
+          android:paddingRight="@dimen/find_in_page_text_padding_end"
+          android:paddingEnd="@dimen/find_in_page_text_padding_end"
+          android:textColorHighlight="@color/fennec_ui_accent"
+          android:imeOptions="actionSearch"
+          android:selectAllOnFocus="true"
+          android:gravity="center_vertical|left|start"
+          tools:text="Find in page"/>
 
     <TextView android:id="@+id/find_status"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:layout_marginRight="@dimen/find_in_page_status_margin_end"
               android:layout_marginEnd="@dimen/find_in_page_status_margin_end"
               android:textColor="@color/tabs_tray_icon_grey"
               android:visibility="gone"/>
 
     <ImageButton android:id="@+id/find_prev"
                  style="@style/FindBar.ImageButton"
+                 android:layout_marginTop="@dimen/find_in_page_control_margin_top"
                  android:contentDescription="@string/find_prev"
-                 android:layout_marginTop="@dimen/find_in_page_control_margin_top"
                  android:src="@drawable/find_prev"/>
 
     <ImageButton android:id="@+id/find_next"
                  style="@style/FindBar.ImageButton"
+                 android:layout_marginTop="@dimen/find_in_page_control_margin_top"
                  android:contentDescription="@string/find_next"
-                 android:layout_marginTop="@dimen/find_in_page_control_margin_top"
                  android:src="@drawable/find_next"/>
 
     <ImageButton android:id="@+id/find_close"
                  style="@style/FindBar.ImageButton"
                  android:contentDescription="@string/find_close"
                  android:layout_marginTop="@dimen/find_in_page_control_margin_top"
                  android:src="@drawable/find_close"/>
 
--- a/mobile/android/app/src/main/res/values/attrs.xml
+++ b/mobile/android/app/src/main/res/values/attrs.xml
@@ -191,10 +191,14 @@
     </declare-styleable>
 
     <declare-styleable name="AnimatedProgressBar">
         <attr name="wrapShiftDrawable" format="boolean" />
         <attr name="shiftDuration" format="reference" />
         <attr name="shiftInterpolator" format="reference" />
     </declare-styleable>
 
+    <declare-styleable name="ToolbarRoundButton">
+        <attr name="showLWTBackground" format="boolean"/>
+    </declare-styleable>
+
 </resources>
 
--- a/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ForwardButton.java
+++ b/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ForwardButton.java
@@ -7,16 +7,17 @@ package org.mozilla.gecko.toolbar;
 import android.content.Context;
 import android.graphics.Path;
 import android.graphics.RectF;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.StateListDrawable;
 import android.util.AttributeSet;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.lwt.LightweightTheme;
 
 public class ForwardButton extends NavButton {
     public ForwardButton(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
 
     @Override
     protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
@@ -34,21 +35,31 @@ public class ForwardButton extends NavBu
     public void onLightweightThemeChanged() {
         final Drawable drawable = BrowserToolbar.getLightweightThemeDrawable(this, getTheme(), R.color.toolbar_grey);
 
         if (drawable == null) {
             return;
         }
 
         final StateListDrawable stateList = new StateListDrawable();
-        stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_private_pressed));
-        stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_pressed));
-        stateList.addState(PRIVATE_STATE_SET, getColorDrawable(android.R.color.transparent));
+
+        final LightweightTheme lightweightTheme = getTheme();
+        if (!lightweightTheme.isEnabled() || isPrivateMode()) {
+            stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_private_pressed));
+            stateList.addState(PRIVATE_STATE_SET, getColorDrawable(android.R.color.transparent));
+            stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_pressed));
+        } else {
+            if (lightweightTheme.isLightTheme()) {
+                stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_lwt_light_pressed));
+            } else {
+                stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.action_bar_item_bg_color_lwt_dark_pressed));
+            }
+        }
+
         stateList.addState(EMPTY_STATE_SET, drawable);
-
         setBackgroundDrawable(stateList);
     }
 
     @Override
     public void onLightweightThemeReset() {
         setBackgroundResource(R.drawable.url_bar_forward_button);
     }
 }
--- a/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -98,17 +98,17 @@ public class ToolbarDisplayLayout extend
 
     private final BrowserApp mActivity;
 
     private UIMode mUiMode;
 
     private boolean mIsAttached;
 
     private final ThemedTextView mTitle;
-    private final ThemedView mTitleBackground;
+    private final ThemedLinearLayout mThemeBackground;
     private final int mTitlePadding;
     private final HorizontalScrollView mTitleScroll;
     private final int mMinUrlScrollMargin;
     private ToolbarPrefs mPrefs;
     private OnTitleChangeListener mTitleChangeListener;
 
     private final ThemedImageButton mSiteSecurity;
     private final ThemedImageButton mStop;
@@ -145,17 +145,17 @@ public class ToolbarDisplayLayout extend
         super(context, attrs);
         setOrientation(HORIZONTAL);
 
         mActivity = (BrowserApp) context;
 
         LayoutInflater.from(context).inflate(R.layout.toolbar_display_layout, this);
 
         mTitle = (ThemedTextView) findViewById(R.id.url_bar_title);
-        mTitleBackground = (ThemedView) findViewById(R.id.url_bar_title_bg);
+        mThemeBackground = (ThemedLinearLayout) findViewById(R.id.url_bar_title_bg);
         mTitlePadding = mTitle.getPaddingRight();
         mTitleScroll = (HorizontalScrollView) findViewById(R.id.url_bar_title_scroll_view);
 
         final OnLayoutChangeListener resizeListener = new OnLayoutChangeListener() {
             @Override
             public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                 final int oldWidth = oldRight - oldLeft;
                 final int newWidth = right - left;
@@ -194,17 +194,17 @@ public class ToolbarDisplayLayout extend
 
     @Override
     public void setPrivateMode(boolean isPrivate) {
         super.setPrivateMode(isPrivate);
         mSiteSecurity.setPrivateMode(isPrivate);
         mStop.setPrivateMode(isPrivate);
         mPageActionLayout.setPrivateMode(isPrivate);
         mTitle.setPrivateMode(isPrivate);
-        mTitleBackground.setPrivateMode(isPrivate);
+        mThemeBackground.setPrivateMode(isPrivate);
     }
 
     @Override
     public void onAttachedToWindow() {
         super.onAttachedToWindow();
 
         mIsAttached = true;
 
@@ -272,17 +272,17 @@ public class ToolbarDisplayLayout extend
         }
 
         if (flags.contains(UpdateFlags.PROGRESS)) {
             updateProgress(tab);
         }
 
         if (flags.contains(UpdateFlags.PRIVATE_MODE)) {
             mTitle.setPrivateMode(tab.isPrivate());
-            mTitleBackground.setPrivateMode(tab.isPrivate());
+            mThemeBackground.setPrivateMode(tab.isPrivate());
         }
     }
 
     void setTitle(CharSequence title) {
         mTitle.setText(title);
 
         if (TextUtils.isEmpty(title)) {
             //  Reset TextDirection to Locale in order to reveal text hint in correct direction
--- a/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java
+++ b/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java
@@ -5,23 +5,26 @@
 package org.mozilla.gecko.toolbar;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Path;
 import android.graphics.RectF;
 import android.graphics.drawable.Drawable;
+import android.graphics.drawable.StateListDrawable;
 import android.support.v4.content.ContextCompat;
 import android.util.AttributeSet;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.lwt.LightweightTheme;
 
 class ToolbarRoundButton extends ShapedButton {
 
+    private boolean mShowLWTBackground;
     private Drawable mBackgroundDrawable;
 
     public ToolbarRoundButton(Context context) {
         this(context, null);
     }
 
     public ToolbarRoundButton(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
@@ -33,16 +36,20 @@ class ToolbarRoundButton extends ShapedB
         final TypedArray a = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.background });
         mBackgroundDrawable = a.getDrawable(0);
         if (mBackgroundDrawable == null) {
             // Use default value if no background specified.
             mBackgroundDrawable = ContextCompat.getDrawable(context, R.drawable.url_bar_action_button);
         }
         a.recycle();
 
+        final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ToolbarRoundButton);
+        mShowLWTBackground = ta.getBoolean(R.styleable.ToolbarRoundButton_showLWTBackground, false);
+        ta.recycle();
+
         setPrivateMode(false);
     }
 
     @Override
     protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
         super.onSizeChanged(width, height, oldWidth, oldHeight);
 
         mPath.reset();
@@ -53,16 +60,27 @@ class ToolbarRoundButton extends ShapedB
         final int hSpace = res.getDimensionPixelSize(R.dimen.browser_toolbar_image_button_h_spacing);
         final RectF rect = new RectF(hSpace, vSpace, width - hSpace, height - vSpace);
         final int radius = res.getDimensionPixelSize(R.dimen.browser_toolbar_menu_radius);
         mPath.addRoundRect(rect, radius, radius, Path.Direction.CW);
     }
 
     @Override
     public void onLightweightThemeChanged() {
-        setBackground(mBackgroundDrawable);
+        final LightweightTheme lightweightTheme = getTheme();
+        if (!lightweightTheme.isEnabled() || isPrivateMode()) {
+            setBackground(mBackgroundDrawable);
+        } else {
+            final StateListDrawable stateList = new StateListDrawable();
+            final int backgroundColorRes = lightweightTheme.isLightTheme()
+                                                ? R.color.action_bar_item_bg_color_lwt_light_pressed
+                                                : R.color.action_bar_item_bg_color_lwt_dark_pressed;
+            stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(backgroundColorRes));
+            stateList.addState(EMPTY_STATE_SET, getColorDrawable(android.R.color.transparent));
+            setBackgroundDrawable(stateList);
+        }
     }
 
     @Override
     public void onLightweightThemeReset() {
         setBackground(mBackgroundDrawable);
     }
 }
--- a/mobile/android/app/src/photon/res/color/url_bar_title_hint.xml
+++ b/mobile/android/app/src/photon/res/color/url_bar_title_hint.xml
@@ -4,12 +4,18 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <!-- private browsing mode -->
     <item android:color="@color/photon_text_placeholder_private" gecko:state_private="true" />
 
+    <!-- dark theme -->
+    <item android:color="@color/photon_text_placeholder_private" gecko:state_dark="true" />
+
+    <!-- light theme -->
+    <item android:color="@color/photon_text_placeholder_private" gecko:state_light="true" />
+
     <!-- normal mode -->
     <item android:color="@color/photon_text_placeholder" />
 
 </selector>
index ff4edaa5f092d800475dc0934eebce95d7daf570..a035d4b032fe95c7c7ab2da6531f19d34254db36
GIT binary patch
literal 207
zc%17D@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8LpG*1`D5D(tB2Nk)R0~n4!tQX)B
zn|(Ipo5;Mw#T@sN4;Sa$T~m5B!=&TnCu#0x!*5?~*_#jkwmbQG&-}$n2d_D)3aiEV
z7(MLip6tVsx$&ydsh%0qW_d?$xt%&OZ(_*r6EklbO+L-Xs;#Eo`X(?b=oGK%{3}K7
zhj+WV3lu!P+Ujsz;Ns^i!Y?g^*yPxRYTJAI`h4bn_kZ_~YhRe+Imcx{7czLd`njxg
HN@xNALfKO(
rename from mobile/android/app/src/main/res/drawable-hdpi/find_prev.png
rename to mobile/android/app/src/photon/res/drawable-hdpi/find_prev.png
index 4c40a1e8ab2d634a33715fcb192a7ee1b08b5e12..7c5b34cf191845d15d48269b9905604fa887361e
GIT binary patch
literal 215
zc%17D@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8LpJWm(L5Rc<;uPE|02Z*=?25^Y5
zbsl*X$@aQo?gnn2+YXBZmuNIKg)KU<HtUi}?FV@k-&uc*|D7t7IsHpr<;xe9aAQGX
z2H}fSeH@N^yBC-}zW8C?LF>tdD}RPOe&wusf66VN#w8b0jLZzTOq`h(6!vY+61AB#
zW-1$h3{*=waHO|D|MBIdRY#{gi%LzE*|plKTjrExr9_^}_WK!;`@ge@96JzG?!MwS
P(4`EXu6{1-oD!M<J}g#a
rename from mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default.9.png
index 1d8cc905590af62d40c64037549aa9b44e297410..2248013e6deb67302c86ac5e338b3fbdd5c7be01
GIT binary patch
literal 298
zc%17D@N?(olHy`uVBq!ia0vp^CLqkg0wnVbFDC%0kDe}$Ar*{oZ`gYs2@q-hn2?xl
zyr4RuK(}w|I)~{C=guxry;Z9q#;nxkt0N*4*wWLY`Dnh(PK#d$rkt#exbuFA$M@Cu
zb*(ZN{B4#fJkXMUrCQ#m;E>#D5&PeN6MagTN9DhYU+p&4D{#|K@mmYmnw0b>9kV*N
zVnf8zx~cBLg$IM0`rbXg+Iz$6!qu2K+s<U3P5sNJhHtfqcUUv$<ocaE&hW5`1UN7v
z5mUZrW){wUyz$NdKl17sx~ClvCtZK*ve|K>!s2cF`~BWaEpjuS`e<8q$);Y5ltbLF
q_WCcIv+2I=;?#&=6EBO^GQN5_HS6fv2r;1N89ZJ6T-G@yGywpdmV*2M
rename from mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default_pb.9.png
index 0bd6115fcf9b8d930d4e083d0e4cf93e32cc13ee..2c0e4e37baef54614c7817d0bc24b217e611504b
GIT binary patch
literal 408
zc%17D@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWW%aV2t;4aSW-r_4byn_u&AEqaPn#
zxaxZ0{elbUljfEb7IZ#%<bGl8YK0d{T@Tc*K8o<xRI(6pnRR4))>8du4$j{0BTqiY
zl<a6}C_TOQ`GNYAQ|{Nyzr!)v=V;<-?Q0^p9DKiYsW8_rvRkFZ{nY)a$i(uPbsoz<
zD;-W$h>Q?%eN?&cMxXZYc6Y8H9bEep#RBhaiaq%&>ua0S&x|nTj=q_02k-uEp0O!w
z?Ye;L8A`k%TJz_1X5PMaFL1?AlYrIN<t5m&Vq&x|%;TFRf5Ba%?O5Y2|MOfWOPjB>
zduHdx`owI%9sIxES-_D+&;<|S)_m-jXOM5>n|%-ak9h{XT$1!?^S^aWqL&?v9~V_D
zTs$ox$J%Y~u`{av$&*&F{;kmDxM$4R@i@ZfzWDLIQ=8vEUTUWG=jomtVbhD!lXyfH
mGFrK>)|mf$z3^hMH{2RhyKb4SRk;ETaRyIUKbLh*2~7a7ezS!D
rename from mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed.9.png
index 91be77476cccb7bfc8e36eb2dd638d672413a9b4..e90b70cbd84012bf8a1e0f3a889402c4fd8e5468
GIT binary patch
literal 403
zc%17D@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWW%aV2tu~aSW+oe0yu7ms6n3@sHll
z&feV<-UnRRoZ|hBW$P7V6;TiU00G{$rq_csgPd=ua;{z~#4>e@#v~@k_v_``JDO!S
ze4O*+?}OcQ-WuO|`ERj3&%C9s!mm9xnu={UYi9o%**tfHs@b_k50#E5x9xq}b)b~{
zMa`k^ufhv{GKyp!I5m;cZo|#M1v=j6<~{gZmfT#GetEydZ|TQ}MPARlE_i0!X|~YB
zWW9j8#VrrE6(j@{>jivW*ZW{wyx{^{=@$8b_1E1Cw9R>5Tw?pkIQgY6%g$Gu8Siqa
zOmJZ0#7zWTSWy4hdy?^j+rRyO*!SiJ)NO8gFwNFvK@azow7cC_O*hX?{r%yPo9?D1
z0o<=l(vDS1B`<vT_VLo|`V|`;nYQe5*vPg<PWsH_6OUC_i=5s#W3NHQg$C1`n$dE#
jabk6O0__W=ZkbPudi4EF+NsCDz-I7t^>bP0l+XkKoO7`i
rename from mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png
index 6b076e75eaf883c29ee0f5ae97b2b742537605a1..ff63d31854cabc3432813faf0b62c5e0630a2b7a
GIT binary patch
literal 395
zc%17D@N?(olHy`uVBq!ia0vp^CLqkg1|*MGNWW%aU<~qfaSW+oe0yuZms6t5v5(Hq
ztGfff2VB^i5ggkX=Q1JpE!)KhsXLY^Y)vUp@R^<EIYnUUfqx1z=Pw`jKGMA>;qmY8
z=Z)`+ww*6n_I>)F#EvyCtJO6&NqOIFQEW0YOVSNXoUIe7%UPqd`TA_-gh@>Eg<Uq<
zFyC`Ouz|Hii|@yYZ`T_6BL3BMzPN5*zQTOl=kAaH4eM?seZDAqW=(kc3hQlxOmpwa
z9lkS5wOy;#;cuk;vu_s)7PRpn;?J0<n~<j;%l_(@LY>3IMGTW?f0J2}E~PTTfr%3z
z@&A|Sq~Zk!a}vH^wD_|ozImtVX}%D?#%(uiYIu!z+jGmu{aE2VjX!#sUvioAazneU
z`}T3aW+`<&^?s1d!*knV`6~ne?EdL{y56)b%{e9D=xvsk8x~t1m$u)aqj_c6H(tNz
Wuji(CK062uWCl-HKbLh*2~7ZOVXCnJ
rename from mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png
index a2e973ea0c007f8f9cf81be030ca34554c1c408c..8c337456398a73769865a1e55f18ebc3d89db0e0
GIT binary patch
literal 289
zc%17D@N?(olHy`uVBq!ia0vp^HXzKw0wgDV75oXLUU<4VhD02Gd()chkb?xvgF6lZ
z2am6G3B0g6WAW5`*$yIa9xXn>xky6T(O|-#v}A)tFH_9LjEfukTi5>ExaNIF+rQL+
z<08^K1b9m~9+J4Kw2j-J`)3^gU;nZWiA~eHTNWuVoRhlzg~Z%9@=J4=!#k9BJ=VD8
zuH7#FYO7jNz!#hLT#p2nZ=yNRKgbG6HY&5;pSNKFQ)Ji5759B-7$hEQ;S^T$L1H|d
z|L~Gu7uUUMr7pT}bMBZ_Xz*XCJIHB!$(Fam^|FK4_nscb=0`u%r=77^*L@<G?Gx~O
f^<Hlt)6>i~pBI)n?O$FC^fQB}tDnm{r-UW|ZS8rD
rename from mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png
index 0e91b33abc716c653b4c42e053ffb9b05f8973f6..db5fb96bc2e1fb0fb5c4d62012647300cb0adc2a
GIT binary patch
literal 404
zc%17D@N?(olHy`uVBq!ia0vp^HXzKw1|+Ti+$>^XV2t*3aSW+oe0zJp*Wmz}qaXJ*
zE@1s{GgX6Ym&J~ff`aR=>boO_g4cE{{Ltfy&3d)}n)nK*m%JQ`7am9Isi@A-<NN+i
z<_F)+UyXg=!)F&4EV5iKD`WQRO;72~j)N23-b|dkAvJ8a?*GKwNy%)-r8m#j`XD#k
zXv-n9xVZZUhHUG4_KWU)E-~FP<zn!*%vzaG^^ZfR8Qi&Rf8guIgp0!4;@I+xST6F`
zMBaE8@x@irB29wF{^4mmHfQd>(+4!2r=@;K&72kW!C#K2PRG!sukYba9SJ6Goec+w
zCH|W=vc~OL-Y#}0e#`NtzHJ7t4or`Yz5nlLO~u*E?2p=V&ot>)?XO_^z&BZ?AoZBa
zi=(w$n#zuHItcE4dvW6NysH!2*Pc5UIlb1p<xi6Tn<;BU=70PVZaSkmUi3S6jOg1A
U(b|~@fuYUd>FVdQ&MBb@01qOung9R*
rename from mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png
index a55ad0b9c3d92c8690cea01d0b6d530c17ce434f..5705c2e646c312032370f684ccea915bec8ae566
GIT binary patch
literal 387
zc%17D@N?(olHy`uVBq!ia0vp^HXzKw1|+Ti+$>^XVD$2IaSW+oe0$s0i#br_=*N}0
zEW9qUQ#CpzO1bkKq>m~coVy}Zcgsb$Ko4<iSH-(30)Hd|C(8JjO181<x1QZ?$^P$b
z$WPIi_s%Yp5%Qd!RqVcEBlERnOJ}90Z~ESDWStgzno0ipjTwp`kF618&fmm&_?TwF
zSDq*G9%+Bp?x<jqQg55LA@uOH|Ihyfq`&9c{oJG0MB>*}-Sz{rZPz64<m}FVQO0p6
zeTVFUvw3W6@7fRC=ZW86u=&yP1M^c2>=WiKtm8>HHeeC^5wE`C028+kk%Y}@e}3LS
z2HE}I);!U%J8t?t`T1eeW%ft;IZK($N><k}75ruD;ZoV0$QWbCc=iORgXrFOFHS6$
zwEVOo>&=9(H#8KVOt`zbcAJFd<HAUpGY3Pb{$<ojyi=U~PNEPPxD1}IelF{r5}E+?
CQlTmU
rename from mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png
index ac6476de7067c51056291b5c476d7a1e40bc51bf..231d4f691f6543f5f345605c4468b0e54b47317c
GIT binary patch
literal 388
zc%17D@N?(olHy`uVBq!ia0vp^HXzKw1|+Ti+$>^XVD$EMaSW+oe0zJZo=c#}(T~4b
zRD2#iUN}R-nA87(Y{rTgq4$!{<em@_QMug9K11M9pNoLF;<V7WbA0?PdLO-s)cz@6
zuC?E3yZ=Osl)y(@4m0s?JI%Hx>BN$**bTX6$Gc88@n`qi8l}kbX8dQpmvEowxbK5s
zEGynmJo{sN(iP@i+HK2NeGj+&fBq-2aj(Ib?Gt`y7<>_q?rP+hsM6gLdDHAm9gj`Q
z4(s;Wcjrk~NHEtM)a*Tc)-Ikmraj?9^0bE;Z0FJvICM4~VB#i{_<x&4tm2j*KW~j`
z=<%gxc6<2DwXOHh=hwHg6{t@;t!Uwr-{#Md=hwL1a8qO~<6@x~>(p!*IWFkB_uE)$
zu8)$C%IW95;p}$8aCeGzj@?(u{_Bqt_}0z3!7pX>>K`}9(F?%PW$<+Mb6Mw<&;$Sl
CUYy(j
rename from mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png
index 2c8c0d80f8cc15e929fc8bd1549a256fa290f747..53fdb8e8fe38193a943bb5e4dc59bedafb0b9569
GIT binary patch
literal 437
zc%17D@N?(olHy`uVBq!ia0vp^V9db+By&~01sE6@Ydl>XLn;{G-nP#Y4P<cpSgD}2
z?!YAuv2A9WO^ni|jG8e`z21e4jM~xD7xWfzaHu)<Jd<D4dBdesaBj!UC$dw`3rv3;
z$XoYe?)sUx|L*vDCoPL_Lw&!X_zsf`X%^naRrPY`3)x>394OT(oc{Upgw1>0jx4v6
z&hgoHc<X*e@gHs3?<~ts9IGqvebRB;_F|e)_|LxRYnQfp9G77|*&%voTL@?ITw~Ts
z?)lNt`YvKzMS}Muqu;yAi9PYoS-aMG;@YM=$Isoe63gWNw7_kNlHUY2%cTm<JVqyo
zC7#tg)*V@FRlnkQ%!JiHj^4_0jT3!hTa%spw#!E2gk{XP8?&T#YZWba|JQYVN2YIX
zmyY2tS<A!fG3%e0`QH(+e8A=F_^&7OTft4)+l(ud`R|sxrp&LLB^UWfsei*H+lQZC
zrn9DAk4$M^-~7<8;&5%ASfFFrzE6p*uYWTZ$hu|sYHs!dMhAnZtDnm{r-UW|%+0xT
rename from mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png
index 670104ed3671c4f6d2c0113db1cbf4f2a21cc80b..6b191c904a6922d491f1718fef5d633d40161e29
GIT binary patch
literal 641
zc%17D@N?(olHy`uVBq!ia0vp^V9db=B#-Mf&t_m?^6+$V45?szdv|a4<UonGk76!I
z_8+*&#kWpRwyUZ87kf!Taly+=juXV1zH+;+*`nd$?G?1f>St#tcaSVgXNZfsy+Bss
z3Qnc1w^V9PIs3nVa**<~3Ej2#I`4H6qbKh7Ccj<s*gj1&^KtnPkND-cmX$48qqjA(
z^vJK<-O(ZQtJY<m3X1X-4cUL|*ZK)}v*Ko6uP-^!$1CR_y>`X?tMk4(eOncpdRTe-
znh#0mUVYuQwDi{-v+tj##>(t{Gh_eNg=xlTqs||?`)c~8J5Q!;+&X(t)!v_l?>QZR
z@t?|0t=!wV_28Uc4`;l;x=i4SV`}=jSO@J*pARqYyD8mtMr(GRMRQ0>fBJl@Cu;?s
zM5lIl$4}^56QO1K<ha0-Nt=px_JpK(PO?Z*W!brAP0&iI?sJN3B`-Cw2ze+-PH<r2
zRAC0P8bRE~6cBd;5@7_D01|8<v6BrjE<|sN6+2uNSiwrhoeL-2pYk^*(ou6$*49@Y
z_D&P>r<|>ia?mo0<$XEfz0(BcQ+fCHb%&&Um$xZ8k*#<_F12~)<Y_9Mt;eN$+j!?%
zy`J#<_T689Ty9pF<v-l`v2%~ISV+3{3B9keH>YmojQ*OhwmE8TTJp^~%6h9~-@a2U
zKa=-0^rpkJmb*L6bFE@zO-uU=H%45VX^}j0;pM&^OTMw`m+&X#g>OEU;d}ndxfk&~
zEVq_#deyA8TwvWou@FC54(X!`nn5f<#!>FNznPz&`gb7UVYn?YX)$=Z`njxgN@xNA
DZC4(2
rename from mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png
index 26dc0221b55c08b09631ef9a7cd9a5ab783ca72c..cc6a77f3a9f7c060776b128fc8e850ba5c8f9ef0
GIT binary patch
literal 600
zc%17D@N?(olHy`uVBq!ia0vp^V9db=B#-Mf&t_m?lJ|6R45?szd)GEwBvGREA#aCA
zU1O?JM8?7et}P2Pl36x-D@J5I7yrksEqKK#$0;FDK*aUKYJ)H>4NgYEEdrZ2DI_I6
zUiX^KT<vCx?K~&>6CWN)tKPlC{w`}5_q>@!TK^5FF4-FYzw+zO-n`(GQYEirRj=Qd
z%PUa7GbOr6E7Lpg*4)Cs|G6xm*jfC|e9*O}bWM$Dfc?(9t6ODCKl`!gdzRnxx;xKn
zcb@+)b7k3GvNK}KZ?w)_{%ChWdvuA_KabXp!NS_-YAqNg<)>WtQ&*oNclqV<#>nE=
zK@-^Le2WWD%XyNP(6>xswcqq*QzWIUB`1^zPk28ki#PSyt9a&3^O|xjx7KMGUwg^+
zB!+9#+bi?J>&|opI&gU?G_p)$<W!m9U<70dd4LHvAeV^~iC~6GC^V*k#du&`sNQKs
za8(cm_ii~c-7LvEr)g}qTcBgJ<_UAZ^>*6EVc9HCe7HVsx_mSJR8Q;-o)glVClZ&x
zeH^r0d)mBd^<KNzu|4_6l#*aqYV|EZ$M!bMqb;wCJx@4(Kl}1T?aSYb>iTtcyxrwl
zl5Xb~PGw0+;M=M1cl+4V;`2+RlmooWk9}QMQW$hAlK058+mE$8PcS`esD9+4UG>l`
zz20y_#{AX0zOM^*+A;6<i*-9Ew)pc+GJ2|Ldr?d4jkwYNP%Zsa|8#&UhQZU-&t;uc
GLK6T%wD;`*
rename from mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png
index 224738af610d9815626c527d551384114d27a5f2..6c407ff8e1c81e08bcc6648a50eb7c2e327419f3
GIT binary patch
literal 596
zc%17D@N?(olHy`uVBq!ia0vp^V9db=B#-Mf&t_m?lJ<0Q45?szd)Gc&Bv7LDBWFiP
zyn}amhk{v>u%ZT+&|ijV7wf=-$8McEc7sdIjBz7Jw}$2suSfG66uLJpFk9WJl%)PD
zB|PS4%A~IqTze-xTxagJtCG*=YKeVC`l*xul2>`m-v4^0+a15{yOXZo37fw3*X_f(
z@Ag!`3Y)8SYgP6x?!4doo%(iu_p9Hv(|Oj)(Dg#E+{-f-Pbj@!zN_3PD#xSQY3kht
z6YkyJc+};9&YhGGMe|O*Kg67O^ySCQsmGq3UuXUOBS*@Q1$zo+*(;mze2zI#^LX14
z1%HdPaw6Vu-c4+X?059D-ny<s_1mkchB>{C+va}S7LhdfD8o-Pww+I|oIfh0UB&px
zooCbQEq4UH&vz_j&{Sw-5%OSDnc%>5vH{2fa}^|kTuv1vf(I(m$TEo$BxVHTBI!Nh
z#fMN(HJh9BN%-=A;;P5Ob}@d8=J~Yr^77|iJx|{<{Ip`Lyt=Y7uyf<Jrwo?D%`)X#
zZzgulyD{N!%;dcH{1b##Pc-~Ik@;@PjS03Eq5`w?QY2E&md<&1ed(j!H{P$+^)8;w
zxbgM3T{=vX2FLHDFF&^8%bQ74wlilvJ-1`C!q#O=qJJ|znq>WElTiv!@$~8!TlA_P
zxe4!==qS75yPNg;YK1!oY75Noe4G);WF)JqV4JI;^;Ue-o6N(U!S9%XsfEGQ)z4*}
HQ$iB}M`H<W
rename from mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png
index 1099a2d807609e82837b7bf94d2ae0ce3620cb4d..f17d41656023b7c3c0afe94bec40999f9fd78921
GIT binary patch
literal 553
zc%17D@N?(olHy`uVBq!ia0vp^WgyJK0wlMuTR)3|f$@W<i(^Oy<J-F%vqTa_j($}1
z)W6NKud%iBM%1xGZr>!gZ2Bnsg>lQJW9%PTlU7E^ipDrj4(c$JJ|b|X^sbJYRh5h0
z<eM85{jAIXJvRxiIosc=dtO)Sh;C-HK<p)1+pB$bCv;!wzkRjy-ODbqkTcsa)clq@
zq5Ho2?v+dbH>7`!@Vm5qSAkTStNi1K-1${cod1{2{&d{_@7>#Vp@qv|oezk;a&eQ}
z$Bg4kZ_nM^6}_sSDa^LEgIziO#F6!@<I7X!erv2qPCr?9^zMaAhHLcLzpge;O>)hb
zJ$$VG!?ew*`Wu{e<q}K%mg>k`#IqgT8<m`Y;?pkUG>IGRrr#Fo)E6D|VX|Ja@qEh9
z*~ZIw-t0KG?)0a9#cmf{xppg_4t{>-^nrOl+f5@jBphsF<rdQ+o^jiPu*w^Yv~T$N
z3YKN0Y+C$z;q}Y>hwr_=_axsXd*$&t+qYI6^7%e}iSgaLG70@FmalzKcg}3>{yR?>
za|+JAzWZje1iP+HyJ21tpYo!4*Pf`<7XMl}`GqNO6#w0vqC?AGx!%1d%xjt}`Y~Yl
oq<2|c4;C(ZGxu-FCAp{idqh0Vxy|BM0FwZNr>mdKI;Vst09XtG$p8QV
rename from mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png
index 3aba71baea3c0bb9089d01ce9af62d1587120284..fdbf42b2b2fd6bda99110e197333f5593f16ad0c
GIT binary patch
literal 859
zc%17D@N?(olHy`uVBq!ia0vp^WgyJK3?#KGrz<lsFnR^}gt!8^@yQuO5xsu>rl_o{
zxvgvC=51TH?bv_t@V)yFzW?}f?fT7c-@YF`e)7@dCyyUL$;c^8NXaZJt-5^W+TDBi
z&tJS$Qc-i}?D@@Gx8J;Vd(o2RSFT=v`}W<>pFe;9{(bBAopl>F=NFehdi41J|Nnpf
z{=IPV^2d)KSFT=n{N$<IckZs=xVfOD0%-f&ckfa%a)F_@c-hKdzkXf4cAaN~O9YT_
zR}$nG%wX8C=kfR7FOK#)Gcov`zL(A-w)ujN-qWwT@BausSbE7S=Ml4{d*YOt`#xUe
zPnf*v;eCx;=Y8(#*YEy$q{qqe3S%EIewsX8978H@y}j)o?BpoYaxtBcgN?<}FtKk&
zv7bc1nVW$=x-0(IYy0hOV!Bp5KkV!FS$A)q*|a`1;FQBP`86wcEZM^2rnP>>npI_2
zQ#KjtZ)a~?y>|8abm=_;D=tny{cARZiv523eN!gN39rw8&%l&-_GZ1#4W5ML=$X0V
z4&BzL+oBq8Of-u7!@}{yI43&FHk`?J$=z>Nv)?j&SmM%kyuokwSEln`E5sG<EWP<o
zEWy=tE7zBdZQ>EZNo$#FXT4=NdwN6nz~Y;X3GRKpOwF@onZ8YlF+A|~^fu<-O>Y<t
z=4=W|IXOwydzwz<CW4GN_UXFn5$x>kpFVr3A77$;>GI7$_O?Uq8`=+rxs-|7UYjc0
zD9_z@VD8*K(F+S1mOC;3Pq=4!I5OnZ97l6QPKC<C%F<l7J)U>&-F+^X|H4U-!{n*9
z#hIDk4ip%(wp;GHx$|cMgIm;!h?uBz*3Og8rv*1f?*GdWeOx5TW}U-dV7xMTy85}S
Ib4q9e0Bz@+!T<mO
rename from mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png
index 779f2721f5446c210f21cfa760d3c1dc1dedd8c9..e15b097500df73c9fc9295b7d1a54baac0eb06c7
GIT binary patch
literal 875
zc%17D@N?(olHy`uVBq!ia0vp^WgyJK3?#KGrz<lsFnR^}gt!8^TrK~H9D+ETyX8Mm
z>wlq+{}SE*l_&mJnfPCQ(tnM~|Fx(5cbxyfaL51Ro&T%%{%=0`zvbZnj>G@EkN)pD
z`hV`Z|I07`UwP&K#vA{)-TJ@%_WwP1|L?o^fB*ge2Os=D`sn|$$N!H%{(t)E|Fh5j
zUwZNX^2`5MUjBdZ;s4{0|DSyP|MJWKPe1;D{`vpwum9hF|Nr^t|L?#5f#9cz?oFVx
zY)gXtf*F{YS@;FTBsFw&_4Ey`oSfZ#{1Ot=bLty<dM8hrxpdR!-Fx;OIePm1g^QPN
z-Mx4J!NW(7pT2ni@$2`WzyItw6{`=7p2?mrjv*QM-rjZ(W^xo^dBEzzdS-^QTS$*a
z7Z>ldImL%~mi_!6-p;y|Wxa8C=-uOcYrbxKb|Y8fXQx(2V9Uy!mvd(|Pts{&yOotw
zzc9{TBz?`riT%^coSoZZ_J^L|@@L16(x0F7raUpO+`U_=bA$Qk9OG5hZgo}_qFKc%
z6Fbb0Td6nv*cmYI$gVxtKOZh*+?c&k@%trSi%mIGZT|UWcq;Lkq(=Vi*xtHKhS_oV
z$!V?)>alAgn6rGhG2Xbatjl)6;S}pe=h`>256o}cJ@AsB&6MU_CQ)(WIM>f<xtV4R
zHd!gt8z!yTGhHWgQ_9Ins@~HGGXCCQlPH=U`0&D_s->=}m#Xewy;;WHb!hc{*Tloi
zw~N_ko}YTa|Lcm*h;=M^flu!i^qsEuH@P!Q@5k=X&v<@o9?kkU=b*tU_e+m^&vrjI
zH+|&(DJ^|x!XCx{oBfZ6q+SR$II}X??u?|a%(ErI7w-u3tQLIk{CDluZAvqvT}_X%
b>}NPKZJ$LW|KeO=JTrK@`njxgN@xNAaaGR`
rename from mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png
index e15f58ab260f22e86e06e932e48ddbb595e191c2..19111e578542372dbaa4f1d6c54b491434126431
GIT binary patch
literal 875
zc%17D@N?(olHy`uVBq!ia0vp^WgyJK3?#KGrz<lsFnR^}gt!8^QyBgaIRte!<Nv8l
z|EF{OpT+-wzSRHu(*GCA{a+~mf05GvHJ1MmX8%8w`~O(k|C4q9PuBlG-TePd+yAre
z|F6vae`E3gTg(36UHAX~=Kl}2{C~9b|D)aiAMg49WZ(a1hyOo2^8fkK|1VDde|h@<
z>kI$iT>Ss$(*IBQ|9^h;|MTPjUtj$H`SJg+&;Nga{r~6t|35$f|NZ?R2v{d2%>z2i
zwj{_en1P9zg<nuiQbR{qPv6kW$=Th<FCj5Kr@o=5ck+~(OE+!ay=UK%qo>bbxOnN-
z-Fx>RJbd){>5KOtzkdJu`_GP3vHHO1ne6G}7?N@C?QQp9CPxvL2dplvXJ#n7h4g52
zaq&KzQ+$YL+0Xys?W{{#)*E++-aWpz=Igd+H*zI@c4~D5wyex~Id@j`B%KzvTUj~v
z3*+oX($`#^*gvhz*|{xdf9Uxwe|GFB{rO36$`j+t-Mf`KH<*9UF<w>eR%cZqnpLba
zvBUhhm3qUEodNTX?Amkv^WieajoAwozhC0D*pxHX=ATc7rxKq@YUIz3?XAmXm>qYY
zoaWk~9=j%jIm>q&<Bbc;x@;F5PO)xuu6-l>!2G7&126g6OliJl5)~JYbN!r_n`y>i
zla(^PVbY2{({&;@rJS6k>OGAh<L~`7iK5wo4=*gLTI!m5sp{_4n`PWxhgRQrO+37O
zyO?d}`Kbr|zpm(vSjUnV`1Ec;-|1?9lRLBYe(e7IjOVxJ(X4-S4jP<tzx25GZ1;0>
z(?{-~($aS(>{0x`+5dP*>V;5)Gb@Ab&PeLYJX;cc@s2RhYQg8uf7f2!rZh9!)$|z4
aeug8{_E|LYFU|$VGlQqApUXO@geCyb`_OOz
index 6e2485edb919948f4fa4277bd918a0f4572ffae4..5f35a5c8270e90edb2c479c1302722629d3dd097
GIT binary patch
literal 254
zc$@+L00IArP)<h;3K|Lk000e1NJLTq001xm001xu1ONa4{R=S+0002RNkl<ZSPAXH
zAqoOP7>3~w7Rv^k$!fH367d=aui**y2%f+b*!KVygCHmf7Msapu<R=aK}4O|nK20e
z^GL=RW6T>2*br*NKrZZvv6Tx4VjSecgcuXKQ4*?@ALfLZ%NH#wnyP5YA8pn&v8JtN
z=yJr@k*=Df&lw+Q`U=B{D=t??3dfk5Z)(Ph!<28PipPvkW=esK1@A1#lm<CVUM<O$
z4juM9+tX26^f>WwqNnsIxNvu&&~Gqg#fqVfG3L+Q0G+B10aqyw;Q#;t07*qoM6N<$
Ef~VJJuK)l5
rename from mobile/android/app/src/main/res/drawable-xhdpi/find_prev.png
rename to mobile/android/app/src/photon/res/drawable-xhdpi/find_prev.png
index 9e3c8f2da284ee16e8e66da2ebc6c427c82d021d..be8e389b5d0604aaf0950b24bdef64ee241b0dd9
GIT binary patch
literal 260
zc$@(Q0sH=mP)<h;3K|Lk000e1NJLTq001xm001xu1ONa4{R=S+0002XNkl<ZSi|kj
zAr69I9ENcm!C)Z~jZ~-{fR6XTlW+n~zyUY_WRnIWiCG+pU~prP$;~<S`}jT#ZvWrg
zpVx7O5aQ2}($kavDxYuz;70O`e8|YdNVs%<%b90qwoB$cT3)qyOXb%zywk8=BEO>K
zlaiJFLC!b1Z9YRKv&rw6lm`<#(|pVo9amzLe87ONfnaXlr(=!|e@=eGfw>NBbn`A1
zCMsOLg91~9PJWM#z51ZHI_T90C#!>_`XHj_Vz`>f5kd$d-nau*?h+fVKMc_T0000<
KMNUMnLSTZ||8PA3
rename from mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default.9.png
index e0cf4cf9090a4747ca072afaa6360ee475dda3a1..d8a9daf774baea9d69fddc0f8ad2db11dda12112
GIT binary patch
literal 369
zc%17D@N?(olHy`uVBq!ia0vp^E+EXo0wgC%MO!j3Fj{!JIEGX(zP-88i`h}6^&w-Y
ztHKk(Bc~1>^Afo4s~xx@u)32YNps)fey<G|^k(UXTnI}xk?z>-eu!gp$J=un_x_t~
z|MTm0osa4J^GAese>o9&w)*)jU9p11hdCD)ItZF4&OTP|F<Z}RW}8+>xxCbh_lD|c
z3{p@0v~UVPCAvAhwDpF9L&QRt<fC~CF6UwzN&=RN+~wFPrr@s;-Zih4fq!A=xhcyw
z3VfGSy7eL^a~8+PB!Om$BMNMW9gaLO=864ns6u^gs+#id{12yooAGU`m;(C?Kh0gD
zNwyAQ7h6A>yuW7n`6~OD!awX^F4!+HFAVjV?A>D2tF-5d_g+om%X5X|KG{Xd1TE^&
zzL6;Q{P~K!nYF)qvebQEY&@={cjlwF7@z8`@cB>tr@d6(d))&VlnkD(elF{r5}E)F
C#hJ4J
rename from mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default_pb.9.png
index ca9e114b69e5b098e30fae53b5162d5c32afc4fe..c500c2da6dcca5f2b8f92c4e8b6c54ca45da429a
GIT binary patch
literal 545
zc%17D@N?(olHy`uVBq!ia0vp^E+EXo1|%(nCvRe4V0_`};uunK>+PNM+J_5eju$Sq
zT(iaA(T`8h&+DHAyJkvc(40RUfqE8#n@tz0e6qJV>H2eH{0)(9?=`01+?P{b{r1DU
zrTv~e-~6uK`?~VR^0FI?_uZd+Z~ij-9+Q$e_4D@qJE*s%Ytf2^B?nJ0=HAj`6);)z
za-ufZLL;H}Z=KU7J~tPTx4Nv~ro4NS*V3cg?3Y|z9--r9GjU2n#d5J{5~i=;A3yQ^
zc#8PRGj|rHY?@|KI%#{kk(Jp(4Q@99nJ){tCQZK{Uiix;xsX+Jftj!ehi65){~e>(
zvu}49r7~4I{aUdjNpJl+(I+8}B8R(E5>DvnN$rsmQHkXavi+baDZ{ygOJ#n2_yqGN
zfffZ8MGi*}CjoMq7A!2y{Bn1<uMW}5i&3aDSUba3>10%1l;Q5c3Bkf15+@HnoS5xk
zw#|vlD3|G_tI->I;nSxq<&?$zHQWTZ{@-$9Pk%~To#&c4#ewgFGdX+wwN51MJ)5U*
z<-W*z&-s}>H@4mVz_B#QGw5aet6%$^LabMAf3;3yt;VANR(xxF!UDQ~8nG1L)#wm<
vaaYmY$>pNdt2O1ZY^&Lu1jE1P?qhh$UM2nPTGw=7)H8Ux`njxgN@xNAmUP~L
rename from mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed.9.png
index 8cbbff19024e62c3d3a015a06062374ca2b7a271..11ff445ce7a6dbde7c6db7a2e8480309774fa81e
GIT binary patch
literal 512
zc%17D@N?(olHy`uVBq!ia0vp^E+EXo1|%(nCvRe4U_9>W;uunK>+Ky|Z>K_;qlJoD
z0*4kVW^^iLWMpzJda>6f*m-Z$ilrVK9B-fIShTUFVD(aVjYaLgRR()(eIuQ+H11uF
z{5AR0d$$XZ_C7yQzN7q4L*9PrUxzPT$^5_PgAH3`Q)<M_g(tN)d5fj~)k!)1ZPQ%U
z$lim?LnC{({$mqLROjId&V2AkQX}-@m+JKl?%xkQ@sm9xmTf4}``@%?=Rt#AOn06<
zye(_bu(z;zQv&P5?!;$C7OX$&ep@mJrQJ1~pmMlGs`2KJZH_ayHrg0|4(2>mwwdk8
z0=^dh#I`;SCe!5!4n_AJ543YQr}H%4ioV&fhtoxYNwC9#MM<EMgG}ZTbp;vusF|k&
zikT}Np4{*|BPW^nnd8j2H|l9@DZPnl;*B?5PBoml>EI@@Yg)q_?VA10#}jHc%$v_Q
z(_HdcSfjQ4;yJdAwVceGUX<RHO<T?rZ@wp7-(h3ZviPNJF*eM>naqsSK3SBSYrM^w
zyOYOm?XgE|&i*rGsdmn3jom!Se;>!h#M3zkUKdNA;%;$Xkaa^{HKVVvPEF<xFlHG%
MUHx3vIVCg!04Yw-$^ZZW
rename from mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png
index f34244e4cbe90021eef886e94ec161ebc7bccf10..52001c53c9e597d124b62e914bf767135b66250f
GIT binary patch
literal 513
zc%17D@N?(olHy`uVBq!ia0vp^E+EXo1|%(nCvRe4U_9aJ;uunK>+PMr-cE@!M++6X
zgnXnHE6$RNl5*<!Hzgx$#s39smuY0I%;;FuqtGO^D0HFtq^1oE&Te30RgEz@DL&=(
zOC7r@Hj<9r-{&#kKbZc9CvX4j--j<;%>2K{SN_-yEAI_l&h6nz{W-0@2J>}qCpWat
zJpAC&tDLE&|Jj66%6WLiH#@wOTQU9O$JMnAHzf+}KJz}CQYzVV?Z1?roRLgFbE`_s
z?(NYD`3Dy0L^}R3I4H$)R3v8qnW>B`Hz-Pb%y?MDH!m{f)B>Fw4x4ydRctnw9BDW*
zOTm}N{&1MS&DNw-4NLYlePDEKduvybb#)J;CWngxlVFDfi;_Sixy&P~3NrO2o7tQX
ze|*9ic&jXFTB3%{VPkK1UXL?uo6Z*)^PktT%5@OSRhZ0U{rA9c?wI{=wjNxu>EV37
znf(%ePA-+L+0(n3A38E`y7O++?emX#&Pw0=BOIW=@bU9293L6xy_e?Lu-R<+J2uq=
zd=bqDms;lZe!XGemY{#6EOOG+*iWt<EVmODzqOmb@K$5NhY;Q0EQ|f-8~)6c2gWG_
NgQu&X%Q~loCIFzS(K`SD
index dfb8e5d4785dfa30a8b00234034b0ed69b1a659d..b6cc53ac18e3fde85593d949a5b2c05ecb60828d
GIT binary patch
literal 336
zc$@)H0k8gvP)<h;3K|Lk000e1NJLTq002k;002k`1ONa4|Kxkj0003ONkl<ZXa()T
zKaN3B7>D7XNE8|>6{VJ1EqV)>Q7d#Ri9&4!5(}^Z3(%;vv^p{pg-|GNBJWg_Ol1Bz
z?m71=zUPsQF~%5Uj4{T%C`KFz;lN1l=o3<3t~e0Vhg@+Yq?24RC8VibQD99dYYK8l
znH?eQDC;@YIOE%ynx03K2%jRFiidZ6dQ*H1@MR!BnBc=izK~^3TywJWhde9dSdo`s
zl-TmDEhYI!l_SqMQdJl<xZ>(cL*dZohKn0*g+&h+J%z`ZM~#&PGR%0yjEs^&js^c&
zkW+Ffvf(cqib@t0_WWi~MaiSig`ZrgD;>0mxEIk<dgySkqjWLkyP?v@gfA1l2D&U+
i(v>mB7-Nhv!F>XX5y(&bMDqIp0000<MNUMnLSTY(NQ|`r
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6e11aec12322c847c02eaef0ade97fcc8e486b7b
GIT binary patch
literal 353
zc$@)Y0iOPeP)<h;3K|Lk000e1NJLTq002k;002k`1ONa4|Kxkj0003fNkl<ZXx{DC
zp^8Fb5QbqzFj!0$!DiKL7Q0;$%-(@`1?LL%26l^0yIHeUSVT=0MGzG9-L$YQ?ymni
z|D0p^p1FZH48x>SA|fIpBF4xPuwzF+_7!q6O!+b;lYG#K??y@I4ESk~WKM@iI!Wa;
zxIPTJ(nunw%8}n3sm7gCV#{B)l;X_Ev*bTZ@^R&4nemKSEQgXb?>y^`w0%&3i@-Xk
zhpV1tPLrE+(2b^5PK`5RoT*vll-U#3p0e+p0xP0eQSh0QV?k64a=vmhOz>gi>3w5}
zFGC+WeSGRi&1rM@8g!=}C8y2>-!9a{=2SRf;Xox!PLT~(HWb~1##kD=2c1lVPVPZ#
z)1b9`P|Gx^6=tow%=s{wIo*_qh=_=Yh`gvz*ig`9vVX|p00000NkvXXu0mjfu0x=a
rename from mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default.9.png
rename to mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default.9.png
index e7b58136c759cdbc82fd90662e1c4fe51b5d9964..21b47a63f9fc4e75948e4d890e868880d7a2540b
GIT binary patch
literal 552
zc%17D@N?(olHy`uVBq!ia0vp^DIm<j0wiy}j=j&o!1&(N#WAFU@$DVM?BGBd)(`Cq
zcI&-!^V*tyysp2l@s;@nN7jjbe15+)cTMeE+Ppl#(QA_9L93F9RyQv^5saI3PkFli
zlmAmp7?=N^UVN@>($nMB`FplU35s2*=Y99kF>!Cd^$M}_i#uBRe>53JB&7f7`hFvd
z_a@5$23E7_j`NaV)!RLMe(2Xq-<gkY`c5cc@O6&q`p6_9cboDvw=J9hW!i6*ua?>P
zrRRq78vlPy3Cz44^9;TANiI2fZ2p91n{r9b*u^qi6e@V0@i{xTwS1lEeDBFa>%~vc
zD6E$)n$qrQabl@spUfv?{>cRsjwy)q&3vZV+N{#-BXj6ZgCPg6lOv0uivZb#rdkt+
zQisCT|12|G>;i6DJW=BJ{iD3j;>_Vxixc|IGFDGQ<$gU>ux;K`aKd?sO>ApYjO1e}
z*=C7U{r=@^4jW|6lS<(amA>RC`}*rE>BVlx72R%byT1B#;>Qlf-N!s`oa1S>c&eK5
zw)jBXN{2%|%++F_&+p+aJjHix!S^K_<b>}TmQ9Oo+R|35vf+c;o8;WDTSH#oIO_iA
zz#4}`499OA{q-t)<*mJ~yIa4SX}u2eINC7xx%utbq}9hS%=iIJ0Sun5elF{r5}E*e
C?Cs0|
rename from mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png
index b5b5a8d3281380959a70d7ca50dabf7972ccd25d..665bcd8c816639c575a934e586ef4f27db044f34
GIT binary patch
literal 783
zc%17D@N?(olHy`uVBq!ia0vp^DIm<j1|$m}O$}jSV7lh%;uuoF`1bC3?~p{1_K%7y
zYIAR;cRan8`rrNZBA-(RFQ&IhrbdP7MO{_XSsbRgg=6|7rQgg#r97vu80I{m+uCLP
zy~;}b9XGo*&*H~(qipzV#4oMx{=Bd-bK$`wve|jh_2TT7SqB!s+3~Jp-G=E`e}CwC
zw=^$q`%>Ys>q)VJ-<5VJ9#)XumC09~F#B5R8}TLK;a}?tzHgmf^xCh!cjLU*d-c4^
zF5j+Zt<0-G@$;Par^G*tr+BRnS{c&vO50N?^5X2J+b>JMYm>ZLTkg9j{zmLKX?eRU
zt<&17nL1wiE4JV1Ejr1(QR3~cw;y;HC%=D^usD2ivRF#=^*HVnB^x=3Dy5$;Rngr>
ziH<tQGUvAF>gsyiO}uxlX^HjIMxGY-{CoSR*DStXmCRgppLr%1|FdrHN%<z$;ae1f
z<xaf+upmaydtac)RNWJ^*n@caAE`{NS!~g#>v5EM;)Z7~-=2xNFfg_tAr=7#4mg_d
zhZ(1wfCC<lXp)&p4FU=Xl+o~~Ut#Kp{z4h<r_o!Zwo2TVI}ueO;F`Ly{{QlD^~23G
zZ(1&_`E6yK?Wkru;opaZj0zWx`)u;|n-yy1PI%t+tN8Nw_@V&2m$|xbi?TN=h^5-t
zyxDE8u=LWZ3kRp&3(3!RJXXpot}^-7gT>nWzbq3=cE0|oNn*<8Z;M|ae6T_1UyM+e
z&fdf-@9vG0@9qlVR#|Z8YG<rgbj%O6*RLn4{9*jF>(-q+KKW_?!~cBkzQg`8(5f`r
z>f^P$#fy*KXkEAZ-QAMto4MTg&WOK@DxH7GJ;FKJ`lfDlY3tvnmaQ+@O6QmEFEM0a
zmp$>FciHZ31?P`B{E@vRyVkPo#?IUS9859~&A2STM&J8`82>^&U_xi`boFyt=akR{
E0JVfuU;qFB
rename from mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed.9.png
rename to mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed.9.png
index 7c2ac33cb5e1656ab0a277657ea722bb0c1430df..f37dee7dabb9ebd25bf4ae35a7ac8928a4f63d32
GIT binary patch
literal 748
zc%17D@N?(olHy`uVBq!ia0vp^DIm<j1|$m}O$}jSVA|~I;uuoF`1Y=C_T)gBwvP%g
z64)=gUT|GACClAfOz^kjAEq#Y*wPQIf=6AKc60G%**mD4HhV;0+{K}kbn)nR$J;5v
z*`1Yp_a2ma;mNO<`>BQRI_vkK{?q^4{oRXWmmP`Nf4k0i_nyDG$IGg3@3~WT?d4&^
z_v^kN)UJG$vF2Irmv<G(dl@9ZKC{d@Z}z@7Pvps*@UK^P?cKg);_bJ`zWFW-oMmpi
zJ8pufe<Jg}rIDEnHKwk5Ww6S0$@ioGw@XKG7cc($&TnP>4RzaA*;<Xg+AB_<F#n=^
zeSwdPgHn&+dYONRR;s@$H2J8(q*<-}*5T8`j}zHXseQ^-o>C)p#NOhG=9{;ZjJj%W
zU-Q3yP~^na4-b6eB;A*P7CiA(<U~xxhd-;0`qK8hC=_c>aH<ISv$$vRp(2(|Q<zq^
zv0vR~)Ti~8W630@zzF+A94@OJSvV9B$m1KMQv(AWF(J!wC?Ls@B<XRVsfB?Nj*jH|
z2{>py<kv1um6@6?=w`{fNkmR$n(OQb`{U+v^3SUcJ9hE1zu*ZUt|v(q26jt(7AFS_
zp7<$pf^of|+}?lda+L0y9a>S{yjFoR)yl@E#y?7<t7=aEtJ`i0m*ey}FHMO$`R=mo
z<B!X;j!OG9xM&;?uitg-op-+2)zl}_zorSgEv|eWBc<ZD^FiiUoz>#^mmIwxv{v!e
zg82HUvycAQimIQu-0_lz`kqP4uY9|c@^;(fs$Y3=D=TluWOd5BNq>@S_m_B`)%#4h
zea{^?$3ty<SKsq~-yZ(>fb84l-&a-cepqmRoukn0M{iSdx0f=P`!-vAP1Lz)FFB>5
Vpz^R|9xxR%c)I$ztaD0e0s!4>L6`sl
rename from mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png
rename to mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png
index 5eb9cecb4191b33d7fbe4d81a37f017886b152d9..b986bdd0b77f2bfc7682326547b54fd9aaf56e17
GIT binary patch
literal 742
zc%17D@N?(olHy`uVBq!ia0vp^DIm<j1|$m}O$}jSU|Q?x;uuoF`1bC8@2QD0Z6CKE
zD2u&gdZcJ-$E*JtIU0ZYyH+SH+PH9OOjlc5+ZN591z&g~Sp+9Kul+kI`RRiT4-4w<
z-M#R;;rz>o1z*0}TEvLoasKk;!`}y%$&m+-2uYWf8}(KS*B(E%S2=FmY~EiVdbU5P
z{q$<y4TtRN`FnT&<mGNYQ<W`Kc7NNmv+qQoOuFv%_rdSvONTq_lKGEa*7)hG|4!^l
z*%xO%&wM@a=+{BJ^`tiB-8TRI<9*q_MEx^s@9nl;x^KgC+g9CqQ|jsi4xTXoqWj-@
zrgwvjgmIkmpXRHd7uCLdx|3tc!?RzQBl-Hp{X0&b+};~7t=f_4SfPL7{(IeCr?!9X
zT`cR}c!z^u>+_;X(Q~^U)-89?dU)`=XyD1(YQe^kAcffv9dm<2ineC41o<{@In?au
z9a1zmjpdS0qef3#Aj_h;3QQ~l$jE^~5rIze<CbG!#G?^aG9`o2seu8G9`UJhD4hK;
zeeSXqPj2;cES|`;vW<P~suv7@uCLa9c<}o3MU#Gi(qW49Y>eUNpEpNr>YYm~Ii7fN
zJy~&`x8Ll37bqYMtnQ`gdpJaL@ynm}h<?4O_MG|GT;&O>`rb`Xg0^0=+jYXc*C6X&
z3X_VH<?hdmUw>Tl<@4MX3Hui2OD2|lj!w^<An|n7^0}MW)P*dumk!##mT}RsZ8e*J
zY+v-f+lF_N+s+49ZI_niZ@GWtkjJmQINSZX)1tn#A6d3%`9tL%(J1r%Pp3?OE2@%n
zYxm2&pUn1{vCC!LzW4f1+2x1xS{;R~-}HWymG-=oo3G%P!{Pl!Jn;LX%^zmyrvlS2
NgQu&X%Q~loCICciN38$=
index 88e11dc9846367d4f257feebb4256dfb59b9bae3..5be7c9be01715a451c2df446f94e6bc257abdfdf
GIT binary patch
literal 434
zc%17D@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7z*y<&;uuoF`1YW^_TNB;;~&rW
z?mBYFNwYj<@9H;YH=lBzVBS&5@`+)|6yLOzDS>7i4JRHcnjT$JJ$uTJzkjTsSD*WN
z?fKV9XOMth;;h(ro^R*HE)(t3%scsXnr3TK`<yb7F7~3T0F7Nwu7qmzop|Z7Fyph2
z-uW$}eW^u}VKOBr7A~&1p|n-^=n)3?B_#(M9woIH2U#Y&d^9|0su^RvFw5Yua%gpm
z+ttKAxzJaJ%d<9m%wP2-GURK-Qmxfq&Ah8NEDXum;GR=$GKJ6Auj6IQvP(%l-bp)C
zd|qCB)F<&SLzDkj3Fp<NYilANv<m3!Xy}J=Y+Upw;`#b(p={fJcIQrQa^(BD)|oAo
z&&~3=`8mnZ$Qe)C=I=@jdYU**z3x$G<kZf}s+#4;_nbN^RJ-p|x@T%~@A@?>YjQr>
z&tAnW_2#qwZ<7#yp2Ab^%S}S%dy0=%hxe?G%P2fJn>%WieA~-{GlsHlscBFkc2(Q&
XEaQW%ty}*A<ATA{)z4*}Q$iB}LSV|g
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..42b7ff3c44d2048a027966008d170ef52e29c808
GIT binary patch
literal 464
zc%17D@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7z&PF0#WAGf*4yj0eoT%GZHZGH
z7P;hZxWwm`+q<?zEXF~9f%=UCh9t+_7rmWpH->s8X=o^vMI`3@@yyt!ptvVY?O1$4
zT6)^#_cyus#2Z^rKG^{S5l7X;Z9bh~ot=5+{?n=D`frx$?muHJZyW3v{LkupP1*UX
zs87>hewfR5I`hQ&qND!nPPExCIGI0d;q&W1ymg=aab8x>H={@*tFF~>vqUhbVf}2u
z%~Bg>?`?h9SZTvjx;LTM?(?h7VqSIg#QtAYl6U&Y^!(3tOYVQ{a}pjMDgS4<tgq%-
z_)H1@83A9X?sx9tHMF+-<ZY99T3Ge^Pgk}ZCJSB|)pthc>`pxy`cG-P%EL*n=FEPc
zr&f0V=}>X?d@g_HLyDo{Q-za%_DaszQ9JfVb?Sc8<CBjb=~%1s$z0;msR_Kdf3E&g
zu=4n-vwvjFca-^_yVqb`W3hQ^{PF3#djHhc+%lKH@XcyLuARa+D+M!ogD+MI8FmXE
zmO30hroZO3?*7wVy~QgWT)M4~$9H!)xw#;~lWy~)p4|WCZxpTu#uS66tDnm{r-UW|
DPH)ux
--- a/mobile/android/app/src/photon/res/drawable/menu_item_button.xml
+++ b/mobile/android/app/src/photon/res/drawable/menu_item_button.xml
@@ -31,16 +31,72 @@
             <shape>
                 <solid android:color="@color/action_bar_item_bg_color_private_pressed"/>
                 <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
             </shape>
         </inset>
     </item>
 
     <item android:state_enabled="true"
+          android:state_pressed="true"
+          gecko:state_dark="true">
+        <inset android:insetBottom="@dimen/browser_toolbar_image_button_v_spacing"
+               android:insetLeft="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetRight="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetTop="@dimen/browser_toolbar_image_button_v_spacing">
+            <shape>
+                <solid android:color="@color/action_bar_item_bg_color_lwt_dark_pressed"/>
+                <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
+            </shape>
+        </inset>
+    </item>
+
+    <item android:state_focused="true"
+          android:state_pressed="false"
+          gecko:state_dark="true">
+        <inset android:insetBottom="@dimen/browser_toolbar_image_button_v_spacing"
+               android:insetLeft="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetRight="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetTop="@dimen/browser_toolbar_image_button_v_spacing">
+            <shape>
+                <solid android:color="@color/action_bar_item_bg_color_lwt_dark_pressed"/>
+                <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
+            </shape>
+        </inset>
+    </item>
+
+    <item android:state_enabled="true"
+          android:state_pressed="true"
+          gecko:state_light="true">
+        <inset android:insetBottom="@dimen/browser_toolbar_image_button_v_spacing"
+               android:insetLeft="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetRight="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetTop="@dimen/browser_toolbar_image_button_v_spacing">
+            <shape>
+                <solid android:color="@color/action_bar_item_bg_color_lwt_light_pressed"/>
+                <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
+            </shape>
+        </inset>
+    </item>
+
+    <item android:state_focused="true"
+          android:state_pressed="false"
+          gecko:state_light="true">
+        <inset android:insetBottom="@dimen/browser_toolbar_image_button_v_spacing"
+               android:insetLeft="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetRight="@dimen/browser_toolbar_image_button_h_spacing"
+               android:insetTop="@dimen/browser_toolbar_image_button_v_spacing">
+            <shape>
+                <solid android:color="@color/action_bar_item_bg_color_lwt_light_pressed"/>
+                <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
+            </shape>
+        </inset>
+    </item>
+
+    <item android:state_enabled="true"
           android:state_pressed="true">
         <inset android:insetBottom="@dimen/browser_toolbar_image_button_v_spacing"
                android:insetLeft="@dimen/browser_toolbar_image_button_h_spacing"
                android:insetRight="@dimen/browser_toolbar_image_button_h_spacing"
                android:insetTop="@dimen/browser_toolbar_image_button_v_spacing">
             <shape>
                 <solid android:color="@color/action_bar_item_bg_color_pressed"/>
                 <corners android:radius="@dimen/browser_toolbar_menu_radius"/>
--- a/mobile/android/app/src/photon/res/drawable/tab_strip_item_bg.xml
+++ b/mobile/android/app/src/photon/res/drawable/tab_strip_item_bg.xml
@@ -15,19 +15,16 @@
     <item android:drawable="@color/photon_tab_strip_item_private_checked"
           android:state_checked="true"
           gecko:state_private="true"/>
 
     <item android:drawable="@color/photon_tab_strip_item_private_pressed"
           android:state_pressed="true"
           gecko:state_private="true"/>
 
-    <item android:drawable="@color/photon_tab_strip_item_private"
-          gecko:state_private="true"/>
-
     <!-- dark theme-->
     <item android:drawable="@color/photon_tab_strip_item_lwt_checked_pressed"
           android:state_checked="true"
           android:state_pressed="true"
           gecko:state_dark="true"/>
 
     <item android:drawable="@color/photon_tab_strip_item_lwt_checked"
           android:state_checked="true"
@@ -63,11 +60,11 @@
           android:state_pressed="true"/>
 
     <item android:drawable="@color/photon_tab_strip_item_checked"
           android:state_checked="true"/>
 
     <item android:drawable="@color/photon_tab_strip_item_pressed"
           android:state_pressed="true"/>
 
-    <item android:drawable="@color/photon_tab_strip_item"/>
+    <item android:drawable="@android:color/transparent"/>
 
 </selector>
--- a/mobile/android/app/src/photon/res/drawable/url_bar_title_bg.xml
+++ b/mobile/android/app/src/photon/res/drawable/url_bar_title_bg.xml
@@ -7,19 +7,27 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <!-- private browsing mode -->
     <item android:drawable="@android:color/transparent"
           gecko:state_private="true"/>
 
     <!-- dark theme -->
-    <item android:drawable="@color/photon_url_bar_bg"
-          gecko:state_dark="true"/>
+    <item gecko:state_dark="true">
+        <shape android:shape="rectangle">
+            <corners android:radius="2dp"/>
+            <solid android:color="@color/photon_url_bar_bg"/>
+        </shape>
+    </item>
 
     <!-- light theme -->
-    <item android:drawable="@color/photon_url_bar_bg"
-          gecko:state_light="true"/>
+    <item gecko:state_light="true">
+        <shape android:shape="rectangle">
+            <corners android:radius="2dp"/>
+            <solid android:color="@color/photon_url_bar_bg"/>
+        </shape>
+    </item>
 
     <!-- normal mode -->
     <item android:drawable="@android:color/transparent"/>
 
 </selector>
--- a/mobile/android/app/src/photon/res/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/app/src/photon/res/layout-large-v11/browser_toolbar.xml
@@ -64,17 +64,18 @@
         android:layout_height="match_parent"
         android:gravity="center_vertical"
         android:orientation="horizontal"/>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/tabs"
         style="@style/UrlBar.Tabs"
         android:layout_alignWithParentIfMissing="true"
-        android:background="@drawable/url_bar_action_button"/>
+        android:background="@drawable/url_bar_action_button"
+        gecko:showLWTBackground="true"/>
 
     <!-- In a 56x60dp space, centering 24dp image will leave 16x18dp. -->
     <org.mozilla.gecko.toolbar.TabCounter
         android:id="@+id/tabs_counter"
         style="@style/UrlBar.TabCounter"
         android:layout_alignBottom="@id/tabs"
         android:layout_alignTop="@id/tabs"
         android:gravity="center"/>
@@ -91,17 +92,18 @@
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/menu"
         style="@style/UrlBar.Menu"
         android:layout_alignWithParentIfMissing="true"
         android:background="@drawable/url_bar_action_button"
         android:contentDescription="@string/menu"
         android:scaleType="center"
-        android:src="@drawable/ic_overflow"/>
+        android:src="@drawable/ic_overflow"
+        gecko:showLWTBackground="true"/>
 
     <!-- We draw after the menu items so when they are hidden, the cancel button,
          which is thus drawn on top, may be pressed. -->
     <org.mozilla.gecko.widget.themed.ThemedImageView
         android:id="@+id/edit_cancel"
         style="@style/UrlBar.EditCancel"
         android:contentDescription="@string/edit_mode_cancel"
         android:src="@drawable/close_edit_mode_selector"
--- a/mobile/android/app/src/photon/res/layout/browser_toolbar.xml
+++ b/mobile/android/app/src/photon/res/layout/browser_toolbar.xml
@@ -39,23 +39,25 @@
         android:src="@android:color/transparent"
         android:visibility="invisible"/>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/menu"
         style="@style/UrlBar.Menu"
         android:background="@drawable/url_bar_action_button"
         android:contentDescription="@string/menu"
-        android:src="@drawable/ic_overflow"/>
+        android:src="@drawable/ic_overflow"
+        gecko:showLWTBackground="true"/>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/tabs"
         style="@style/UrlBar.Tabs"
         android:layout_alignWithParentIfMissing="true"
-        android:background="@drawable/url_bar_action_button"/>
+        android:background="@drawable/url_bar_action_button"
+        gecko:showLWTBackground="true"/>
 
     <org.mozilla.gecko.toolbar.TabCounter
         android:id="@+id/tabs_counter"
         style="@style/UrlBar.TabCounter"
         android:layout_height="24dip"
         android:layout_centerVertical="true"
         android:clipChildren="false"
         android:clipToPadding="false"
@@ -65,17 +67,18 @@
     <!-- Note that the edit components are invisible so that the views
          depending on their location can properly layout. -->
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/edit_cancel"
         style="@style/UrlBar.EditCancel"
         android:background="@drawable/url_bar_action_button"
         android:contentDescription="@string/edit_mode_cancel"
         android:src="@drawable/ic_cancel"
-        android:visibility="invisible"/>
+        android:visibility="invisible"
+        gecko:showLWTBackground="true"/>
 
     <!-- The space to the left of the cancel button would be larger than the right because
          the url bar drawable contains some whitespace, so we compensate by removing
          some padding from the right (value determined through experimentation). -->
     <org.mozilla.gecko.toolbar.ToolbarEditLayout
         android:id="@+id/edit_layout"
         style="@style/UrlBar.EditLayout"
         android:visibility="invisible"/>
--- a/mobile/android/app/src/photon/res/layout/toolbar_display_layout.xml
+++ b/mobile/android/app/src/photon/res/layout/toolbar_display_layout.xml
@@ -12,36 +12,32 @@
        tools:layout_width="match_parent"
        tools:parentTag="LinearLayout">
 
     <!-- The site security icon is misaligned with the page title so
          we add a bottom margin to align their bottoms.
          Site security icon must have exact position and size as search icon in
          edit layout -->
 
-    <org.mozilla.gecko.widget.themed.ThemedImageButton
-        android:id="@+id/site_security"
-        style="@style/UrlBar.SiteIdentity"
+    <org.mozilla.gecko.widget.themed.ThemedLinearLayout
+        android:id="@+id/url_bar_title_bg"
+        style="@style/UrlBar.ThemeBackground"
+        android:layout_width="0dp"
+        android:layout_height="@dimen/browser_toolbar_url_height"
+        android:layout_weight="1"
         android:layout_gravity="center_vertical"
-        android:background="@drawable/url_bar_title_bg"
-        android:contentDescription="@string/site_security"
-        android:src="@drawable/security_mode_icon"
-        tools:src="@drawable/ic_lock"/>
+        android:background="@drawable/url_bar_title_bg">
 
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_weight="1.0">
-
-        <org.mozilla.gecko.widget.themed.ThemedView
-            android:id="@+id/url_bar_title_bg"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/browser_toolbar_url_height"
+        <org.mozilla.gecko.widget.themed.ThemedImageButton
+            android:id="@+id/site_security"
+            style="@style/UrlBar.SiteIdentity"
             android:layout_gravity="center_vertical"
-            android:background="@drawable/url_bar_title_bg"/>
+            android:contentDescription="@string/site_security"
+            android:src="@drawable/security_mode_icon"
+            tools:src="@drawable/ic_lock"/>
 
         <!-- We need this on a separate layer to avoid fading out the toolbar background as well
      and we can't use a hardware layer because that causes problems with the snapshot
      for our toolbar animation.-->
         <org.mozilla.gecko.widget.FadedHorizontalScrollView
             android:id="@+id/url_bar_title_scroll_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
@@ -54,28 +50,29 @@
             <org.mozilla.gecko.widget.themed.ThemedTextView
                 android:id="@+id/url_bar_title"
                 style="@style/UrlBar.Title"
                 android:layout_width="wrap_content"
                 android:layout_gravity="center_vertical"/>
 
         </org.mozilla.gecko.widget.FadedHorizontalScrollView>
 
-    </FrameLayout>
+    </org.mozilla.gecko.widget.themed.ThemedLinearLayout>
 
     <org.mozilla.gecko.toolbar.PageActionLayout
         android:id="@+id/page_action_layout"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:orientation="horizontal"
         android:visibility="gone"
         tools:visibility="visible"/>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/stop"
         style="@style/UrlBar.ImageButton"
         android:background="@drawable/url_bar_action_button"
         android:contentDescription="@string/stop"
         android:src="@drawable/ic_cancel"
         android:visibility="gone"
-        tools:visibility="visible"/>
+        tools:visibility="visible"
+        gecko:showLWTBackground="true"/>
 
 </merge>
--- a/mobile/android/app/src/photon/res/layout/toolbar_edit_layout.xml
+++ b/mobile/android/app/src/photon/res/layout/toolbar_edit_layout.xml
@@ -8,45 +8,55 @@
        xmlns:gecko="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        tools:background="@android:color/holo_green_light"
        tools:layout_height="@dimen/browser_toolbar_height"
        tools:layout_width="match_parent"
        tools:orientation="horizontal"
        tools:parentTag="LinearLayout">
 
-    <!-- Search icon must have exact position and size as site security in
-         display layout -->
-    <org.mozilla.gecko.widget.themed.ThemedImageButton
-        android:id="@+id/search_icon"
-        style="@style/UrlBar.SiteIdentity"
+    <org.mozilla.gecko.widget.themed.ThemedLinearLayout
+        android:id="@+id/url_bar_title_bg"
+        style="@style/UrlBar.ThemeBackground"
+        android:layout_width="0dp"
+        android:layout_height="@dimen/browser_toolbar_url_height"
+        android:layout_weight="1"
         android:layout_gravity="center_vertical"
-        android:background="@drawable/url_bar_title_bg"
-        android:scaleType="center"
-        android:src="@drawable/ic_search_icon"
-        android:visibility="gone"
-        tools:visibility="visible"/>
+        android:background="@drawable/url_bar_title_bg">
 
-    <org.mozilla.gecko.toolbar.ToolbarEditText
-        android:id="@+id/url_edit_text"
-        style="@style/UrlBar.EditLayout.Title"
-        android:layout_width="match_parent"
-        android:layout_gravity="center_vertical"
-        android:layout_weight="1.0"
-        android:background="@drawable/url_bar_title_bg"
-        android:contentDescription="@string/url_bar_default_text"
-        android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen"
-        android:inputType="textUri"
-        android:selectAllOnFocus="true"/>
+        <!-- Search icon must have exact position and size as site security in
+             display layout -->
+        <org.mozilla.gecko.widget.themed.ThemedImageButton
+            android:id="@+id/search_icon"
+            style="@style/UrlBar.SiteIdentity"
+            android:layout_gravity="center_vertical"
+            android:scaleType="center"
+            android:src="@drawable/ic_search_icon"
+            android:visibility="gone"
+            tools:visibility="visible"/>
+
+        <org.mozilla.gecko.toolbar.ToolbarEditText
+            android:id="@+id/url_edit_text"
+            style="@style/UrlBar.EditLayout.Title"
+            android:layout_width="match_parent"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="1.0"
+            android:contentDescription="@string/url_bar_default_text"
+            android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen"
+            android:inputType="textUri"
+            android:selectAllOnFocus="true"/>
+    </org.mozilla.gecko.widget.themed.ThemedLinearLayout>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/qrcode"
         style="@style/UrlBar.QRCode"
         android:background="@drawable/url_bar_action_button"
-        android:src="@drawable/ic_qrcode"/>
+        android:src="@drawable/ic_qrcode"
+        gecko:showLWTBackground="true"/>
 
     <org.mozilla.gecko.toolbar.ToolbarRoundButton
         android:id="@+id/mic"
         style="@style/UrlBar.ImageButton"
         android:background="@drawable/url_bar_action_button"
-        android:src="@drawable/ic_mic"/>
+        android:src="@drawable/ic_mic"
+        gecko:showLWTBackground="true"/>
 
 </merge>
--- a/mobile/android/app/src/photon/res/values-large-v17/styles.xml
+++ b/mobile/android/app/src/photon/res/values-large-v17/styles.xml
@@ -76,20 +76,26 @@
     </style>
 
     <style name="UrlBar.EditCancel" parent="UrlBar.V17.EditCancel" />
 
     <style name="UrlBar.V17.EditCancel" parent="UrlBar.Base.EditCancel">
         <item name="android:layout_alignParentEnd">true</item>
     </style>
 
+    <style name="UrlBar.ThemeBackground" parent="UrlBar.V17.ThemeBackground"/>
+
+    <style name="UrlBar.V17.ThemeBackground" parent="UrlBar.Base">
+        <item name="android:layout_marginStart">8dp</item>
+    </style>
+
     <style name="UrlBar.SiteIdentity" parent="UrlBar.V17.SiteIdentity" />
 
     <style name="UrlBar.V17.SiteIdentity" parent="UrlBar.Base.SiteIdentity">
-        <item name="android:layout_marginStart">8dp</item>
+        <item name="android:paddingStart">3dp</item>
         <item name="android:paddingEnd">@dimen/browser_toolbar_site_security_margin_end</item>
     </style>
 
     <style name="TabsTray.AddTab" parent="TabsTray.V17.AddTab"/>
     <style name="TabsTray.V17.AddTab" parent="TabsTray.Base.AddTab"/>
 
     <style name="TabsTray.Menu" parent="TabsTray.V17.Menu"/>
     <style name="TabsTray.V17.Menu" parent="TabsTray.Base.Menu">
--- a/mobile/android/app/src/photon/res/values-large/dimens.xml
+++ b/mobile/android/app/src/photon/res/values-large/dimens.xml
@@ -12,23 +12,25 @@
     <dimen name="browser_toolbar_button_padding">16dp</dimen>
     <dimen name="browser_toolbar_icon_width">@dimen/browser_toolbar_height</dimen>
     <dimen name="browser_toolbar_menu_radius">4dp</dimen>
     <dimen name="browser_toolbar_favicon_size">16dp</dimen>
 
     <dimen name="browser_toolbar_image_button_width">48dp</dimen>
     <!-- ToolbarImageButton's pressed-highlight region is different from clickable region.
          Our design is to make pressed-highlight region to be square. this vertical spacing value
-         helps drawable xml to set padding: (56 - 48) / 2 -->
-    <dimen name="browser_toolbar_image_button_v_spacing">4dp</dimen>
-    <dimen name="browser_toolbar_image_button_h_spacing">4dp</dimen>
+         helps drawable xml to set padding: (56 - 36) / 2 -->
+    <dimen name="browser_toolbar_image_button_v_spacing">10dp</dimen>
+    <dimen name="browser_toolbar_image_button_h_spacing">10dp</dimen>
 
     <dimen name="browser_toolbar_site_security_width">34dp</dimen>
     <dimen name="browser_toolbar_site_security_margin_end">6dp</dimen>
 
+    <dimen name="browser_toolbar_url_height">36dp</dimen>
+
     <dimen name="firstrun_background_height">300dp</dimen>
 
     <dimen name="tabs_panel_indicator_width">96dp</dimen>
     <dimen name="tabs_panel_button_width">60dp</dimen>
     <dimen name="panel_grid_view_column_width">200dp</dimen>
 
     <dimen name="overlay_prompt_container_width">360dp</dimen>
 
--- a/mobile/android/app/src/photon/res/values-large/styles.xml
+++ b/mobile/android/app/src/photon/res/values-large/styles.xml
@@ -195,20 +195,26 @@
     <style name="UrlBar.EditCancel" parent="UrlBar.V15.EditCancel" />
 
     <style name="UrlBar.Base.EditCancel" parent="UrlBar.ImageButton" />
 
     <style name="UrlBar.V15.EditCancel" parent="UrlBar.Base.EditCancel">
         <item name="android:layout_alignParentRight">true</item>
     </style>
 
+    <style name="UrlBar.ThemeBackground" parent="UrlBar.V15.ThemeBackground"/>
+
+    <style name="UrlBar.V15.ThemeBackground" parent="UrlBar.Base">
+        <item name="android:layout_marginLeft">8dp</item>
+    </style>
+
     <style name="UrlBar.SiteIdentity" parent="UrlBar.V15.SiteIdentity" />
 
     <style name="UrlBar.V15.SiteIdentity" parent="UrlBar.Base.SiteIdentity">
-        <item name="android:layout_marginLeft">8dp</item>
+        <item name="android:paddingLeft">3dp</item>
         <item name="android:paddingRight">@dimen/browser_toolbar_site_security_margin_end</item>
     </style>
 
     <style name="TabsTray.AddTab" parent="TabsTray.V15.AddTab"/>
     <style name="TabsTray.V15.AddTab" parent="TabsTray.Base.AddTab"/>
 
     <style name="TabsTray.Menu" parent="TabsTray.V15.Menu"/>
     <style name="TabsTray.V15.Menu" parent="TabsTray.Base.Menu">
--- a/mobile/android/app/src/photon/res/values-v17/styles.xml
+++ b/mobile/android/app/src/photon/res/values-v17/styles.xml
@@ -1,15 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <style name="UrlBar.ThemeBackground" parent="UrlBar.V17.ThemeBackground"/>
+
+    <style name="UrlBar.V17.ThemeBackground" parent="UrlBar.Base">
+        <item name="android:layout_marginStart">5dp</item>
+    </style>
 
     <style name="UrlBar.SiteIdentity" parent="UrlBar.V17.SiteIdentity" />
 
     <style name="UrlBar.V17.SiteIdentity" parent="UrlBar.Base.SiteIdentity">
-        <item name="android:layout_marginStart">5dp</item>
         <item name="android:paddingEnd">@dimen/browser_toolbar_site_security_margin_end</item>
     </style>
 
     <style name="UrlBar.Entry" parent="UrlBar.V17.Entry" />
 
     <style name="UrlBar.V17.Entry" parent="UrlBar.Base.Entry">
         <item name="android:layout_marginStart">5dp</item>
         <item name="android:layout_toStartOf">@+id/tabs</item>
--- a/mobile/android/app/src/photon/res/values/colors.xml
+++ b/mobile/android/app/src/photon/res/values/colors.xml
@@ -64,27 +64,25 @@
     <color name="photon_search_item_text_private">@color/photon_text_main_private</color>
 
     <color name="photon_url_bar_blocked">#D70022</color>
     <color name="photon_url_bar_blocked_private">#D70022</color>
     <color name="photon_url_bar_certificate_owner">#05A700</color>
     <color name="photon_url_bar_certificate_owner_private">#16DA00</color>
     <color name="photon_url_bar_domain">@color/photon_text_main</color>
     <color name="photon_url_bar_domain_private">@color/photon_text_main_private</color>
-    <color name="photon_url_bar_bg">#80FFFFFF</color>
+    <color name="photon_url_bar_bg">#B3FFFFFF</color>
 
     <!-- Tab strip color on tablet -->
     <color name="photon_tab_strip_bg">#272727</color>
 
     <!-- Tab strip item color on tablet -->
-    <color name="photon_tab_strip_item">#272727</color>
     <color name="photon_tab_strip_item_checked">#F9F9FA</color>
     <color name="photon_tab_strip_item_checked_pressed">#E4E4E5</color> <!-- #F9F9FA + #272727@10% Alpha -->
     <color name="photon_tab_strip_item_pressed">#3D3C3D</color> <!-- #272727 + #FFFFFF@10% Alpha -->
-    <color name="photon_tab_strip_item_private">#272727</color>
     <color name="photon_tab_strip_item_private_checked">#38383D</color>
     <color name="photon_tab_strip_item_private_checked_pressed">#4C4B51</color> <!-- #38383D + #FFFFFF@10% Alpha -->
     <color name="photon_tab_strip_item_private_pressed">#3D3C3D</color> <!-- #272727 + #FFFFFF@10% Alpha -->
 
     <color name="photon_tab_strip_item_lwt_checked">#CCF9F9FA</color> <!-- 80% -->
     <color name="photon_tab_strip_item_lwt_checked_pressed">#99FFFFFF</color> <!-- 60% -->
     <color name="photon_tab_strip_item_lwt">#66E4E4E4</color> <!-- 40% -->
     <color name="photon_tab_strip_item_lwt_pressed">#33FFFFFF</color> <!-- 20% -->
@@ -115,16 +113,18 @@
     <color name="nav_button_bg_color_private">#2A2A2A</color>
     <color name="nav_button_bg_color_private_disabled">#0DFFFFFF</color>
     <color name="nav_button_bg_color_private_focused">#1AFFFFFF</color>
     <color name="nav_button_bg_color_private_pressed">#33FFFFFF</color>
     <color name="nav_button_border_color">#E4E4E4</color>
     <color name="nav_button_border_color_private">#272727</color>
 
     <color name="action_bar_item_bg_color_pressed">#33272727</color>
+    <color name="action_bar_item_bg_color_lwt_dark_pressed">#B3FFFFFF</color>
+    <color name="action_bar_item_bg_color_lwt_light_pressed">#80B2B