Merge m-c to inbound, a=merge
authorWes Kocher <wkocher@mozilla.com>
Tue, 08 Aug 2017 15:16:00 -0700
changeset 373559 7a8936f1a4f42133145336d19d768f01c54ea477
parent 373558 46c587c3e5de4f816c33f87c43f4cda92038805a (current diff)
parent 373429 1d042bcb2632ea6a38fa08dbe21a6e8a0ee46961 (diff)
child 373560 babbce26f79b577209f11e953e1332baff93dea3
push id32304
push usercbook@mozilla.com
push dateWed, 09 Aug 2017 09:37:21 +0000
treeherdermozilla-central@4c5fbf493763 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to inbound, a=merge MozReview-Commit-ID: 9Abf0fILvvK
browser/themes/linux/customizableui/background-noise-toolbar.png
browser/themes/linux/customizableui/customizeMode-gridTexture.png
browser/themes/linux/customizableui/customizeMode-separatorHorizontal.png
browser/themes/linux/customizableui/customizeMode-separatorVertical.png
browser/themes/osx/Toolbar-background-noise.png
browser/themes/osx/customizableui/background-noise-toolbar.png
browser/themes/osx/customizableui/customizeMode-gridTexture.png
browser/themes/osx/customizableui/customizeMode-separatorHorizontal.png
browser/themes/osx/customizableui/customizeMode-separatorVertical.png
browser/themes/shared/customizableui/customize-illustration-rtl.png
browser/themes/shared/customizableui/customize-illustration-rtl@2x.png
browser/themes/shared/customizableui/customize-illustration.png
browser/themes/shared/customizableui/customize-illustration@2x.png
browser/themes/shared/customizableui/customizeTip.inc.css
browser/themes/shared/customizableui/info-icon-customizeTip.png
browser/themes/shared/customizableui/info-icon-customizeTip@2x.png
browser/themes/shared/customizableui/panelarrow-customizeTip.png
browser/themes/shared/customizableui/panelarrow-customizeTip@2x.png
browser/themes/shared/icons/back-large.svg
browser/themes/shared/icons/bookmarksMenu.svg
browser/themes/shared/icons/download.svg
browser/themes/shared/identity-block/identity-icon-hover.svg
browser/themes/shared/identity-block/identity-icon-notice-hover.svg
browser/themes/shared/menuPanel.svg
browser/themes/windows/customizableui/background-noise-toolbar.png
browser/themes/windows/customizableui/customizeMode-gridTexture.png
browser/themes/windows/customizableui/customizeMode-separatorHorizontal.png
browser/themes/windows/customizableui/customizeMode-separatorVertical.png
devtools/server/actors/utils/webconsole-listeners.js
devtools/server/actors/utils/webconsole-utils.js
devtools/server/actors/utils/webconsole-worker-listeners.js
toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js
toolkit/modules/AppConstants.jsm
--- a/accessible/tests/browser/.eslintrc.js
+++ b/accessible/tests/browser/.eslintrc.js
@@ -99,17 +99,16 @@ module.exports = {
     "no-iterator": "off",
     "no-label-var": "off",
     "no-lone-blocks": "off",
     "no-loop-func": "off",
     "no-negated-in-lhs": "off",
     "no-new": "off",
     "no-new-func": "off",
     "no-new-object": "off",
-    "no-new-wrappers": "off",
     "no-obj-calls": "off",
     "no-octal-escape": "off",
     "no-undef-init": "error",
     "object-curly-spacing": "off",
     "no-unused-expressions": "off",
     "no-void": "off",
     "no-wrap-func": "off",
     "operator-assignment": "off",
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -243,21 +243,17 @@ pref("general.autoScroll", true);
 
 pref("browser.stopReloadAnimation.enabled", true);
 
 // UI density of the browser chrome. This mostly affects toolbarbutton
 // and urlbar spacing. The possible values are 0=normal, 1=compact, 2=touch.
 pref("browser.uidensity", 0);
 // Whether Firefox will automatically override the uidensity to "touch"
 // while the user is in a touch environment (such as Windows tablet mode).
-#ifdef MOZ_PHOTON_THEME
 pref("browser.touchmode.auto", true);
-#else
-pref("browser.touchmode.auto", false);
-#endif
 
 // At startup, check if we're the default browser and prompt user if not.
 pref("browser.shell.checkDefaultBrowser", true);
 pref("browser.shell.shortcutFavicons",true);
 pref("browser.shell.mostRecentDateSetAsDefault", "");
 pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true);
 pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", false);
 pref("browser.shell.defaultBrowserCheckCount", 0);
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -42,19 +42,16 @@ var BrowserPageActions = {
     delete this.mainViewBodyNode;
     return this.mainViewBodyNode = this.mainViewNode.querySelector(".panel-subview-body");
   },
 
   /**
    * Inits.  Call to init.
    */
   init() {
-    if (!AppConstants.MOZ_PHOTON_THEME) {
-      return;
-    }
     for (let action of PageActions.actions) {
       this.placeAction(action, PageActions.insertBeforeActionIDInUrlbar(action));
     }
   },
 
   /**
    * Adds or removes as necessary DOM nodes for the given action.
    *
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1278,42 +1278,22 @@ var BookmarkingUI = {
   BOOKMARK_BUTTON_SHORTCUT: "addBookmarkAsKb",
   get button() {
     delete this.button;
     let widgetGroup = CustomizableUI.getWidget(this.BOOKMARK_BUTTON_ID);
     return this.button = widgetGroup.forWindow(window).node;
   },
 
   get star() {
-    if (AppConstants.MOZ_PHOTON_THEME) {
-      delete this.star;
-      return this.star = document.getElementById(this.STAR_ID);
-    }
-    /* Can't make this a self-deleting getter because it's anonymous content
-     * and might lose/regain bindings at some point. */
-    return document.getAnonymousElementByAttribute(this.button, "anonid",
-                                                   "button");
+    delete this.star;
+    return this.star = document.getElementById(this.STAR_ID);
   },
 
   get anchor() {
-    if (AppConstants.MOZ_PHOTON_THEME) {
-      return this.star;
-    }
-    if (!this._shouldUpdateStarState()) {
-      return null;
-    }
-    let widget = CustomizableUI.getWidget(this.BOOKMARK_BUTTON_ID)
-                               .forWindow(window);
-    if (widget.overflowed)
-      return widget.anchor;
-
-    let star = this.star;
-    return star ? document.getAnonymousElementByAttribute(star, "class",
-                                                          "toolbarbutton-icon")
-                : null;
+    return this.star;
   },
 
   get notifier() {
     delete this.notifier;
     return this.notifier = document.getElementById("bookmarked-notification-anchor");
   },
 
   get dropmarkerNotifier() {
@@ -1326,19 +1306,16 @@ var BookmarkingUI = {
     let broadcaster = document.getElementById("bookmarkThisPageBroadcaster");
     return this.broadcaster = broadcaster;
   },
 
   STATUS_UPDATING: -1,
   STATUS_UNSTARRED: 0,
   STATUS_STARRED: 1,
   get status() {
-    if (!this._shouldUpdateStarState()) {
-      return this.STATUS_UNSTARRED;
-    }
     if (this._pendingUpdate)
       return this.STATUS_UPDATING;
     return this.broadcaster.hasAttribute("starred") ? this.STATUS_STARRED
                                                     : this.STATUS_UNSTARRED;
   },
 
   get _starredTooltip() {
     delete this._starredTooltip;
@@ -1356,27 +1333,16 @@ var BookmarkingUI = {
     let args = [];
     let shortcut = document.getElementById(this.BOOKMARK_BUTTON_SHORTCUT);
     if (shortcut)
       args.push(ShortcutUtils.prettifyShortcut(shortcut));
     return gNavigatorBundle.getFormattedString(strId, args);
   },
 
   /**
-   * The type of the area in which the button is currently located.
-   * When in the panel, we don't update the button's icon.
-   */
-  _currentAreaType: null,
-  _shouldUpdateStarState() {
-    // Remove everything checking _shouldUpdateStarState when non-photon goes away.
-    return AppConstants.MOZ_PHOTON_THEME ||
-           this._currentAreaType == CustomizableUI.TYPE_TOOLBAR;
-  },
-
-  /**
    * The popup contents must be updated when the user customizes the UI, or
    * changes the personal toolbar collapsed status.  In such a case, any needed
    * change should be handled in the popupshowing helper, for performance
    * reasons.
    */
   _popupNeedsUpdate: true,
   onToolbarVisibilityChange: function BUI_onToolbarVisibilityChange() {
     this._popupNeedsUpdate = true;
@@ -1389,17 +1355,17 @@ var BookmarkingUI = {
 
     // On non-photon, this code should never be reached. However, if you click
     // the outer button's border, some cpp code for the menu button's XBL
     // binding decides to open the popup even though the dropmarker is invisible.
     //
     // Separately, in Photon, if the button is in the dynamic portion of the
     // overflow panel, we want to show a subview instead.
     if (this.button.getAttribute("cui-areatype") == CustomizableUI.TYPE_MENU_PANEL ||
-        (AppConstants.MOZ_PHOTON_THEME && this.button.hasAttribute("overflowedItem"))) {
+        this.button.hasAttribute("overflowedItem")) {
       this._showSubView();
       event.preventDefault();
       event.stopPropagation();
       return;
     }
 
     let widget = CustomizableUI.getWidget(this.BOOKMARK_BUTTON_ID)
                                .forWindow(window);
@@ -1612,21 +1578,16 @@ var BookmarkingUI = {
   showRecentlyBookmarked() {
     Services.prefs.setBoolPref(this.RECENTLY_BOOKMARKED_PREF, true);
   },
 
   hideRecentlyBookmarked() {
     Services.prefs.setBoolPref(this.RECENTLY_BOOKMARKED_PREF, false);
   },
 
-  _updateCustomizationState: function BUI__updateCustomizationState() {
-    let placement = CustomizableUI.getPlacementOfWidget(this.BOOKMARK_BUTTON_ID);
-    this._currentAreaType = placement && CustomizableUI.getAreaType(placement.area);
-  },
-
   _uninitView: function BUI__uninitView() {
     // When an element with a placesView attached is removed and re-inserted,
     // XBL reapplies the binding causing any kind of issues and possible leaks,
     // so kill current view and let popupshowing generate a new one.
     if (this.button._placesView)
       this.button._placesView.uninit();
     // Also uninit the main menubar placesView, since it would have the same
     // issues.
@@ -1672,42 +1633,32 @@ var BookmarkingUI = {
 
   onWidgetUndoMove: function BUI_undoWidgetUndoMove(aNode, aContainer) {
     if (aNode == this.button) {
       this._onWidgetWasMoved();
     }
   },
 
   _onWidgetWasMoved: function BUI_widgetWasMoved() {
-    let usedToUpdateStarState = this._shouldUpdateStarState();
-    this._updateCustomizationState();
-    if (!usedToUpdateStarState && this._shouldUpdateStarState()) {
-      this.updateStarState();
-    } else if (usedToUpdateStarState && !this._shouldUpdateStarState()) {
-      this._updateStar();
-    }
     // If we're moved outside of customize mode, we need to uninit
     // our view so it gets reconstructed.
     if (!this._isCustomizing) {
       this._uninitView();
     }
   },
 
   onCustomizeEnd: function BUI_customizeEnd(aWindow) {
     if (aWindow == window) {
       this._isCustomizing = false;
       this.onToolbarVisibilityChange();
     }
   },
 
   init() {
     CustomizableUI.addListener(this);
-    if (!AppConstants.MOZ_PHOTON_THEME) {
-      this._updateCustomizationState();
-    }
 
     if (Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled")) {
       let starButtonBox = document.getElementById("star-button-box");
       starButtonBox.setAttribute("animationsenabled", "true");
       this.star.addEventListener("mouseover", this, {once: true});
     }
   },
 
@@ -1774,40 +1725,25 @@ var BookmarkingUI = {
            }
          }
 
          delete this._pendingUpdate;
        });
   },
 
   _updateStar: function BUI__updateStar() {
-    if (!this._shouldUpdateStarState()) {
-      if (this.broadcaster.hasAttribute("starred")) {
-        this.broadcaster.removeAttribute("starred");
-        this.broadcaster.removeAttribute("buttontooltiptext");
-        this.broadcaster.removeAttribute("tooltiptext");
-      }
-      return;
-    }
-
     if (this._itemGuids.size > 0) {
       this.broadcaster.setAttribute("starred", "true");
       this.broadcaster.setAttribute("buttontooltiptext", this._starredTooltip);
       this.broadcaster.setAttribute("tooltiptext", this._starredTooltip);
-      if (!AppConstants.MOZ_PHOTON_THEME && this.button.getAttribute("overflowedItem") == "true") {
-        this.button.setAttribute("label", this._starButtonOverflowedStarredLabel);
-      }
     } else {
       this.star.removeAttribute("animate");
       this.broadcaster.removeAttribute("starred");
       this.broadcaster.setAttribute("buttontooltiptext", this._unstarredTooltip);
       this.broadcaster.setAttribute("tooltiptext", this._unstarredTooltip);
-      if (!AppConstants.MOZ_PHOTON_THEME && this.button.getAttribute("overflowedItem") == "true") {
-        this.button.setAttribute("label", this._starButtonOverflowedLabel);
-      }
     }
   },
 
   /**
    * forceReset is passed when we're destroyed and the label should go back
    * to the default (Bookmark This Page) for OS X.
    */
   updateBookmarkPageMenuItem: function BUI_updateBookmarkPageMenuItem(forceReset) {
@@ -1923,20 +1859,16 @@ var BookmarkingUI = {
     }
     this.onStarCommand(aEvent);
   },
 
   onStarCommand(aEvent) {
     // Ignore non-left clicks on the star, or if we are updating its state.
     if (!this._pendingUpdate && (aEvent.type != "click" || aEvent.button == 0)) {
       let isBookmarked = this._itemGuids.size > 0;
-      // Disable the old animation in photon
-      if (!isBookmarked && !AppConstants.MOZ_PHOTON_THEME)
-        this._showBookmarkedNotification();
-      // Set up variables for new animation in Photon
       if (!isBookmarked) {
         BrowserUtils.setToolbarButtonHeightProperty(this.star);
         this.star.setAttribute("animate", "true");
       }
       PlacesCommandHook.bookmarkCurrentPage(true);
     }
   },
 
@@ -2050,59 +1982,24 @@ var BookmarkingUI = {
   },
 
   onBeginUpdateBatch() {},
   onEndUpdateBatch() {},
   onBeforeItemRemoved() {},
   onItemVisited() {},
   onItemMoved() {},
 
-  // CustomizableUI events:
-  _starButtonLabel: null,
-  get _starButtonOverflowedLabel() {
-    delete this._starButtonOverflowedLabel;
-    return this._starButtonOverflowedLabel =
-      gNavigatorBundle.getString("starButtonOverflowed.label");
-  },
-  get _starButtonOverflowedStarredLabel() {
-    delete this._starButtonOverflowedStarredLabel;
-    return this._starButtonOverflowedStarredLabel =
-      gNavigatorBundle.getString("starButtonOverflowedStarred.label");
-  },
-  onWidgetOverflow(aNode, aContainer) {
-    let win = aNode.ownerGlobal;
-    if (AppConstants.MOZ_PHOTON_THEME || aNode.id != this.BOOKMARK_BUTTON_ID || win != window)
-      return;
-
-
-    let currentLabel = aNode.getAttribute("label");
-    if (!this._starButtonLabel)
-      this._starButtonLabel = currentLabel;
-
-    if (currentLabel == this._starButtonLabel) {
-      let desiredLabel = this._itemGuids.size > 0 ? this._starButtonOverflowedStarredLabel
-                                                  : this._starButtonOverflowedLabel;
-      aNode.setAttribute("label", desiredLabel);
-    }
-  },
-
   onWidgetUnderflow(aNode, aContainer) {
     let win = aNode.ownerGlobal;
     if (aNode.id != this.BOOKMARK_BUTTON_ID || win != window)
       return;
 
     // The view gets broken by being removed and reinserted. Uninit
     // here so popupshowing will generate a new one:
     this._uninitView();
-
-    if (AppConstants.MOZ_PHOTON_THEME)
-      return;
-
-    if (aNode.getAttribute("label") != this._starButtonLabel)
-      aNode.setAttribute("label", this._starButtonLabel);
   },
 
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsINavBookmarkObserver
   ])
 };
 
 var AutoShowBookmarksToolbar = {
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -171,18 +171,17 @@ var TabsInTitlebar = {
         fullMenuHeight = verticalMargins(menuStyles) + menuHeight;
       }
 
       // And get the height of what's in the titlebar:
       let titlebarContentHeight = rect(titlebarContent).height;
 
       // Begin setting CSS properties which will cause a reflow
 
-      if (AppConstants.MOZ_PHOTON_THEME &&
-          AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
+      if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
         if (!menuHeight && window.windowState == window.STATE_MAXIMIZED) {
           titlebarContentHeight = Math.max(titlebarContentHeight, fullTabsHeight);
           $("titlebar-buttonbox").style.height = titlebarContentHeight + "px";
         } else {
           $("titlebar-buttonbox").style.removeProperty("height");
         }
       }
 
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -13,21 +13,17 @@
   --lwt-background-alignment: right top;
   --lwt-background-tiling: no-repeat;
 }
 
 :root:-moz-lwtheme {
   color: var(--lwt-text-color) !important;
 }
 
-%ifndef MOZ_PHOTON_THEME
-:root:-moz-lwtheme:not([customization-lwtheme]) {
-%else
 :root:-moz-lwtheme {
-%endif
   background-color: var(--lwt-accent-color) !important;
   background-image: var(--lwt-header-image), var(--lwt-additional-images) !important;
   background-position: var(--lwt-background-alignment) !important;
   background-repeat: var(--lwt-background-tiling) !important;
 }
 
 #main-window:not([chromehidden~="toolbar"]) {
 %ifdef XP_MACOSX
@@ -685,25 +681,19 @@ html|input.urlbar-input[textoverflow]:no
   transition: none;
 }
 
 #DateTimePickerPanel[active="true"] {
   -moz-binding: url("chrome://global/content/bindings/datetimepopup.xml#datetime-popup");
 }
 
 #urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon,
-%ifdef MOZ_PHOTON_THEME
 #urlbar[pageproxystate="invalid"] > #urlbar-icons > #star-button-box > .urlbar-icon,
 .urlbar-go-button[pageproxystate="valid"],
 .urlbar-go-button:not([parentfocused="true"]),
-%else
-#urlbar[pageproxystate="invalid"][focused="true"] > #urlbar-go-button ~ toolbarbutton,
-#urlbar[pageproxystate="valid"] > #urlbar-go-button,
-#urlbar:not([focused="true"]) > #urlbar-go-button,
-%endif
 #urlbar[pageproxystate="invalid"] > #identity-box > #blocked-permissions-container,
 #urlbar[pageproxystate="invalid"] > #identity-box > #notification-popup-box,
 #urlbar[pageproxystate="invalid"] > #identity-box > #identity-icon-labels {
   visibility: collapse;
 }
 
 #identity-box {
   -moz-user-focus: normal;
@@ -1193,32 +1183,16 @@ toolbarpaletteitem[place="palette"] > #d
 }
 
 #BMB_bookmarksPopup[animate="cancel"] {
   transform: none;
 }
 %endif
 
 /* Customize mode */
-%ifndef MOZ_PHOTON_THEME
-#navigator-toolbox,
-#browser-bottombox,
-#content-deck {
-  transition-property: margin-left, margin-right;
-  transition-duration: 200ms;
-  transition-timing-function: linear;
-}
-
-#tab-view-deck[fastcustomizeanimation] #navigator-toolbox,
-#tab-view-deck[fastcustomizeanimation] #content-deck {
-  transition-duration: 1ms;
-  transition-timing-function: linear;
-}
-%endif
-
 #PanelUI-contents > .panel-customization-placeholder > .panel-customization-placeholder-child {
   list-style-image: none;
 }
 
 /* Apply crisp rendering for favicons at exactly 2dppx resolution */
 @media (resolution: 2dppx) {
   #PanelUI-remotetabs-tabslist > toolbarbutton > .toolbarbutton-icon,
   #PanelUI-recentlyClosedWindows > toolbarbutton > .toolbarbutton-icon,
@@ -1424,17 +1398,15 @@ toolbarpaletteitem[place="palette"][hidd
 }
 
 .dragfeedback-tab {
   -moz-appearance: none;
   opacity: 0.65;
   -moz-window-shadow: none;
 }
 
-%ifdef MOZ_PHOTON_THEME
 /* Page action panel */
 #pageAction-panel-sendToDevice-subview-body:not([state="notready"]) > #pageAction-panel-sendToDevice-notReady,
 #pageAction-urlbar-sendToDevice-subview-body:not([state="notready"]) > #pageAction-urlbar-sendToDevice-notReady {
   display: none;
 }
-%endif
 
 %include theme-vars.inc.css
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4192,17 +4192,16 @@ function OpenBrowserWindow(options) {
     }
   }
 
   // Make sure to remove the 'document-shown' observer in case the window
   // is being closed right after it was opened to avoid leaking.
   Services.obs.addObserver(newDocumentShown, "document-shown");
   Services.obs.addObserver(windowClosed, "domwindowclosed");
 
-  var charsetArg = new String();
   var handler = Components.classes["@mozilla.org/browser/clh;1"]
                           .getService(Components.interfaces.nsIBrowserHandler);
   var defaultArgs = handler.defaultArgs;
   var wintype = document.documentElement.getAttribute("windowtype");
 
   var extraFeatures = "";
   if (options && options.private) {
     extraFeatures = ",private";
@@ -4228,17 +4227,17 @@ function OpenBrowserWindow(options) {
   }
 
   // if and only if the current window is a browser window and it has a document with a character
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document) {
     var DocCharset = window.content.document.characterSet;
-    charsetArg = "charset=" + DocCharset;
+    let charsetArg = "charset=" + DocCharset;
 
     // we should "inherit" the charset menu setting in a new window
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
   } else {
     // forget about the charset information.
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
   }
 
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -435,17 +435,16 @@
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
       </hbox>
       <hbox pack="center">
         <button id="ctrlTab-showAll" class="ctrlTab-preview" noicon="true"/>
       </hbox>
     </panel>
 
-#ifdef MOZ_PHOTON_THEME
     <panel id="pageActionPanel"
            class="cui-widget-panel"
            role="group"
            type="arrow"
            hidden="true"
            flip="slide"
            position="bottomcenter topright"
            tabspecific="true"
@@ -469,17 +468,16 @@
     <menupopup id="pageActionPanelContextMenu"
                onpopupshowing="BrowserPageActions.onContextMenuShowing(event, this);">
       <menuitem id="pageActionPanelContextMenu-toggleUrlbar"
                 add-label="&pageAction.addToUrlbar.label;"
                 remove-label="&pageAction.removeFromUrlbar.label;"
                 label="&pageAction.addToUrlbar.label;"
                 oncommand="BrowserPageActions.toggleShownInUrlbarForContextAction();"/>
     </menupopup>
-#endif
 
     <!-- Bookmarks and history tooltip -->
     <tooltip id="bhTooltip"/>
 
     <tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>
 
     <tooltip id="back-button-tooltip">
       <label class="tooltip-label" value="&backButton.tooltip;"/>
@@ -890,17 +888,16 @@
                 <image id="reader-mode-button"
                        class="urlbar-icon"
                        hidden="true"
                        onclick="ReaderParent.buttonClick(event);"/>
                 <toolbarbutton id="urlbar-zoom-button"
                        onclick="FullZoom.reset();"
                        tooltip="dynamic-shortcut-tooltip"
                        hidden="true"/>
-#ifdef MOZ_PHOTON_THEME
                 <image id="pageActionButton"
                        class="urlbar-icon"
                        tooltiptext="&pageActionButton.tooltip;"
                        onclick="BrowserPageActions.mainButtonClicked(event);"/>
                 <hbox id="star-button-box"
                       hidden="true"
                       context="pageActionPanelContextMenu"
                       oncontextmenu="BrowserPageActions.onContextMenu(event);"
@@ -908,56 +905,36 @@
                   <image id="star-button" class="urlbar-icon">
                     <observes element="bookmarkThisPageBroadcaster" attribute="starred"/>
                     <observes element="bookmarkThisPageBroadcaster" attribute="tooltiptext"/>
                   </image>
                   <hbox id="star-button-animatable-box">
                     <image id="star-button-animatable-image"/>
                   </hbox>
                 </hbox>
-#endif
               </hbox>
               <hbox id="userContext-icons" hidden="true">
                 <label id="userContext-label"/>
                 <image id="userContext-indicator"/>
               </hbox>
-#ifndef MOZ_PHOTON_THEME
-              <toolbarbutton id="urlbar-go-button"
-                             class="chromeclass-toolbar-additional"
-                             onclick="gURLBar.handleCommand(event);"
-                             tooltiptext="&goEndCap.tooltip;"/>
-              <toolbarbutton id="reload-button"
-                             class="chromeclass-toolbar-additional"
-                             command="Browser:ReloadOrDuplicate"
-                             onclick="checkForMiddleClick(this, event);"
-                             tooltip="dynamic-shortcut-tooltip"/>
-              <toolbarbutton id="stop-button"
-                             class="chromeclass-toolbar-additional"
-                             command="Browser:Stop"
-                             tooltip="dynamic-shortcut-tooltip"/>
-#endif
             </textbox>
           </hbox>
         </toolbaritem>
 
         <toolbaritem id="search-container" title="&searchItem.title;"
                      align="center" class="chromeclass-toolbar-additional panel-wide-item"
                      cui-areatype="toolbar"
                      flex="100" persist="width" removable="true">
           <searchbar id="searchbar" flex="1"/>
         </toolbaritem>
 
         <toolbarbutton id="bookmarks-menu-button"
                        class="toolbarbutton-1 chromeclass-toolbar-additional"
                        removable="true"
-#ifdef MOZ_PHOTON_THEME
                        type="menu"
-#else
-                       type="menu-button"
-#endif
                        label="&bookmarksMenuButton.label;"
                        tooltip="dynamic-shortcut-tooltip"
                        anchor="dropmarker"
                        ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
                        ondragover="PlacesMenuDNDHandler.onDragOver(event);"
                        ondragleave="PlacesMenuDNDHandler.onDragLeave(event);"
                        ondrop="PlacesMenuDNDHandler.onDrop(event);"
                        cui-areatype="toolbar"
@@ -1159,19 +1136,16 @@
     <toolbar id="addon-bar" toolbar-delegate="nav-bar" mode="icons" iconsize="small"
              customizable="true">
       <hbox id="addonbar-closebutton"/>
       <statusbar id="status-bar"/>
     </toolbar>
 
     <toolbarpalette id="BrowserToolbarPalette">
 
-# Update primaryToolbarButtons in browser/themes/shared/browser.inc when adding
-# or removing default items with the toolbarbutton-1 class.
-
       <toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
 #ifdef XP_MACOSX
                      command="cmd_print"
                      tooltip="dynamic-shortcut-tooltip"
 #else
                      command="cmd_printPreview"
                      tooltiptext="&printButton.tooltip;"
 #endif
@@ -1187,26 +1161,25 @@
                      ondragenter="newWindowButtonObserver.onDragOver(event)"
                      ondragexit="newWindowButtonObserver.onDragExit(event)"/>
 
       <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      observes="View:FullScreen"
                      type="checkbox"
                      label="&fullScreenCmd.label;"
                      tooltip="dynamic-shortcut-tooltip"/>
-#ifdef MOZ_PHOTON_THEME
+
       <toolbarbutton id="library-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      oncommand="PanelUI.showSubView('appMenu-libraryView', this, null, event);"
                      closemenu="none"
                      label="&places.library.title;">
         <box class="toolbarbutton-animatable-box">
           <image class="toolbarbutton-animatable-image"/>
         </box>
       </toolbarbutton>
-#endif
     </toolbarpalette>
   </toolbox>
 
   <hbox id="fullscr-toggler" hidden="true"/>
 
   <deck id="content-deck" flex="1">
     <hbox flex="1" id="browser">
       <vbox id="browser-border-start" hidden="true" layer="true"/>
@@ -1274,32 +1247,15 @@
       &pointerlockWarning.generic.label;
     </html:div>
   </html:div>
 
   <vbox id="browser-bottombox" layer="true">
     <notificationbox id="global-notificationbox" notificationside="bottom"/>
   </vbox>
 
-#ifndef MOZ_PHOTON_THEME
-  <svg:svg height="0">
-    <svg:clipPath id="urlbar-back-button-clip-path">
-#ifndef XP_MACOSX
-      <svg:path d="M -9,-4 l 0,1 a 15 15 0 0,1 0,30 l 0,1 l 10000,0 l 0,-32 l -10000,0 z" />
-#else
-      <svg:path d="M -11,-5 a 16 16 0 0 1 0,34 l 10000,0 l 0,-34 l -10000,0 z"/>
-#endif
-    </svg:clipPath>
-#ifdef XP_WIN
-    <svg:clipPath id="urlbar-back-button-clip-path-win10">
-      <svg:path d="M -6,-2 l 0,1 a 15 15 0 0,1 0,30 l 0,1 l 10000,0 l 0,-32 l -10000,0 z" />
-    </svg:clipPath>
-#endif
-  </svg:svg>
-#endif
-
 </vbox>
 # <iframe id="tab-view"> is dynamically appended as the 2nd child of #tab-view-deck.
 #     Introducing the iframe dynamically, as needed, was found to be better than
 #     starting with an empty iframe here in browser.xul from a Ts standpoint.
 </deck>
 
 </window>
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -6102,19 +6102,17 @@
 
               break;
           }
         ]]></body>
       </method>
 
       <property name="_isCustomizing" readonly="true">
         <getter><![CDATA[
-          let root = document.documentElement;
-          return root.getAttribute("customizing") == "true" ||
-                 (!AppConstants.MOZ_PHOTON_THEME && root.getAttribute("customize-exiting") == "true");
+          return document.documentElement.getAttribute("customizing") == "true";
         ]]></getter>
       </property>
 
       <method name="_setPositionalAttributes">
         <body><![CDATA[
           let visibleTabs = this.tabbrowser.visibleTabs;
 
           if (!visibleTabs.length)
--- a/browser/base/content/test/general/browser_bookmark_popup.js
+++ b/browser/base/content/test/general/browser_bookmark_popup.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 /**
  * Test opening and closing the bookmarks panel.
  */
 
 let bookmarkPanel = document.getElementById("editBookmarkPanel");
-let bookmarkStar = AppConstants.MOZ_PHOTON_THEME ? BookmarkingUI.star : BookmarkingUI.button;
+let bookmarkStar = BookmarkingUI.star;
 let bookmarkPanelTitle = document.getElementById("editBookmarkPanelTitle");
 let editBookmarkPanelRemoveButtonRect;
 
 StarUI._closePanelQuickForTesting = true;
 
 add_task(async function setup() {
   bookmarkPanel.setAttribute("animate", false);
   registerCleanupFunction(() => {
--- a/browser/base/content/test/performance/browser_startup_images.js
+++ b/browser/base/content/test/performance/browser_startup_images.js
@@ -23,34 +23,24 @@
  *
  * Please don't add items to this list. Please remove items from this list.
  */
 const whitelist = [
   // Photon-only entries
   {
     file: "chrome://browser/skin/stop.svg",
     platforms: ["linux", "win", "macosx"],
-    photon: true,
   },
   {
     file: "chrome://browser/skin/bookmark-hollow.svg",
     platforms: ["linux", "win", "macosx"],
-    photon: true,
   },
   {
     file: "chrome://browser/skin/page-action.svg",
     platforms: ["linux", "win", "macosx"],
-    photon: true,
-  },
-
-  // Non-Photon-only entries
-  {
-    file: "chrome://browser/skin/toolbarbutton-dropdown-arrow.png",
-    platforms: ["linux", "win", "macosx"],
-    photon: false,
   },
 
   // Shared entries
   {
     file: "chrome://browser/skin/arrow-left.svg",
     platforms: ["linux", "win", "macosx"],
   },
   {
@@ -114,18 +104,17 @@ const whitelist = [
 ];
 
 add_task(async function() {
   let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
   await startupRecorder.done;
 
   let data = startupRecorder.data.images;
   let filteredWhitelist = whitelist.filter(el => {
-    return el.platforms.includes(AppConstants.platform) &&
-           (el.photon === undefined || el.photon == AppConstants.MOZ_PHOTON_THEME);
+    return el.platforms.includes(AppConstants.platform);
   });
 
   let loadedImages = data["image-loading"];
   let shownImages = data["image-drawing"];
 
   for (let loaded of loadedImages.values()) {
     let whitelistItem = filteredWhitelist.find(el => {
       if (window.devicePixelRatio >= 2 && el.hidpi && el.hidpi == loaded) {
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -169,29 +169,16 @@ var whitelist = [
   {file: "resource://gre/modules/Manifest.jsm"},
   // Bug 1351097
   {file: "resource://gre/modules/accessibility/AccessFu.jsm"},
   // Bug 1351637
   {file: "resource://gre/modules/sdk/bootstrap.js"},
 
 ];
 
-if (!AppConstants.MOZ_PHOTON_THEME) {
-  whitelist.push(
-    // Bug 1343824
-    {file: "chrome://browser/skin/customizableui/customize-illustration-rtl@2x.png",
-     platforms: ["linux", "win"]},
-    {file: "chrome://browser/skin/customizableui/customize-illustration@2x.png",
-     platforms: ["linux", "win"]},
-    {file: "chrome://browser/skin/customizableui/info-icon-customizeTip@2x.png",
-     platforms: ["linux", "win"]},
-    {file: "chrome://browser/skin/customizableui/panelarrow-customizeTip@2x.png",
-     platforms: ["linux", "win"]});
-}
-
 whitelist = new Set(whitelist.filter(item =>
   ("isFromDevTools" in item) == isDevtools &&
   (!item.skipNightly || !AppConstants.NIGHTLY_BUILD) &&
   (!item.platforms || item.platforms.includes(AppConstants.platform))
 ).map(item => item.file));
 
 const ignorableWhitelist = new Set([
   // chrome://xslt-qa/ isn't referenced, but isn't included in packaged builds,
--- a/browser/base/content/theme-vars.inc.css
+++ b/browser/base/content/theme-vars.inc.css
@@ -15,26 +15,22 @@
 :root[lwthemeicons~="--reload-icon"] #reload-button:-moz-lwtheme {
   list-style-image: var(--reload-icon) !important;
 }
 
 :root[lwthemeicons~="--stop-icon"] #stop-button:-moz-lwtheme {
   list-style-image: var(--stop-icon) !important;
 }
 
-%ifdef MOZ_PHOTON_THEME
 :root[lwthemeicons~="--bookmark_star-icon"] #star-button:-moz-lwtheme,
-%endif
 :root[lwthemeicons~="--bookmark_star-icon"] #bookmarks-menu-button:-moz-lwtheme {
   list-style-image: var(--bookmark_star-icon) !important;
 }
 
-%ifdef MOZ_PHOTON_THEME
 :root[lwthemeicons~="--bookmark_menu-icon"] #bookmarks-menu-button:-moz-lwtheme,
-%endif
 :root[lwthemeicons~="--bookmark_menu-icon"] #bookmarks-menu-button[cui-areatype='toolbar'] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon:-moz-lwtheme {
   list-style-image: var(--bookmark_menu-icon) !important;
 }
 
 :root[lwthemeicons~="--downloads-icon"] #downloads-button:-moz-lwtheme {
   list-style-image: var(--downloads-icon) !important;
 }
 
@@ -129,20 +125,18 @@
 :root[lwthemeicons~="--forget-icon"] #panic-button:-moz-lwtheme {
   list-style-image: var(--forget-icon) !important;
 }
 
 :root[lwthemeicons~="--pocket-icon"] #pocket-button:-moz-lwtheme {
   list-style-image: var(--pocket-icon) !important;
 }
 
-%ifdef MOZ_PHOTON_THEME
 :root[lwthemeicons~="--bookmark_star-icon"] #star-button:-moz-lwtheme,
 :root[lwthemeicons~="--bookmark_menu-icon"] #bookmarks-menu-button:-moz-lwtheme,
-%endif
 :root[lwthemeicons~="--back-icon"] #back-button:-moz-lwtheme,
 :root[lwthemeicons~="--forward-icon"] #forward-button:-moz-lwtheme,
 :root[lwthemeicons~="--reload-icon"] #reload-button:-moz-lwtheme,
 :root[lwthemeicons~="--stop-icon"] #stop-button:-moz-lwtheme,
 :root[lwthemeicons~="--bookmark_star-icon"] #bookmarks-menu-button:-moz-lwtheme,
 :root[lwthemeicons~="--bookmark_menu-icon"] #bookmarks-menu-button[cui-areatype='toolbar'] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon:-moz-lwtheme,
 :root[lwthemeicons~="--downloads-icon"] #downloads-button:-moz-lwtheme,
 :root[lwthemeicons~="--home-icon"] #home-button:-moz-lwtheme,
@@ -166,15 +160,8 @@
 :root[lwthemeicons~="--share_page-icon"] #social-share-button:-moz-lwtheme,
 :root[lwthemeicons~="--subscribe-icon"] #feed-button:-moz-lwtheme,
 :root[lwthemeicons~="--text_encoding-icon"] #characterencoding-button:-moz-lwtheme,
 :root[lwthemeicons~="--email_link-icon"] #email-link-button:-moz-lwtheme,
 :root[lwthemeicons~="--forget-icon"] #panic-button:-moz-lwtheme,
 :root[lwthemeicons~="--pocket-icon"] #pocket-button:-moz-lwtheme {
   -moz-image-region: rect(0, 16px, 16px, 0) !important;
 }
-
-%ifndef MOZ_PHOTON_THEME
-:root[lwthemeicons~="--reload-icon"] #urlbar > #reload-button:-moz-lwtheme,
-:root[lwthemeicons~="--stop-icon"] #urlbar > #stop-button:-moz-lwtheme {
-  -moz-image-region: rect(0, 14px, 14px, 0) !important;
-}
-%endif
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -36,23 +36,21 @@ file, You can obtain one at http://mozil
                   class="textbox-input-box urlbar-input-box"
                   flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input"
                       class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
                       allowevents="true"
                       inputmode="url"
                       xbl:inherits="tooltiptext=inputtooltiptext,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
-#ifdef MOZ_PHOTON_THEME
           <xul:image anonid="go-button"
                      class="urlbar-go-button"
                      onclick="gURLBar.handleCommand(event);"
                      tooltiptext="&goEndCap.tooltip;"
                      xbl:inherits="pageproxystate,parentfocused=focused"/>
-#endif
         </xul:hbox>
         <xul:dropmarker anonid="historydropmarker"
                         class="autocomplete-history-dropmarker urlbar-history-dropmarker"
                         tooltiptext="&urlbar.openHistoryPopup.tooltip;"
                         allowevents="true"
                         xbl:inherits="open,enablehistory,parentfocused=focused"/>
         <children includes="hbox"/>
       </xul:hbox>
@@ -155,25 +153,19 @@ file, You can obtain one at http://mozil
 
         // Null out the one-offs' popup and textbox so that it cleans up its
         // internal state for both.  Most importantly, it removes the event
         // listeners that it added to both.
         this.popup.oneOffSearchButtons.popup = null;
         this.popup.oneOffSearchButtons.textbox = null;
       ]]></destructor>
 
-#ifdef MOZ_PHOTON_THEME
       <field name="goButton">
         document.getAnonymousElementByAttribute(this, "anonid", "go-button");
       </field>
-#else
-      <field name="goButton">
-        document.getElementById("urlbar-go-button");
-      </field>
-#endif
 
       <field name="_value">""</field>
       <field name="gotResultForCurrentQuery">false</field>
 
       <!--
         This is set around HandleHenter so it can be used in handleCommand.
         It is also used to track whether we must handle a delayed handleEnter,
         by checking if it has been cleared.
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -333,19 +333,16 @@ CustomizeMode.prototype = {
         // Force layout reflow to ensure the animation runs,
         // and make it async so it doesn't affect the timing.
         this.visiblePalette.clientTop;
         this.visiblePalette.setAttribute("showing", "true");
       }, 0);
       this._updateEmptyPaletteNotice();
 
       this._updateLWThemeButtonIcon();
-      if (!AppConstants.MOZ_PHOTON_THEME) {
-        this.maybeShowTip(panelHolder);
-      }
 
       this._handler.isEnteringCustomizeMode = false;
 
       CustomizableUI.dispatchToolboxEvent("customizationready", {}, window);
 
       if (!this._wantToBeInCustomizeMode) {
         this.exit();
       }
@@ -494,70 +491,25 @@ CustomizeMode.prototype = {
    * order - customize-entered, customize-exiting, remove LWT swapping,
    * pre-customization mode.
    *
    * When in the customize-entering, customize-entered, or customize-exiting
    * phases, there is a "customizing" attribute set on the main-window to simplify
    * excluding certain styles while in any phase of customize mode.
    */
   _doTransition(aEntering) {
-    if (AppConstants.MOZ_PHOTON_THEME) {
-      let docEl = this.document.documentElement;
-      if (aEntering) {
-        docEl.setAttribute("customizing", true);
-        docEl.setAttribute("customize-entered", true);
-      } else {
-        docEl.removeAttribute("customizing");
-        docEl.removeAttribute("customize-entered");
-      }
-      return Promise.resolve();
+    let docEl = this.document.documentElement;
+    if (aEntering) {
+      docEl.setAttribute("customizing", true);
+      docEl.setAttribute("customize-entered", true);
+    } else {
+      docEl.removeAttribute("customizing");
+      docEl.removeAttribute("customize-entered");
     }
-    let deck = this.document.getElementById("content-deck");
-    let customizeTransitionEndPromise = new Promise(resolve => {
-      let customizeTransitionEnd = (aEvent) => {
-        if (aEvent != "timedout" &&
-            (aEvent.originalTarget != deck || aEvent.propertyName != "margin-left")) {
-          return;
-        }
-        this.window.clearTimeout(catchAllTimeout);
-        // We request an animation frame to do the final stage of the transition
-        // to improve perceived performance. (bug 962677)
-        this.window.requestAnimationFrame(() => {
-          deck.removeEventListener("transitionend", customizeTransitionEnd);
-
-          if (!aEntering) {
-            this.document.documentElement.removeAttribute("customize-exiting");
-            this.document.documentElement.removeAttribute("customizing");
-          } else {
-            this.document.documentElement.setAttribute("customize-entered", true);
-            this.document.documentElement.removeAttribute("customize-entering");
-          }
-          CustomizableUI.dispatchToolboxEvent("customization-transitionend", aEntering, this.window);
-
-          resolve();
-        });
-      };
-      deck.addEventListener("transitionend", customizeTransitionEnd);
-      let catchAll = () => customizeTransitionEnd("timedout");
-      let catchAllTimeout = this.window.setTimeout(catchAll, kMaxTransitionDurationMs);
-    });
-
-    if (gDisableAnimation) {
-      this.document.getElementById("tab-view-deck").setAttribute("fastcustomizeanimation", true);
-    }
-
-    if (aEntering) {
-      this.document.documentElement.setAttribute("customizing", true);
-      this.document.documentElement.setAttribute("customize-entering", true);
-    } else {
-      this.document.documentElement.setAttribute("customize-exiting", true);
-      this.document.documentElement.removeAttribute("customize-entered");
-    }
-
-    return customizeTransitionEndPromise;
+    return Promise.resolve();
   },
 
   updateLWTStyling(aData) {
     let docElement = this.document.documentElement;
     if (!aData) {
       let lwt = docElement._lightweightTheme;
       aData = lwt.getData();
     }
--- a/browser/components/customizableui/content/customizeMode.inc.xul
+++ b/browser/components/customizableui/content/customizeMode.inc.xul
@@ -60,17 +60,16 @@
           <toolbarbutton class="customization-lwtheme-menu-footeritem"
                          label="&customizeMode.lwthemes.menuGetMore;"
                          accesskey="&customizeMode.lwthemes.menuGetMore.accessKey;"
                          tabindex="0"
                          oncommand="gCustomizeMode.getMoreThemes(event);"/>
         </hbox>
       </panel>
     </button>
-#ifdef MOZ_PHOTON_THEME
     <button id="customization-uidensity-button"
             label="&customizeMode.uidensity;"
             class="customizationmode-button"
             type="menu">
       <panel type="arrow" id="customization-uidensity-menu"
              onpopupshowing="gCustomizeMode.onUIDensityMenuShowing();"
              position="topcenter bottomleft"
              flip="none"
@@ -116,17 +115,16 @@
         <spacer hidden="true" id="customization-uidensity-touch-spacer"/>
         <checkbox id="customization-uidensity-autotouchmode-checkbox"
                   hidden="true"
                   label="&customizeMode.uidensity.autoTouchMode.checkbox.label;"
                   oncommand="gCustomizeMode.updateAutoTouchMode(this.checked)"/>
 #endif
       </panel>
     </button>
-#endif
 
     <spacer id="customization-footer-spacer"/>
     <button id="customization-undo-reset-button"
             class="customizationmode-button"
             hidden="true"
             oncommand="gCustomizeMode.undoReset();"
             label="&undoCmd.label;"/>
     <button id="customization-reset-button"
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -79,49 +79,29 @@
     </panelview>
 
     <panelview id="PanelUI-history" flex="1">
       <label value="&appMenuHistory.label;" class="panel-subview-header"/>
       <vbox class="panel-subview-body">
         <toolbarbutton id="appMenuViewHistorySidebar"
                        label="&appMenuHistory.viewSidebar.label;"
                        type="checkbox"
-#ifndef MOZ_PHOTON_THEME
-                       class="subviewbutton"
-#else
                        class="subviewbutton subviewbutton-iconic"
-#endif
                        key="key_gotoHistory"
                        oncommand="SidebarUI.toggle('viewHistorySidebar'); PanelUI.hide();">
           <observes element="viewHistorySidebar" attribute="checked"/>
         </toolbarbutton>
         <toolbarbutton id="appMenuClearRecentHistory"
                        label="&appMenuHistory.clearRecent.label;"
-#ifndef MOZ_PHOTON_THEME
-                       class="subviewbutton"
-#else
                        class="subviewbutton subviewbutton-iconic"
-#endif
                        command="Tools:Sanitize"/>
         <toolbarbutton id="appMenuRestoreLastSession"
                        label="&appMenuHistory.restoreSession.label;"
-#ifndef MOZ_PHOTON_THEME
-                       class="subviewbutton"
-#else
                        class="subviewbutton subviewbutton-iconic"
-#endif
                        command="Browser:RestoreLastSession"/>
-#ifndef MOZ_PHOTON_THEME
-        <menuseparator id="PanelUI-recentlyClosedTabs-separator"/>
-        <vbox id="PanelUI-recentlyClosedTabs" tooltip="bhTooltip"/>
-        <menuseparator id="PanelUI-recentlyClosedWindows-separator"/>
-        <vbox id="PanelUI-recentlyClosedWindows" tooltip="bhTooltip"/>
-        <menuseparator id="PanelUI-historyItems-separator"/>
-        <vbox id="PanelUI-historyItems" tooltip="bhTooltip"/>
-#else
         <toolbarseparator/>
         <toolbarbutton id="appMenuRecentlyClosedTabs"
                        label="&historyUndoMenu.label;"
                        class="subviewbutton subviewbutton-iconic subviewbutton-nav"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-library-recentlyClosedTabs', this)"/>
         <toolbarbutton id="appMenuRecentlyClosedWindows"
                        label="&historyUndoWindowMenu.label;"
@@ -133,28 +113,25 @@
                class="subview-subheader"/>
         <toolbaritem id="appMenu_historyMenu"
                      orient="vertical"
                      smoothscroll="false"
                      flatList="true"
                      tooltip="bhTooltip">
           <!-- history menu items will go here -->
         </toolbaritem>
-#endif
       </vbox>
       <toolbarbutton id="PanelUI-historyMore"
                      class="panel-subview-footer subviewbutton"
                      label="&appMenuHistory.showAll.label;"
                      oncommand="PlacesCommandHook.showPlacesOrganizer('History'); CustomizableUI.hidePanelForNode(this);"/>
     </panelview>
 
-#ifdef MOZ_PHOTON_THEME
     <panelview id="appMenu-library-recentlyClosedTabs"/>
     <panelview id="appMenu-library-recentlyClosedWindows"/>
-#endif
 
     <panelview id="PanelUI-remotetabs" flex="1" class="PanelUI-subView"
                descriptionheightworkaround="true">
       <label value="&appMenuRemoteTabs.label;" class="panel-subview-header"/>
       <vbox class="panel-subview-body">
         <!-- this widget has 3 boxes in the body, but only 1 is ever visible -->
         <!-- When Sync is ready to sync -->
         <vbox id="PanelUI-remotetabs-main" observes="sync-syncnow-state">
@@ -248,72 +225,38 @@
         </hbox>
       </vbox>
     </panelview>
 
     <panelview id="PanelUI-bookmarks" flex="1" class="PanelUI-subView">
       <label value="&bookmarksMenu.label;" class="panel-subview-header"/>
       <vbox class="panel-subview-body">
         <toolbarbutton id="panelMenuBookmarkThisPage"
-#ifndef MOZ_PHOTON_THEME
-                       class="subviewbutton"
-#else
                        class="subviewbutton subviewbutton-iconic"
-#endif
                        observes="bookmarkThisPageBroadcaster"
                        command="Browser:AddBookmarkAs"
                        onclick="PanelUI.hide();"/>
-#ifndef MOZ_PHOTON_THEME
-        <toolbarseparator/>
-#endif
         <toolbarbutton id="panelMenu_viewBookmarksSidebar"
                        label="&viewBookmarksSidebar2.label;"
-#ifndef MOZ_PHOTON_THEME
-                       class="subviewbutton"
-#else
                        class="subviewbutton subviewbutton-iconic"
-#endif
                        key="viewBookmarksSidebarKb"
                        oncommand="SidebarUI.toggle('viewBookmarksSidebar'); PanelUI.hide();">
           <observes element="viewBookmarksSidebar" attribute="checked"/>
         </toolbarbutton>
-#ifndef MOZ_PHOTON_THEME
-        <toolbarbutton id="panelMenu_viewBookmarksToolbar"
-                       label="&viewBookmarksToolbar.label;"
-                       type="checkbox"
-                       toolbarId="PersonalToolbar"
-                       class="subviewbutton"
-                       oncommand="onViewToolbarCommand(event); PanelUI.hide();"/>
-        <toolbarseparator/>
-        <toolbarbutton id="panelMenu_bookmarksToolbar"
-                       label="&personalbarCmd.label;"
-                       class="subviewbutton cui-withicon"
-                       oncommand="PlacesCommandHook.showPlacesOrganizer('BookmarksToolbar'); PanelUI.hide();"/>
-        <toolbarbutton id="panelMenu_unsortedBookmarks"
-                       label="&otherBookmarksCmd.label;"
-                       class="subviewbutton cui-withicon"
-                       oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks'); PanelUI.hide();"/>
-        <toolbarseparator class="small-separator"/>
-#else
         <toolbarbutton id="panelMenu_searchBookmarks"
                        label="&searchBookmarks.label;"
                        class="subviewbutton subviewbutton-iconic"
                        oncommand="PlacesCommandHook.searchBookmarks(); PanelUI.hide();"/>
         <toolbarseparator/>
         <label id="panelMenu_recentBookmarks"
                value="&recentBookmarks.label;"
                class="subview-subheader"/>
-#endif
         <toolbaritem id="panelMenu_bookmarksMenu"
                      orient="vertical"
                      smoothscroll="false"
-#ifndef MOZ_PHOTON_THEME
-                     onclick="if (event.button == 1) BookmarkingUI.onPanelMenuViewCommand(event, this._placesView);"
-                     oncommand="BookmarkingUI.onPanelMenuViewCommand(event, this._placesView);"
-#endif
                      flatList="true"
                      tooltip="bhTooltip">
           <!-- bookmarks menu items will go here -->
         </toolbaritem>
       </vbox>
       <toolbarbutton id="panelMenu_showAllBookmarks"
                      label="&showAllBookmarks2.label;"
                      class="subviewbutton panel-subview-footer"
@@ -403,43 +346,36 @@
 
 </panel>
 
 <panel id="widget-overflow"
        role="group"
        type="arrow"
        noautofocus="true"
        position="bottomcenter topright"
-#ifndef MOZ_PHOTON_THEME
-       context="toolbar-context-menu"
-#endif
        hidden="true">
-#ifdef MOZ_PHOTON_THEME
   <photonpanelmultiview mainViewId="widget-overflow-mainView">
     <panelview id="widget-overflow-mainView"
                context="toolbar-context-menu">
-#endif
       <vbox class="panel-subview-body">
         <vbox id="widget-overflow-scroller">
           <vbox id="widget-overflow-list" class="widget-overflow-list"
                 overflowfortoolbar="nav-bar"/>
           <toolbarseparator id="widget-overflow-fixed-separator" hidden="true"/>
           <vbox id="widget-overflow-fixed-list" class="widget-overflow-list" hidden="true"
                 emptylabel="&customizeMode.emptyOverflowList.description;"/>
         </vbox>
       </vbox>
-#ifdef MOZ_PHOTON_THEME
       <toolbarbutton command="cmd_CustomizeToolbars"
                       id="overflowMenu-customize-button"
                       class="subviewbutton panel-subview-footer"
                       accesskey="&overflowCustomizeToolbar.accesskey;"
                       label="&overflowCustomizeToolbar.label;"/>
     </panelview>
   </photonpanelmultiview>
-#endif
   <!-- This menu is here because not having it in the menu in which it's used flickers
        when hover styles overlap. See https://bugzilla.mozilla.org/show_bug.cgi?id=1378427 .
        -->
   <menupopup id="customizationPanelItemContextMenu"
              onpopupshowing="gCustomizeMode.onPanelContextMenuShowing(event)">
     <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)"
               id="customizationPanelItemContextMenuPin"
               accesskey="&customizeMenu.pinToOverflowMenu.accesskey;"
--- a/browser/components/customizableui/test/browser_984455_bookmarks_items_reparenting.js
+++ b/browser/components/customizableui/test/browser_984455_bookmarks_items_reparenting.js
@@ -68,20 +68,17 @@ function checkSpecialContextMenus() {
     const kSpecialItemIDs = {
       "BMB_bookmarksToolbar": "BMB_bookmarksToolbarPopup",
       "BMB_unsortedBookmarks": "BMB_unsortedBookmarksPopup",
     };
 
     // Open the bookmarks menu button context menus and ensure that
     // they have the proper views attached.
     let shownPromise = bookmarksMenuPanelShown();
-    if (!AppConstants.MOZ_PHOTON_THEME) {
-      bookmarksMenuButton = document.getAnonymousElementByAttribute(bookmarksMenuButton,
-                                                                    "anonid", "dropmarker");
-    }
+
     EventUtils.synthesizeMouseAtCenter(bookmarksMenuButton, {});
     info("Waiting for bookmarks menu popup to show after clicking dropmarker.")
     await shownPromise;
 
     for (let menuID in kSpecialItemIDs) {
       let menuItem = document.getElementById(menuID);
       let menuPopup = document.getElementById(kSpecialItemIDs[menuID]);
       info("Waiting to open menu for " + menuID);
--- a/browser/components/customizableui/test/browser_customizemode_uidensity.js
+++ b/browser/components/customizableui/test/browser_customizemode_uidensity.js
@@ -111,30 +111,20 @@ async function testModeMenuitem(mode, mo
 
   is(Services.prefs.getIntPref(PREF_UI_DENSITY), window.gUIDensity.MODE_NORMAL,
      "UI Density pref should be set to normal.");
 
   await endCustomizing();
 }
 
 add_task(async function test_compact_mode_menuitem() {
-  if (!AppConstants.MOZ_PHOTON_THEME) {
-    ok(true, "Skipping test because Photon is not enabled.");
-    return;
-  }
-
   await testModeMenuitem("compact", window.gUIDensity.MODE_COMPACT);
 });
 
 add_task(async function test_touch_mode_menuitem() {
-  if (!AppConstants.MOZ_PHOTON_THEME) {
-    ok(true, "Skipping test because Photon is not enabled.");
-    return;
-  }
-
   // OSX doesn't get touch mode for now.
   if (AppConstants.platform == "macosx") {
     is(document.getElementById("customization-uidensity-menuitem-touch"), null,
        "There's no touch option on Mac OSX");
     return;
   }
 
   await testModeMenuitem("touch", window.gUIDensity.MODE_TOUCH);
--- a/browser/components/extensions/test/browser/browser_ext_themes_icons.js
+++ b/browser/components/extensions/test/browser/browser_ext_themes_icons.js
@@ -137,23 +137,18 @@ async function runTestWithIcons(icons) {
     ["subscribe", "#feed-button", "feed-button"],
     ["text_encoding", "#characterencoding-button", "characterencoding-button"],
     ["email_link", "#email-link-button", "email-link-button"],
     ["forget", "#panic-button", "panic-button"],
     ["pocket", "#pocket-button", "pocket-button"],
   ];
   // We add these at the beginning because adding them at the end can end up
   // putting them in the overflow panel, where they aren't displayed the same way.
-  if (AppConstants.MOZ_PHOTON_THEME) {
-    ICON_INFO.unshift(["bookmark_star", "#star-button"]);
-    ICON_INFO.unshift(["bookmark_menu", "#bookmarks-menu-button", "bookmarks-menu-button"]);
-  } else {
-    ICON_INFO.unshift(["bookmark_star", "#bookmarks-menu-button", "bookmarks-menu-button"]);
-    ICON_INFO.unshift(["bookmark_menu", "#bookmarks-menu-button > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon"]);
-  }
+  ICON_INFO.unshift(["bookmark_star", "#star-button"]);
+  ICON_INFO.unshift(["bookmark_menu", "#bookmarks-menu-button", "bookmarks-menu-button"]);
 
   window.maximize();
 
   for (let button of ICON_INFO) {
     if (button[2]) {
       CustomizableUI.addWidgetToArea(button[2], CustomizableUI.AREA_NAVBAR);
     }
 
--- a/browser/components/places/tests/browser/browser_library_batch_delete.js
+++ b/browser/components/places/tests/browser/browser_library_batch_delete.js
@@ -59,17 +59,17 @@ add_task(async function test_create_and_
      "Delete command is enabled");
   let promiseItemRemovedNotification = promiseBookmarksNotification(
     "onItemRemoved", (itemId, parentId, index, type, uri, guid) => guid == folderNode.bookmarkGuid);
   // Execute the delete command and check bookmark has been removed.
   PO._places.controller.doCommand("cmd_delete");
 
   await promiseItemRemovedNotification;
 
-  Assert.ok(!PlacesUtils.bookmarks.isBookmarked(testURI),
+  Assert.ok(!(await PlacesUtils.bookmarks.fetch({url: testURI})),
     "Bookmark has been correctly removed");
   // Test live update.
   Assert.equal(unsortedNode.childCount, 1, "Unsorted node has 1 child");
   Assert.equal(PO._places.selectedNode.title, "keepme", "Folder node selected");
   unsortedNode.containerOpen = false;
 });
 
 add_task(async function test_ensure_correct_selection_and_functionality() {
--- a/browser/components/places/tests/browser/browser_toolbarbutton_menu_context.js
+++ b/browser/components/places/tests/browser/browser_toolbarbutton_menu_context.js
@@ -13,19 +13,16 @@ add_task(async function testPopup() {
   CustomizableUI.addWidgetToArea("bookmarks-menu-button", target);
   CustomizableUI.addWidgetToArea("bookmarks-menu-button", CustomizableUI.AREA_NAVBAR, pos);
   info("Checking popup context menu after moving the bookmarks button");
   await checkPopupContextMenu();
 });
 
 async function checkPopupContextMenu() {
   let clickTarget = bookmarksMenuButton;
-  if (!AppConstants.MOZ_PHOTON_THEME) {
-    clickTarget = document.getAnonymousElementByAttribute(bookmarksMenuButton, "anonid", "dropmarker");
-  }
   BMB_menuPopup.setAttribute("style", "transition: none;");
   let popupShownPromise = onPopupEvent(BMB_menuPopup, "shown");
   EventUtils.synthesizeMouseAtCenter(clickTarget, {});
   info("Waiting for bookmarks menu to be shown.");
   await popupShownPromise;
   let contextMenuShownPromise = onPopupEvent(contextMenu, "shown");
   EventUtils.synthesizeMouseAtCenter(BMB_showAllBookmarks, {type: "contextmenu", button: 2 });
   info("Waiting for context menu on bookmarks menu to be shown.");
--- a/browser/extensions/formautofill/.eslintrc.js
+++ b/browser/extensions/formautofill/.eslintrc.js
@@ -116,13 +116,10 @@ module.exports = {
     // Require "use strict" to be defined globally in the script.
     "strict": ["error", "global"],
 
     // Disallow Yoda conditions (where literal value comes first).
     "yoda": "error",
 
     // Disallow function or variable declarations in nested blocks
     "no-inner-declarations": "error",
-
-    // Disallow creating new instances of String, Number, and Boolean
-    "no-new-wrappers": "error",
   },
 };
--- a/browser/extensions/formautofill/FormAutofillHeuristics.jsm
+++ b/browser/extensions/formautofill/FormAutofillHeuristics.jsm
@@ -350,16 +350,26 @@ this.FormAutofillHeuristics = {
           labelStrings.push(...FormAutofillUtils.extractLabelStrings(label));
         }
       }
       yield *labelStrings;
     };
 
     for (let regexp of regexps) {
       for (let string of getElementStrings) {
+        // The original regexp "(?<!united )state|county|region|province" for
+        // "address-line1" wants to exclude any "united state" string, so the
+        // following code is to remove all "united state" string before applying
+        // "addess-level1" regexp.
+        //
+        // Since "united state" string matches to the regexp of address-line2&3,
+        // the two regexps should be excluded here.
+        if (["address-level1", "address-line2", "address-line3"].includes(regexp)) {
+          string = string.toLowerCase().split("united state").join("");
+        }
         if (this.RULES[regexp].test(string)) {
           return {
             fieldName: regexp,
             section: "",
             addressType: "",
             contactType: "",
           };
         }
--- a/browser/extensions/formautofill/content/heuristicsRegexp.js
+++ b/browser/extensions/formautofill/content/heuristicsRegexp.js
@@ -116,18 +116,18 @@ var HeuristicsRegExp = {
       "|cidade" + // pt-BR, pt-PT
       "|Город" + // ru
       "|市" + // zh-CN
       "|分區" + // zh-TW
       "|^시[^도·・]|시[·・]?군[·・]?구",  // ko-KR
       "iu"
     ),
     "address-level1": new RegExp(
-      // TODO: [Bug 1358960] JS does not support backward matching, and we
-      // should apply this pattern in JS rather than regexp.
+      // JS does not support backward matching, so the following pattern is
+      // applied in FormAutofillHeuristics.getInfo() rather than regexp.
       // "(?<!united )state|county|region|province"
       "state|county|region|province" +
       "|land" + // de-DE
       "|county|principality" + // en-UK
       "|都道府県" + // ja-JP
       "|estado|provincia" + // pt-BR, pt-PT
       "|область" + // ru
       "|省" + // zh-CN
--- a/browser/extensions/formautofill/test/unit/test_getInfo.js
+++ b/browser/extensions/formautofill/test/unit/test_getInfo.js
@@ -186,16 +186,50 @@ const TESTCASES = [
     elementId: "targetElement",
     expectedReturnValue: {
       fieldName: "email",
       section: "",
       addressType: "",
       contactType: "",
     },
   },
+  {
+    description: "Exclude United State string",
+    document: `<label>United State
+                 <input id="targetElement" />
+               </label>`,
+    elementId: "targetElement",
+    expectedReturnValue: null,
+  },
+  {
+    description: "\"County\" field with \"United State\" string",
+    document: `<label>United State County
+                 <input id="targetElement" />
+               </label>`,
+    elementId: "targetElement",
+    expectedReturnValue: {
+      fieldName: "address-level1",
+      section: "",
+      addressType: "",
+      contactType: "",
+    },
+  },
+  {
+    description: "\"city\" field with double \"United State\" string",
+    document: `<label>United State united sTATE city
+                 <input id="targetElement" />
+               </label>`,
+    elementId: "targetElement",
+    expectedReturnValue: {
+      fieldName: "address-level2",
+      section: "",
+      addressType: "",
+      contactType: "",
+    },
+  },
 ];
 
 TESTCASES.forEach(testcase => {
   add_task(async function() {
     do_print("Starting testcase: " + testcase.description);
 
     let doc = MockDocument.createTestDocument(
       "http://localhost:8080/test/", testcase.document);
--- a/browser/extensions/pocket/bootstrap.js
+++ b/browser/extensions/pocket/bootstrap.js
@@ -156,18 +156,17 @@ function isPocketEnabled() {
          !!CustomizableUI.getPlacementOfWidget("pocket-button");
 }
 
 var PocketPageAction = {
   pageAction: null,
 
   get shouldUse() {
     return !Services.prefs.getBranch(PREF_BRANCH)
-                    .getBoolPref("disablePageAction", false) &&
-           AppConstants.MOZ_PHOTON_THEME;
+                    .getBoolPref("disablePageAction", false);
   },
 
   get enabled() {
     return !!this.pageAction;
   },
 
   init() {
     if (!this.shouldUse) {
--- a/browser/extensions/pocket/jar.mn
+++ b/browser/extensions/pocket/jar.mn
@@ -7,23 +7,23 @@
 % skin pocket classic/1.0 %skin/linux/ os=LikeUnix
 % skin pocket classic/1.0 %skin/osx/ os=Darwin
 % skin pocket classic/1.0 %skin/windows/ os=WINNT
 % skin pocket-shared classic/1.0 %skin/shared/
   content/  (content/*)
   skin/shared (skin/shared/*)
 #ifdef XP_WIN
   skin/windows/ (skin/windows/*.png)
-* skin/windows/pocket.css (skin/windows/pocket.css)
+  skin/windows/pocket.css (skin/windows/pocket.css)
 #elifdef XP_MACOSX
   skin/osx/ (skin/osx/*.png)
-* skin/osx/pocket.css (skin/osx/pocket.css)
+  skin/osx/pocket.css (skin/osx/pocket.css)
 #else
   skin/linux/ (skin/linux/*.png)
-* skin/linux/pocket.css (skin/linux/pocket.css)
+  skin/linux/pocket.css (skin/linux/pocket.css)
 #endif
 
 # windows overrides
 % override chrome://pocket/skin/menuPanel.png             chrome://pocket/skin/menuPanel-aero.png            os=WINNT osversion=6
 % override chrome://pocket/skin/menuPanel.png             chrome://pocket/skin/menuPanel-aero.png            os=WINNT osversion=6.1
 % override chrome://pocket/skin/menuPanel@2x.png          chrome://pocket/skin/menuPanel-aero@2x.png         os=WINNT osversion=6
 % override chrome://pocket/skin/menuPanel@2x.png          chrome://pocket/skin/menuPanel-aero@2x.png         os=WINNT osversion=6.1
 % override chrome://pocket/skin/menuPanel.png             chrome://pocket/skin/menuPanel-yosemite.png        os=Darwin osversion>=10.10
--- a/browser/extensions/pocket/skin/linux/pocket.css
+++ b/browser/extensions/pocket/skin/linux/pocket.css
@@ -1,14 +1,10 @@
 @import url("chrome://pocket-shared/skin/pocket.css");
 
 #nav-bar #pocket-button > .toolbarbutton-icon {
-%ifndef MOZ_PHOTON_THEME
-  padding: 2px 6px;
-%else
   padding: calc(var(--toolbarbutton-inner-padding) - 1px);
-%endif
 }
 
 :-moz-any(#TabsToolbar, .widget-overflow-list) #pocket-button > .toolbarbutton-icon {
     max-width: 18px;
     padding: 0;
 }
--- a/browser/extensions/pocket/skin/osx/pocket.css
+++ b/browser/extensions/pocket/skin/osx/pocket.css
@@ -1,13 +1,9 @@
 @import url("chrome://pocket-shared/skin/pocket.css");
 
 #nav-bar #pocket-button > .toolbarbutton-icon {
-%ifndef MOZ_PHOTON_THEME
-  padding: var(--toolbarbutton-inner-padding) 6px;
-%else
   padding: calc(var(--toolbarbutton-inner-padding) - 1px);
-%endif
 }
 
 #PanelUI-pocketView[mainview=true] > .panel-subview-body > #pocket-panel-iframe {
   border-radius: var(--arrowpanel-border-radius);
 }
--- a/browser/extensions/pocket/skin/windows/pocket.css
+++ b/browser/extensions/pocket/skin/windows/pocket.css
@@ -1,14 +1,10 @@
 @import url("chrome://pocket-shared/skin/pocket.css");
 
 #nav-bar #pocket-button > .toolbarbutton-icon {
-%ifndef MOZ_PHOTON_THEME
-  padding: var(--toolbarbutton-inner-padding) 6px;
-%else
   padding: calc(var(--toolbarbutton-inner-padding) - 1px);
-%endif
 }
 
 :-moz-any(#TabsToolbar, .widget-overflow-list) #pocket-button > .toolbarbutton-icon {
     max-width: 18px;
     padding: 0;
 }
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -412,18 +412,16 @@ refreshBlocked.redirectLabel=%S prevente
 
 # General bookmarks button
 # LOCALIZATION NOTE (bookmarksMenuButton.tooltip):
 # %S is the keyboard shortcut for "Show All Bookmarks"
 bookmarksMenuButton.tooltip=Show your bookmarks (%S)
 # Star button
 starButtonOn.tooltip2=Edit this bookmark (%S)
 starButtonOff.tooltip2=Bookmark this page (%S)
-starButtonOverflowed.label=Bookmark This Page
-starButtonOverflowedStarred.label=Edit This Bookmark
 
 # Downloads button tooltip
 # LOCALIZATION NOTE (downloads.tooltip):
 # %S is the keyboard shortcut for "Downloads"
 downloads.tooltip=Display the progress of ongoing downloads (%S)
 
 # Print button tooltip on OS X
 # LOCALIZATION NOTE (printButton.tooltip):
--- a/browser/modules/PageActions.jsm
+++ b/browser/modules/PageActions.jsm
@@ -30,20 +30,16 @@ const ACTION_ID_BUILT_IN_SEPARATOR = "bu
 const PREF_PERSISTED_ACTIONS = "browser.pageActions.persistedActions";
 
 
 this.PageActions = {
   /**
    * Inits.  Call to init.
    */
   init() {
-    if (!AppConstants.MOZ_PHOTON_THEME) {
-      return;
-    }
-
     let callbacks = this._deferredAddActionCalls;
     delete this._deferredAddActionCalls;
 
     this._loadPersistedActions();
 
     // Add the built-in actions, which are defined below in this file.
     for (let options of gBuiltInActions) {
       if (options._isSeparator || !this.actionForID(options.id)) {
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -18,35 +18,17 @@
   --tabs-border: rgba(0,0,0,.3);
 
   --toolbar-non-lwt-bgcolor: -moz-dialog;
   --toolbar-non-lwt-textcolor: -moz-dialogtext;
   --toolbar-non-lwt-bgimage: linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15));
   --toolbar-bgcolor: var(--toolbar-non-lwt-bgcolor);
   --toolbar-bgimage: var(--toolbar-non-lwt-bgimage);
 
-%ifdef MOZ_PHOTON_THEME
   --toolbarbutton-border-radius: 4px;
-%else
-  --toolbarbutton-border-radius: 1px;
-
-  --backbutton-background: rgba(255,255,255,.15);
-  --backbutton-border-color: var(--urlbar-border-color-hover);
-
-  --toolbarbutton-hover-background: rgba(255,255,255,.5) linear-gradient(rgba(255,255,255,.5), transparent);
-  --toolbarbutton-hover-bordercolor: rgba(0,0,0,.25);
-  --toolbarbutton-hover-boxshadow: none;
-
-  --toolbarbutton-active-background: rgba(154,154,154,.5) linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.4));
-  --toolbarbutton-active-bordercolor: rgba(0,0,0,.3);
-  --toolbarbutton-active-boxshadow: 0 1px 1px rgba(0,0,0,.1) inset, 0 0 1px rgba(0,0,0,.3) inset;
-
-  --toolbarbutton-checkedhover-backgroundcolor: rgba(200,200,200,.5);
-%endif
-
   --toolbarbutton-vertical-text-padding: calc(var(--toolbarbutton-inner-padding) - 1px);
 
   --panel-separator-color: ThreeDShadow;
   --arrowpanel-dimmed: hsla(0,0%,80%,.3);
   --arrowpanel-dimmed-further: hsla(0,0%,80%,.45);
   --arrowpanel-dimmed-even-further: hsla(0,0%,80%,.8);
 
   --urlbar-separator-color: ThreeDShadow;
@@ -274,66 +256,26 @@ menuitem.bookmark-item {
 
 #urlbar {
   /* override textbox[enablehistory="true"] styling: */
   background-color: -moz-field;
 }
 
 %include ../shared/urlbar-searchbar.inc.css
 
-%ifdef MOZ_PHOTON_THEME
-
 #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;
 }
 
-%else
-
-#main-window {
-  --urlbar-border-color: ThreeDShadow;
-  --urlbar-border-color-hover: var(--urlbar-border-color);
-}
-
-#navigator-toolbox:-moz-lwtheme {
-  --urlbar-border-color: rgba(0,0,0,.3);
-}
-
-#urlbar,
-.searchbar-textbox {
-  -moz-appearance: none;
-  padding: 0;
-  border: 1px solid var(--urlbar-border-color);
-  border-radius: 2px;
-  background-clip: padding-box;
-  margin: 0 3px;
-}
-
-#urlbar[focused],
-.searchbar-textbox[focused] {
-  border-color: Highlight;
-}
-
-#urlbar:-moz-lwtheme,
-.searchbar-textbox:-moz-lwtheme {
-  background-color: rgba(255,255,255,.8);
-  color: black;
-}
-
-#urlbar:-moz-lwtheme[focused=true],
-.searchbar-textbox:-moz-lwtheme[focused=true] {
-  background-color: white;
-}
-%endif
-
 .urlbar-textbox-container {
   -moz-appearance: none;
   -moz-box-align: stretch;
 }
 .urlbar-input-box {
   margin: 0;
 }
 .urlbar-history-dropmarker {
@@ -343,48 +285,16 @@ menuitem.bookmark-item {
 #urlbar-wrapper[switchingtabs] > #urlbar > .urlbar-textbox-container > .urlbar-history-dropmarker {
   transition: none;
 }
 
 #navigator-toolbox:not(:hover) #nav-bar:not([customizing="true"]) #urlbar:not([focused]) > .urlbar-textbox-container > .urlbar-history-dropmarker {
   opacity: 0;
 }
 
-%ifndef MOZ_PHOTON_THEME
-@conditionalForwardWithUrlbar@ > #urlbar {
-  border-inline-start: none;
-  margin-left: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(ltr) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ {
-  clip-path: url("chrome://browser/content/browser.xul#urlbar-back-button-clip-path");
-  margin-inline-start: calc(-1 * var(--backbutton-urlbar-overlap));
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl),
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  /* let urlbar-back-button-clip-path clip the urlbar's right side for RTL */
-  transform: scaleX(-1);
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl) {
-  -moz-box-direction: reverse;
-}
-%endif
-
 #urlbar-icons {
   -moz-box-align: center;
 }
 
 .urlbar-icon {
   padding: 0 3px;
   /* 16x16 icon with border-box sizing */
   width: 22px;
@@ -729,129 +639,16 @@ html|span.ac-emphasize-text-url {
   color: GrayText;
   font-size: smaller;
 }
 
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* Combined go/reload/stop button in location bar */
-
-#urlbar-go-button,
-#reload-button,
-#stop-button {
-  -moz-appearance: none;
-  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
-  padding: 0 9px;
-  margin-inline-start: 5px;
-  border-inline-start: 1px solid var(--urlbar-separator-color);
-  border-image: linear-gradient(transparent 15%,
-                                var(--urlbar-separator-color) 15%,
-                                var(--urlbar-separator-color) 85%,
-                                transparent 85%);
-  border-image-slice: 1;
-}
-
-#reload-button {
-  -moz-image-region: rect(0, 14px, 14px, 0);
-}
-
-#reload-button:not([disabled]):hover {
-  -moz-image-region: rect(14px, 14px, 28px, 0);
-}
-
-#reload-button:not([disabled]):hover:active {
-  -moz-image-region: rect(28px, 14px, 42px, 0);
-}
-
-#reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#urlbar-go-button {
-  -moz-image-region: rect(0, 42px, 14px, 28px);
-}
-
-#urlbar-go-button:hover {
-  -moz-image-region: rect(14px, 42px, 28px, 28px);
-}
-
-#urlbar-go-button:hover:active {
-  -moz-image-region: rect(28px, 42px, 42px, 28px);
-}
-
-#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#stop-button {
-  -moz-image-region: rect(0, 28px, 14px, 14px);
-}
-
-#stop-button:not([disabled]):hover {
-  -moz-image-region: rect(14px, 28px, 28px, 14px);
-}
-
-#stop-button:hover:active {
-  -moz-image-region: rect(28px, 28px, 42px, 14px);
-}
-
-@media (min-resolution: 1.1dppx) {
-  #urlbar-go-button,
-  #reload-button,
-  #stop-button {
-    list-style-image: url("chrome://browser/skin/reload-stop-go@2x.png");
-  }
-
-  #urlbar-go-button > .toolbarbutton-icon,
-  #reload-button > .toolbarbutton-icon,
-  #stop-button > .toolbarbutton-icon {
-    width: 14px;
-  }
-
-  #urlbar-go-button {
-    -moz-image-region: rect(0, 84px, 28px, 56px);
-  }
-
-  #urlbar-go-button:hover {
-    -moz-image-region: rect(28px, 84px, 56px, 56px);
-  }
-
-  #urlbar-go-button:hover:active {
-    -moz-image-region: rect(56px, 84px, 84px, 56px);
-  }
-
-  #reload-button {
-    -moz-image-region: rect(0, 28px, 28px, 0);
-  }
-
-  #reload-button:not([disabled]):hover {
-    -moz-image-region: rect(28px, 28px, 56px, 0);
-  }
-
-  #reload-button:not([disabled]):hover:active {
-    -moz-image-region: rect(56px, 28px, 84px, 0);
-  }
-
-  #stop-button {
-    -moz-image-region: rect(0, 56px, 28px, 28px);
-  }
-
-  #stop-button:not([disabled]):hover {
-    -moz-image-region: rect(28px, 56px, 56px, 28px);
-  }
-
-  #stop-button:hover:active {
-    -moz-image-region: rect(56px, 56px, 84px, 28px);
-  }
-}
-%endif
-
 /* Popup blocker button */
 #page-report-button {
   list-style-image: url("chrome://browser/skin/Info.png");
 }
 
 /* Reader mode button */
 
 #reader-mode-button {
@@ -1108,58 +905,16 @@ toolbarbutton.chevron > .toolbarbutton-i
   border-radius: 1px;
   margin-inline-end: 2px;
 }
 
 /* Customization mode */
 
 %include ../shared/customizableui/customizeMode.inc.css
 
-%ifndef MOZ_PHOTON_THEME
-#main-window[customize-entered] > #tab-view-deck {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
-                    linear-gradient(to bottom, #bcbcbc, #b5b5b5);
-  background-attachment: fixed;
-}
-
-#main-window[customization-lwtheme]:-moz-lwtheme {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
-                    url("chrome://browser/skin/customizableui/background-noise-toolbar.png"),
-                    linear-gradient(to bottom, #bcbcbc, #b5b5b5);
-  background-color: #b5b5b5;
-  background-repeat: repeat;
-  background-attachment: fixed;
-  background-position: left top;
-}
-
-#main-window[customize-entered] #browser-bottombox,
-#main-window[customize-entered] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar),
-#main-window[customize-entered] #customization-container {
-  border: 3px solid hsla(0,0%,0%,.1);
-  border-top-width: 0;
-  background-clip: padding-box;
-  background-origin: padding-box;
-  -moz-border-right-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-  -moz-border-bottom-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-  -moz-border-left-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-}
-
-#main-window[customize-entered] #customization-container,
-#main-window[customize-entered] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
-  border-bottom-width: 0;
-}
-
-#main-window[customize-entered] #TabsToolbar {
-  -moz-appearance: none;
-  background-clip: padding-box;
-  border-right: 3px solid transparent;
-  border-left: 3px solid transparent;
-}
-%endif
-
 /* End customization mode */
 
 
 #main-window[privatebrowsingmode=temporary] #private-browsing-indicator {
   background: url("chrome://browser/skin/privatebrowsing-mask.png") center no-repeat;
   width: 40px;
 }
 
deleted file mode 100644
index d09ba9dafb5ede66e92ce577ecaa6f9575dba104..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a7c2775cfc799da31a505b249f5a59b89c148a58..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 5e17cb4db08e310e6c3a9e14c5bd722772dfb639..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index dc4caee812878f246c87d71093768eb36c5656fc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/linux/jar.mn
+++ b/browser/themes/linux/jar.mn
@@ -26,22 +26,16 @@ browser.jar:
   skin/classic/browser/privatebrowsing-mask.png
   skin/classic/browser/reload-stop-go.png
   skin/classic/browser/reload-stop-go@2x.png
   skin/classic/browser/searchbar.css
   skin/classic/browser/setDesktopBackground.css
   skin/classic/browser/slowStartup-16.png
   skin/classic/browser/webRTC-indicator.css  (../shared/webRTC-indicator.css)
 * skin/classic/browser/controlcenter/panel.css        (controlcenter/panel.css)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/customizableui/background-noise-toolbar.png  (customizableui/background-noise-toolbar.png)
-  skin/classic/browser/customizableui/customizeMode-gridTexture.png  (customizableui/customizeMode-gridTexture.png)
-  skin/classic/browser/customizableui/customizeMode-separatorHorizontal.png  (customizableui/customizeMode-separatorHorizontal.png)
-  skin/classic/browser/customizableui/customizeMode-separatorVertical.png  (customizableui/customizeMode-separatorVertical.png)
-#endif
 * skin/classic/browser/customizableui/panelUI.css (customizableui/panelUI.css)
 * skin/classic/browser/downloads/allDownloadsViewOverlay.css   (downloads/allDownloadsViewOverlay.css)
   skin/classic/browser/downloads/download-glow-menuPanel.png (downloads/download-glow-menuPanel.png)
 * skin/classic/browser/downloads/downloads.css        (downloads/downloads.css)
   skin/classic/browser/feeds/feedIcon.png             (feeds/feedIcon.png)
   skin/classic/browser/feeds/feedIcon16.png           (feeds/feedIcon16.png)
   skin/classic/browser/feeds/subscribe.css            (feeds/subscribe.css)
 * skin/classic/browser/newtab/newTab.css              (newtab/newTab.css)
deleted file mode 100644
index aab0a02c84d63603ec1fc3a385a08c5cf5360fd2..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -18,42 +18,17 @@
 
   --toolbar-non-lwt-bgcolor: #f9f9fa;
   --toolbar-non-lwt-textcolor: #0c0c0d;
   --toolbar-non-lwt-bgimage: none;
   --toolbar-bgcolor: var(--toolbar-non-lwt-bgcolor);
   --toolbar-bgimage: var(--toolbar-non-lwt-bgimage);
 
   --toolbarbutton-vertical-text-padding: calc(var(--toolbarbutton-inner-padding) + 1px);
-
-%ifdef MOZ_PHOTON_THEME
   --toolbarbutton-border-radius: 4px;
-%else
-  --space-above-tabbar: 9px;
-
-  --toolbarbutton-border-radius: 3px;
-
-  --toolbarbutton-hover-background: hsla(0,0%,100%,.1) linear-gradient(hsla(0,0%,100%,.3), hsla(0,0%,100%,.1)) padding-box;
-  --toolbarbutton-active-background: hsla(0,0%,0%,.02) linear-gradient(hsla(0,0%,0%,.12), transparent) border-box;
-
-  --backbutton-border-color: rgba(0,0,0,0.2);
-  --backbutton-background: linear-gradient(rgba(255,255,255,0.9),
-                                           rgba(255,255,255,0.7)) repeat-x;
-
-  --toolbarbutton-hover-bordercolor: hsla(0,0%,0%,.2);
-  --toolbarbutton-hover-boxshadow: 0 1px 0 hsla(0,0%,100%,.5),
-                                   0 1px 0 hsla(0,0%,100%,.5) inset;
-
-  --toolbarbutton-active-bordercolor: hsla(0,0%,0%,.3);
-  --toolbarbutton-active-boxshadow: 0 1px 0 hsla(0,0%,100%,.5),
-                                    0 1px 0 hsla(0,0%,0%,.05) inset,
-                                    0 1px 1px hsla(0,0%,0%,.2) inset;
-
-  --toolbarbutton-checkedhover-backgroundcolor: hsla(0,0%,0%,.09);
-%endif
 
   --urlbar-dropmarker-url: url("chrome://browser/skin/urlbar-history-dropmarker.png");
   --urlbar-dropmarker-region: rect(0, 11px, 14px, 0);
   --urlbar-dropmarker-active-region: rect(0, 22px, 14px, 11px);
   --urlbar-dropmarker-2x-url: url("chrome://browser/skin/urlbar-history-dropmarker@2x.png");
   --urlbar-dropmarker-2x-region: rect(0, 22px, 28px, 0);
   --urlbar-dropmarker-active-2x-region: rect(0, 44px, 28px, 22px);
 
@@ -65,30 +40,16 @@
   --urlbar-separator-color: hsla(0,0%,16%,.2);
 }
 
 :root:-moz-lwtheme {
   --toolbar-bgcolor: rgba(255,255,255,.4);
   --toolbar-bgimage: none;
 }
 
-%ifndef MOZ_PHOTON_THEME
-toolbar:-moz-lwtheme {
-  --backbutton-background: linear-gradient(rgba(255,255,255,0.5),
-                              rgba(255,255,255,0.2) 50%,
-                              rgba(255,255,255,0.1) 50%,
-                              rgba(255,255,255,0.2)) repeat-x;
-}
-
-#urlbar:-moz-lwtheme:not([focused="true"]),
-.searchbar-textbox:-moz-lwtheme:not([focused="true"]) {
-  opacity: .9;
-}
-%endif
-
 #navigator-toolbox::after {
   -moz-box-ordinal-group: 101; /* tabs toolbar is 100 */
   content: "";
   display: -moz-box;
   border-top: 1px solid hsla(0,0%,100%,.15);
   border-bottom: 1px solid hsla(0,0%,0%,.15);
   margin-top: -2px;
   position: relative;
@@ -144,127 +105,59 @@ toolbar:-moz-lwtheme {
   height: 22px; /* The native titlebar on OS X is 22px tall. */
 }
 
 /**
  * For tabs in titlebar on OS X, we stretch the titlebar down so that the
  * tabstrip can overlap it.
  */
 #main-window[tabsintitlebar] > #titlebar {
-%ifndef MOZ_PHOTON_THEME
-  min-height: calc(var(--tab-min-height) + var(--space-above-tabbar) - var(--tab-toolbar-navbar-overlap));
-%else
   min-height: calc(var(--tab-min-height) - var(--tab-toolbar-navbar-overlap));
-%endif
 }
 
 /**
  * We also vertically center the window buttons.
  */
 #titlebar-buttonbox-container {
   -moz-box-align: start;
 }
 
 #main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-buttonbox-container,
 #main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
-%ifdef MOZ_PHOTON_THEME
   margin-top: 6px;
-%else
-  margin-top: 11px;
-%endif
 }
 
 #main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-buttonbox-container,
 #main-window:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
   margin-top: 3px;
 }
 
-%ifndef MOZ_PHOTON_THEME
-#main-window[customize-entered] > #titlebar {
-  -moz-appearance: none;
-}
-%endif
-
 /** End titlebar **/
 
 #main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
   border-top: 1px solid rgba(0,0,0,0.65);
 }
 
-%ifdef MOZ_PHOTON_THEME
 #navigator-toolbox > toolbar:not(#TabsToolbar) {
   -moz-appearance: none;
   background: var(--toolbar-bgcolor);
 }
-%else
-#navigator-toolbox > toolbar:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
-  -moz-appearance: none;
-  background: url(chrome://browser/skin/Toolbar-background-noise.png) hsl(0,0%,83%);
-}
-
-/* remove noise texture on Yosemite */
-@media (-moz-mac-yosemite-theme) {
-  #navigator-toolbox > toolbar:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
-    background-image: none;
-  }
-
-  #navigator-toolbox > toolbar:-moz-window-inactive:not(#TabsToolbar):not(#nav-bar):not(:-moz-lwtheme) {
-    background-color: hsl(0,0%,95%);
-  }
-}
-%endif
 
 #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar) {
   overflow: -moz-hidden-unscrollable;
   max-height: 4em;
   transition: min-height 170ms ease-out, max-height 170ms ease-out;
 }
 
 #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar)[collapsed=true] {
   min-height: 0.1px;
   max-height: 0;
   transition: min-height 170ms ease-out, max-height 170ms ease-out, visibility 170ms linear;
 }
 
-%ifndef MOZ_PHOTON_THEME
-#nav-bar {
-  -moz-appearance: none;
-  background: url(chrome://browser/skin/Toolbar-background-noise.png),
-              linear-gradient(hsl(0,0%,93%), hsl(0,0%,83%));
-  background-clip: border-box;
-  background-origin: border-box !important;
-
-  /* Move the noise texture out of the top 1px strip because that overlaps
-     with the tabbar and we don't want to repaint it when animating tabs.
-     The noise image is at least 100px high, so repeating it only horizontally
-     is enough. */
-  background-repeat: repeat-x, no-repeat;
-  background-position: 0 1px, 0 0;
-
-  box-shadow: inset 0 1px 0 hsla(0,0%,100%,.4);
-}
-
-@media (min-resolution: 2dppx) {
-  #nav-bar {
-    background-size: 100px 100px, auto;
-  }
-}
-
-/* remove noise texture on Yosemite */
-@media (-moz-mac-yosemite-theme) {
-  #nav-bar {
-    background: linear-gradient(hsl(0,0%,93%), hsl(0,0%,83%));
-  }
-
-  #nav-bar:-moz-window-inactive {
-    background: linear-gradient(hsl(0,0%,97%), hsl(0,0%,95%));
-  }
-}
-%endif
-
 /* Draw the bottom border of the tabs toolbar when it's not using
    -moz-appearance: toolbar. */
 #main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
 #main-window:not([tabsintitlebar]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
 #TabsToolbar:not([collapsed="true"]) + #nav-bar:-moz-lwtheme {
   border-top: 1px solid var(--tabs-border);
   background-clip: padding-box;
   /* Position the toolbar above the bottom of background tabs */
@@ -301,23 +194,16 @@ toolbar:-moz-lwtheme {
   padding: 0 4px 4px;
 }
 
 #PersonalToolbar:not([collapsed=true]) {
   /* 4px padding ^  plus 19px personal-bookmarks (see below) */
   min-height: 23px;
 }
 
-%ifndef MOZ_PHOTON_THEME
-#navigator-toolbox > toolbar:not(#TabsToolbar):-moz-lwtheme {
-  background-color: @toolbarColorLWT@;
-  background-image: url(chrome://browser/skin/Toolbar-background-noise.png);
-}
-%endif
-
 #PersonalToolbar:not(:-moz-lwtheme):-moz-window-inactive,
 #nav-bar:not(:-moz-lwtheme):-moz-window-inactive {
   background-color: -moz-mac-chrome-inactive;
 }
 
 /* ----- BOOKMARK TOOLBAR ----- */
 
 #personal-bookmarks {
@@ -537,157 +423,41 @@ toolbarpaletteitem[place="palette"] > #p
   list-style-image: url("chrome://browser/skin/menu-back.png") !important;
 }
 
 .unified-nav-forward[_moz-menuactive]:-moz-locale-dir(ltr),
 .unified-nav-back[_moz-menuactive]:-moz-locale-dir(rtl) {
   list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
 }
 
-%ifndef MOZ_PHOTON_THEME
-@media (-moz-mac-yosemite-theme) {
-  #forward-button > .toolbarbutton-icon {
-    border-top: none !important;
-    border-bottom: none !important;
-    box-shadow: 0 .5px 0 0 rgba(0,0,0,0.2) !important;
-  }
-  #forward-button:-moz-window-inactive > .toolbarbutton-icon {
-    box-shadow: 0 1px 0 0 rgba(0,0,0,0.2) inset,
-                0 -1px 0 0 rgba(0,0,0,0.2) inset !important;
-  }
-}
-%endif
-
 /* ----- FULLSCREEN WINDOW CONTROLS ----- */
 
 #minimize-button,
 #close-button,
 #fullscreen-button ~ #window-controls > #restore-button {
   display: none;
 }
 
 /* ::::: nav-bar-inner ::::: */
 
 %include ../shared/urlbar-searchbar.inc.css
 
-%ifdef MOZ_PHOTON_THEME
-
 #urlbar,
 .searchbar-textbox {
   font-size: 1.25em;
 }
 
 #urlbar[focused="true"],
 .searchbar-textbox[focused="true"] {
   border-color: -moz-mac-focusring;
   box-shadow: var(--focus-ring-box-shadow);
 }
 
-%else
-
-#urlbar,
-.searchbar-textbox {
-  font: icon;
-  -moz-appearance: none;
-  box-shadow: 0 1px 0 hsla(0,0%,100%,.2),
-              inset 0 0 1px hsla(0,0%,0%,.05),
-              inset 0 1px 2px hsla(0,0%,0%,.1);
-  margin: 0 4px;
-  padding: 1px 0;
-  border: 1px solid;
-  background-image: linear-gradient(hsl(0,0%,97%), hsl(0,0%,100%));
-  border-color: hsla(0,0%,0%,.35) hsla(0,0%,0%,.25) hsla(0,0%,0%,.15);
-  background-clip: padding-box;
-}
-
-#urlbar[readonly] {
-  background-color: -moz-field;
-}
-
-@media (-moz-mac-yosemite-theme) {
-  .searchbar-textbox,
-  #urlbar {
-    border-color: #fff;
-    border-radius: 3px;
-    box-shadow: 0 .5px 0 0 rgba(0,0,0,0.2);
-    background-image: none;
-  }
-  .searchbar-textbox:-moz-window-inactive,
-  #urlbar:-moz-window-inactive {
-    box-shadow: none;
-    border-color: rgba(0,0,0,0.1);
-  }
-}
-
-#urlbar[focused="true"],
-.searchbar-textbox[focused="true"] {
-  border-color: -moz-mac-focusring;
-  box-shadow: var(--focus-ring-box-shadow);
-}
-
-#urlbar {
-  border-radius: var(--toolbarbutton-border-radius);
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar {
-  border-inline-start: none;
-  margin-left: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(ltr) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ {
-  clip-path: url("chrome://browser/content/browser.xul#urlbar-back-button-clip-path");
-  margin-inline-start: calc(-1 * var(--backbutton-urlbar-overlap));
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl),
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  /* let urlbar-back-button-clip-path clip the urlbar's right side for RTL */
-  transform: scaleX(-1);
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl) {
-  -moz-box-direction: reverse;
-}
-%endif
-
 %include ../shared/identity-block/identity-block.inc.css
 
-%ifndef MOZ_PHOTON_THEME
-#identity-box {
-  padding-top: 2px;
-  padding-bottom: 2px;
-}
-
-#urlbar:not([focused="true"]) > #identity-box {
-  margin-top: -1px;
-  margin-bottom: -1px;
-  padding-top: 3px;
-  padding-bottom: 3px;
-}
-
-@media (-moz-mac-yosemite-theme) {
-  #urlbar:not([focused="true"]):not(:-moz-window-inactive) > #identity-box {
-    margin-top: -2px;
-    margin-bottom: -2px;
-    padding-top: 4px;
-    padding-bottom: 4px;
-  }
-}
-%endif
-
 #identity-box:-moz-locale-dir(ltr) {
   border-top-left-radius: 2px;
   border-bottom-left-radius: 2px;
 }
 
 #identity-box:-moz-locale-dir(rtl) {
   border-top-right-radius: 2px;
   border-bottom-right-radius: 2px;
@@ -920,106 +690,16 @@ html|span.ac-emphasize-text-url {
   color: GrayText;
   font-size: smaller;
 }
 
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
-
-%ifndef MOZ_PHOTON_THEME
-/* ----- COMBINED GO/RELOAD/STOP BUTTON IN LOCATION BAR ----- */
-
-#urlbar-go-button,
-#reload-button,
-#stop-button {
-  margin: 0;
-  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
-  padding: 0 9px;
-  margin-inline-start: 5px;
-  border-inline-start: 1px solid var(--urlbar-separator-color);
-  border-image: linear-gradient(transparent 15%,
-                                var(--urlbar-separator-color) 15%,
-                                var(--urlbar-separator-color) 85%,
-                                transparent 85%);
-  border-image-slice: 1;
-}
-
-#urlbar-go-button {
-  -moz-image-region: rect(0, 42px, 14px, 28px);
-}
-
-#urlbar-go-button:hover:active {
-  -moz-image-region: rect(14px, 42px, 28px, 28px);
-}
-
-#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#reload-button {
-  -moz-image-region: rect(0, 14px, 14px, 0);
-}
-
-#reload-button:not([disabled]):hover:active {
-  -moz-image-region: rect(14px, 14px, 28px, 0);
-}
-
-#reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#stop-button {
-  -moz-image-region: rect(0, 28px, 14px, 14px);
-}
-
-#stop-button:hover:active {
-  -moz-image-region: rect(14px, 28px, 28px, 14px);
-}
-
-@media (min-resolution: 2dppx) {
-  #urlbar-go-button,
-  #reload-button,
-  #stop-button {
-    list-style-image: url("chrome://browser/skin/reload-stop-go@2x.png");
-  }
-
-  #urlbar-go-button > .toolbarbutton-icon,
-  #reload-button > .toolbarbutton-icon,
-  #stop-button > .toolbarbutton-icon {
-    width: 14px;
-  }
-
-  #urlbar-go-button {
-    -moz-image-region: rect(0, 84px, 28px, 56px);
-  }
-
-  #urlbar-go-button:hover:active {
-    -moz-image-region: rect(28px, 84px, 56px, 56px);
-  }
-
-  #reload-button {
-    -moz-image-region: rect(0, 28px, 28px, 0);
-  }
-
-  #reload-button:not([disabled]):hover:active {
-    -moz-image-region: rect(28px, 28px, 56px, 0);
-  }
-
-  #stop-button {
-    -moz-image-region: rect(0, 56px, 28px, 28px);
-  }
-
-  #stop-button:hover:active {
-    -moz-image-region: rect(28px, 56px, 56px, 28px);
-  }
-}
-%endif
-
 #BMB_bookmarksPopup[side="top"],
 #BMB_bookmarksPopup[side="bottom"] {
   margin-left: -26px;
   margin-right: -26px;
 }
 
 #BMB_bookmarksPopup[side="left"],
 #BMB_bookmarksPopup[side="right"] {
@@ -1457,21 +1137,17 @@ toolbarbutton.chevron > .toolbarbutton-m
 
 .tabbrowser-tab {
   font: message-box;
   border: none;
 }
 
 .tabbrowser-tab[visuallyselected=true]:not(:-moz-lwtheme) {
   /* overriding tabbox.css */
-%ifdef MOZ_PHOTON_THEME
   color: hsl(240, 5%, 5%);
-%else
-  color: inherit;
-%endif
 }
 
 .tabbrowser-tab[visuallyselected=true] {
   /* overriding tabbox.css */
   text-shadow: inherit;
 }
 
 .tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label-container:not([pinned]),
@@ -1481,43 +1157,31 @@ toolbarbutton.chevron > .toolbarbutton-m
 }
 
 #TabsToolbar {
   -moz-appearance: none;
   /* overlap the nav-bar's top border */
   margin-bottom: calc(-1 * var(--tab-toolbar-navbar-overlap));
 }
 
-%ifndef MOZ_PHOTON_THEME
-#main-window:not([customizing]) #navigator-toolbox[inFullscreen] > #TabsToolbar:not(:-moz-lwtheme),
-#main-window:not(:-moz-any([customizing],[tabsintitlebar])) #navigator-toolbox > #TabsToolbar:not(:-moz-lwtheme) {
-%else
 :root:not([customizing]):not([tabsintitlebar]):not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
-%endif
   -moz-appearance: toolbar;
 }
 
 #TabsToolbar:not(:-moz-lwtheme) {
   color: #333;
   text-shadow: @loweredShadow@;
 }
 
-%ifdef MOZ_PHOTON_THEME
 :root:-moz-any([inFullscreen], [tabsintitlebar]) #TabsToolbar:not(:-moz-lwtheme) {
   -moz-appearance: -moz-mac-vibrancy-dark;
   color: hsl(240, 9%, 98%);
   text-shadow: none;
 }
-%endif
 
-%ifndef MOZ_PHOTON_THEME
-#navigator-toolbox[inFullscreen] > #TabsToolbar {
-  padding-top: var(--space-above-tabbar);
-}
-%endif
 #tabbrowser-tabs {
   -moz-box-align: stretch;
 }
 
 /**
  * Tab Drag and Drop
  */
 
@@ -1858,104 +1522,16 @@ html|*.addon-webext-perm-list {
   border-top-left-radius: inherit;
   border-top-right-radius: inherit;
 }
 
 /* Customization mode */
 
 %include ../shared/customizableui/customizeMode.inc.css
 
-%ifndef MOZ_PHOTON_THEME
-#main-window[customizing] {
-  background-color: rgb(178,178,178);
-}
-
-#main-window[tabsintitlebar][customize-entered] > #titlebar,
-#main-window[privatebrowsingmode=temporary]:not([tabsintitlebar])[customize-entered] > #titlebar,
-#main-window[customize-entered] > #tab-view-deck {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
-                    url("chrome://browser/skin/customizableui/background-noise-toolbar.png"),
-                    linear-gradient(to bottom, rgb(233,233,233), rgb(178,178,178) 40px);
-  background-attachment: fixed;
-}
-
-#main-window[tabsintitlebar][customization-lwtheme] > #titlebar:-moz-lwtheme {
-  background-repeat: no-repeat;
-  background-position: right top;
-  background-attachment: fixed;
-  background-image: var(--lwt-header-image);
-  background-color: var(--lwt-accent-color);
-}
-
-#main-window[customization-lwtheme]:-moz-lwtheme {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
-                    url("chrome://browser/skin/customizableui/background-noise-toolbar.png");
-  background-color: rgb(178,178,178);
-  background-repeat: repeat;
-  background-attachment: fixed;
-  background-position: left top;
-}
-
-#main-window[customize-entered] #browser-bottombox,
-#main-window[customize-entered] #navigator-toolbox > toolbar:not(#TabsToolbar),
-#main-window[customize-entered] #customization-container {
-  border: 3px solid hsla(0,0%,0%,.1);
-  border-top-width: 0;
-  background-clip: padding-box;
-  background-origin: padding-box;
-  -moz-border-right-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-  -moz-border-bottom-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-  -moz-border-left-colors: hsla(0,0%,0%,.05) hsla(0,0%,0%,.1) hsla(0,0%,0%,.2);
-}
-
-#main-window[customize-entered] #customization-container,
-#main-window[customize-entered] #navigator-toolbox > toolbar:not(#TabsToolbar) {
-  border-bottom-width: 0;
-}
-
-#main-window[customize-entered] #nav-bar {
-  border-top-left-radius: 2.5px;
-  border-top-right-radius: 2.5px;
-}
-
-/* Compensate for the border set above for this horizontal line. */
-#main-window[customize-entered] #navigator-toolbox::after {
-  margin-left: 3px;
-  margin-right: 3px;
-}
-
-#main-window[customize-entered] #TabsToolbar {
-  background-clip: padding-box;
-  border-right: 3px solid transparent;
-  border-left: 3px solid transparent;
-}
-%endif
-
-%ifndef MOZ_PHOTON_THEME
-@media (min-resolution: 2dppx) {
-  .customization-tipPanel-infoBox {
-    background-image: url(chrome://browser/skin/customizableui/info-icon-customizeTip@2x.png);
-    background-size: 25px 25px;
-  }
-
-  .customization-tipPanel-contentImage {
-    list-style-image: url(chrome://browser/skin/customizableui/customize-illustration@2x.png);
-  }
-
-  .customization-tipPanel-contentImage:-moz-locale-dir(rtl) {
-    list-style-image: url(chrome://browser/skin/customizableui/customize-illustration-rtl@2x.png);
-  }
-
-  #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="left"],
-  #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="right"] {
-    list-style-image: url("chrome://browser/skin/customizableui/panelarrow-customizeTip@2x.png");
-  }
-}
-%endif
-
 /* End customization mode */
 
 .private-browsing-indicator {
   background-image: url("chrome://browser/skin/privatebrowsing-mask.png");
   background-repeat: no-repeat;
   background-size: 100% auto;
   width: 38px;
   height: 28px;
@@ -1988,19 +1564,16 @@ html|*.addon-webext-perm-list {
     background-image: url("chrome://browser/skin/privatebrowsing-mask@2x.png");
   }
   #main-window[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
     background-image: url("chrome://browser/skin/privatebrowsing-mask-short@2x.png");
   }
 }
 
 #TabsToolbar > .private-browsing-indicator {
-%ifndef MOZ_PHOTON_THEME
-  transform: translateY(calc(-1 * var(--space-above-tabbar)));
-%endif
   /* We offset by 38px for mask graphic, plus 4px to account for the
    * margin-left, which sums to 42px.
    */
   margin-right: -42px;
 }
 
 #main-window[privatebrowsingmode=temporary] .titlebar-placeholder[type="fullscreen-button"],
 #main-window[privatebrowsingmode=temporary] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button {
deleted file mode 100644
index d09ba9dafb5ede66e92ce577ecaa6f9575dba104..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a7c2775cfc799da31a505b249f5a59b89c148a58..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 5e17cb4db08e310e6c3a9e14c5bd722772dfb639..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index dc4caee812878f246c87d71093768eb36c5656fc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/osx/jar.mn
+++ b/browser/themes/osx/jar.mn
@@ -45,22 +45,16 @@ browser.jar:
   skin/classic/browser/webRTC-sharingDevice-menubar.png
   skin/classic/browser/webRTC-sharingDevice-menubar@2x.png
   skin/classic/browser/webRTC-sharingMicrophone-menubar.png
   skin/classic/browser/webRTC-sharingMicrophone-menubar@2x.png
   skin/classic/browser/webRTC-sharingScreen-menubar.png
   skin/classic/browser/webRTC-sharingScreen-menubar@2x.png
   skin/classic/browser/webRTC-indicator.css
 * skin/classic/browser/controlcenter/panel.css        (controlcenter/panel.css)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/customizableui/background-noise-toolbar.png  (customizableui/background-noise-toolbar.png)
-  skin/classic/browser/customizableui/customizeMode-gridTexture.png  (customizableui/customizeMode-gridTexture.png)
-  skin/classic/browser/customizableui/customizeMode-separatorHorizontal.png  (customizableui/customizeMode-separatorHorizontal.png)
-  skin/classic/browser/customizableui/customizeMode-separatorVertical.png  (customizableui/customizeMode-separatorVertical.png)
-#endif
 * skin/classic/browser/customizableui/panelUI.css    (customizableui/panelUI.css)
 * skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css)
   skin/classic/browser/downloads/download-glow-menuPanel.png (downloads/download-glow-menuPanel.png)
   skin/classic/browser/downloads/download-glow-menuPanel@2x.png (downloads/download-glow-menuPanel@2x.png)
 * skin/classic/browser/downloads/downloads.css              (downloads/downloads.css)
   skin/classic/browser/feeds/subscribe.css                  (feeds/subscribe.css)
   skin/classic/browser/feeds/feedIcon.png                   (feeds/feedIcon.png)
   skin/classic/browser/feeds/feedIcon16.png                 (feeds/feedIcon16.png)
@@ -108,19 +102,16 @@ browser.jar:
   skin/classic/browser/tabbrowser/tabDragIndicator.png                   (tabbrowser/tabDragIndicator.png)
   skin/classic/browser/tabbrowser/tabDragIndicator@2x.png                (tabbrowser/tabDragIndicator@2x.png)
   skin/classic/browser/sync-desktopIcon.svg  (../shared/sync-desktopIcon.svg)
   skin/classic/browser/sync-horizontalbar.png
   skin/classic/browser/sync-horizontalbar@2x.png
   skin/classic/browser/sync-mobileIcon.svg  (../shared/sync-mobileIcon.svg)
   skin/classic/browser/syncProgress-horizontalbar.png
   skin/classic/browser/syncProgress-horizontalbar@2x.png
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/Toolbar-background-noise.png         (Toolbar-background-noise.png)
-#endif
   skin/classic/browser/yosemite/menuPanel-customize.png                (menuPanel-customize-yosemite.png)
   skin/classic/browser/yosemite/menuPanel-customize@2x.png             (menuPanel-customize-yosemite@2x.png)
   skin/classic/browser/yosemite/menuPanel-exit.png                     (menuPanel-exit-yosemite.png)
   skin/classic/browser/yosemite/menuPanel-exit@2x.png                  (menuPanel-exit-yosemite@2x.png)
   skin/classic/browser/yosemite/menuPanel-help.png                     (menuPanel-help-yosemite.png)
   skin/classic/browser/yosemite/menuPanel-help@2x.png                  (menuPanel-help-yosemite@2x.png)
   skin/classic/browser/yosemite/reload-stop-go.png                     (reload-stop-go-yosemite.png)
   skin/classic/browser/yosemite/reload-stop-go@2x.png                  (reload-stop-go-yosemite@2x.png)
--- a/browser/themes/shared/browser.inc
+++ b/browser/themes/shared/browser.inc
@@ -1,25 +1,8 @@
 %filter substitution
 
 % Note that zoom-reset-button is a bit different since it doesn't use an image and thus has the image with display: none.
 %define nestedButtons #zoom-out-button, #zoom-reset-button, #zoom-in-button, #cut-button, #copy-button, #paste-button
-%define primaryToolbarButtons #back-button, #forward-button, #home-button, #print-button, #downloads-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #fullscreen-button, #sync-button, #feed-button, #social-share-button, #open-file-button, #find-button, #developer-button, #preferences-button, #privatebrowsing-button, #save-page-button, #add-ons-button, #history-panelmenu, #nav-bar-overflow-button, #PanelUI-menu-button, #characterencoding-button, #email-link-button, #sidebar-button, @nestedButtons@, #e10s-button, #panic-button, #webide-button, #containers-panelmenu
-
-%ifdef MOZ_PHOTON_THEME
-%define primaryToolbarButtons @primaryToolbarButtons@, #reload-button, #stop-button, #library-button
-%endif
-
-%ifdef XP_MACOSX
-% Prior to 10.7 there wasn't a native fullscreen button so we use #restore-button to exit fullscreen
-% and want it to behave like other toolbar buttons.
-%define primaryToolbarButtons @primaryToolbarButtons@, #restore-button
-%endif
 
 %define inAnyPanel :-moz-any(:not([cui-areatype="toolbar"]), [overflowedItem=true])
 
-%ifdef MOZ_PHOTON_THEME
-%define attributeSelectorForToolbar
-%define panelPaletteIconSize var(--panel-palette-icon-size)
-%else
-%define attributeSelectorForToolbar [cui-areatype="toolbar"]
-%define panelPaletteIconSize 32px
-%endif
+%define panelPaletteIconSize var(--panel-palette-icon-size)
\ No newline at end of file
--- a/browser/themes/shared/browser.inc.css
+++ b/browser/themes/shared/browser.inc.css
@@ -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/. */
 
-%ifdef MOZ_PHOTON_THEME
 %ifdef CAN_DRAW_IN_TITLEBAR
 /* Add space for dragging the window */
 %ifdef MOZ_WIDGET_COCOA
 :root[tabsintitlebar]:not([sizemode=fullscreen]) #TabsToolbar
 %elifdef MENUBAR_CAN_AUTOHIDE
 :root[tabsintitlebar][sizemode=normal] #toolbar-menubar[autohide=true] ~ #TabsToolbar
 %else
 :root[tabsintitlebar][sizemode=normal] #TabsToolbar
@@ -49,9 +48,8 @@
   .urlbar-go-button:hover {
     -moz-image-region: rect(28px, 84px, 56px, 56px);
   }
 
   .urlbar-go-button:hover:active {
     -moz-image-region: rect(56px, 84px, 84px, 56px);
   }
 }
-%endif
--- a/browser/themes/shared/compacttheme.inc.css
+++ b/browser/themes/shared/compacttheme.inc.css
@@ -2,133 +2,64 @@
 % 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/.
 
 /* compacttheme.css is loaded in browser.xul after browser.css when it is
    preffed on.  The bulk of the styling is here in the shared file, but
    there are overrides for each platform in their compacttheme.css files. */
 
 :root:-moz-lwtheme {
-%ifndef MOZ_PHOTON_THEME
-  --space-above-tabbar: 0px;
-  --backbutton-urlbar-overlap: 0px;
-  /* 18px icon + 2 * 5px padding + 1 * 1px border */
-  --forwardbutton-width: 29px;
-%endif
   --toolbar-bgcolor: var(--chrome-secondary-background-color);
   --toolbar-gbimage: none;
   --toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor);
   --toolbar-non-lwt-textcolor: var(--chrome-color);
   --toolbar-non-lwt-bgimage: none;
 }
 
 :root:-moz-lwtheme-brighttext {
-
-%ifndef MOZ_PHOTON_THEME
-
-  /* Chrome */
-  --chrome-background-color: #272b35;
-  --chrome-color: #F5F7FA;
-  --chrome-secondary-background-color: #393F4C;
-  --chrome-navigator-toolbox-separator-color: rgba(0,0,0,.2);
-  --chrome-nav-bar-separator-color: rgba(0,0,0,.2);
-  --chrome-nav-buttons-background: #252C33;
-  --chrome-nav-buttons-hover-background: #1B2127;
-  --chrome-nav-bar-controls-border-color: #1D2328;
-  --chrome-selection-color: #fff;
-  --chrome-selection-background-color: #5675B9;
-
-  --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, rgba(0,0,0,0.4) 16%, transparent 70%);
-
-
-%else
-
   /* Chrome */
   --chrome-background-color: hsl(240, 5%, 5%);
   --chrome-color: rgb(249, 249, 250);
   --chrome-secondary-background-color: hsl(240, 1%, 20%);
   --chrome-navigator-toolbox-separator-color: hsla(240, 5%, 5%, .1);
   --chrome-nav-bar-separator-color: rgba(0,0,0,.2);
   --chrome-nav-buttons-background: hsla(240, 5%, 5%, .1);
   --chrome-nav-buttons-hover-background: hsla(240, 5%, 5%, .15);
   --chrome-nav-bar-controls-border-color: hsla(240, 5%, 5%, .3);
   --chrome-selection-color: #fff;
   --chrome-selection-background-color: #5675B9;
 
-%endif
-
   /* Url and search bars */
-%ifndef MOZ_PHOTON_THEME
-  --url-and-searchbar-background-color: #171B1F;
-%else
   --url-and-searchbar-background-color: hsla(0, 0%, 100%, .1);
-%endif
   --urlbar-separator-color: #5F6670;
   --urlbar-dropmarker-url: url("chrome://browser/skin/compacttheme/urlbar-history-dropmarker.svg");
   --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px);
   --urlbar-dropmarker-hover-region: rect(0, 22px, 14px, 11px);
   --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px);
   --urlbar-dropmarker-2x-url: url("chrome://browser/skin/compacttheme/urlbar-history-dropmarker.svg");
   --urlbar-dropmarker-2x-region: rect(0px, 11px, 14px, 0px);
   --urlbar-dropmarker-hover-2x-region: rect(0, 22px, 14px, 11px);
   --urlbar-dropmarker-active-2x-region: rect(0px, 33px, 14px, 22px);
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* Override the lwtheme-specific styling for toolbar buttons */
-:root:-moz-lwtheme-brighttext,
-toolbar:-moz-lwtheme-brighttext  {
-  --toolbarbutton-hover-background: rgba(25,33, 38,.6) linear-gradient(rgba(25,33,38,.6), rgba(25,33,38,.6)) padding-box;
-  --toolbarbutton-hover-boxshadow: none;
-  --toolbarbutton-hover-bordercolor: rgba(25,33,38,.6);
-  --toolbarbutton-active-background: rgba(25,33,38,1) linear-gradient(rgba(25,33,38,1), rgba(25,33,38,1)) border-box;
-  --toolbarbutton-active-boxshadow: none;
-  --toolbarbutton-active-bordercolor: rgba(25,33,38,.8);
-  --toolbarbutton-checkedhover-backgroundcolor: #3C5283;
-}
-%endif
 :root:-moz-lwtheme-darktext {
   --url-and-searchbar-background-color: #fff;
 
   --chrome-background-color: #E3E4E6;
   --chrome-color: #18191a;
   --chrome-secondary-background-color: #f5f6f7;
   --chrome-navigator-toolbox-separator-color: #cccccc;
   --chrome-nav-bar-separator-color: #B6B6B8;
   --chrome-nav-buttons-background: #ffffff; /* --theme-body-background */
   --chrome-nav-buttons-hover-background: #DADBDB;
   --chrome-nav-bar-controls-border-color: #ccc;
   --chrome-selection-color: #f5f7fa;
   --chrome-selection-background-color: #4c9ed9;
-
-%ifndef MOZ_PHOTON_THEME
-  --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, transparent 16%);
-%endif
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* Override the lwtheme-specific styling for toolbar buttons */
-:root:-moz-lwtheme-darktext,
-toolbar:-moz-lwtheme-darktext {
-  --toolbarbutton-hover-background: #eaeaea;
-  --toolbarbutton-hover-boxshadow: none;
-  --toolbarbutton-hover-bordercolor: rgba(0,0,0,0.1);
-  --toolbarbutton-active-background: #d7d7d8 border-box;
-  --toolbarbutton-active-boxshadow: none;
-  --toolbarbutton-active-bordercolor: rgba(0,0,0,0.15);
-  --toolbarbutton-checkedhover-backgroundcolor: #d7d7d8;
-}
-
-/* Give some space to drag the window around while customizing
-   (normal space to left and right of tabs doesn't work in this case) */
-#main-window[tabsintitlebar][customizing] {
-  --space-above-tabbar: 9px;
-}
-%endif
-
 toolbar[brighttext] .toolbarbutton-1 {
   fill: rgba(249, 249, 250, .7);
 }
 
 #urlbar ::-moz-selection,
 #navigator-toolbox .searchbar-textbox ::-moz-selection,
 .browserContainer > findbar ::-moz-selection {
   background-color: var(--chrome-selection-background-color);
@@ -166,63 +97,16 @@ toolbar[brighttext] .toolbarbutton-1 {
 #PlacesToolbar toolbarbutton.bookmark-item {
   color: var(--chrome-color);
   text-shadow: none;
 }
 
 #TabsToolbar {
   text-shadow: none !important;
 }
-%ifndef MOZ_PHOTON_THEME
-
-/* Back and forward button */
-
-#back-button > .toolbarbutton-icon,
-#forward-button > .toolbarbutton-icon {
-  background: var(--chrome-nav-buttons-background) !important;
-  border-radius: 0 !important;
-  padding: var(--toolbarbutton-inner-padding) 5px !important;
-  margin: 0 !important;
-  border: 1px solid var(--chrome-nav-bar-controls-border-color) !important;
-  box-shadow: none !important;
-  height: auto !important;
-}
-
-/* the normal theme adds box-shadow: <stuff> !important when the back-button is [open]. Fix: */
-#back-button[open="true"] > .toolbarbutton-icon {
-  box-shadow: none !important;
-}
-
-#forward-button > .toolbarbutton-icon {
-  border-inline-start: none !important;
-}
-
-/* Override a box shadow for disabled back button */
-#main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon {
-  box-shadow: none !important;
-}
-
-/* Override !important properties for hovered back button */
-#main-window #back-button:hover:not([disabled="true"]) > .toolbarbutton-icon,
-#main-window #forward-button:hover:not([disabled="true"]) > .toolbarbutton-icon {
-  background: var(--chrome-nav-buttons-hover-background) !important;
-  box-shadow: none !important;
-}
-
-#back-button > .toolbarbutton-icon {
-  border-radius: 2px 0 0 2px !important;
-}
-
-#nav-bar .toolbarbutton-1:not([type=menu-button]),
-#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
-#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
-  padding-top: 2px;
-  padding-bottom: 2px;
-}
-%endif
 
 /* URL bar and search bar*/
 #urlbar,
 #navigator-toolbox .searchbar-textbox {
   background-color: var(--url-and-searchbar-background-color) !important;
   background-image: none !important;
   color: inherit !important;
   border: 1px solid var(--chrome-nav-bar-controls-border-color) !important;
@@ -237,50 +121,39 @@ toolbar[brighttext] .toolbarbutton-1 {
 #tracking-protection-icon:-moz-lwtheme-brighttext,
 #connection-icon:-moz-lwtheme-brighttext,
 .notification-anchor-icon:-moz-lwtheme-brighttext,
 #blocked-permissions-container > .blocked-permission-icon:-moz-lwtheme-brighttext,
 #extension-icon:-moz-lwtheme-brighttext {
   fill: rgba(255,255,255,.7);
 }
 
-%ifndef MOZ_PHOTON_THEME
-#urlbar {
-  border-inline-start: none !important;
-  opacity: 1 !important;
-}
-
-window:not([chromehidden~="toolbar"]) #urlbar-wrapper {
-  overflow: -moz-hidden-unscrollable;
-  clip-path: none;
-  margin-inline-start: 0;
-}
-
-window:not([chromehidden~="toolbar"]) #urlbar-wrapper:-moz-locale-dir(rtl),
-window:not([chromehidden~="toolbar"]) #urlbar-wrapper > #urlbar:-moz-locale-dir(rtl) {
-  /* Resolves text blurring issue when hovering, see bug 1340206 */
-  transform: none;
-  /* For some reason, this property must be specified here, even though the same
-     value is set in the previous rule set. o_O */
-  margin-inline-start: 0;
-}
-%endif
 #urlbar-zoom-button:-moz-lwtheme-brighttext:hover {
   background-color: rgba(255,255,255,.2);
 }
 
 #urlbar-zoom-button:-moz-lwtheme-brighttext:hover:active {
   background-color: rgba(255,255,255,.3);
 }
 
 /* Use smaller back button icon */
 #back-button {
   list-style-image: url("chrome://browser/skin/back.svg");
 }
 
+.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-position: center bottom -4px;
+}
+
+.tabbrowser-tab[image] > .tab-stack > .tab-content[attention]:not([pinned]):not([selected="true"]) {
+  background-position: left bottom var(--tab-toolbar-navbar-overlap);
+  background-size: 34px 100%;
+}
+
 .tab-throbber[selected][progress] {
   list-style-image: url("chrome://browser/skin/compacttheme/loading-inverted.png");
 }
 
 @media (min-resolution: 1.1dppx) {
   .tab-throbber[selected][progress] {
     list-style-image: url("chrome://browser/skin/compacttheme/loading-inverted@2x.png");
   }
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -208,21 +208,17 @@
 }
 
 .identity-popup-warning-gray:-moz-locale-dir(rtl),
 .identity-popup-warning-yellow:-moz-locale-dir(rtl) {
   background-position: 100% 50%;
 }
 /* SECURITY */
 .identity-popup-connection-secure {
-%ifdef MOZ_PHOTON_THEME
   color: #058B00;
-%else
-  color: #418220;
-%endif
 }
 .identity-popup-connection-not-secure {
   color: #d74345;
 }
 #identity-popup-securityView {
   overflow: hidden;
 }
 
@@ -234,21 +230,17 @@
 #identity-popup[connection=chrome] #identity-popup-securityView,
 #identity-popup[connection=chrome] #identity-popup-security-content {
   background-image: url(chrome://branding/content/icon48.png);
 }
 #identity-popup[connection^=secure] #identity-popup-securityView,
 #identity-popup[connection^=secure] #identity-popup-security-content {
   background-image: url(chrome://browser/skin/controlcenter/connection.svg#connection-secure);
   -moz-context-properties: fill;
-%ifdef MOZ_PHOTON_THEME
   fill: #12BC00;
-%else
-  fill: #4d9a26;
-%endif
 }
 /* Use [isbroken] to make sure we don't show a lock on an http page. See Bug 1192162. */
 #identity-popup[ciphers=weak] #identity-popup-securityView,
 #identity-popup[ciphers=weak] #identity-popup-security-content,
 #identity-popup[mixedcontent~=passive-loaded][isbroken] #identity-popup-securityView,
 #identity-popup[mixedcontent~=passive-loaded][isbroken] #identity-popup-security-content {
   background-image: url(chrome://browser/skin/controlcenter/connection.svg#connection-degraded);
 }
deleted file mode 100644
index 12005095cbce00d80371de31ca215e3a32969822..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index c1af12990c4d7ad7784447d36eeba7e8bd7a04a3..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 9131951b03a25f05300fe3abc3e498447741f0d0..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 50c0d19490bf12aa027ee7262fe04eaab57e284f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/shared/customizableui/customizeMode.inc.css
+++ b/browser/themes/shared/customizableui/customizeMode.inc.css
@@ -3,119 +3,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Customization mode */
 
 :root {
   --drag-drop-transition-duration: .3s;
 }
 
-%ifndef MOZ_PHOTON_THEME
-#main-window[customization-lwtheme] #tab-view-deck:-moz-lwtheme {
-  background-repeat: no-repeat;
-  background-position: right top;
-  background-attachment: fixed;
-  background-color: transparent;
-  background-image: -moz-image-rect(var(--lwt-header-image), 0, 100%,
-                      var(--toolbox-rect-height), 0),
-                    linear-gradient(to bottom,
-                      var(--lwt-accent-color) calc(var(--toolbox-rect-height-with-unit) - 1px),
-                      rgba(0,0,0,0.25) calc(var(--toolbox-rect-height-with-unit) - 1px),
-                      rgba(0,0,0,0.25) calc(var(--toolbox-rect-height-with-unit) + 1px),
-                      rgba(255,255,255,0.5) calc(var(--toolbox-rect-height-with-unit) + 1px),
-                      rgba(255,255,255,0.5) calc(var(--toolbox-rect-height-with-unit) + 2px),
-                      transparent calc(var(--toolbox-rect-height-with-unit) + 2px));
-}
-
-#main-window:-moz-any([customize-entering],[customize-entered]) #browser-bottombox {
-  margin-bottom: 2em;
-}
-
-#main-window:-moz-any([customize-entering],[customize-entered]) #content-deck,
-#main-window:-moz-any([customize-entering],[customize-entered]) #browser-bottombox,
-#main-window:-moz-any([customize-entering],[customize-entered]) #navigator-toolbox {
-  margin-left: 2em;
-  margin-right: 2em;
-}
-
-#main-window:-moz-any([customize-entering],[customize-exiting]) #tab-view-deck {
-  pointer-events: none;
-}
-
-#main-window[customize-entered] .customization-target:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar))::before,
-#PanelUI-contents > .panel-customization-placeholder {
-  -moz-outline-radius: 2.5px;
-  outline: 1px dashed transparent;
-}
-
-#main-window[customize-entered] .customization-target:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar))::before {
-  /* Prevent jumping of tabs when switching a window between inactive and active (bug 853415). */
-  -moz-box-ordinal-group: 0;
-  content: "";
-  display: -moz-box;
-  height: 100%;
-  left: 0;
-  outline-offset: -2px;
-  pointer-events: none;
-  position: absolute;
-  top: 0;
-  width: 100%;
-}
-
-/* Shift the TabsToolbar outline up 2px since the #nav-bar is shifted up by 1px and the
-   #TabsToolbar::after is a pixel higher to draw the bottom border of the tabstrip so this makes the
-   offset from the bottom effectively the same as other targets (-2px). */
-#main-window[customize-entered] #TabsToolbar.customization-target::before {
-  top: -2px;
-}
-
-/* The parents of the outline pseudo-elements need to be positioned so that the outline is positioned relative to it. */
-#main-window[customize-entered] .customization-target:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar)):hover,
-#main-window[customize-entered] .customization-target[customizing-dragovertarget]:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar)),
-#main-window[customize-entered] #nav-bar-customization-target.customization-target {
-  position: relative;
-}
-
-/* Most target outlines are shown on hover and drag over but the panel menu uses
-   placeholders instead. */
-#main-window[customize-entered] .customization-target:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar)):hover::before,
-#main-window[customize-entered] .customization-target[customizing-dragovertarget]:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar))::before,
-/* nav-bar and panel outlines are always shown */
-#nav-bar[showoutline=true] > #nav-bar-customization-target.customization-target::before {
-  outline-color: currentColor;
-}
-
-#nav-bar[showoutline=true] > #nav-bar-customization-target.customization-target::before {
-  transition: outline-color 250ms linear;
-}
-
-#PanelUI-contents[showoutline=true] > .panel-customization-placeholder {
-  transition: outline-color 250ms linear;
-  outline-color: var(--panel-separator-color);
-}
-
-#PanelUI-contents > .panel-customization-placeholder {
-  cursor: auto;
-  outline-offset: -5px;
-}
-%endif
-
 #main-window[customizing] .customization-target:not(#PanelUI-contents):not(#widget-overflow-fixed-list) {
   min-width: 100px;
 }
 
 #customization-container {
-%ifdef MOZ_PHOTON_THEME
   background-color: var(--toolbar-non-lwt-bgcolor);
   background-image: var(--toolbar-non-lwt-bgimage);
   color: var(--toolbar-non-lwt-textcolor);
-%else
-  background-color: -moz-field;
-  color: -moz-fieldText;
-%endif
   text-shadow: none;
 }
 
 #customization-container:-moz-lwtheme {
   background-color: transparent;
   background-image: linear-gradient(var(--toolbar-bgcolor), var(--toolbar-non-lwt-bgcolor) 45px);
 }
 
@@ -132,31 +37,19 @@
 
 #customization-header:-moz-lwtheme {
   text-shadow: 0 0 1em var(--toolbar-non-lwt-bgcolor),
                0 0 1em var(--toolbar-non-lwt-bgcolor),
                0 0 .5em var(--toolbar-non-lwt-bgcolor);
 }
 
 #customization-panel-container {
-%ifndef MOZ_PHOTON_THEME
-  padding: 15px 25px 25px;
-  background-image: linear-gradient(to bottom, #3e86ce, #3878ba);
-%else
   padding: 0 20px 25px;
-%endif
 }
 
-%ifndef MOZ_PHOTON_THEME
-#main-window:-moz-any([customize-entering],[customize-entered]) #browser-bottombox,
-#customization-footer {
-  background-color: -moz-dialog;
-}
-%endif
-
 #customization-footer {
   border-top: 1px solid rgba(0,0,0,.15);
   padding: 10px;
 }
 
 %if defined(XP_MACOSX) || defined(XP_WIN)
 %ifdef XP_WIN
 @media (-moz-windows-default-theme) {
@@ -259,35 +152,19 @@
   border-radius: 2px;
   background-size: contain;
 }
 
 #customization-lwtheme-button > .box-inherit > .box-inherit > .button-icon {
   background-image: url("chrome://browser/content/default-theme-icon.svg");
 }
 
-%ifdef MOZ_PHOTON_THEME
 #customization-uidensity-button > .box-inherit > .box-inherit > .button-icon {
   background-image: url("chrome://browser/skin/customizableui/density-normal.svg");
 }
-%endif
-
-%ifndef MOZ_PHOTON_THEME
-#main-window[customize-entered] #customization-panel-container {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-separatorHorizontal.png"),
-                    url("chrome://browser/skin/customizableui/customizeMode-separatorVertical.png"),
-                    url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"),
-                    url("chrome://browser/skin/customizableui/background-noise-toolbar.png"),
-                    linear-gradient(to bottom, #3e86ce, #3878ba);
-  background-position: center top, left center, left top, left top, left top;
-  background-repeat: no-repeat, no-repeat, repeat, repeat, no-repeat;
-  background-size: auto 12px, 12px 100%, auto, auto, auto;
-  background-attachment: scroll, scroll, fixed, fixed, scroll;
-}
-%endif
 
 #widget-overflow-fixed-list > toolbarpaletteitem[place="panel"],
 toolbarpaletteitem[place="toolbar"] {
   transition: border-width 250ms ease-in-out;
 }
 
 toolbarpaletteitem[mousedown] {
   cursor: -moz-grabbing;
@@ -456,29 +333,27 @@ toolbarpaletteitem[place=toolbar] > tool
 .customization-uidensity-menuitem {
   color: inherit;
 }
 
 .customization-lwtheme-menu-theme[defaulttheme] {
   list-style-image: url(chrome://browser/content/default-theme-icon.svg);
 }
 
-%ifdef MOZ_PHOTON_THEME
 #customization-uidensity-menuitem-normal {
   list-style-image: url("chrome://browser/skin/customizableui/density-normal.svg");
 }
 
 #customization-uidensity-menuitem-compact {
   list-style-image: url("chrome://browser/skin/customizableui/density-compact.svg");
 }
 
 #customization-uidensity-menuitem-touch {
   list-style-image: url("chrome://browser/skin/customizableui/density-touch.svg");
 }
-%endif
 
 .customization-uidensity-menuitem[active="true"],
 .customization-uidensity-menuitem:hover,
 .customization-lwtheme-menu-theme[active="true"],
 .customization-lwtheme-menu-theme:hover {
   background-color: var(--arrowpanel-dimmed);
   border-color: var(--panel-separator-color);
 }
@@ -597,17 +472,16 @@ toolbarpaletteitem[place=toolbar] > tool
 @media (min-resolution: 2dppx) {
   #customization-panelWrapper > .panel-arrowbox > .panel-arrow[side="top"] {
     list-style-image: var(--panel-arrow-image-vertical,
                           url("chrome://global/skin/arrow/panelarrow-vertical@2x.png"));
   }
 }
 %endif
 
-%ifdef MOZ_PHOTON_THEME
 #customization-panelHolder > #widget-overflow-fixed-list:not(:empty) {
   padding-bottom: 50px; /* Make sure there's always space to drop stuff. */
 }
 
 #customization-panelHolder > #widget-overflow-fixed-list:empty {
   background-image: url("chrome://browser/skin/customizableui/empty-overflow-panel.png");
   background-position: center top 10px;
   background-size: 218px 134px;
@@ -621,12 +495,8 @@ toolbarpaletteitem[place=toolbar] > tool
   display: block;
 }
 
 @media (min-resolution: 1.1dppx) {
   #customization-panelHolder > #widget-overflow-fixed-list:empty {
     background-image: url("chrome://browser/skin/customizableui/empty-overflow-panel@2x.png");
   }
 }
-
-%else
-%include customizeTip.inc.css
-%endif
deleted file mode 100644
--- a/browser/themes/shared/customizableui/customizeTip.inc.css
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#customization-tipPanel > .panel-arrowcontainer > .panel-arrowcontent {
-  padding: 0;
-  margin: 0;
-  min-width: 400px;
-  max-width: 1000px;
-  min-height: 200px;
-  border-radius: 3px;
-  background-image: linear-gradient(90deg, #a0dfff 0%, #ceeeff 100%);
-  border: 0px solid rgba(0,148,221,.5);
-  box-shadow: 0 1px 5px 0 rgba(0,0,0,.5), inset 0 1px 1px 0 #fff;
-  color: rgb(51,51,51);
-}
-
-#customization-tipPanel > .panel-arrowcontainer > .panel-arrowcontent:-moz-locale-dir(rtl) {
-  background-image: linear-gradient(90deg, #ceeeff 0%, #a0dfff 100%);
-}
-
-.customization-tipPanel-infoBox {
-  margin: 20px 25px 25px;
-  width: 25px;
-  background-image: url(chrome://browser/skin/customizableui/info-icon-customizeTip.png);
-  background-repeat: no-repeat;
-}
-
-.customization-tipPanel-content {
-  margin: 25px 0;
-  font-size: 12px;
-  line-height: 18px;
-}
-
-.customization-tipPanel-em {
-  margin: 0;
-  font-weight: bold;
-}
-
-.customization-tipPanel-contentImage {
-  margin-top: 25px;
-  list-style-image: url(chrome://browser/skin/customizableui/customize-illustration.png);
-  min-width: 300px;
-  max-width: 300px;
-  min-height: 190px;
-  max-height: 190px;
-  display: -moz-box;
-}
-
-.customization-tipPanel-contentImage:-moz-locale-dir(rtl) {
-  list-style-image: url(chrome://browser/skin/customizableui/customize-illustration-rtl.png);
-}
-
-.customization-tipPanel-link {
-  -moz-appearance: none;
-  background: transparent;
-  border: none;
-  box-shadow: none;
-  color: rgb(25,82,171);
-  margin: 0;
-  cursor: pointer;
-}
-
-.customization-tipPanel-link > .button-box > .button-text {
-  margin: 0 !important;
-}
-
-.customization-tipPanel-closeBox > .close-icon {
-  margin-inline-end: -25px;
-}
-
-#customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="left"],
-#customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="right"] {
-  list-style-image: url("chrome://browser/skin/customizableui/panelarrow-customizeTip.png");
-}
deleted file mode 100644
index 0dfbbce5d885e54de1f8866d6f6590e60eac4540..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 7a87fac20358b768193b90c47c4f57b06709467b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -1195,20 +1195,18 @@ panelview:not([mainView]) .subviewbutton
 .subviewbutton.panel-subview-footer > .menu-accel-container {
   padding-inline-start: 6px;
 }
 
 .subviewbutton:not(.panel-subview-footer) {
   margin: 0;
 }
 
-%ifdef MOZ_PHOTON_THEME
 #widget-overflow-fixed-list .toolbarbutton-1 > .toolbarbutton-text,
 #widget-overflow-list .toolbarbutton-1 > .toolbarbutton-text,
-%endif
 .subviewbutton:not(.panel-subview-footer) > .toolbarbutton-text,
 /* Bookmark items need a more specific selector. */
 .PanelUI-subView .subviewbutton:not(.panel-subview-footer) > .menu-text,
 .PanelUI-subView .subviewbutton:not(.panel-subview-footer) > .menu-iconic-text {
   font: menu;
 }
 
 .subviewbutton[shortcut]::after {
@@ -1368,20 +1366,16 @@ photonpanelmultiview .panel-subview-foot
 }
 
 photonpanelmultiview panelview:not([mainView]) .subviewbutton.panel-subview-footer > .toolbarbutton-text {
   text-align: start;
 }
 
 /* END photon adjustments */
 
-%ifndef MOZ_PHOTON_THEME
-.widget-overflow-list > .toolbarbutton-1:not(:first-child),
-.widget-overflow-list > toolbaritem:not(:first-child),
-%endif
 panelview .toolbarbutton-1 {
   margin-top: 6px;
 }
 
 panelview .toolbarbutton-1@buttonStateHover@,
 toolbarbutton.subviewbutton@buttonStateHover@,
 menu.subviewbutton@menuStateHover@,
 menuitem.subviewbutton@menuStateHover@,
@@ -1596,73 +1590,30 @@ toolbarpaletteitem[place="palette"] > .t
 }
 
 toolbarpaletteitem[place="palette"] > #search-container {
   min-width: 7em;
   width: 7em;
   min-height: 37px;
 }
 
-%ifndef MOZ_PHOTON_THEME
-.toolbaritem-combined-buttons@inAnyPanel@ {
-  background-color: transparent;
-  border-radius: 2px;
-  border: 1px solid;
-  border-color: transparent;
-  border-bottom-color: var(--panel-separator-color);
-  padding: 0;
-  transition-property: background-color, border-color;
-  transition-duration: 150ms;
-}
-
-/* Make direct siblings overlap borders: */
-.toolbaritem-combined-buttons + .toolbaritem-combined-buttons@inAnyPanel@ {
-  border-top-color: transparent !important;
-}
-
-.toolbaritem-combined-buttons + .toolbaritem-combined-buttons@inAnyPanel@,
-toolbarpaletteitem[haswideitem][place="panel"] + toolbarpaletteitem[haswideitem][place="panel"] {
-  margin-top: -1px;
-}
-%endif
-
 .toolbaritem-combined-buttons@inAnyPanel@ > toolbarbutton {
   border: 0;
   margin: 0;
   -moz-box-flex: 1;
-%ifndef MOZ_PHOTON_THEME
-  min-width: calc(@menuPanelButtonWidth@);
-  max-width: calc(@menuPanelButtonWidth@);
-  padding: .5em;
-  /* We'd prefer to use height: auto here but it leads to layout bugs in the panel. Cope:
-     1.2em for line height + 2 * .5em padding + margin on the label (2 * 2px) */
-  height: calc(2.2em + 4px);
-  max-height: none;
-%else
   padding-top: 4px;
   padding-bottom: 4px;
-%endif
   -moz-box-orient: horizontal;
 }
 
-%ifdef MOZ_PHOTON_THEME
 /* In customize mode, extend the buttons *only* in the panel, just to make them not look stupid */
 toolbarpaletteitem[place=panel] > .toolbaritem-combined-buttons > toolbarbutton {
   min-width: calc(@menuPanelButtonWidth@ - 1px);
   max-width: calc(@menuPanelButtonWidth@ - 1px);
 }
-%else
-#edit-controls@inAnyPanel@ > #copy-button,
-#zoom-controls@inAnyPanel@ > #zoom-reset-button {
-  /* reduce the width with 2px for this button to compensate for two separators
-     of 1px. */
-  min-width: calc(@menuPanelButtonWidth@ - 2px);
-  max-width: calc(@menuPanelButtonWidth@ - 2px);
-}
-%endif
 
 #main-window:not([customizing]) .toolbaritem-combined-buttons@inAnyPanel@ > toolbarbutton[disabled] > .toolbarbutton-icon {
   opacity: .25;
 }
 
 #zoom-controls[cui-areatype="toolbar"] > #zoom-reset-button > .toolbarbutton-text {
 %ifdef XP_MACOSX
   min-width: 6ch;
@@ -1703,87 +1654,50 @@ toolbarpaletteitem[place=panel] > .toolb
   margin: 0;
 }
 
 #widget-overflow > .panel-arrowcontainer > .panel-arrowcontent {
   padding: 0;
 }
 
 .cui-widget-panelview,
-%ifndef MOZ_PHOTON_THEME
-#widget-overflow-scroller {
-%else
 #widget-overflow-mainView .panel-subview-body {
-%endif
   overflow-y: auto;
   overflow-x: hidden;
 }
 
 #widget-overflow-scroller {
-%ifdef MOZ_PHOTON_THEME
   margin-top: 4px;
   margin-bottom: 4px;
-%else
-  max-height: 30em;
-  margin-top: 10px;
-  margin-bottom: 10px;
-%endif
 }
 
 .widget-overflow-list {
   width: @menuPanelWidth@;
-%ifndef MOZ_PHOTON_THEME
-  padding-left: 10px;
-  padding-right: 10px;
-%endif
 }
 
 toolbaritem[overflowedItem=true],
 .widget-overflow-list .toolbarbutton-1 {
   width: 100%;
   max-width: @menuPanelWidth@;
-%ifndef MOZ_PHOTON_THEME
-  min-height: 36px;
-%endif
   background-repeat: no-repeat;
   background-position: 0 center;
 }
 
 .widget-overflow-list .toolbarbutton-1,
 .widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button {
   -moz-box-align: center;
   -moz-box-orient: horizontal;
 }
 
 .widget-overflow-list .toolbarbutton-1:not(.toolbarbutton-combined) > .toolbarbutton-text,
 .widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-text {
   text-align: start;
   padding-inline-start: .5em;
 }
 
-%ifndef MOZ_PHOTON_THEME
-.widget-overflow-list > .toolbaritem-combined-buttons {
-  min-height: 28px;
-}
-
-.widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button::after {
-  content: "";
-  display: -moz-box;
-  width: 1px;
-  height: 18px;
-  margin-inline-end: -1px;
-  background-image: linear-gradient(hsla(210,54%,20%,.2) 0, hsla(210,54%,20%,.2) 18px);
-  background-clip: padding-box;
-  background-position: center;
-  background-repeat: no-repeat;
-  background-size: 1px 18px;
-  box-shadow: 0 0 0 1px hsla(0,0%,100%,.2);
-}
-%endif
-
 .subviewbutton[checked="true"] {
   background: url("chrome://global/skin/menu/shared-menu-check.png") center left 7px / 11px 11px no-repeat transparent;
 }
 
 .subviewbutton[checked="true"]:-moz-locale-dir(rtl) {
   background-position: center right 7px;
 }
 
deleted file mode 100644
index cbdf4692bbb566ffd6aa1f5c3e492d7ff9728f8e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index cfd7ba9668a2b2520da31c3dedf74a0260c29c87..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/shared/downloads/indicator.inc.css
+++ b/browser/themes/shared/downloads/indicator.inc.css
@@ -1,20 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*** Status and progress indicator ***/
 
 #downloads-button {
-%ifdef MOZ_PHOTON_THEME
   --downloads-indicator-image: url("chrome://browser/skin/downloads/download-icons.svg#arrow-with-bar");
-%else
-  --downloads-indicator-image: url("chrome://browser/skin/download.svg");
-%endif
 }
 
 #downloads-indicator-anchor {
   min-width: 16px;
   min-height: 16px;
 }
 
 #downloads-indicator-progress-outer {
deleted file mode 100644
--- a/browser/themes/shared/icons/back-large.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
-  <path fill="context-fill" fill-opacity="context-fill-opacity" d="M14 6H6.5l3-3a.967.967 0 0 0 0-1.4L8.7.7a.967.967 0 0 0-1.4 0L.7 7.3a.967.967 0 0 0 0 1.4l6.6 6.6a.967.967 0 0 0 1.4 0l.8-.8a.965.965 0 0 0 0-1.4l-3-3.1H14c.6 0 1-.2 1-.8V7a.945.945 0 0 0-1-1z"/>
-</svg>
deleted file mode 100644
--- a/browser/themes/shared/icons/bookmarksMenu.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
-  <path fill="context-fill" d="M13 15H3a2.006 2.006 0 0 1-2-2V5a2.006 2.006 0 0 1 2-2h2l3-3 3 3h2a2.006 2.006 0 0 1 2 2v8a2.006 2.006 0 0 1-2 2zM4 5a.945.945 0 0 0-1 1 .945.945 0 0 0 1 1 .945.945 0 0 0 1-1 .945.945 0 0 0-1-1zm0 3a.945.945 0 0 0-1 1 .945.945 0 0 0 1 1 .945.945 0 0 0 1-1 .945.945 0 0 0-1-1zm0 3a1 1 0 0 0 0 2 1 1 0 0 0 0-2zm9-6H6v2h7zm0 3H6v2h7zm0 3H6v2h7z"/>
-</svg>
deleted file mode 100644
--- a/browser/themes/shared/icons/download.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
-  <path fill="context-fill" d="M7.293 12.707a1 1 0 0 0 1.414 0l5-5a1 1 0 0 0-1.414-1.414L9 9.586V1a1 1 0 1 0-2 0v8.586L3.707 6.293a1 1 0 0 0-1.414 1.414zM13 14H3a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2z"/>
-</svg>
--- a/browser/themes/shared/identity-block/identity-block.inc.css
+++ b/browser/themes/shared/identity-block/identity-block.inc.css
@@ -1,74 +1,58 @@
 %if 0
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 %endif
 
 #identity-box {
-%ifdef MOZ_PHOTON_THEME
   padding: 0 5px;
-%else
-  font-size: .9em;
-  padding: 3px 5px;
-  /* The padding-left and padding-right transitions handle the delayed hiding of
-     the forward button when hovered. */
-  transition: padding-left, padding-right;
-%endif
   /* Set default fill for icons in the identity block.
      Individual icons can override this. */
   fill: currentColor;
   fill-opacity: .6;
   /* This is for tracking-protection-icon's slide-in animation. */
   overflow: hidden;
 }
 
-%ifdef MOZ_PHOTON_THEME
 #identity-box:hover:not(.no-hover):not([open=true]) {
   background-color: hsla(240,5%,5%,.05);
   fill-opacity: .8;
 }
 
 #identity-box:hover:active:not(.no-hover),
 #identity-box[open=true] {
   background-color: hsla(240,5%,5%,.1);
   fill-opacity: .8;
 }
-%endif
 
 #urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity > #identity-icon-labels {
-%ifdef MOZ_PHOTON_THEME
   color: #058B00;
-%else
-  color: hsl(92,100%,30%);
-%endif
 }
 #urlbar[pageproxystate="valid"] > #identity-box.chromeUI > #identity-icon-labels {
 %ifdef MOZ_OFFICIAL_BRANDING
   color: rgb(229,115,0);
 %else
   color: inherit;
 %endif
 }
 
 #identity-icon-labels:-moz-locale-dir(ltr) {
   padding-left: 2px;
 }
 #identity-icon-labels:-moz-locale-dir(rtl) {
   padding-right: 2px;
 }
-%ifdef MOZ_PHOTON_THEME
 #identity-box:not(.chromeUI):not(.extensionPage) {
   --urlbar-separator-color: transparent;
 }
 #urlbar[pageproxystate=valid] > #identity-box.verifiedIdentity {
   --urlbar-separator-color: rgba(18, 188, 0, .5);
 }
-%endif
 
 #identity-box {
   padding-inline-end: 2px;
   margin-inline-end: 2px;
 }
 
 #urlbar[pageproxystate=valid] > #identity-box.verifiedIdentity,
 #urlbar[pageproxystate=valid] > #identity-box.chromeUI,
@@ -88,33 +72,16 @@
 
 #urlbar-display-box {
   padding-inline-start: 4px;
   border-inline-start: 1px solid var(--urlbar-separator-color);
   border-image: linear-gradient(transparent 15%, var(--urlbar-separator-color) 15%, var(--urlbar-separator-color) 85%, transparent 85%);
   border-image-slice: 1;
 }
 
-%ifndef MOZ_PHOTON_THEME
-@conditionalForwardWithUrlbar@ > #forward-button[disabled] + #urlbar > #identity-box {
-  padding-inline-start: calc(var(--backbutton-urlbar-overlap) + 5px);
-}
-@conditionalForwardWithUrlbar@:hover:not([switchingtabs]) > #forward-button[disabled] + #urlbar > #identity-box {
-  /* Forward button hiding is delayed when hovered, so we should use the same
-     delay for the identity box. We handle both horizontal paddings (for LTR and
-     RTL), the latter two delays here are for padding-left and padding-right. */
-  transition-delay: 100s, 100s;
-}
-
-@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] + #urlbar > #identity-box {
-  /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */
-  padding-inline-start: calc(var(--backbutton-urlbar-overlap) + 5.01px);
-}
-%endif
-
 #identity-icon,
 #tracking-protection-icon,
 #connection-icon,
 .notification-anchor-icon,
 #blocked-permissions-container > .blocked-permission-icon,
 #extension-icon {
   width: 16px;
   height: 16px;
@@ -122,26 +89,16 @@
   -moz-context-properties: fill, fill-opacity;
 }
 
 /* MAIN IDENTITY ICON */
 #identity-icon {
   margin-inline-start: 0;
   list-style-image: url(chrome://browser/skin/identity-icon.svg);
 }
-%ifndef MOZ_PHOTON_THEME
-#identity-box:not(.no-hover):hover > #identity-icon,
-#identity-box[open=true] > #identity-icon {
-  list-style-image: url(chrome://browser/skin/identity-icon-hover.svg);
-}
-#identity-box.grantedPermissions:not(.no-hover):hover > #identity-icon,
-#identity-box.grantedPermissions[open=true] > #identity-icon {
-  list-style-image: url(chrome://browser/skin/identity-icon-notice-hover.svg);
-}
-%endif
 
 #identity-box.grantedPermissions > #identity-icon {
   list-style-image: url(chrome://browser/skin/identity-icon-notice.svg);
 }
 #urlbar[pageproxystate="valid"] > #identity-box.chromeUI > #identity-icon {
   list-style-image: url(chrome://branding/content/identity-icons-brand.svg);
 }
 #urlbar[pageproxystate="invalid"] > #identity-box > #identity-icon {
@@ -235,21 +192,17 @@
   visibility: collapse;
 }
 #urlbar[pageproxystate="valid"] > #identity-box.verifiedDomain > #connection-icon,
 #urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity > #connection-icon,
 #urlbar[pageproxystate="valid"] > #identity-box.mixedActiveBlocked > #connection-icon {
   list-style-image: url(chrome://browser/skin/connection-secure.svg);
   visibility: visible;
   -moz-context-properties: fill;
-%ifdef MOZ_PHOTON_THEME
   fill: #12BC00;
-%else
-  fill: #4d9a26;
-%endif
 }
 #urlbar[pageproxystate="valid"] > #identity-box.weakCipher > #connection-icon,
 #urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContent > #connection-icon,
 #urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContentLoadedActiveBlocked > #connection-icon,
 #urlbar[pageproxystate="valid"] > #identity-box.certUserOverridden > #connection-icon {
   list-style-image: url(chrome://browser/skin/connection-mixed-passive-loaded.svg);
   visibility: visible;
 }
deleted file mode 100644
--- a/browser/themes/shared/identity-block/identity-icon-hover.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
-  <path fill="context-fill" fill-opacity="context-fill-opacity" fill-rule="evenodd" d="M8 1a7 7 0 1 1-7 7 7 7 0 0 1 7-7zm0 3a1 1 0 1 1-1 1 1 1 0 0 1 1-1zm0 3a1 1 0 0 1 1 1v3a1 1 0 0 1-2 0V8a1 1 0 0 1 1-1z"/>
-</svg>
deleted file mode 100644
--- a/browser/themes/shared/identity-block/identity-icon-notice-hover.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
-  <path fill="context-fill" fill-opacity="context-fill-opacity" fill-rule="evenodd" d="M13.5 5A2.5 2.5 0 1 1 16 2.5 2.5 2.5 0 0 1 13.5 5zm0 1.039a3.5 3.5 0 0 0 1.125-.2 7.124 7.124 0 1 1-4.464-4.464 3.5 3.5 0 0 0-.2 1.125A3.54 3.54 0 0 0 13.5 6.039zM8 4a1 1 0 1 0 1 1 1 1 0 0 0-1-1zm1 4a1 1 0 0 0-2 0v3a1 1 0 0 0 2 0V8z"/>
-</svg>
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -28,61 +28,41 @@
 * skin/classic/browser/controlcenter/mcb-disabled.svg          (../shared/controlcenter/mcb-disabled.svg)
   skin/classic/browser/controlcenter/extension.svg             (../shared/controlcenter/extension.svg)
 * skin/classic/browser/controlcenter/permissions.svg           (../shared/controlcenter/permissions.svg)
 * skin/classic/browser/controlcenter/tracking-protection.svg   (../shared/controlcenter/tracking-protection.svg)
   skin/classic/browser/controlcenter/warning-gray.svg          (../shared/controlcenter/warning-gray.svg)
   skin/classic/browser/controlcenter/warning-yellow.svg        (../shared/controlcenter/warning-yellow.svg)
   skin/classic/browser/customizableui/menuPanel-customizeFinish.png  (../shared/customizableui/menuPanel-customizeFinish.png)
   skin/classic/browser/customizableui/menuPanel-customizeFinish@2x.png  (../shared/customizableui/menuPanel-customizeFinish@2x.png)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/customizableui/empty-overflow-panel.png     (../shared/customizableui/empty-overflow-panel.png)
   skin/classic/browser/customizableui/empty-overflow-panel@2x.png  (../shared/customizableui/empty-overflow-panel@2x.png)
   skin/classic/browser/customizableui/density-compact.svg      (../shared/customizableui/density-compact.svg)
   skin/classic/browser/customizableui/density-normal.svg       (../shared/customizableui/density-normal.svg)
   skin/classic/browser/customizableui/density-touch.svg        (../shared/customizableui/density-touch.svg)
-#else
-  skin/classic/browser/customizableui/customize-illustration.png  (../shared/customizableui/customize-illustration.png)
-  skin/classic/browser/customizableui/customize-illustration@2x.png  (../shared/customizableui/customize-illustration@2x.png)
-  skin/classic/browser/customizableui/customize-illustration-rtl.png  (../shared/customizableui/customize-illustration-rtl.png)
-  skin/classic/browser/customizableui/customize-illustration-rtl@2x.png  (../shared/customizableui/customize-illustration-rtl@2x.png)
-  skin/classic/browser/customizableui/info-icon-customizeTip.png  (../shared/customizableui/info-icon-customizeTip.png)
-  skin/classic/browser/customizableui/info-icon-customizeTip@2x.png  (../shared/customizableui/info-icon-customizeTip@2x.png)
-  skin/classic/browser/customizableui/panelarrow-customizeTip.png  (../shared/customizableui/panelarrow-customizeTip.png)
-  skin/classic/browser/customizableui/panelarrow-customizeTip@2x.png  (../shared/customizableui/panelarrow-customizeTip@2x.png)
-#endif
   skin/classic/browser/customizableui/subView-arrow-back-inverted.png  (../shared/customizableui/subView-arrow-back-inverted.png)
   skin/classic/browser/customizableui/subView-arrow-back-inverted@2x.png  (../shared/customizableui/subView-arrow-back-inverted@2x.png)
   skin/classic/browser/customizableui/subView-arrow-back-inverted-rtl.png  (../shared/customizableui/subView-arrow-back-inverted-rtl.png)
   skin/classic/browser/customizableui/subView-arrow-back-inverted-rtl@2x.png  (../shared/customizableui/subView-arrow-back-inverted-rtl@2x.png)
   skin/classic/browser/customizableui/whimsy.png               (../shared/customizableui/whimsy.png)
   skin/classic/browser/customizableui/whimsy@2x.png            (../shared/customizableui/whimsy@2x.png)
   skin/classic/browser/downloads/contentAreaDownloadsView.css  (../shared/downloads/contentAreaDownloadsView.css)
   skin/classic/browser/downloads/download-blocked.svg          (../shared/downloads/download-blocked.svg)
   skin/classic/browser/downloads/download-summary.svg          (../shared/downloads/download-summary.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/downloads/download-icons.svg            (../shared/downloads/download-icons.svg)
-#endif
   skin/classic/browser/downloads/notification-start-animation.svg  (../shared/downloads/notification-start-animation.svg)
   skin/classic/browser/drm-icon.svg                            (../shared/drm-icon.svg)
   skin/classic/browser/fullscreen/insecure.svg                 (../shared/fullscreen/insecure.svg)
   skin/classic/browser/fullscreen/secure.svg                   (../shared/fullscreen/secure.svg)
   skin/classic/browser/connection-secure.svg                   (../shared/identity-block/connection-secure.svg)
   skin/classic/browser/connection-mixed-passive-loaded.svg     (../shared/identity-block/connection-mixed-passive-loaded.svg)
   skin/classic/browser/connection-mixed-active-loaded.svg      (../shared/identity-block/connection-mixed-active-loaded.svg)
   skin/classic/browser/identity-icon.svg                       (../shared/identity-block/identity-icon.svg)
   skin/classic/browser/identity-icon-notice.svg                (../shared/identity-block/identity-icon-notice.svg)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/identity-icon-hover.svg                 (../shared/identity-block/identity-icon-hover.svg)
-  skin/classic/browser/identity-icon-notice-hover.svg          (../shared/identity-block/identity-icon-notice-hover.svg)
-#endif
   skin/classic/browser/info.svg                                (../shared/info.svg)
-#ifndef MOZ_PHOTON_THEME
-* skin/classic/browser/menuPanel.svg                           (../shared/menuPanel.svg)
-#endif
 * skin/classic/browser/menuPanel-small.svg                     (../shared/menuPanel-small.svg)
   skin/classic/browser/notification-icons.svg                  (../shared/notification-icons.svg)
   skin/classic/browser/tracking-protection-16.svg              (../shared/identity-block/tracking-protection-16.svg)
   skin/classic/browser/newtab/close.png                        (../shared/newtab/close.png)
   skin/classic/browser/newtab/controls.svg                     (../shared/newtab/controls.svg)
   skin/classic/browser/panel-icon-arrow-left.svg               (../shared/panel-icon-arrow-left.svg)
   skin/classic/browser/panel-icon-arrow-right.svg              (../shared/panel-icon-arrow-right.svg)
   skin/classic/browser/panel-icon-cancel.svg                   (../shared/panel-icon-cancel.svg)
@@ -112,71 +92,53 @@
   skin/classic/browser/fxa/ios@2x.png                          (../shared/fxa/ios@2x.png)
 
 
   skin/classic/browser/addons.svg                     (../shared/icons/addons.svg)
   skin/classic/browser/arrow-dropdown-12.svg          (../shared/icons/arrow-dropdown-12.svg)
   skin/classic/browser/arrow-dropdown-16.svg          (../shared/icons/arrow-dropdown-16.svg)
   skin/classic/browser/arrow-left.svg                 (../shared/icons/arrow-left.svg)
   skin/classic/browser/back.svg                       (../shared/icons/back.svg)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/back-large.svg                 (../shared/icons/back-large.svg)
-#endif
   skin/classic/browser/back-12.svg                    (../shared/icons/back-12.svg)
   skin/classic/browser/bookmark.svg                   (../shared/icons/bookmark.svg)
   skin/classic/browser/bookmark-animation.svg         (../shared/icons/bookmark-animation.svg)
   skin/classic/browser/bookmark-hollow.svg            (../shared/icons/bookmark-hollow.svg)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/bookmarksMenu.svg              (../shared/icons/bookmarksMenu.svg)
-#else
   skin/classic/browser/bookmark-star-on-tray.svg      (../shared/icons/bookmark-star-on-tray.svg)
-#endif
   skin/classic/browser/characterEncoding.svg          (../shared/icons/characterEncoding.svg)
   skin/classic/browser/chevron.svg                    (../shared/icons/chevron.svg)
   skin/classic/browser/chevron-animation.svg          (../shared/icons/chevron-animation.svg)
   skin/classic/browser/check.svg                      (../shared/icons/check.svg)
   skin/classic/browser/containers.svg                 (../shared/icons/containers.svg)
   skin/classic/browser/customize.svg                  (../shared/icons/customize.svg)
   skin/classic/browser/developer.svg                  (../shared/icons/developer.svg)
   skin/classic/browser/device-mobile.svg              (../shared/icons/device-mobile.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/device-desktop.svg             (../shared/icons/device-desktop.svg)
-#endif
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/download.svg                   (../shared/icons/download.svg)
-#endif
   skin/classic/browser/edit-copy.svg                  (../shared/icons/edit-copy.svg)
   skin/classic/browser/edit-cut.svg                   (../shared/icons/edit-cut.svg)
   skin/classic/browser/edit-paste.svg                 (../shared/icons/edit-paste.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/email-link.svg                 (../shared/icons/email-link.svg)
-#endif
   skin/classic/browser/feed.svg                       (../shared/icons/feed.svg)
   skin/classic/browser/find.svg                       (../shared/icons/find.svg)
   skin/classic/browser/forget.svg                     (../shared/icons/forget.svg)
   skin/classic/browser/forward.svg                    (../shared/icons/forward.svg)
   skin/classic/browser/fullscreen.svg                 (../shared/icons/fullscreen.svg)
   skin/classic/browser/fullscreen-enter.svg           (../shared/icons/fullscreen-enter.svg)
   skin/classic/browser/fullscreen-exit.svg            (../shared/icons/fullscreen-exit.svg)
   skin/classic/browser/help.svg                       (../shared/icons/help.svg)
   skin/classic/browser/history.svg                    (../shared/icons/history.svg)
   skin/classic/browser/home.svg                       (../shared/icons/home.svg)
   skin/classic/browser/library.svg                    (../shared/icons/library.svg)
   skin/classic/browser/library-bookmark-animation.svg (../shared/icons/library-bookmark-animation.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/link.svg                       (../shared/icons/link.svg)
-#endif
   skin/classic/browser/mail.svg                       (../shared/icons/mail.svg)
   skin/classic/browser/menu.svg                       (../shared/icons/menu.svg)
   skin/classic/browser/new-tab.svg                    (../shared/icons/new-tab.svg)
   skin/classic/browser/new-window.svg                 (../shared/icons/new-window.svg)
   skin/classic/browser/open.svg                       (../shared/icons/open.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/page-action.svg                (../shared/icons/page-action.svg)
-#endif
   skin/classic/browser/print.svg                      (../shared/icons/print.svg)
   skin/classic/browser/privateBrowsing.svg            (../shared/icons/privateBrowsing.svg)
   skin/classic/browser/quit.svg                       (../shared/icons/quit.svg)
   skin/classic/browser/reload.svg                     (../shared/icons/reload.svg)
   skin/classic/browser/reload-to-stop.svg             (../shared/icons/reload-to-stop.svg)
   skin/classic/browser/save.svg                       (../shared/icons/save.svg)
   skin/classic/browser/settings.svg                   (../shared/icons/settings.svg)
   skin/classic/browser/share.svg                      (../shared/icons/share.svg)
@@ -202,19 +164,17 @@
   skin/classic/browser/search-indicator-badge-add@2x.png       (../shared/search/search-indicator-badge-add@2x.png)
   skin/classic/browser/search-indicator-magnifying-glass.svg   (../shared/search/search-indicator-magnifying-glass.svg)
   skin/classic/browser/search-arrow-go.svg                     (../shared/search/search-arrow-go.svg)
   skin/classic/browser/gear.svg                                (../shared/search/gear.svg)
   skin/classic/browser/tabbrowser/connecting.png               (../shared/tabbrowser/connecting.png)
   skin/classic/browser/tabbrowser/connecting@2x.png            (../shared/tabbrowser/connecting@2x.png)
   skin/classic/browser/tabbrowser/crashed.svg                  (../shared/tabbrowser/crashed.svg)
   skin/classic/browser/tabbrowser/newtab.svg                   (../shared/tabbrowser/newtab.svg)
-#ifdef MOZ_PHOTON_THEME
   skin/classic/browser/tabbrowser/indicator-tab-attention.svg  (../shared/tabbrowser/indicator-tab-attention.svg)
-#endif
   skin/classic/browser/tabbrowser/pendingpaint.png             (../shared/tabbrowser/pendingpaint.png)
   skin/classic/browser/tabbrowser/tab-audio-playing.svg        (../shared/tabbrowser/tab-audio-playing.svg)
   skin/classic/browser/tabbrowser/tab-audio-muted.svg          (../shared/tabbrowser/tab-audio-muted.svg)
   skin/classic/browser/tabbrowser/tab-audio-blocked.svg        (../shared/tabbrowser/tab-audio-blocked.svg)
   skin/classic/browser/tabbrowser/tab-audio-small.svg          (../shared/tabbrowser/tab-audio-small.svg)
   skin/classic/browser/tabbrowser/tab-overflow-indicator.png   (../shared/tabbrowser/tab-overflow-indicator.png)
   skin/classic/browser/toolbarbutton-dropdown-arrow.png        (../shared/toolbarbutton-dropdown-arrow.png)
   skin/classic/browser/translating-16.png                      (../shared/translation/translating-16.png)
deleted file mode 100644
--- a/browser/themes/shared/menuPanel.svg
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg"
-     width="1056" height="32" viewBox="0 0 1056 32"
-     class="fieldtext">
-#include icon-colors.inc.svg
-
-  <path id="containers" d="M1050,30h-20a2,2,0,0,1-2-2V4.414a1.03,1.03,0,0,1,.29-0.707L1030,2h20l1.71,1.707a1.03,1.03,0,0,1,.29.707V28A2,2,0,0,1,1050,30Zm0-24h-20V28h20V6Zm-2,10h-16V8h16v8Zm-4-4.5a0.5,0.5,0,0,0-1,0V13h-6V11.5a0.5,0.5,0,0,0-1,0v2a0.5,0.5,0,0,0,.5.5h7a0.5,0.5,0,0,0,.5-0.5v-2Zm4,14.5h-16V18h16v8Zm-4-4.5a0.5,0.5,0,0,0-1,0V23h-6V21.5a0.5,0.5,0,0,0-1,0v2a0.5,0.5,0,0,0,.5.5h7a0.5,0.5,0,0,0,.5-0.5v-2Z"/>
-  <path id="tabs" d="M1021.98,28h-28a2,2,0,0,1-2-2V22a2,2,0,0,1,2-2H994c4.591,0,4-3,4.009-8,0.009-4.686.166-8,6.261-8h7.41c6.13,0,6.27,3.314,6.3,8,0.02,5-.59,8,4.02,8h-0.02a2,2,0,0,1,2,2v4A2,2,0,0,1,1021.98,28Z"/>
-  <path id="pocket" d="M975.969,29.969A13.969,13.969,0,0,1,962,16V8.333A4.333,4.333,0,0,1,966.333,4H985.6a4.333,4.333,0,0,1,4.333,4.333V16A13.969,13.969,0,0,1,975.969,29.969Zm7.507-19.035a2.009,2.009,0,0,0-1.424.59l-0.007-.007-6.095,6.015-5.479-5.422a2,2,0,1,0-2.917,2.727l-0.01.01,5.555,5.5h0l1.518,1.5a1.9,1.9,0,0,0,2.661,0l7.558-7.459a1.979,1.979,0,0,0,.649-1.46A2,2,0,0,0,983.476,10.933Z"/>
-  <path id="webIDE" d="M951.947,10a24.679,24.679,0,0,1,.362,2.691L949,16h-4v4l-2,2h-4.393a14.261,14.261,0,0,0,1.358,3.076l-1.716,3.777A15,15,0,1,1,957.175,7.825L955,10h-3.053ZM938.292,26.023A17.1,17.1,0,0,1,936.54,22h-2.819A12.445,12.445,0,0,0,938.292,26.023ZM932.616,20h3.437a25.331,25.331,0,0,1-.462-4h-3.978A12.38,12.38,0,0,0,932.616,20Zm0-10a12.38,12.38,0,0,0-1,4h3.978a25.331,25.331,0,0,1,.462-4h-3.437Zm1.105-2h2.819a17.093,17.093,0,0,1,1.752-4.023A12.444,12.444,0,0,0,933.721,8ZM943,2.613c-0.393.031-.777,0.093-1.158,0.16A10.229,10.229,0,0,0,938.607,8H943V2.613ZM943,10h-4.914a24.566,24.566,0,0,0-.467,4H943V10Zm0,6h-5.381a24.566,24.566,0,0,0,.467,4H943V16Zm2-2h5.381a24.566,24.566,0,0,0-.467-4H945v4Zm1.158-11.227c-0.381-.067-0.765-0.128-1.158-0.16V8h4.393A10.229,10.229,0,0,0,946.158,2.773Zm3.55,1.2A17.093,17.093,0,0,1,951.46,8h2.819A12.444,12.444,0,0,0,949.708,3.977ZM947.068,28.3L939,32l3.726-8.047ZM944,23l13-13,4,4L948,27Zm3.4,6.6,11.2-11.2A15,15,0,0,1,947.4,29.6Z"/>
-  <path id="app" d="M920.044,27.006l-4.354-4.863c-0.39.4-1.028,2.507-1.49,2.769h-4.4c-0.459-.262-1.094-2.375-1.484-2.769l-4.153,4.863H901V16.067l4.353-4.271C906.443,5.26,910.259,1,912,1s5.7,4.26,6.515,10.8L923,16.135V27.006h-2.956Zm-8.036-19.48c-0.61,0-1.819,2.268-2.484,4.251a14.406,14.406,0,0,1,2.535-.224,14.627,14.627,0,0,1,2.423.2C913.818,9.782,912.613,7.526,912.008,7.526Zm-0.762,18.23a4.106,4.106,0,0,0-.165,1.17,1.493,1.493,0,0,0,.858,1.466,1.535,1.535,0,0,0,.957-1.466,4.071,4.071,0,0,0-.165-1.17h1.079a9.949,9.949,0,0,1,.544,1.973A3.6,3.6,0,0,1,912,31.014a3.686,3.686,0,0,1-2.352-3.337,9.384,9.384,0,0,1,.544-1.921h1.051Z"/>
-  <path id="forget" d="M880,31a15,15,0,1,1,15-15A15,15,0,0,1,880,31ZM879.963,8.208V4.159l-6.328,5.2,6.328,5.524v-4.27A5.279,5.279,0,0,1,885.391,16,5.233,5.233,0,0,1,880,21.391a5.406,5.406,0,0,1-5.28-3.516h-2.189A7.773,7.773,0,0,0,887.852,16,8.115,8.115,0,0,0,879.963,8.208Z"/>
-  <path id="sidebars" d="M862,29H834a1,1,0,0,1-1-1V4a1,1,0,0,1,1-1h28a1,1,0,0,1,1,1V28A1,1,0,0,1,862,29ZM840,9h-3a1,1,0,0,0-1,1V25a1,1,0,0,0,1,1h3V9Zm3,17h16a1,1,0,0,0,1-1V10a1,1,0,0,0-1-1H843V26Zm8-20.986a0.991,0.991,0,1,0,1,.99A0.995,0.995,0,0,0,851,5.015Zm3,0a0.991,0.991,0,1,0,1,.99A0.995,0.995,0,0,0,854,5.015ZM859,5h-2a1,1,0,0,0,0,2h2A1,1,0,0,0,859,5Z"/>
-  <path id="addon-generic" d="M815.988,2.013a13.987,13.987,0,1,1-13.975,14A14,14,0,0,1,815.988,2.013ZM814.923,4.4a2.112,2.112,0,0,0-2.371,2,2.064,2.064,0,0,0,.547,1.585,0.884,0.884,0,0,1,.285.717,1.458,1.458,0,0,1-1.706,1.329h-3.2a0.581,0.581,0,0,0-.552.584c-0.011.061,0,2.462,0,2.462a2.445,2.445,0,0,0,.289,1.489,0.8,0.8,0,0,0,.841.411,2.8,2.8,0,0,0,1.6-.487,1.632,1.632,0,0,1,1.221-.428c1.108,0,1.293.45,1.293,1.856,0,1.013-.469,1.931-1.262,1.931a1.054,1.054,0,0,1-.969-0.384,2.6,2.6,0,0,0-1.718-.63,0.99,0.99,0,0,0-1,.485c-0.339.544-.3,1.255-0.3,2.768,0,2.015,0,3.248,0,3.285a0.591,0.591,0,0,0,.552.668h3.2c1.072,0,2.874.361,2.874-1.05a1.611,1.611,0,0,0-.458-1.111,1.685,1.685,0,0,1-.377-1.149c0-.285-0.068-1.283,1.668-1.283,0.071,0,1.634.148,1.634,1.346a1.388,1.388,0,0,1-.245,1.04A1.4,1.4,0,0,0,816.185,23c0,1.5,1.683,1.039,2.213,1.039,1.884,0,2.763.017,3.031,0a0.628,0.628,0,0,0,.585-0.634C822,22.875,822,22.735,822,19.861a6.582,6.582,0,0,1,.172-2.259,0.642,0.642,0,0,1,.657-0.231,1.869,1.869,0,0,1,1.047.384,2.142,2.142,0,0,0,1.625,1.006c1.386,0,2.125-1.622,2.125-2.779,0-1.232-.628-2.754-2.158-2.754a2.029,2.029,0,0,0-1.516.723,1.384,1.384,0,0,1-.876.584,1.131,1.131,0,0,1-1.067-.877V10.738a0.734,0.734,0,0,0-.56-0.709c-0.012,0-1.881,0-3.34,0a1.407,1.407,0,0,1-1.541-1.389,1.292,1.292,0,0,1,.279-0.984,1.8,1.8,0,0,0,.548-1.283C817.392,5.666,817.042,4.4,814.923,4.4Z"/>
-  <path id="mail" d="M787.333,16a4.507,4.507,0,0,1-6.666,0L769.39,6.7A3.349,3.349,0,0,1,772.333,5h23.334a3.348,3.348,0,0,1,2.943,1.7Zm-6.666,3.143a4.507,4.507,0,0,0,6.666,0L799,9.243V23.857A3.242,3.242,0,0,1,795.667,27H772.333A3.243,3.243,0,0,1,769,23.857V9.243Z"/>
-  <path id="settings" d="M763.005,16c0,1.307.425,2.516,1.03,2.728L765,19.068a13.308,13.308,0,0,1-1.644,3.956l-0.921-.443c-0.578-.278-1.733.276-2.657,1.2s-1.478,2.079-1.2,2.657l0.444,0.923a13.357,13.357,0,0,1-3.964,1.622l-0.333-.949c-0.212-.6-1.421-1.03-2.728-1.03s-2.516.425-2.728,1.03l-0.34.969a13.322,13.322,0,0,1-3.956-1.644l0.443-.921c0.278-.578-0.276-1.733-1.2-2.657s-2.08-1.478-2.658-1.2l-0.923.444a13.366,13.366,0,0,1-1.622-3.964l0.949-.333C740.57,18.516,741,17.308,741,16s-0.425-2.516-1.03-2.728l-0.971-.341a13.255,13.255,0,0,1,1.667-3.946l0.9,0.433c0.578,0.278,1.733-.276,2.658-1.2s1.478-2.08,1.2-2.657l-0.433-.9A13.261,13.261,0,0,1,748.932,3l0.34,0.969C749.484,4.57,750.693,5,752,5s2.516-.425,2.728-1.03L755.068,3a13.321,13.321,0,0,1,3.956,1.644l-0.443.921c-0.277.577,0.276,1.733,1.2,2.657s2.079,1.478,2.657,1.2l0.923-.444a13.337,13.337,0,0,1,1.622,3.964l-0.949.333C763.43,13.485,763.005,14.693,763.005,16ZM752,8.946A7.054,7.054,0,1,0,759.054,16,7.054,7.054,0,0,0,752,8.946Z"/>
-  <path id="developer" d="M724.986,11.177a2.978,2.978,0,0,1,.246.367,2.361,2.361,0,0,0,2.835-.346l4.975-4.932A7.808,7.808,0,0,1,734,9.952a7.969,7.969,0,0,1-10.791,7.435L711.4,29.075a3.192,3.192,0,0,1-4.486,0,3.125,3.125,0,0,1,0-4.447l11.675-11.563a7.863,7.863,0,0,1-.64-3.113,7.974,7.974,0,0,1,11.725-7.014l-4.972,4.929a2.307,2.307,0,0,0-.246,2.964A3.066,3.066,0,0,1,724.986,11.177ZM709.25,25A1.747,1.747,0,1,0,711,26.748,1.746,1.746,0,0,0,709.25,25Z"/>
-  <path id="fullscreen" d="M696,22V10l6,6Zm-14,2h12l-6,6Zm11-2H683a1,1,0,0,1-1-1V11a1,1,0,0,1,1-1h10a1,1,0,0,1,1,1V21A1,1,0,0,1,693,22Zm-1-7a1,1,0,0,0-1-1h-6a1,1,0,0,0-1,1v4a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V15ZM688,2l6,6H681.982Zm-8,8V22l-6-6Z"/>
-  <path id="print" d="M670,26h-4V24h-1l3,6H644l2-4h-4a2,2,0,0,1-2-2V14a2,2,0,0,1,2-2h2V10a2,2,0,0,1,2-2V3a1,1,0,0,1,1-1h18a1,1,0,0,1,1,1V8a2,2,0,0,1,2,2v2h2a2,2,0,0,1,2,2V24A2,2,0,0,1,670,26Zm-24,0,1-2h-1v2Zm1-10h-2a1,1,0,0,0,0,2h2A1,1,0,0,0,647,16ZM664,4.5a0.5,0.5,0,0,0-.5-0.5h-15a0.5,0.5,0,0,0-.5.5v9a0.5,0.5,0,0,0,.5.5h15a0.5,0.5,0,0,0,.5-0.5v-9ZM662.222,24H649.778L648,28h16Z"/>
-  <path id="search" d="M626.853,23.318a10.074,10.074,0,0,1-5.361-1.545l-6.611,6.619a2.028,2.028,0,0,1-2.87,0l-0.4-.4a2.033,2.033,0,0,1,0-2.873l6.618-6.627A10.137,10.137,0,1,1,626.853,23.318Zm0-16.254a6.1,6.1,0,1,0,6.088,6.1A6.092,6.092,0,0,0,626.853,7.064Z"/>
-  <path id="privateBrowsing" d="M574.273,11.973c-0.122,2.136.37,4.688-2.4,8.367-2.953,3.926-5.886,3.626-6.44,3.685-3.322.354-3.76-2.62-5.7-2.62-1.7,0-3.083,2.955-5.578,2.62-0.552-.074-3.487.241-6.44-3.685-2.768-3.679-2.276-6.231-2.4-8.367a41.419,41.419,0,0,0-.553-4.451,5.372,5.372,0,0,0,3.056,1.484c1.722,0.119,2.044-.61,5.678-1.662,3.929-1.137,6.3,3.522,6.3,3.522s2.668-4.591,6.3-3.522,3.78,1.78,5.5,1.662a6.249,6.249,0,0,0,3.232-1.484A41.574,41.574,0,0,0,574.273,11.973Zm-20.315.895c-2.148-.479-3.049.339-3.969,0.688a7.615,7.615,0,0,1-1.534.4s0.123,1.246,2.276,2.314,6.569,0.517,6.569.517S557.769,13.718,553.958,12.868ZM569.6,13.557c-0.92-.349-1.821-1.167-3.969-0.688-3.811.85-3.342,3.918-3.342,3.918s4.416,0.551,6.569-.517,2.276-2.314,2.276-2.314A7.615,7.615,0,0,1,569.6,13.557Z"/>
-  <path id="new-tab" d="M541.977,28h-28a2,2,0,0,1-2-2V22a2,2,0,0,1,2-2H514c4.591,0,4-3,4.009-8,0.009-4.686.166-8,6.26-8h7.415c6.126,0,6.271,3.314,6.293,8,0.023,5-.592,8,4.023,8h-0.023a2,2,0,0,1,2,2v4A2,2,0,0,1,541.977,28ZM533,14h-4V10h-2v4h-4v2h4v4h2V16h4V14Z"/>
-  <path id="new-window" d="M510,29H482a1,1,0,0,1-1-1V4a1,1,0,0,1,1-1h28a1,1,0,0,1,1,1V28A1,1,0,0,1,510,29ZM499,5.015a0.991,0.991,0,1,0,1,.99A0.995,0.995,0,0,0,499,5.015Zm3,0a0.991,0.991,0,1,0,1,.99A0.995,0.995,0,0,0,502,5.015ZM507,5h-2a1,1,0,0,0,0,2h2A1,1,0,0,0,507,5Zm1,5a1,1,0,0,0-1-1H485a1,1,0,0,0-1,1V25a1,1,0,0,0,1,1h22a1,1,0,0,0,1-1V10Z"/>
-  <path id="encoding" d="M474,30H454a4,4,0,0,1-4-4V6a4,4,0,0,1,4-4h20a4,4,0,0,1,4,4V26A4,4,0,0,1,474,30Zm-1-19a6,6,0,0,0-6-6h-8a6,6,0,0,0-6,6v8a6,6,0,0,0,6,6h8c3.314,0,6-.686,6-4V11Zm-5.953,6.863a7.6,7.6,0,0,0,1.655-.171,7.822,7.822,0,0,0,1.587-.552v1.445a8.416,8.416,0,0,1-1.567.532,8.014,8.014,0,0,1-1.714.161A4.231,4.231,0,0,1,462.964,17a4.931,4.931,0,0,1-1.753,1.758,4.724,4.724,0,0,1-2.271.518,3.547,3.547,0,0,1-2.5-.83,3,3,0,0,1-.9-2.325,2.846,2.846,0,0,1,1.211-2.447,6.7,6.7,0,0,1,3.692-.952l1.8-.059V12a2.632,2.632,0,0,0-.566-1.86,2.271,2.271,0,0,0-1.729-.6,6.575,6.575,0,0,0-3,.82l-0.508-1.24a7.934,7.934,0,0,1,3.623-.918,4.438,4.438,0,0,1,2.076.425,2.656,2.656,0,0,1,1.206,1.353A3.647,3.647,0,0,1,464.7,8.653a3.833,3.833,0,0,1,1.909-.469,3.787,3.787,0,0,1,3.008,1.3,5.1,5.1,0,0,1,1.133,3.472V14H463.9Q463.98,17.863,467.047,17.863ZM462.2,13.819l-1.543.068a5.31,5.31,0,0,0-2.617.611,1.837,1.837,0,0,0-.8,1.646,1.673,1.673,0,0,0,.522,1.363,2.092,2.092,0,0,0,1.382.435,3.013,3.013,0,0,0,2.237-.825,3.16,3.16,0,0,0,.82-2.329V13.819Zm6.808-1.114a3.81,3.81,0,0,0-.625-2.344,2.124,2.124,0,0,0-1.8-.82,2.3,2.3,0,0,0-1.861.811,4.028,4.028,0,0,0-.786,2.354h5.069Z"/>
-  <path id="share" d="M433.425,19.753l-0.658.08,0-.08L443.07,4.742l-13.5,15.01,0.154,0.45-0.494.06,0.547,0.094,3.651,10.653L426.77,20.562l-8.777,1.067L445,1V25.188Zm0,1.231,4.938,2.986-4.938,7.04-0.6-10.129Z"/>
-  <path id="feed" d="M412.68,29.958l-3.1.031a1.516,1.516,0,0,1-1.538-1.516s0.687-7.114-6.308-14.356c-5.1-6.065-14.151-6.358-14.151-6.358a1.517,1.517,0,0,1-1.6-1.451l0.031-2.833a1.463,1.463,0,0,1,1.538-1.451s12.628,0.807,19.264,8.856c6.554,6.143,7.213,17.593,7.213,17.593A1.337,1.337,0,0,1,412.68,29.958Zm-25.159-18s7.416,0.88,11.585,4.753c4.264,3.961,4.9,11.794,4.9,11.794,0,0.832-.112,1.474-0.952,1.474l-2.852-.031a1.321,1.321,0,0,1-1.235-1.537,12.715,12.715,0,0,0-3.786-8.6c-2.877-2.641-7.694-2.8-7.694-2.8a1.437,1.437,0,0,1-1.521-1.412L386,13.371A1.436,1.436,0,0,1,387.521,11.96Zm2.488,10.03a4.012,4.012,0,1,1-4,4.012A4,4,0,0,1,390.009,21.989Z"/>
-  <path id="sync" d="M381.914,17.518a13.937,13.937,0,0,1-.8,3.367,10.892,10.892,0,0,1-5.084,6.587,23.381,23.381,0,0,0,2.531,1.884,51.867,51.867,0,0,1-8.176.671c-0.073.012-.145-0.233-0.218-0.221l-0.009.219a19.383,19.383,0,0,1-5.989-1.271,10.818,10.818,0,0,0,3.225-4.19,16.7,16.7,0,0,0,1.216-6.063,36.351,36.351,0,0,0,2.73,4.119,8.152,8.152,0,0,0,4.263-6.1,7.53,7.53,0,0,0-1.165-4.689,7.645,7.645,0,0,0-3.463-2.839c0.461-.872,1-1.847,1.513-2.674a7.385,7.385,0,0,1,2.559-2.383A13.959,13.959,0,0,1,381.914,17.518ZM367.96,13.509s-2.271-2.971-3.244-4.054a8.006,8.006,0,0,0-4.306,7.011,7.6,7.6,0,0,0,4.837,6.526,11.93,11.93,0,0,1-1.982,2.818,21.3,21.3,0,0,1-2.45,2.158,13.955,13.955,0,0,1-5.641-17.528,10.883,10.883,0,0,1,4.232-5.453c0.189-.147.382-0.287,0.577-0.424-0.8-.739-3.667-1.049-3.667-1.049s5.431-2.093,13.959-1.16C367.87,6.295,367.96,13.509,367.96,13.509Z"/>
-  <path id="save" d="M346.25,30h-20.5A1.755,1.755,0,0,1,324,28.25V3.75A1.755,1.755,0,0,1,325.75,2h13.5a5.164,5.164,0,0,1,3.033,1.19L346.717,7.3A4.6,4.6,0,0,1,348,10.241V28.25A1.755,1.755,0,0,1,346.25,30ZM345.774,9.293l-5-4.586C340.347,4.318,340,4.45,340,5v5h5.455C346.055,10,346.2,9.682,345.774,9.293Z"/>
-  <path id="open" d="M319.749,13.924a67.491,67.491,0,0,0-1.34,7.977,37.552,37.552,0,0,0-.4,6.4,0.708,0.708,0,0,1-.714.7H290.679a0.709,0.709,0,0,1-.715-0.7,37.552,37.552,0,0,0-.4-6.4,67.491,67.491,0,0,0-1.34-7.977C287.973,12.779,288.606,12,289,12h29.974C319.368,12,320,12.779,319.749,13.924Zm-29.682-6.9h-0.076V5.019a1.987,1.987,0,0,1,1.968-2.006h8.105c1.087,0,2.276,1.755,2.276,1.755l1.635,2.222,13-.009a1.012,1.012,0,0,1,1.025,1V11H290.048Z"/>
-  <path id="addOns" d="M277.051,30.97a1.987,1.987,0,0,0,1.977-2V21.86s0.3-1.829,1.515-1.829,1.088,1.934,3.356,1.934c1.133,0,3.085-.581,3.085-4.082s-1.952-3.924-3.085-3.924c-2.268,0-2.138,1.828-3.356,1.828s-1.515-1.881-1.515-1.881V10.994a1.988,1.988,0,0,0-1.977-2h-5.2s-1.725-.3-1.725-1.515,1.882-1.3,1.882-3.565c0-1.131-.632-2.926-4.135-2.926s-3.977,1.8-3.977,2.926c0,2.268,1.724,2.349,1.724,3.565S263.9,8.993,263.9,8.993h-4.951a1.989,1.989,0,0,0-1.976,2l0,3.906s-0.211,3.015,2.213,3.015c1.528,0,1.732-2.057,3.742-2.057,1,0,2.019.941,2.019,3.02S263.932,22,262.932,22c-2.01,0-2.214-2.055-3.742-2.055-2.424,0-2.213,2.909-2.213,2.909l0,6.115a1.988,1.988,0,0,0,1.976,2h6.638s3.154,0.212,3.154-2.214c0-1.528-1.991-1.824-1.991-3.835,0-1,1.109-2.238,3.19-2.238s3.314,1.238,3.314,2.238c0,2.012-1.928,2.307-1.928,3.835,0,2.425,3.154,2.214,3.154,2.214h2.572Z"/>
-#ifdef MOZ_PHOTON_THEME
-  <path id="downloads" d="M248.7 26.1h-17.5c-1 0-1.8.8-1.8 1.8s.8 1.8 1.8 1.8h17.5c1 0 1.8-.8 1.8-1.8s-.8-1.8-1.8-1.8zm-10-2.2c.7.7 1.8.7 2.5 0l8.8-8.8c.7-.7.6-1.8-.1-2.5-.7-.6-1.7-.6-2.4 0l-5.8 5.8v-15c0-1-.8-1.8-1.8-1.8s-1.8.8-1.8 1.8v15l-5.8-5.8c-.7-.7-1.8-.6-2.5.1-.6.7-.6 1.7 0 2.4l8.9 8.8z"/>
-#else
-  <path id="downloads" d="M253.285,18.118L242.09,29.126a3.008,3.008,0,0,1-4.242,0L226.59,18.118c-1.166-1.166-.772-2.121.879-2.121h6.5l0.062-12a2.027,2.027,0,0,1,2.032-2H244a2,2,0,0,1,2,2V16h6.406C254.057,16,254.451,16.952,253.285,18.118Z"/>
-#endif
-  <path id="history" d="M208.007,30.007a14,14,0,1,1,14-14A14,14,0,0,1,208.007,30.007Zm0-24.007a10.008,10.008,0,1,0,10,10.008A10,10,0,0,0,208.007,6ZM206.1,15.9V10.412a1.829,1.829,0,0,1,1.829-1.829,1.951,1.951,0,0,1,1.965,1.829v5.032a22.977,22.977,0,0,1,3.52,5.939s-4.106-1.8-6.059-3.773A1.811,1.811,0,0,1,206.1,15.9Z"/>
-  <path id="bookmark-filled" d="M188.4,11.546l-2.241-.371-5.3-.872-1.354-2.728v0l-1.09-2.192-1.088-2.2c-0.743-1.5-1.96-1.5-2.7,0l-1.089,2.2-1.088,2.192v0L171.1,10.3l-5.295.872-2.242.371c-1.677.275-2.093,1.49-.928,2.7l5.452,5.634-0.834,5.464L166.879,27.8c-0.253,1.643.766,2.348,2.264,1.576L171.2,28.3l2.051-1.071a0.007,0.007,0,0,0,.005,0l2.726-1.427,2.725,1.427a0.016,0.016,0,0,0,.007,0l2.048,1.071,2.06,1.082c1.5,0.772,2.514.068,2.266-1.576l-0.376-2.461-0.828-5.464,5.444-5.628C190.5,13.037,190.08,11.821,188.4,11.546Z"/>
-  <path id="Bookmark-hollow" d="M144,8.365l1.725,3.526,0.79,1.616,1.773,0.3,4.069,0.681-3.007,3.153-1.182,1.24,0.254,1.7,0.63,4.207-3.426-1.821-1.639-.871-1.639.871-3.423,1.819,0.632-4.2,0.255-1.7-1.184-1.241-3-3.15,4.111-.683,1.79-.3,0.787-1.636L144,8.365M143.984,2a1.671,1.671,0,0,0-1.351,1.139l-3.472,7.213-7.582,1.259c-1.675.279-2.091,1.509-.926,2.735l5.445,5.709-1.207,8.031c-0.183,1.207.3,1.914,1.151,1.914a2.448,2.448,0,0,0,1.111-.317l6.832-3.631,6.832,3.631a2.447,2.447,0,0,0,1.11.317c0.85,0,1.333-.707,1.152-1.914l-1.2-8.031,5.438-5.7c1.165-1.229.749-2.461-.926-2.74l-7.527-1.259-3.527-7.213A1.668,1.668,0,0,0,143.984,2h0Z"/>
-  <path id="home" d="M124,16L112,6,100,16H96L112,2l16,14h-4Zm-2,0v13.96h-8V20h-4v9.96h-8V16l10-8Z"/>
-  <path id="stop" d="M93.121,24.879l-4.243,4.243-8.9-8.9L71.206,29l-4.2-4.2,8.774-8.774-8.9-8.9,4.243-4.243,8.9,8.9L88.794,3l4.2,4.2L84.222,15.98Z"/>
-  <path id="reload" d="M62,14a2,2,0,0,1-2,2H48l5.833-5.833a8.993,8.993,0,1,0,1,12.686l3.035,2.6A13,13,0,1,1,56.669,7.331L62,2V14Z"/>
-  <path id="placeholder" fill-rule="evenodd" d="M16,0A16,16,0,1,1,0,16,16,16,0,0,1,16,0ZM8,24V8H24V24H8Zm14-2h0Zm-2.121,0L16,18.121,12.121,22h7.757Zm-6-6L10,12.121v7.757Zm-1.757-6L16,13.879,19.879,10H12.121Zm6,6L22,19.879V12.121Z"/>
-</svg>
--- a/browser/themes/shared/menupanel.inc.css
+++ b/browser/themes/shared/menupanel.inc.css
@@ -1,188 +1,10 @@
 /* Menu panel and palette styles */
 
-%ifndef MOZ_PHOTON_THEME
-toolbaritem[sdkstylewidget="true"] > toolbarbutton,
-:-moz-any(@primaryToolbarButtons@)[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > :-moz-any(@primaryToolbarButtons@) {
-  list-style-image: url(chrome://browser/skin/menuPanel.svg);
-}
-
-:-moz-any(@primaryToolbarButtons@)[cui-areatype="menu-panel"][panel-multiview-anchor=true] > .toolbarbutton-icon,
-:-moz-any(@primaryToolbarButtons@)[cui-areatype="menu-panel"][panel-multiview-anchor=true] > .toolbarbutton-badge-stack > .toolbarbutton-icon,
-:-moz-any(@primaryToolbarButtons@)[cui-areatype="menu-panel"][panel-multiview-anchor=true] > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
-  filter: url(chrome://global/skin/filters.svg#fill);
-  fill: currentColor;
-}
-
-#home-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #home-button {
-  -moz-image-region: rect(0px, 128px, 32px, 96px);
-}
-
-#bookmarks-menu-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #bookmarks-menu-button {
-  -moz-image-region: rect(0px, 192px, 32px, 160px);
-}
-
-#history-panelmenu[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #history-panelmenu {
-  -moz-image-region: rect(0px, 224px, 32px, 192px);
-}
-
-#downloads-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #downloads-button {
-  -moz-image-region: rect(0px, 256px, 32px, 224px);
-}
-
-#add-ons-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #add-ons-button {
-  -moz-image-region: rect(0px, 288px, 32px, 256px);
-}
-
-#open-file-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #open-file-button {
-  -moz-image-region: rect(0px, 320px, 32px, 288px);
-}
-
-#save-page-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #save-page-button {
-  -moz-image-region: rect(0px, 352px, 32px, 320px);
-}
-
-#sync-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #sync-button {
-  -moz-image-region: rect(0px, 1024px, 32px, 992px);
-}
-
-#containers-panelmenu[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #containers-panelmenu {
-  -moz-image-region: rect(0px, 1056px, 32px, 1024px);
-}
-
-#feed-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #feed-button {
-  -moz-image-region: rect(0px, 416px, 32px, 384px);
-}
-
-#social-share-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #social-share-button {
-  -moz-image-region: rect(0px, 448px, 32px, 416px);
-}
-
-#characterencoding-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #characterencoding-button {
-  -moz-image-region: rect(0px, 480px, 32px, 448px);
-}
-
-#new-window-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #new-window-button {
-  -moz-image-region: rect(0px, 512px, 32px, 480px);
-}
-
-#e10s-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #e10s-button {
-  -moz-image-region: rect(0px, 512px, 32px, 480px);
-}
-
-#new-tab-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #new-tab-button {
-  -moz-image-region: rect(0px, 544px, 32px, 512px);
-}
-
-#privatebrowsing-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #privatebrowsing-button {
-  -moz-image-region: rect(0px, 576px, 32px, 544px);
-}
-
-#find-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #find-button {
-  -moz-image-region: rect(0px, 640px, 32px, 608px);
-}
-
-#print-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #print-button {
-  -moz-image-region: rect(0px, 672px, 32px, 640px);
-}
-
-#fullscreen-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #fullscreen-button {
-  -moz-image-region: rect(0px, 704px, 32px, 672px);
-}
-
-#developer-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #developer-button {
-  -moz-image-region: rect(0px, 736px, 32px, 704px);
-}
-
-#preferences-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #preferences-button {
-  -moz-image-region: rect(0px, 768px, 32px, 736px);
-}
-
-#email-link-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #email-link-button {
-  -moz-image-region: rect(0, 800px, 32px, 768px);
-}
-
-#sidebar-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #sidebar-button {
-  -moz-image-region: rect(0, 864px, 32px, 832px);
-}
-
-#panic-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #panic-button {
-  -moz-image-region: rect(0, 896px, 32px, 864px);
-}
-
-#webide-button[cui-areatype="menu-panel"],
-toolbarpaletteitem[place="palette"] > #webide-button {
-  -moz-image-region: rect(0px, 960px, 32px, 928px);
-}
-
-toolbaritem[sdkstylewidget="true"] > toolbarbutton {
-  -moz-image-region: rect(0, 832px, 32px, 800px);
-}
-
-/* Wide panel control icons */
-
-#edit-controls@inAnyPanel@ > toolbarbutton,
-#zoom-controls@inAnyPanel@ > toolbarbutton,
-toolbarpaletteitem[place="palette"] > #edit-controls > toolbarbutton,
-toolbarpaletteitem[place="palette"] > #zoom-controls > toolbarbutton {
-  list-style-image: url(chrome://browser/skin/menuPanel-small.svg);
-}
-
-#edit-controls@inAnyPanel@ > #cut-button,
-toolbarpaletteitem[place="palette"] > #edit-controls > #cut-button {
-  -moz-image-region: rect(0px, 32px, 16px, 16px);
-}
-
-#edit-controls@inAnyPanel@ > #copy-button,
-toolbarpaletteitem[place="palette"] > #edit-controls > #copy-button {
-  -moz-image-region: rect(0px, 48px, 16px, 32px);
-}
-
-#edit-controls@inAnyPanel@ > #paste-button,
-toolbarpaletteitem[place="palette"] > #edit-controls > #paste-button {
-  -moz-image-region: rect(0px, 64px, 16px, 48px);
-}
-
-#zoom-controls@inAnyPanel@ > #zoom-out-button,
-toolbarpaletteitem[place="palette"] > #zoom-controls > #zoom-out-button {
-  -moz-image-region: rect(0px, 80px, 16px, 64px);
-}
-
-#zoom-controls@inAnyPanel@ > #zoom-in-button,
-toolbarpaletteitem[place="palette"] > #zoom-controls > #zoom-in-button {
-  -moz-image-region: rect(0px, 96px, 16px, 80px);
-}
-%endif
-
 #add-share-provider {
   list-style-image: url(chrome://browser/skin/menuPanel-small.svg);
   -moz-image-region: rect(0px, 96px, 16px, 80px);
 }
 
 #appMenuRecentlyClosedWindows,
 #appMenu-new-window-button {
   list-style-image: url(chrome://browser/skin/new-window.svg);
@@ -280,22 +102,20 @@ toolbarpaletteitem[place="palette"] > #z
 #panelMenuBookmarkThisPage {
   list-style-image: url("chrome://browser/skin/bookmark-hollow.svg");
 }
 
 #panelMenuBookmarkThisPage[starred] {
   list-style-image: url("chrome://browser/skin/bookmark.svg");
 }
 
-%ifdef MOZ_PHOTON_THEME
 #bookmarks-menu-button[cui-areatype="menu-panel"],
 toolbarpaletteitem[place="palette"] > #bookmarks-menu-button {
   list-style-image: url("chrome://browser/skin/bookmark-star-on-tray.svg");
 }
 
 #appMenuClearRecentHistory {
   list-style-image: url("chrome://browser/skin/forget.svg");
 }
 
 #appMenuRestoreLastSession {
   list-style-image: url("chrome://browser/skin/reload.svg");
 }
-%endif
--- a/browser/themes/shared/tabs.inc.css
+++ b/browser/themes/shared/tabs.inc.css
@@ -363,24 +363,18 @@
 /* Pinned tab separators need position: absolute when positioned (during overflow). */
 #tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned]::before {
   height: 100%;
   position: absolute;
 }
 
 .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"]) {
-%ifdef MOZ_PHOTON_THEME
   background-image: url(chrome://browser/skin/tabbrowser/indicator-tab-attention.svg);
   background-position: center bottom calc(-4px + var(--tab-toolbar-navbar-overlap));
-%else
-  background-image: radial-gradient(farthest-corner at center bottom, rgb(255,255,255) 3%, rgba(186,221,251,0.75) 20%, rgba(127,179,255,0.25) 40%, transparent 70%);
-  background-position: center bottom var(--tab-toolbar-navbar-overlap);
-  background-size: 85% 100%;
-%endif
   background-repeat: no-repeat;
 }
 
 .tabbrowser-tab[image] > .tab-stack > .tab-content[attention]:not([pinned]):not([selected="true"]) {
   background-position-x: left 11px;
 }
 
 .tabbrowser-tab[image] > .tab-stack > .tab-content[attention]:not([pinned]):not([selected="true"]):-moz-locale-dir(rtl) {
--- a/browser/themes/shared/toolbarbutton-icons.inc.css
+++ b/browser/themes/shared/toolbarbutton-icons.inc.css
@@ -7,39 +7,32 @@
   fill: #4c4c4c;
 }
 
 toolbar[brighttext] .toolbarbutton-1 {
   fill: #fff;
 }
 
 #back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
-%ifdef MOZ_PHOTON_THEME
 #forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
 #reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
 #library-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
-%endif
 #nav-bar-overflow-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
 #panic-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
   transform: scaleX(-1);
 }
 
 #back-button {
-%ifdef MOZ_PHOTON_THEME
   list-style-image: url("chrome://browser/skin/back.svg");
-%else
-  list-style-image: url("chrome://browser/skin/back-large.svg");
-%endif
 }
 
 #forward-button {
   list-style-image: url("chrome://browser/skin/forward.svg");
 }
 
-%ifdef MOZ_PHOTON_THEME
 .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
   animation-fill-mode: forwards;
   animation-iteration-count: 1;
   list-style-image: none;
 }
 
 /* The animations for the reload-button and stop-button are disabled
    outside of the nav-bar due to bug 1382894. */
@@ -173,159 +166,142 @@ toolbar[brighttext] .toolbarbutton-1 {
 
 #reload-button {
   list-style-image: url("chrome://browser/skin/reload.svg");
 }
 
 #stop-button {
   list-style-image: url("chrome://browser/skin/stop.svg");
 }
-%endif
 
-#home-button@attributeSelectorForToolbar@ {
+#home-button {
   list-style-image: url("chrome://browser/skin/home.svg");
 }
 
-#bookmarks-menu-button@attributeSelectorForToolbar@ {
+#bookmarks-menu-button {
   list-style-image: url("chrome://browser/skin/bookmark-hollow.svg");
 }
 
-#bookmarks-menu-button@attributeSelectorForToolbar@[starred] {
+#bookmarks-menu-button[starred] {
   list-style-image: url("chrome://browser/skin/bookmark.svg");
 }
 
-toolbar:not([brighttext]) #bookmarks-menu-button@attributeSelectorForToolbar@[starred] > .toolbarbutton-menubutton-button {
+toolbar:not([brighttext]) #bookmarks-menu-button[starred] > .toolbarbutton-menubutton-button {
   -moz-context-properties: fill;
   fill: var(--toolbarbutton-icon-fill-attention);
 }
 
-%ifdef MOZ_PHOTON_THEME
 #bookmarks-menu-button > .toolbarbutton-icon {
   list-style-image: url("chrome://browser/skin/bookmark-star-on-tray.svg");
 }
-%else
-#bookmarks-menu-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
-  list-style-image: url("chrome://browser/skin/bookmarksMenu.svg");
-}
-%endif
 
-#history-panelmenu@attributeSelectorForToolbar@ {
+#history-panelmenu {
   list-style-image: url("chrome://browser/skin/history.svg");
 }
 
-#downloads-button@attributeSelectorForToolbar@ {
-%ifdef MOZ_PHOTON_THEME
+#downloads-button {
   list-style-image: url("chrome://browser/skin/downloads/download-icons.svg#arrow-with-bar");
-%else
-  list-style-image: url("chrome://browser/skin/download.svg");
-%endif
 }
 
-#add-ons-button@attributeSelectorForToolbar@ {
+#add-ons-button {
   list-style-image: url("chrome://browser/skin/addons.svg");
 }
 
-#open-file-button@attributeSelectorForToolbar@ {
+#open-file-button {
   list-style-image: url("chrome://browser/skin/open.svg");
 }
 
-#save-page-button@attributeSelectorForToolbar@ {
+#save-page-button {
   list-style-image: url("chrome://browser/skin/save.svg");
 }
 
-#sync-button@attributeSelectorForToolbar@ {
+#sync-button {
   list-style-image: url("chrome://browser/skin/synced-tabs.svg");
 }
 
-#containers-panelmenu@attributeSelectorForToolbar@ {
+#containers-panelmenu {
   list-style-image: url("chrome://browser/skin/containers.svg");
 }
 
-#feed-button@attributeSelectorForToolbar@ {
+#feed-button {
   list-style-image: url("chrome://browser/skin/feed.svg");
 }
 
-#social-share-button@attributeSelectorForToolbar@ {
+#social-share-button {
   list-style-image: url("chrome://browser/skin/share.svg");
 }
 
-#characterencoding-button@attributeSelectorForToolbar@{
+#characterencoding-button {
   list-style-image: url("chrome://browser/skin/characterEncoding.svg");
 }
 
-#new-window-button@attributeSelectorForToolbar@ {
+#new-window-button {
   list-style-image: url("chrome://browser/skin/new-window.svg");
 }
 
-#e10s-button@attributeSelectorForToolbar@ {
+#e10s-button {
   list-style-image: url("chrome://browser/skin/new-window.svg");
 }
 
 #e10s-button > .toolbarbutton-icon {
   transform: scaleY(-1);
 }
 
-#new-tab-button@attributeSelectorForToolbar@ {
+#new-tab-button {
   list-style-image: url("chrome://browser/skin/new-tab.svg");
 }
 
-#privatebrowsing-button@attributeSelectorForToolbar@ {
+#privatebrowsing-button {
   list-style-image: url("chrome://browser/skin/privateBrowsing.svg");
 }
 
-#find-button@attributeSelectorForToolbar@ {
+#find-button {
   list-style-image: url("chrome://browser/skin/find.svg");
 }
 
-#print-button@attributeSelectorForToolbar@ {
+#print-button {
   list-style-image: url("chrome://browser/skin/print.svg");
 }
 
 %ifdef XP_MACOSX
 #restore-button,
 %endif
-#fullscreen-button@attributeSelectorForToolbar@ {
+#fullscreen-button {
   list-style-image: url("chrome://browser/skin/fullscreen.svg");
 }
 
-#developer-button@attributeSelectorForToolbar@ {
+#developer-button {
   list-style-image: url("chrome://browser/skin/developer.svg");
 }
 
-#preferences-button@attributeSelectorForToolbar@ {
+#preferences-button {
   list-style-image: url("chrome://browser/skin/settings.svg");
 }
 
 #PanelUI-menu-button {
   list-style-image: url("chrome://browser/skin/menu.svg");
 }
 
-%ifdef MOZ_PHOTON_THEME
-%define PSEUDO_FOR_COMBINED_BUTTONS
-%else
-%define PSEUDO_FOR_COMBINED_BUTTONS :not(@inAnyPanel@)
-%endif
-
-#edit-controls@PSEUDO_FOR_COMBINED_BUTTONS@ > #cut-button {
+#cut-button {
   list-style-image: url("chrome://browser/skin/edit-cut.svg");
 }
 
-#edit-controls@PSEUDO_FOR_COMBINED_BUTTONS@ > #copy-button {
+#copy-button {
   list-style-image: url("chrome://browser/skin/edit-copy.svg");
 }
 
-#edit-controls@PSEUDO_FOR_COMBINED_BUTTONS@ > #paste-button {
+#paste-button {
   list-style-image: url("chrome://browser/skin/edit-paste.svg");
 }
 
-#zoom-controls@PSEUDO_FOR_COMBINED_BUTTONS@ > #zoom-out-button {
+#zoom-out-button {
   list-style-image: url("chrome://browser/skin/zoom-out.svg");
 }
 
-#zoom-controls@PSEUDO_FOR_COMBINED_BUTTONS@ > #zoom-in-button {
+#zoom-in-button {
   list-style-image: url("chrome://browser/skin/zoom-in.svg");
 }
 
 #nav-bar-overflow-button {
   list-style-image: url("chrome://browser/skin/chevron.svg");
 }
 
 #nav-bar-overflow-button[animate] > .toolbarbutton-icon {
@@ -409,38 +385,38 @@ toolbar:not([brighttext]) #bookmarks-men
   animation-timing-function: ease-out;
   animation-duration: 730ms;
 }
 
 #nav-bar-overflow-button[animate][fade]:-moz-locale-dir(rtl) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
   transform: scaleX(-1);
 }
 
-#email-link-button@attributeSelectorForToolbar@ {
+#email-link-button {
   list-style-image: url("chrome://browser/skin/mail.svg");
 }
 
-#sidebar-button@attributeSelectorForToolbar@ {
+#sidebar-button {
   list-style-image: url("chrome://browser/skin/sidebars-right.svg");
 }
 
-#sidebar-button@attributeSelectorForToolbar@:-moz-locale-dir(ltr):not([positionend]),
-#sidebar-button@attributeSelectorForToolbar@:-moz-locale-dir(rtl)[positionend] {
+#sidebar-button:-moz-locale-dir(ltr):not([positionend]),
+#sidebar-button:-moz-locale-dir(rtl)[positionend] {
   list-style-image: url("chrome://browser/skin/sidebars.svg");
 }
 
-#panic-button@attributeSelectorForToolbar@ {
+#panic-button {
   list-style-image: url("chrome://browser/skin/forget.svg");
 }
 
-#panic-button@attributeSelectorForToolbar@[open] {
+#panic-button[open] {
   fill: rgb(213, 32, 20);
 }
 
-#webide-button@attributeSelectorForToolbar@ {
+#webide-button {
   list-style-image: url("chrome://browser/skin/webIDE.svg");
 }
 
 #library-button {
   list-style-image: url("chrome://browser/skin/library.svg");
 }
 
 @keyframes library-bookmark-animation {
--- a/browser/themes/shared/toolbarbuttons.inc.css
+++ b/browser/themes/shared/toolbarbuttons.inc.css
@@ -1,72 +1,42 @@
 /* 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 MOZ_PHOTON_THEME
-%filter substitution
-%define toolbarShadowColor hsla(209,67%,12%,0.35)
-%define forwardTransitionLength 150ms
-%define conditionalForwardWithUrlbar window:not([chromehidden~="toolbar"]) #urlbar-wrapper
-%endif
-
 :root {
-%ifdef MOZ_PHOTON_THEME
   --toolbarbutton-hover-background: hsla(240,5%,5%,.1);
   --toolbarbutton-active-background: hsla(240,5%,5%,.15);
 
   --toolbarbutton-inner-padding: 6px;
 
   --backbutton-background: hsla(0,100%,100%,.8);
   --backbutton-hover-background: var(--backbutton-background);
   --backbutton-active-background: var(--toolbarbutton-active-background);
 
   --backbutton-border-color: hsla(240,5%,5%,.3);
-%else
-  --backbutton-urlbar-overlap: 6px;
-
-  /* icon width + border + horizontal padding (without the overlap from backbutton-urlbar-overlap) */
-  --forwardbutton-width: 25px;
-
-  --toolbarbutton-inner-padding: 3px;
-%endif
   /* This default value of --toolbarbutton-height is defined to prevent
      CSS errors for an invalid variable. The value should not get used,
      as a more specific value should be set when the value will be used. */
   --toolbarbutton-height: 0;
 }
 
 /* Larger buttons in touch mode */
 :root[uidensity=touch] {
   --toolbarbutton-inner-padding: 9px;
 }
 
-%ifndef MOZ_PHOTON_THEME
-toolbar:-moz-lwtheme {
-  --toolbarbutton-hover-background: rgba(255,255,255,.25);
-  --toolbarbutton-active-background: rgba(70%,70%,70%,.25);
-
-  --toolbarbutton-hover-bordercolor: rgba(0,0,0,.2);
-
-  --toolbarbutton-active-bordercolor: rgba(0,0,0,.3);
-  --toolbarbutton-active-boxshadow: 0 0 2px rgba(0,0,0,.6) inset;
-
-  --toolbarbutton-checkedhover-backgroundcolor: rgba(85%,85%,85%,.25);
-}
-%else
 toolbar[brighttext] {
   --toolbarbutton-hover-background: hsla(0,0%,100%,.2);
   --toolbarbutton-active-background: hsla(0,0%,100%,.3);
 
   --backbutton-background: var(--toolbarbutton-hover-background);
   --backbutton-hover-background: var(--toolbarbutton-active-background);
   --backbutton-active-background: hsla(0,0%,100%,.4);
 }
-%endif
 
 /* ::::: primary toolbar buttons ::::: */
 
 .tabbrowser-arrowscrollbox > .scrollbutton-up[disabled=true],
 .tabbrowser-arrowscrollbox > .scrollbutton-down[disabled=true],
 /* specialcase the overflow and the hamburger button so they show up disabled in customize mode. */
 #nav-bar-overflow-button[disabled=true] > .toolbarbutton-icon,
 #PanelUI-menu-button[disabled=true] > .toolbarbutton-badge-stack > .toolbarbutton-icon,
@@ -134,69 +104,46 @@ toolbar[brighttext] {
 #nav-bar .toolbarbutton-1 > menupopup {
   margin-top: -3px;
 }
 
 #nav-bar .toolbarbutton-1 > menupopup.cui-widget-panel {
   margin-top: -8px;
 }
 
-%ifndef MOZ_PHOTON_THEME
-@conditionalForwardWithUrlbar@ > .toolbarbutton-1:-moz-any([disabled],:not([open]):not([disabled]):not(:active)) > .toolbarbutton-icon,
-%endif
 .findbar-button > .toolbarbutton-text,
 toolbarbutton.bookmark-item:not(.subviewbutton),
 #nav-bar .toolbarbutton-1 > .toolbarbutton-icon,
 #nav-bar .toolbarbutton-1 > .toolbarbutton-text,
 #nav-bar .toolbarbutton-1 > .toolbarbutton-badge-stack {
-%ifdef MOZ_PHOTON_THEME
   padding: var(--toolbarbutton-inner-padding);
-%else
-  padding: var(--toolbarbutton-inner-padding) 7px;
-  background-origin: padding-box !important;
-  background-clip: padding-box !important;
-  border: 1px solid transparent;
-%endif
   border-radius: var(--toolbarbutton-border-radius);
   transition-property: background-color, border-color, box-shadow;
   transition-duration: 150ms;
 }
 
 #nav-bar .toolbarbutton-1 > .toolbarbutton-icon {
-%ifdef MOZ_PHOTON_THEME
   /* horizontal padding + actual icon width */
   max-width: calc(2 * var(--toolbarbutton-inner-padding) + 16px);
-%else
-  /* Before Photon horizontal padding is 7px, but --toolbarbutton-inner-padding is set to 3px */
-  max-width: 32px;
-%endif
 }
 
 .bookmark-item > .toolbarbutton-menu-dropmarker,
 #TabsToolbar .toolbarbutton-1 > .toolbarbutton-menu-dropmarker,
 #nav-bar .toolbarbutton-1 > .toolbarbutton-menu-dropmarker {
   display: none;
 }
 
 #nav-bar .toolbarbutton-1 > .toolbarbutton-text {
   padding-top: var(--toolbarbutton-vertical-text-padding);
   padding-bottom: 0;
-%ifdef MOZ_PHOTON_THEME
   /* To make the hover feedback line up with sibling buttons, it needs the same
    * height as the button icons and the same vertical padding, but as a minimum,
    * because otherwise an increase in text sizes would break things.
    */
   min-height: calc(16px + 2 * var(--toolbarbutton-inner-padding));
-%else
-  /* To make the hover feedback line up with sibling buttons, it needs the same
-   * height (16px) + padding (2 * 3px) + border (2 * 1px), but as a minimum
-   * because otherwise an increase in text sizes would break things.
-   */
-  min-height: calc(18px + 2 * var(--toolbarbutton-inner-padding));
-%endif
 }
 
 #nav-bar .toolbaritem-combined-buttons {
   margin-left: 2px;
   margin-right: 2px;
 }
 
 #nav-bar .toolbaritem-combined-buttons > .toolbarbutton-1 {
@@ -225,96 +172,36 @@ toolbarbutton.bookmark-item:not(.subview
 #TabsToolbar .toolbarbutton-1[open],
 .tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled=true]):hover,
 .tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled=true]):hover,
 .findbar-button:not(:-moz-any([checked="true"],[disabled="true"])):hover > .toolbarbutton-text,
 toolbarbutton.bookmark-item:not(.subviewbutton):hover:not([disabled="true"]):not([open]),
 #nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-icon,
 #nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-text,
 #nav-bar .toolbarbutton-1:not([disabled=true]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-stack {
-%ifdef MOZ_PHOTON_THEME
   background-color: var(--toolbarbutton-hover-background);
-%else
-  background: var(--toolbarbutton-hover-background);
-  border-color: var(--toolbarbutton-hover-bordercolor);
-  box-shadow: var(--toolbarbutton-hover-boxshadow);
-%endif
   color: inherit;
 }
 
 .findbar-button:not([disabled=true]):-moz-any([checked="true"],:hover:active) > .toolbarbutton-text,
 toolbarbutton.bookmark-item:not(.subviewbutton):hover:active:not([disabled="true"]),
 toolbarbutton.bookmark-item[open="true"],
 #nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-icon,
 #nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-text,
 #nav-bar .toolbarbutton-1:not([disabled=true]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-stack {
-%ifdef MOZ_PHOTON_THEME
   background-color: var(--toolbarbutton-active-background);
-%else
-  background: var(--toolbarbutton-active-background);
-  border-color: var(--toolbarbutton-active-bordercolor);
-  box-shadow: var(--toolbarbutton-active-boxshadow);
-%endif
   transition-duration: 10ms;
   color: inherit;
 }
 
 #nav-bar .toolbarbutton-1[checked]:not(:active):hover > .toolbarbutton-icon {
-%ifdef MOZ_PHOTON_THEME
   background-color: var(--toolbarbutton-hover-background);
-%else
-  background-color: var(--toolbarbutton-checkedhover-backgroundcolor);
-%endif
   transition: background-color .4s;
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* unified back/forward button */
-
-:-moz-any(#back-button, #forward-button) > .toolbarbutton-icon {
-  border-color: var(--backbutton-border-color) !important;
-  background: var(--backbutton-background);
-}
-
-#forward-button {
-  -moz-box-align: stretch; /* let the button shape grow vertically with the location bar */
-  padding: 0 !important;
-}
-
-#forward-button > menupopup {
-  margin-top: 1px !important;
-}
-
-#forward-button > .toolbarbutton-icon {
-  border-left-style: none !important;
-  border-radius: 0 !important;
-  padding-left: calc(var(--backbutton-urlbar-overlap) + 4px) !important;
-  padding-right: 4px !important;
-  max-width: calc(var(--forwardbutton-width) + var(--backbutton-urlbar-overlap)) !important;
-}
-
-@conditionalForwardWithUrlbar@:not([switchingtabs]) > #forward-button {
-  transition: margin-left @forwardTransitionLength@ ease-out;
-}
-
-@conditionalForwardWithUrlbar@ > #forward-button[disabled] {
-  margin-left: calc(0px - var(--forwardbutton-width) - var(--backbutton-urlbar-overlap));
-}
-
-@conditionalForwardWithUrlbar@:hover:not([switchingtabs]) > #forward-button[disabled] {
-  /* delay the hiding of the forward button when hovered to avoid accidental clicks on the url bar */
-  transition-delay: 100s;
-}
-
-@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] {
-  /* when not hovered anymore, trigger a new transition to hide the forward button immediately */
-  margin-left: calc(-0.01px - var(--forwardbutton-width) - var(--backbutton-urlbar-overlap));
-}
-%endif
-
 :root:not([uidensity=compact]) #back-button {
   padding-top: 3px;
   padding-bottom: 3px;
   padding-inline-start: 5px !important;
   padding-inline-end: 0 !important;
   position: relative !important;
   z-index: 1 !important;
   border-radius: 0 10000px 10000px 0;
@@ -324,50 +211,46 @@ toolbarbutton.bookmark-item[open="true"]
   border-radius: 10000px 0 0 10000px;
 }
 
 #back-button > menupopup {
   margin-top: -1px !important;
 }
 
 :root:not([uidensity=compact]) #back-button > .toolbarbutton-icon {
-%ifdef MOZ_PHOTON_THEME
   background-color: var(--backbutton-background);
   background-origin: padding-box;
   background-clip: padding-box;
   border: 1px solid var(--backbutton-border-color);
-%endif
   border-radius: 10000px;
   max-width: 32px;
   padding: 7px;
 }
 
 :root[uidensity=touch] #back-button {
   padding-top: 1px;
   padding-bottom: 1px;
 }
 
 :root[uidensity=touch] #back-button > .toolbarbutton-icon {
   max-width: 38px;
   padding: 10px;
 }
 
-%ifdef MOZ_PHOTON_THEME
 :root:not([uidensity=compact]) #back-button:not([disabled]):not([open]):hover > .toolbarbutton-icon {
   background-color: var(--backbutton-hover-background) !important;
   box-shadow: 0 1px 6px hsla(0,0%,0%,.1);
   border-color: hsla(240,5%,5%,.35);
 }
 
 :root:not([uidensity=compact]) #back-button[open] > .toolbarbutton-icon,
 :root:not([uidensity=compact]) #back-button:not([disabled]):hover:active > .toolbarbutton-icon {
   background-color: var(--backbutton-active-background) !important;
   border-color: hsla(240,5%,5%,.40);
 }
-%endif
 
 /* bookmarks menu button */
 
 #BMB_bookmarksPopup[side="top"],
 #BMB_bookmarksPopup[side="bottom"] {
   margin-left: -20px;
   margin-right: -20px;
 }
--- a/browser/themes/shared/urlbar-searchbar.inc.css
+++ b/browser/themes/shared/urlbar-searchbar.inc.css
@@ -1,14 +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/. */
 
-%ifdef MOZ_PHOTON_THEME
-
 #urlbar,
 .searchbar-textbox {
   -moz-appearance: none;
   background-clip: content-box;
   border: 1px solid hsla(240,5%,5%,.25);
   border-radius: var(--toolbarbutton-border-radius);
   box-shadow: 0 1px 4px rgba(0,0,0,.05);
   padding: 0;
@@ -30,18 +28,16 @@
 
 #urlbar:-moz-lwtheme:hover,
 #urlbar:-moz-lwtheme[focused="true"],
 .searchbar-textbox:-moz-lwtheme:hover,
 .searchbar-textbox:-moz-lwtheme[focused="true"] {
   background-color: white;
 }
 
-%endif
-
 :root[uidensity=compact] #urlbar,
 :root[uidensity=compact] .searchbar-textbox {
   min-height: 26px;
   margin-top: 3px;
   margin-bottom: 3px;
 }
 
 :root[uidensity=touch] #urlbar,
@@ -59,17 +55,16 @@
   min-width: 12px;
   margin: 0 -6px;
   position: relative;
   border: none;
   background: transparent;
   -moz-appearance: none;
 }
 
-%ifdef MOZ_PHOTON_THEME
 /* Page action panel */
 .pageAction-panel-button > .toolbarbutton-icon {
   width: 16px;
   height: 16px;
 }
 
 #pageAction-panel-bookmark,
 #star-button {
@@ -195,17 +190,16 @@
   animation-timing-function: steps(19);
   animation-duration: 317ms;
   width: 660px;
 }
 
 #star-button-box[animationsenabled] > #star-button[starred][animate]:-moz-locale-dir(rtl) + #star-button-animatable-box > #star-button-animatable-image {
   animation-name: bookmark-animation-rtl;
 }
-%endif /* MOZ_PHOTON_THEME */
 
 /* Zoom button */
 #urlbar-zoom-button {
   margin: 0 3px;
   font-size: .8em;
   padding: 0 8px;
   border-radius: 1em;
   background-color: hsla(0,0%,0%,.05);
--- a/browser/themes/windows/browser-aero.css
+++ b/browser/themes/windows/browser-aero.css
@@ -39,31 +39,29 @@
 
   @media not all and (-moz-os-version: windows-win7) {
     @media not all and (-moz-os-version: windows-win8) {
       @media (-moz-windows-default-theme) {
         :root:not(:-moz-lwtheme) {
           background-color: hsl(0, 0%, 78%);
         }
 
-%ifdef MOZ_PHOTON_THEME
         @media (-moz-windows-accent-color-in-titlebar: 0) {
           :root[tabsintitlebar]:not(:-moz-lwtheme) {
             background-color: hsl(235,33%,19%);
             --titlebar-text-color: hsl(240,9%,98%);
           }
         }
 
         @media (-moz-windows-accent-color-in-titlebar) {
           :root[tabsintitlebar]:not(:-moz-window-inactive):not(:-moz-lwtheme) {
             background-color: -moz-win-accentcolor;
             --titlebar-text-color: -moz-win-accentcolortext;
           }
         }
-%endif
 
         :root[tabsintitlebar] .tab-label:-moz-window-inactive {
           /* Calculated to match the opacity change of Windows Explorer
              titlebar text change for inactive windows. */
           opacity: .6;
         }
       }
 
@@ -78,21 +76,17 @@
         -moz-appearance: none !important;
       }
 
       .titlebar-button {
         border: none;
         margin: 0 !important;
         padding: 10px 17px;
         -moz-context-properties: stroke;
-%ifdef MOZ_PHOTON_THEME
         stroke: var(--titlebar-text-color);
-%else
-        stroke: black;
-%endif
       }
 
       :root[sizemode=maximized] .titlebar-button {
         padding-top: 8px;
         padding-bottom: 8px;
       }
 
       .titlebar-button > .toolbarbutton-icon {
@@ -174,17 +168,16 @@
          * impossible to know by how much. */
         .titlebar-button > .toolbarbutton-icon {
           width: 10.8px;
           height: 10.8px;
         }
       }
 
       @media (-moz-windows-default-theme) {
-%ifdef MOZ_PHOTON_THEME
         #main-menubar > menu {
           -moz-appearance: none;
         }
 
         #main-menubar > menu[_moz-menuactive="true"],
         .titlebar-button:hover {
           background-color: hsla(0,0%,100%,.22);
         }
@@ -193,30 +186,16 @@
         }
         #main-menubar > menu[_moz-menuactive="true"]:-moz-lwtheme-darktext,
         .titlebar-button:-moz-lwtheme-darktext:hover {
           background-color: hsla(0,0%,0%,.12);
         }
         .titlebar-button:-moz-lwtheme-darktext:hover:active {
           background-color: hsla(0,0%,0%,.22);
         }
-%else
-        .titlebar-button:hover {
-          background-color: hsla(0,0%,0%,.12);
-        }
-        .titlebar-button:hover:active {
-          background-color: hsla(0,0%,0%,.22);
-        }
-        .titlebar-button:-moz-lwtheme-brighttext:hover {
-          background-color: hsla(0,0%,100%,.12);
-        }
-        .titlebar-button:-moz-lwtheme-brighttext:hover:active {
-          background-color: hsla(0,0%,100%,.22);
-        }
-%endif
 
         .titlebar-button:not(:hover) > .toolbarbutton-icon:-moz-window-inactive {
           opacity: 0.5;
         }
 
         #titlebar-close:hover {
           stroke: white;
           background-color: hsl(355,86%,49%);
@@ -340,22 +319,16 @@
 
     #main-window[sizemode=normal] #browser-bottombox {
       border: 1px solid @toolbarShadowColor@;
       border-top-style: none;
       background-clip: padding-box;
     }
   }
 
-%ifndef MOZ_PHOTON_THEME
-  #main-window[sizemode=normal] #TabsToolbar {
-    padding-left: 1px;
-    padding-right: 1px;
-  }
-%endif
   #appcontent:not(:-moz-lwtheme) {
     background-color: -moz-dialog;
   }
 }
 
 @media (-moz-windows-glass) {
   #main-window[sizemode=normal] #nav-bar {
     border-top-left-radius: 2.5px;
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -20,38 +20,17 @@
 
   --toolbar-non-lwt-bgcolor: -moz-dialog;
   --toolbar-non-lwt-textcolor: -moz-dialogtext;
   --toolbar-non-lwt-bgimage: linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15));
   --toolbar-bgcolor: var(--toolbar-non-lwt-bgcolor);
   --toolbar-bgimage: var(--toolbar-non-lwt-bgimage);
 
   --toolbarbutton-vertical-text-padding: calc(var(--toolbarbutton-inner-padding) - 1px);
-
-%ifdef MOZ_PHOTON_THEME
   --toolbarbutton-border-radius: 2px;
-%else
-  --space-above-tabbar: 15px;
-
-  --toolbarbutton-border-radius: 1px;
-
-  --toolbarbutton-hover-background: rgba(0,0,0,.1);
-  --toolbarbutton-active-background: rgba(0,0,0,.15);
-
-  --backbutton-border-color: var(--urlbar-border-color-hover);
-  --backbutton-background: rgba(255,255,255,.15);
-
-  --toolbarbutton-hover-bordercolor: rgba(0,0,0,.2);
-  --toolbarbutton-hover-boxshadow: none;
-
-  --toolbarbutton-active-bordercolor: rgba(0,0,0,.3);
-  --toolbarbutton-active-boxshadow: 0 0 0 1px rgba(0,0,0,.15) inset;
-
-  --toolbarbutton-checkedhover-backgroundcolor: rgba(0,0,0,.1);
-%endif
 
   --urlbar-dropmarker-url: url("chrome://browser/skin/urlbar-history-dropmarker.png");
   --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px);
   --urlbar-dropmarker-hover-region: rect(0px, 22px, 14px, 11px);
   --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px);
   --urlbar-dropmarker-2x-url: url("chrome://browser/skin/urlbar-history-dropmarker@2x.png");
   --urlbar-dropmarker-2x-region: rect(0, 22px, 28px, 0);
   --urlbar-dropmarker-hover-2x-region: rect(0, 44px, 28px, 22px);
@@ -79,76 +58,43 @@
 
 :root:-moz-lwtheme {
   --tabs-border: rgba(0,0,0,.3);
 
   --toolbar-bgcolor: rgba(255,255,255,.4);
   --toolbar-bgimage: none;
 }
 
-%ifndef MOZ_PHOTON_THEME
-toolbar[brighttext] {
-  --toolbarbutton-hover-background: rgba(255,255,255,.25);
-  --toolbarbutton-hover-bordercolor: rgba(255,255,255,.5);
-
-  --toolbarbutton-active-background: rgba(255,255,255,.4);
-  --toolbarbutton-active-bordercolor: rgba(255,255,255,.7);
-  --toolbarbutton-active-boxshadow: 0 0 0 1px rgba(255,255,255,.4) inset;
-
-  --toolbarbutton-checkedhover-backgroundcolor: rgba(255,255,255,.3);
-}
-%endif
 #menubar-items {
   -moz-box-orient: vertical; /* for flex hack */
 }
 
 #main-menubar {
   -moz-box-flex: 1; /* make menu items expand to fill toolbar height */
 }
 
 /* Hides the titlebar-placeholder underneath the window caption buttons when we
    are not autohiding the menubar. */
 #toolbar-menubar:not([autohide="true"]) + #TabsToolbar > .titlebar-placeholder[type="caption-buttons"] {
   display: none;
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* We want a 4px gap between the TabsToolbar and the toolbar-menubar when the
-   toolbar-menu is displayed, and a 16px gap when it is not. 1px is taken care
-   of by the (light) outer shadow of the tab, the remaining 3/15 are these margins. */
-#toolbar-menubar:not([autohide=true]) ~ #TabsToolbar:not([inFullscreen]),
-#toolbar-menubar[autohide=true]:not([inactive]) ~ #TabsToolbar:not([inFullscreen]) {
-  margin-top: 3px;
-}
-
-#main-window[tabsintitlebar][sizemode="normal"]:not([inFullscreen])[chromehidden~="menubar"] #toolbar-menubar ~ #TabsToolbar,
-#main-window[tabsintitlebar][sizemode="normal"]:not([inFullscreen]) #toolbar-menubar[autohide="true"][inactive] ~ #TabsToolbar {
-  margin-top: var(--space-above-tabbar);
-}
-%endif
 #navigator-toolbox,
 #navigator-toolbox > toolbar {
   -moz-appearance: none;
 }
 
 #navigator-toolbox::after {
   content: "";
   display: -moz-box;
   -moz-box-ordinal-group: 101; /* tabs toolbar is 100 */
   border-bottom: 1px solid ThreeDShadow;
 }
 
 @media (-moz-windows-default-theme) {
-%ifndef MOZ_PHOTON_THEME
-  @media (-moz-os-version: windows-win7) {
-    #navigator-toolbox::after {
-      border-bottom-color: #aabccf;
-    }
-  }
-%endif
   @media (-moz-os-version: windows-win8),
          (-moz-os-version: windows-win10) {
     #navigator-toolbox::after {
       border-bottom-color: #c2c2c2;
     }
   }
 }
 
@@ -161,28 +107,16 @@ toolbar[brighttext] {
 }
 
 #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
   background-color: var(--toolbar-bgcolor);
   background-image: var(--toolbar-bgimage);
   background-clip: padding-box;
 }
 
-%ifndef MOZ_PHOTON_THEME
-@media (-moz-os-version: windows-win7) {
-  #nav-bar {
-    background-image: linear-gradient(@toolbarHighlight@, transparent) !important;
-  }
-
-  #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar) {
-    background-image: none;
-  }
-}
-%endif
-
 #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar) {
   overflow: -moz-hidden-unscrollable;
   max-height: 4em;
   transition: min-height 170ms ease-out, max-height 170ms ease-out;
   padding: 0 5px;
 }
 
 #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):not(#addon-bar)[collapsed=true] {
@@ -468,37 +402,16 @@ menuitem.bookmark-item {
   opacity: 0.7;
 }
 
 
 %include ../shared/bookmarked-notification.inc.css
 %include ../shared/toolbarbuttons.inc.css
 %include ../shared/toolbarbutton-icons.inc.css
 %include ../shared/menupanel.inc.css
-%ifndef MOZ_PHOTON_THEME
-@media (-moz-os-version: windows-win7) {
-  :root {
-    --toolbarbutton-hover-background: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
-    --toolbarbutton-hover-bordercolor: hsla(210,54%,20%,.15) hsla(210,54%,20%,.2) hsla(210,54%,20%,.25);
-    --toolbarbutton-hover-boxshadow: 0 1px hsla(0,0%,100%,.3) inset,
-                                     0 1px hsla(210,54%,20%,.03),
-                                     0 0 2px hsla(210,54%,20%,.1);
-
-    --toolbarbutton-active-background: hsla(210,54%,20%,.15) linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
-    --toolbarbutton-active-bordercolor: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4);
-    --toolbarbutton-active-boxshadow: 0 1px 1px hsla(210,54%,20%,.1) inset,
-                                      0 0 1px hsla(210,54%,20%,.2) inset,
-/* allows keyhole-forward-clip-path to be used for non-hover as well as hover: */
-                                      0 1px 0 hsla(210,54%,20%,0),
-                                      0 0 2px hsla(210,54%,20%,0);
-
-    --toolbarbutton-checkedhover-backgroundcolor: rgba(90%,90%,90%,.4);
-  }
-}
-%endif
 
 .unified-nav-back[_moz-menuactive]:-moz-locale-dir(ltr),
 .unified-nav-forward[_moz-menuactive]:-moz-locale-dir(rtl) {
   list-style-image: url("chrome://browser/skin/menu-back.png") !important;
 }
 
 .unified-nav-forward[_moz-menuactive]:-moz-locale-dir(ltr),
 .unified-nav-back[_moz-menuactive]:-moz-locale-dir(rtl) {
@@ -638,18 +551,16 @@ menuitem.bookmark-item {
     transform: scaleX(-1);
   }
 }
 
 /* ::::: Location Bar ::::: */
 
 %include ../shared/urlbar-searchbar.inc.css
 
-%ifdef MOZ_PHOTON_THEME
-
 #urlbar,
 .searchbar-textbox {
   font-size: 1.15em;
 }
 
 @media (-moz-windows-default-theme: 0) {
   #urlbar:not(:-moz-lwtheme):not([focused="true"]),
   .searchbar-textbox:not(:-moz-lwtheme):not([focused="true"]) {
@@ -657,165 +568,16 @@ menuitem.bookmark-item {
   }
 }
 
 #urlbar[focused="true"],
 .searchbar-textbox[focused="true"] {
   border-color: Highlight;
 }
 
-%else
-
-#main-window {
-  --urlbar-border-color: ThreeDShadow;
-  --urlbar-border-color-hover: var(--urlbar-border-color);
-}
-
-#navigator-toolbox:-moz-lwtheme {
-  --urlbar-border-color: var(--toolbarbutton-hover-bordercolor);
-}
-
-@media (-moz-windows-default-theme) {
-  @media (-moz-os-version: windows-win7),
-         (-moz-os-version: windows-win8) {
-    #main-window:not(:-moz-lwtheme) {
-      --urlbar-border-color: hsla(210,54%,20%,.25) hsla(210,54%,20%,.27) hsla(210,54%,20%,.3);
-      --urlbar-border-color-hover: hsla(210,54%,20%,.35) hsla(210,54%,20%,.37) hsla(210,54%,20%,.4);
-    }
-  }
-
-  @media (-moz-os-version: windows-win10) {
-    #main-window:not(:-moz-lwtheme) {
-      --urlbar-border-color: hsl(0,0%,90%);
-      --urlbar-border-color-hover: hsl(0,0%,80%);
-    }
-  }
-}
-
-#urlbar,
-.searchbar-textbox {
-  -moz-appearance: none;
-  margin: 0 3px;
-  padding: 0;
-  background-clip: padding-box;
-  border: 1px solid;
-  border-color: var(--urlbar-border-color);
-}
-
-#urlbar:hover,
-.searchbar-textbox:hover {
-  border-color: var(--urlbar-border-color-hover);
-}
-
-@media (-moz-windows-default-theme) {
-  #urlbar,
-  .searchbar-textbox {
-    border-radius: 1px;
-  }
-
-  @media (-moz-os-version: windows-win7),
-         (-moz-os-version: windows-win8) {
-    #urlbar:not(:-moz-lwtheme),
-    .searchbar-textbox:not(:-moz-lwtheme) {
-      box-shadow: 0 1px 0 hsla(0,0%,0%,.01) inset,
-                  0 1px 0 hsla(0,0%,100%,.1);
-    }
-  }
-
-  @media (-moz-os-version: windows-win10) {
-    #urlbar:not(:-moz-lwtheme),
-    .searchbar-textbox:not(:-moz-lwtheme) {
-      padding: 1px;
-      transition-property: border-color, box-shadow;
-      transition-duration: .1s;
-    }
-
-    #urlbar:not(:-moz-lwtheme)[focused],
-    .searchbar-textbox:not(:-moz-lwtheme)[focused] {
-      box-shadow: 0 0 0 1px Highlight inset;
-    }
-  }
-
-  #urlbar:not(:-moz-lwtheme)[focused],
-  .searchbar-textbox:not(:-moz-lwtheme)[focused] {
-    border-color: Highlight;
-  }
-}
-
-@media (-moz-os-version: windows-win10) {
-  #urlbar,
-  .searchbar-textbox {
-    font-size: 1.15em;
-    min-height: 28px;
-  }
-
-  :root {
-    /* let toolbar buttons match the location and search bar's minimum height */
-    --toolbarbutton-inner-padding: 5px;
-  }
-}
-
-#urlbar:-moz-lwtheme,
-.searchbar-textbox:-moz-lwtheme {
-  background-color: rgba(255,255,255,.8);
-  color: black;
-}
-
-#urlbar:-moz-lwtheme:hover:not([readonly]),
-.searchbar-textbox:-moz-lwtheme:hover {
-  background-color: rgba(255,255,255,.9);
-}
-
-#urlbar:-moz-lwtheme[focused]:not([readonly]),
-.searchbar-textbox:-moz-lwtheme[focused] {
-  background-color: white;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar {
-  border-inline-start: none;
-  padding-inline-start: 0;
-  margin-left: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(ltr) {
-  border-top-left-radius: 0;
-  border-bottom-left-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  border-top-right-radius: 0;
-  border-bottom-right-radius: 0;
-}
-
-@conditionalForwardWithUrlbar@ {
-  clip-path: url("chrome://browser/content/browser.xul#urlbar-back-button-clip-path");
-  margin-inline-start: calc(-1 * var(--backbutton-urlbar-overlap));
-}
-
-@media (-moz-os-version: windows-win10) {
-  @conditionalForwardWithUrlbar@ {
-    clip-path: url("chrome://browser/content/browser.xul#urlbar-back-button-clip-path-win10");
-  }
-
-  :root {
-    --backbutton-urlbar-overlap: 9px;
-  }
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl),
-@conditionalForwardWithUrlbar@ > #urlbar:-moz-locale-dir(rtl) {
-  /* let urlbar-back-button-clip-path clip the urlbar's right side for RTL */
-  transform: scaleX(-1);
-}
-
-@conditionalForwardWithUrlbar@:-moz-locale-dir(rtl) {
-  -moz-box-direction: reverse;
-}
-%endif
-
 html|*.urlbar-input:-moz-lwtheme::placeholder,
 .searchbar-textbox:-moz-lwtheme > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input::placeholder {
   opacity: 1.0;
   color: #777;
 }
 
 .urlbar-textbox-container {
   -moz-box-align: stretch;
@@ -1104,130 +866,16 @@ treechildren.searchbar-treebody::-moz-tr
   color: GrayText;
   font-size: smaller;
 }
 
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
-%ifndef MOZ_PHOTON_THEME
-/* combined go/reload/stop button in location bar */
-
-#urlbar-go-button,
-#reload-button,
-#stop-button {
-  -moz-appearance: none;
-  border-style: none;
-  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
-  padding: 0 9px;
-  margin-inline-start: 5px;
-  border-inline-start: 1px solid var(--urlbar-separator-color);
-  border-image: linear-gradient(transparent 15%,
-                                var(--urlbar-separator-color) 15%,
-                                var(--urlbar-separator-color) 85%,
-                                transparent 85%);
-  border-image-slice: 1;
-}
-
-#reload-button {
-  -moz-image-region: rect(0, 14px, 14px, 0);
-}
-
-#reload-button:not([disabled]):hover {
-  -moz-image-region: rect(14px, 14px, 28px, 0);
-}
-
-#reload-button:not([disabled]):hover:active {
-  -moz-image-region: rect(28px, 14px, 42px, 0);
-}
-
-#reload-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#urlbar-go-button {
-  -moz-image-region: rect(0, 42px, 14px, 28px);
-}
-
-#urlbar-go-button:hover {
-  -moz-image-region: rect(14px, 42px, 28px, 28px);
-}
-
-#urlbar-go-button:hover:active {
-  -moz-image-region: rect(28px, 42px, 42px, 28px);
-}
-
-#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
-  transform: scaleX(-1);
-}
-
-#stop-button {
-  -moz-image-region: rect(0, 28px, 14px, 14px);
-}
-
-#stop-button:not([disabled]):hover {
-  -moz-image-region: rect(14px, 28px, 28px, 14px);
-}
-
-#stop-button:hover:active {
-  -moz-image-region: rect(28px, 28px, 42px, 14px);
-}
-
-@media (min-resolution: 1.1dppx) {
-  #urlbar-go-button,
-  #reload-button,
-  #stop-button {
-    list-style-image: url("chrome://browser/skin/reload-stop-go@2x.png");
-  }
-
-  #urlbar-go-button > .toolbarbutton-icon,
-  #reload-button > .toolbarbutton-icon,
-  #stop-button > .toolbarbutton-icon {
-    width: 14px;
-  }
-
-  #urlbar-go-button {
-    -moz-image-region: rect(0, 84px, 28px, 56px);
-  }
-
-  #urlbar-go-button:hover {
-    -moz-image-region: rect(28px, 84px, 56px, 56px);
-  }
-
-  #urlbar-go-button:hover:active {
-    -moz-image-region: rect(56px, 84px, 84px, 56px);
-  }
-
-  #reload-button {
-    -moz-image-region: rect(0, 28px, 28px, 0);
-  }
-
-  #reload-button:not([disabled]):hover {
-    -moz-image-region: rect(28px, 28px, 56px, 0);
-  }
-
-  #reload-button:not([disabled]):hover:active {
-    -moz-image-region: rect(56px, 28px, 84px, 0);
-  }
-
-  #stop-button {
-    -moz-image-region: rect(0, 56px, 28px, 28px);
-  }
-
-  #stop-button:not([disabled]):hover {
-    -moz-image-region: rect(28px, 56px, 56px, 28px);
-  }
-
-  #stop-button:hover:active {
-    -moz-image-region: rect(56px, 56px, 84px, 28px);
-  }
-}
-%endif
-
 /* popup blocker button */
 
 #page-report-button {
   list-style-image: url("chrome://browser/skin/urlbar-popup-blocked.png");
   -moz-image-region: rect(0, 16px, 16px, 0);
 }
 
 #page-report-button:hover {
@@ -1698,41 +1346,16 @@ notification[value="translation"] {
  * labels during the customize mode transition. Subpixel anti-aliasing
  * on Windows with Direct2D layers acceleration is particularly slow to
  * paint, so this hack is how we sidestep that performance bottleneck.
  */
 #main-window:-moz-any([customize-entering],[customize-exiting]) label {
   transform: perspective(0.01px);
 }
 
-%ifndef MOZ_PHOTON_THEME
-#main-window[customize-entered] > #tab-view-deck {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png");
-  background-attachment: fixed;
-}
-
-#main-window[customization-lwtheme]:-moz-lwtheme {
-  background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png");
-  background-repeat: repeat;
-  background-attachment: fixed;
-  background-position: left top;
-}
-
-#main-window[customize-entered] #browser-bottombox,
-#main-window[customize-entered] #customization-container {
-  border-left: 1px solid @toolbarShadowColor@;
-  border-right: 1px solid @toolbarShadowColor@;
-  background-clip: padding-box;
-}
-
-#main-window[customize-entered] #browser-bottombox {
-  border-bottom: 1px solid @toolbarShadowColor@;
-}
-%endif
-
 #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="left"] {
   margin-right: -2px;
 }
 
 #customization-tipPanel > .panel-arrowcontainer > .panel-arrowbox > .panel-arrow[side="right"] {
   margin-left: -2px;
 }
 
--- a/browser/themes/windows/compacttheme.css
+++ b/browser/themes/windows/compacttheme.css
@@ -31,21 +31,16 @@
 }
 
 #toolbar-menubar {
   text-shadow: none !important;
 }
 
 @media (-moz-os-version: windows-win7),
        (-moz-os-version: windows-win8) {
-%ifndef MOZ_PHOTON_THEME
-  :root {
-    --space-above-tabbar: 15px;
-  }
-%endif
   /* It'd be nice if there was an element in the scrollbox's inner content
      that collapsed to the current width of the tabs. Since there isn't we
      need to handle overflowing and non-overflowing tabs separately.
 
      In the case of overflowing tabs, set a border-top on the entire container,
      otherwise we need to set it on each element individually */
   #main-window[sizemode=normal] .tabbrowser-tabs[overflow="true"] {
     background-clip: padding-box;
deleted file mode 100644
index d09ba9dafb5ede66e92ce577ecaa6f9575dba104..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index ca6c1196c23a8b24c957057dd23fbb52dfefdea7..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 5e17cb4db08e310e6c3a9e14c5bd722772dfb639..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index dc4caee812878f246c87d71093768eb36c5656fc..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -49,22 +49,16 @@ browser.jar:
   skin/classic/browser/toolbarbutton-dropdown-arrow-win7.png
   skin/classic/browser/urlbar-popup-blocked.png
   skin/classic/browser/urlbar-history-dropmarker.png
   skin/classic/browser/urlbar-history-dropmarker@2x.png
   skin/classic/browser/urlbar-history-dropmarker-win7.png
   skin/classic/browser/urlbar-history-dropmarker-win7@2x.png
   skin/classic/browser/webRTC-indicator.css  (../shared/webRTC-indicator.css)
 * skin/classic/browser/controlcenter/panel.css                 (controlcenter/panel.css)
-#ifndef MOZ_PHOTON_THEME
-  skin/classic/browser/customizableui/customizeMode-gridTexture.png  (customizableui/customizeMode-gridTexture.png)
-  skin/classic/browser/customizableui/background-noise-toolbar.png  (customizableui/background-noise-toolbar.png)
-  skin/classic/browser/customizableui/customizeMode-separatorHorizontal.png  (customizableui/customizeMode-separatorHorizontal.png)
-  skin/classic/browser/customizableui/customizeMode-separatorVertical.png  (customizableui/customizeMode-separatorVertical.png)
-#endif
   skin/classic/browser/customizableui/menu-arrow.svg           (customizableui/menu-arrow.svg)
 * skin/classic/browser/customizableui/panelUI.css       (customizableui/panelUI.css)
 * skin/classic/browser/downloads/allDownloadsViewOverlay.css   (downloads/allDownloadsViewOverlay.css)
   skin/classic/browser/downloads/download-glow-menuPanel.png   (downloads/download-glow-menuPanel.png)
   skin/classic/browser/downloads/download-glow-menuPanel-win7.png   (downloads/download-glow-menuPanel-win7.png)
 * skin/classic/browser/downloads/downloads.css                 (downloads/downloads.css)
   skin/classic/browser/feeds/feedIcon.png                      (feeds/feedIcon.png)
   skin/classic/browser/feeds/feedIcon16.png                    (feeds/feedIcon16.png)
--- a/devtools/client/themes/firebug-theme.css
+++ b/devtools/client/themes/firebug-theme.css
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 @import url(resource://devtools/client/themes/variables.css);
 @import url(resource://devtools/client/themes/common.css);
 @import url(chrome://devtools/skin/light-theme.css);
 
-:root {
+:root.theme-firebug {
   font-size: 11px;
   font-family: var(--proportional-font-family);
 }
 
 /* CodeMirror Color Syntax */
 
 .theme-firebug .cm-keyword {color: BlueViolet; font-weight: bold;}
 .theme-firebug .cm-atom {color: #219;}
--- a/devtools/shim/DevToolsShim.jsm
+++ b/devtools/shim/DevToolsShim.jsm
@@ -204,21 +204,17 @@ this.DevToolsShim = {
    * Called from SessionStore.jsm in mozilla-central when restoring a state that contained
    * opened scratchpad windows.
    */
   restoreScratchpadSession: function (scratchpads) {
     if (!this.isInstalled()) {
       return;
     }
 
-    if (!this.isInitialized()) {
-      this._initDevTools();
-    }
-
-    this._gDevTools.restoreScratchpadSession(scratchpads);
+    this.gDevTools.restoreScratchpadSession(scratchpads);
   },
 
   /**
    * Called from nsContextMenu.js in mozilla-central when using the Inspect Element
    * context menu item.
    *
    * @param {XULTab} tab
    *        The browser tab on which inspect node was used.
--- a/devtools/shim/tests/unit/test_devtools_shim.js
+++ b/devtools/shim/tests/unit/test_devtools_shim.js
@@ -1,20 +1,17 @@
 /* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-const { DevToolsShim: realDevToolsShim } =
+const { DevToolsShim } =
     Components.utils.import("chrome://devtools-shim/content/DevToolsShim.jsm", {});
 
-// Create a copy of the DevToolsShim for the test.
-const DevToolsShim = Object.assign({}, realDevToolsShim);
-
 // Test the DevToolsShim
 
 /**
  * Create a mocked version of DevTools that records all calls made to methods expected
  * to be called by DevToolsShim.
  */
 function createMockDevTools() {
   let methods = [
@@ -39,21 +36,23 @@ function createMockDevTools() {
       mock.callLog[method].push(args);
     };
     mock.callLog[method] = [];
   }
 
   return mock;
 }
 
-function mockDevToolsInstalled() {
-  DevToolsShim.isInstalled = () => true;
+let isInstalledMethodBackup = DevToolsShim.isInstalled;
+function mockDevToolsInstalled(isInstalled) {
+  DevToolsShim.isInstalled = () => isInstalled;
 }
-function mockDevToolsUninstalled() {
-  DevToolsShim.isInstalled = () => false;
+
+function restoreDevToolsInstalled() {
+  DevToolsShim.isInstalled = isInstalledMethodBackup;
 }
 
 /**
  * Check if a given method was called an expected number of times, and finally check the
  * arguments provided to the last call, if appropriate.
  */
 function checkCalls(mock, method, length, lastArgs) {
   ok(mock.callLog[method].length === length,
@@ -67,71 +66,87 @@ function checkCalls(mock, method, length
   for (let i = 0; i < lastArgs.length; i++) {
     let expectedArg = lastArgs[i];
     ok(mock.callLog[method][length - 1][i] === expectedArg,
         `Devtools.${method} was called with the expected argument (index ${i})`);
   }
 }
 
 function test_register_unregister() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   DevToolsShim.register(createMockDevTools());
   ok(DevToolsShim.isInitialized(), "DevTools are installed");
 
   DevToolsShim.unregister();
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
+
+  restoreDevToolsInstalled();
 }
 
 function test_on_is_forwarded_to_devtools() {
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   function cb1() {}
   function cb2() {}
   let mock = createMockDevTools();
 
   DevToolsShim.on("test_event", cb1);
   DevToolsShim.register(mock);
   checkCalls(mock, "on", 1, ["test_event", cb1]);
 
   DevToolsShim.on("other_event", cb2);
   checkCalls(mock, "on", 2, ["other_event", cb2]);
+
+  restoreDevToolsInstalled();
 }
 
 function test_off_called_before_registering_devtools() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   function cb1() {}
   let mock = createMockDevTools();
 
   DevToolsShim.on("test_event", cb1);
   DevToolsShim.off("test_event", cb1);
 
   DevToolsShim.register(mock);
   checkCalls(mock, "on", 0);
+
+  restoreDevToolsInstalled();
 }
 
 function test_off_called_before_with_bad_callback() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   function cb1() {}
   function cb2() {}
   let mock = createMockDevTools();
 
   DevToolsShim.on("test_event", cb1);
   DevToolsShim.off("test_event", cb2);
 
   DevToolsShim.register(mock);
   // on should still be called
   checkCalls(mock, "on", 1, ["test_event", cb1]);
   // Calls to off should not be held and forwarded.
   checkCalls(mock, "off", 0);
+
+  restoreDevToolsInstalled();
 }
 
 function test_registering_tool() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   let tool1 = {};
   let tool2 = {};
   let tool3 = {};
   let mock = createMockDevTools();
 
   // Pre-register tool1
@@ -148,19 +163,23 @@ function test_registering_tool() {
   checkCalls(mock, "registerTool", 2, [tool2]);
 
   DevToolsShim.unregister();
 
   // Create a new mock and check the tools are not added once again.
   mock = createMockDevTools();
   DevToolsShim.register(mock);
   checkCalls(mock, "registerTool", 0);
+
+  restoreDevToolsInstalled();
 }
 
 function test_registering_theme() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   let theme1 = {};
   let theme2 = {};
   let theme3 = {};
   let mock = createMockDevTools();
 
   // Pre-register theme1
@@ -177,36 +196,42 @@ function test_registering_theme() {
   checkCalls(mock, "registerTheme", 2, [theme2]);
 
   DevToolsShim.unregister();
 
   // Create a new mock and check the themes are not added once again.
   mock = createMockDevTools();
   DevToolsShim.register(mock);
   checkCalls(mock, "registerTheme", 0);
+
+  restoreDevToolsInstalled();
 }
 
 function test_events() {
+  mockDevToolsInstalled(true);
+
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   let mock = createMockDevTools();
   // Check emit was not called.
   checkCalls(mock, "emit", 0);
 
   // Check emit is called once with the devtools-registered event.
   DevToolsShim.register(mock);
   checkCalls(mock, "emit", 1, ["devtools-registered"]);
 
   // Check emit is called once with the devtools-unregistered event.
   DevToolsShim.unregister();
   checkCalls(mock, "emit", 2, ["devtools-unregistered"]);
+
+  restoreDevToolsInstalled();
 }
 
 function test_scratchpad_apis() {
-  mockDevToolsUninstalled();
+  mockDevToolsInstalled(false);
 
   ok(!DevToolsShim.isInstalled(), "DevTools are not installed");
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   // Ensure that getOpenedScratchpads doesn't initialize the tools
   DevToolsShim.getOpenedScratchpads();
 
   ok(!DevToolsShim.isInstalled(), "DevTools are not installed");
@@ -214,17 +239,17 @@ function test_scratchpad_apis() {
 
   // Check that restoreScratchpadSession doesn't crash.
   DevToolsShim.restoreScratchpadSession([{}]);
 
   let scratchpads = DevToolsShim.getOpenedScratchpads();
   equal(scratchpads.length, 0,
       "getOpenedScratchpads returns [] when DevTools are not installed");
 
-  mockDevToolsInstalled();
+  mockDevToolsInstalled(true);
 
   ok(DevToolsShim.isInstalled(), "DevTools are installed");
   ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");
 
   let mock = createMockDevTools();
   DevToolsShim._initDevTools = () => {
     // Next call to restoreScratchpadSession is expected to initialize DevTools, which we
     // simulate here by registering our mock.
@@ -234,16 +259,18 @@ function test_scratchpad_apis() {
   let scratchpadSessions = [{}];
   DevToolsShim.restoreScratchpadSession(scratchpadSessions);
   checkCalls(mock, "restoreScratchpadSession", 1, [scratchpadSessions]);
 
   ok(DevToolsShim.isInitialized(), "DevTools are initialized");
 
   DevToolsShim.getOpenedScratchpads();
   checkCalls(mock, "getOpenedScratchpads", 1, []);
+
+  restoreDevToolsInstalled();
 }
 
 function run_test() {
   test_register_unregister();
   DevToolsShim.unregister();
 
   test_on_is_forwarded_to_devtools();
   DevToolsShim.unregister();
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -81,16 +81,17 @@
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/asmjscache/AsmJSCache.h"
 #include "mozilla/dom/CanvasRenderingContext2DBinding.h"
 #include "mozilla/ContentEvents.h"
 
 #include "nsCycleCollectionNoteRootCallback.h"
 #include "GeckoProfiler.h"
+#include "mozilla/IdleTaskRunner.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 const size_t gStackSize = 8192;
 
 // Thank you Microsoft!
 #ifdef CompareString
@@ -114,17 +115,17 @@ const size_t gStackSize = 8192;
 
 // The amount of time we wait between a request to CC (after GC ran)
 // and doing the actual CC.
 #define NS_CC_DELAY                 6000 // ms
 
 #define NS_CC_SKIPPABLE_DELAY       250 // ms
 
 // ForgetSkippable is usually fast, so we can use small budgets.
-// This isn't a real budget but a hint to CollectorRunner whether there
+// This isn't a real budget but a hint to IdleTaskRunner whether there
 // is enough time to call ForgetSkippable.
 static const int64_t kForgetSkippableSliceDuration = 2;
 
 // Maximum amount of time that should elapse between incremental CC slices
 static const int64_t kICCIntersliceDelay = 64; // ms
 
 // Time budget for an incremental CC slice when using timer to run it.
 static const int64_t kICCSliceBudget = 3; // ms
@@ -143,26 +144,24 @@ static const uint32_t kMaxICCDuration = 
 #define NS_MAX_CC_LOCKEDOUT_TIME    (30 * PR_USEC_PER_SEC) // 30 seconds
 
 // Trigger a CC if the purple buffer exceeds this size when we check it.
 #define NS_CC_PURPLE_LIMIT          200
 
 // Large value used to specify that a script should run essentially forever
 #define NS_UNLIMITED_SCRIPT_RUNTIME (0x40000000LL << 32)
 
-class CollectorRunner;
-
 // if you add statics here, add them to the list in StartupJSEnvironment
 
 static nsITimer *sGCTimer;
 static nsITimer *sShrinkingGCTimer;
-static StaticRefPtr<CollectorRunner> sCCRunner;
-static StaticRefPtr<CollectorRunner> sICCRunner;
+static StaticRefPtr<IdleTaskRunner> sCCRunner;
+static StaticRefPtr<IdleTaskRunner> sICCRunner;
 static nsITimer *sFullGCTimer;
-static StaticRefPtr<CollectorRunner> sInterSliceGCRunner;
+static StaticRefPtr<IdleTaskRunner> sInterSliceGCRunner;
 
 static TimeStamp sLastCCEndTime;
 
 static bool sCCLockedOut;
 static PRTime sCCLockedOutTime;
 
 static JS::GCSliceCallback sPrevGCSliceCallback;
 
@@ -220,203 +219,16 @@ static bool sIsCompactingOnUserInactive 
 // In testing, we call RunNextCollectorTimer() to ensure that the collectors are run more
 // aggressively than they would be in regular browsing. sExpensiveCollectorPokes keeps
 // us from triggering expensive full collections too frequently.
 static int32_t sExpensiveCollectorPokes = 0;
 static const int32_t kPokesBetweenExpensiveCollectorTriggers = 5;
 
 static TimeDuration sGCUnnotifiedTotalTime;
 
-// Return true if some meaningful work was done.
-typedef bool (*CollectorRunnerCallback) (TimeStamp aDeadline, void* aData);
-
-// Repeating callback runner for CC and GC.
-class CollectorRunner final : public IdleRunnable
-{
-public:
-  static already_AddRefed<CollectorRunner>
-  Create(CollectorRunnerCallback aCallback, uint32_t aDelay,
-         int64_t aBudget, bool aRepeating, void* aData = nullptr)
-  {
-    if (sShuttingDown) {
-      return nullptr;
-    }
-
-    RefPtr<CollectorRunner> runner =
-      new CollectorRunner(aCallback, aDelay, aBudget, aRepeating, aData);
-    runner->Schedule(false); // Initial scheduling shouldn't use idle dispatch.
-    return runner.forget();
-  }
-
-  NS_IMETHOD Run() override
-  {
-    if (!mCallback) {
-      return NS_OK;
-    }
-
-    // Deadline is null when called from timer.
-    bool deadLineWasNull = mDeadline.IsNull();
-    bool didRun = false;
-    if (deadLineWasNull || ((TimeStamp::Now() + mBudget) < mDeadline)) {
-      CancelTimer();
-      didRun = mCallback(mDeadline, mData);
-    }
-
-    if (mCallback && (mRepeating || !didRun)) {
-      // If we didn't do meaningful work, don't schedule using immediate
-      // idle dispatch, since that could lead to a loop until the idle
-      // period ends.
-      Schedule(didRun);
-    }
-
-    return NS_OK;
-  }
-
-  static void
-  TimedOut(nsITimer* aTimer, void* aClosure)
-  {
-    RefPtr<CollectorRunner> runnable = static_cast<CollectorRunner*>(aClosure);
-    runnable->Run();
-  }
-
-  void SetDeadline(mozilla::TimeStamp aDeadline) override
-  {
-    mDeadline = aDeadline;
-  };
-
-  void SetTimer(uint32_t aDelay, nsIEventTarget* aTarget) override
-  {
-    MOZ_ASSERT(NS_IsMainThread());
-    // aTarget is always the main thread event target provided from
-    // NS_IdleDispatchToCurrentThread(). We ignore aTarget here to ensure that
-    // CollectorRunner a(ways run specifically on SystemGroup::EventTargetFor(
-    // TaskCategory::GarbageCollection) of the main thread.
-    SetTimerInternal(aDelay);
-  }
-
-  nsresult Cancel() override
-  {
-    CancelTimer();
-    mTimer = nullptr;
-    mScheduleTimer = nullptr;
-    mCallback = nullptr;
-    return NS_OK;
-  }
-
-  static void
-  ScheduleTimedOut(nsITimer* aTimer, void* aClosure)
-  {
-    RefPtr<CollectorRunner> runnable = static_cast<CollectorRunner*>(aClosure);
-    runnable->Schedule(true);
-  }
-
-  void Schedule(bool aAllowIdleDispatch)
-  {
-    if (!mCallback) {
-      return;
-    }
-
-    if (sShuttingDown) {
-      Cancel();
-      return;
-    }
-
-    mDeadline = TimeStamp();
-    TimeStamp now = TimeStamp::Now();
-    TimeStamp hint = nsRefreshDriver::GetIdleDeadlineHint(now);
-    if (hint != now) {
-      // RefreshDriver is ticking, let it schedule the idle dispatch.
-      nsRefreshDriver::DispatchIdleRunnableAfterTick(this, mDelay);
-      // Ensure we get called at some point, even if RefreshDriver is stopped.
-      SetTimerInternal(mDelay);
-    } else {
-      // RefreshDriver doesn't seem to be running.
-      if (aAllowIdleDispatch) {
-        nsCOMPtr<nsIRunnable> runnable = this;
-        SetTimerInternal(mDelay);
-        NS_IdleDispatchToCurrentThread(runnable.forget());
-      } else {
-        if (!mScheduleTimer) {
-          mScheduleTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
-          if (!mScheduleTimer) {
-            return;
-          }
-          mScheduleTimer->SetTarget(SystemGroup::EventTargetFor(TaskCategory::GarbageCollection));
-        } else {
-          mScheduleTimer->Cancel();
-        }
-
-        // We weren't allowed to do idle dispatch immediately, do it after a
-        // short timeout.
-        mScheduleTimer->InitWithNamedFuncCallback(ScheduleTimedOut, this, 16,
-                                                  nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY,
-                                                  "CollectorRunner");
-      }
-    }
-  }
-
-private:
-  explicit CollectorRunner(CollectorRunnerCallback aCallback,
-                           uint32_t aDelay, int64_t aBudget,
-                           bool aRepeating, void* aData)
-    : mCallback(aCallback), mDelay(aDelay)
-    , mBudget(TimeDuration::FromMilliseconds(aBudget))
-    , mRepeating(aRepeating), mTimerActive(false), mData(aData)
-  {
-  }
-
-  ~CollectorRunner()
-  {
-    CancelTimer();
-  }
-
-  void CancelTimer()
-  {
-    nsRefreshDriver::CancelIdleRunnable(this);
-    if (mTimer) {
-      mTimer->Cancel();
-    }
-    if (mScheduleTimer) {
-      mScheduleTimer->Cancel();
-    }
-    mTimerActive = false;
-  }
-
-  void SetTimerInternal(uint32_t aDelay)
-  {
-    if (mTimerActive) {
-      return;
-    }
-
-    if (!mTimer) {
-      mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
-    } else {
-      mTimer->Cancel();
-    }
-
-    if (mTimer) {
-      mTimer->SetTarget(SystemGroup::EventTargetFor(TaskCategory::GarbageCollection));
-      mTimer->InitWithNamedFuncCallback(TimedOut, this, aDelay,
-                                        nsITimer::TYPE_ONE_SHOT,
-                                        "CollectorRunner");
-      mTimerActive = true;
-    }
-  }
-
-  nsCOMPtr<nsITimer> mTimer;
-  nsCOMPtr<nsITimer> mScheduleTimer;
-  CollectorRunnerCallback mCallback;
-  uint32_t mDelay;
-  TimeStamp mDeadline;
-  TimeDuration mBudget;
-  bool mRepeating;
-  bool mTimerActive;
-  void* mData;
-};
-
 static const char*
 ProcessNameForCollectorLog()
 {
   return XRE_GetProcessType() == GeckoProcessType_Default ?
     "default" : "content";
 }
 
 namespace xpc {
@@ -1758,17 +1570,17 @@ nsJSContext::ClearMaxCCSliceTime()
 
 uint32_t
 nsJSContext::GetMaxCCSliceTimeSinceClear()
 {
   return gCCStats.mMaxSliceTimeSinceClear;
 }
 
 static bool
-ICCRunnerFired(TimeStamp aDeadline, void* aData)
+ICCRunnerFired(TimeStamp aDeadline)
 {
   if (sDidShutdown) {
     return false;
   }
 
   // Ignore ICC timer fires during IGC. Running ICC during an IGC will cause us
   // to synchronously finish the GC, which is bad.
 
@@ -1799,18 +1611,22 @@ nsJSContext::BeginCycleCollectionCallbac
   KillCCRunner();
 
   gCCStats.RunForgetSkippable();
 
   MOZ_ASSERT(!sICCRunner, "Tried to create a new ICC timer when one already existed.");
 
   // Create an ICC timer even if ICC is globally disabled, because we could be manually triggering
   // an incremental collection, and we want to be sure to finish it.
-  sICCRunner = CollectorRunner::Create(ICCRunnerFired, kICCIntersliceDelay,
-                                       kIdleICCSliceBudget, true);
+  sICCRunner = IdleTaskRunner::Create(ICCRunnerFired,
+                                      kICCIntersliceDelay,
+                                      kIdleICCSliceBudget,
+                                      true,
+                                      []{ return sShuttingDown; },
+                                      TaskCategory::GarbageCollection);
 }
 
 static_assert(NS_GC_DELAY > kMaxICCDuration, "A max duration ICC shouldn't reduce GC delay to 0");
 
 //static
 void
 nsJSContext::EndCycleCollectionCallback(CycleCollectorResults &aResults)
 {
@@ -2012,21 +1828,23 @@ InterSliceGCRunnerFired(TimeStamp aDeadl
 }
 
 // static
 void
 GCTimerFired(nsITimer *aTimer, void *aClosure)
 {
   nsJSContext::KillGCTimer();
   // Now start the actual GC after initial timer has fired.
-  sInterSliceGCRunner = CollectorRunner::Create(InterSliceGCRunnerFired,
-                                                NS_INTERSLICE_GC_DELAY,
-                                                sActiveIntersliceGCBudget,
-                                                false,
-                                                aClosure);
+  sInterSliceGCRunner = IdleTaskRunner::Create([aClosure](TimeStamp aDeadline) {
+    return InterSliceGCRunnerFired(aDeadline, aClosure);
+  }, NS_INTERSLICE_GC_DELAY,
+     sActiveIntersliceGCBudget,
+     false,
+     []{ return sShuttingDown; },
+     TaskCategory::GarbageCollection);
 }
 
 // static
 void
 ShrinkingGCTimerFired(nsITimer* aTimer, void* aClosure)
 {
   nsJSContext::KillShrinkingGCTimer();
   sIsCompactingOnUserInactive = true;
@@ -2040,17 +1858,17 @@ ShouldTriggerCC(uint32_t aSuspected)
 {
   return sNeedsFullCC ||
          aSuspected > NS_CC_PURPLE_LIMIT ||
          (aSuspected > NS_CC_FORCED_PURPLE_LIMIT &&
           TimeUntilNow(sLastCCEndTime) > NS_CC_FORCED);
 }
 
 static bool
-CCRunnerFired(TimeStamp aDeadline, void* aData)
+CCRunnerFired(TimeStamp aDeadline)
 {
   if (sDidShutdown) {
     return false;
   }
 
   static uint32_t ccDelay = NS_CC_DELAY;
   if (sCCLockedOut) {
     ccDelay = NS_CC_DELAY / 3;
@@ -2202,23 +2020,23 @@ nsJSContext::RunNextCollectorTimer()
   }
 
   // Check the CC timers after the GC timers, because the CC timers won't do
   // anything if a GC is in progress.
   MOZ_ASSERT(!sCCLockedOut, "Don't check the CC timers if the CC is locked out.");
 
   if (sCCRunner) {
     if (ReadyToTriggerExpensiveCollectorTimer()) {
-      CCRunnerFired(TimeStamp(), nullptr);
+      CCRunnerFired(TimeStamp());
     }
     return;
   }
 
   if (sICCRunner) {
-    ICCRunnerFired(TimeStamp(), nullptr);
+    ICCRunnerFired(TimeStamp());
     return;
   }
 }
 
 // static
 void
 nsJSContext::PokeGC(JS::gcreason::Reason aReason,
                     JSObject* aObj,
@@ -2315,18 +2133,20 @@ nsJSContext::MaybePokeCC()
 
   if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
     sCCRunnerFireCount = 0;
 
     // We can kill some objects before running forgetSkippable.
     nsCycleCollector_dispatchDeferredDeletion();
 
     sCCRunner =
-      CollectorRunner::Create(CCRunnerFired, NS_CC_SKIPPABLE_DELAY,
-                              kForgetSkippableSliceDuration, true);
+      IdleTaskRunner::Create(CCRunnerFired, NS_CC_SKIPPABLE_DELAY,
+                             kForgetSkippableSliceDuration, true,
+                             []{ return sShuttingDown; },
+                             TaskCategory::GarbageCollection);
   }
 }
 
 //static
 void
 nsJSContext::KillGCTimer()
 {
   if (sGCTimer) {
@@ -2500,18 +2320,23 @@ DOMGCSliceCallback(JSContext* aCx, JS::G
     case JS::GC_SLICE_END:
       sGCUnnotifiedTotalTime +=
         aDesc.lastSliceEnd(aCx) - aDesc.lastSliceStart(aCx);
 
       // Schedule another GC slice if the GC has more work to do.
       nsJSContext::KillInterSliceGCRunner();
       if (!sShuttingDown && !aDesc.isComplete_) {
         sInterSliceGCRunner =
-          CollectorRunner::Create(InterSliceGCRunnerFired, NS_INTERSLICE_GC_DELAY,
-                                  sActiveIntersliceGCBudget, false);
+          IdleTaskRunner::Create([](TimeStamp aDeadline) {
+            return InterSliceGCRunnerFired(aDeadline, nullptr);
+          }, NS_INTERSLICE_GC_DELAY,
+             sActiveIntersliceGCBudget,
+             false,
+             []{ return sShuttingDown; },
+             TaskCategory::GarbageCollection);
       }
 
       if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {
         nsCycleCollector_dispatchDeferredDeletion();
       }
 
       if (sPostGCEventsToConsole) {
         nsString prefix, gcstats;
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -20,28 +20,26 @@
 #include "DeviceMotionEvent.h"
 #include "DragEvent.h"
 #include "GeckoProfiler.h"
 #include "KeyboardEvent.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/dom/CloseEvent.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/dom/DeviceOrientationEvent.h"
-#include "mozilla/dom/ErrorEvent.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/dom/FocusEvent.h"
 #include "mozilla/dom/HashChangeEvent.h"
 #include "mozilla/dom/InputEvent.h"
 #include "mozilla/dom/MessageEvent.h"
 #include "mozilla/dom/MouseScrollEvent.h"
 #include "mozilla/dom/MutationEvent.h"
 #include "mozilla/dom/NotifyPaintEvent.h"
 #include "mozilla/dom/PageTransitionEvent.h"
 #include "mozilla/dom/PointerEvent.h"
-#include "mozilla/dom/PopStateEvent.h"
 #include "mozilla/dom/RootedDictionary.h"
 #include "mozilla/dom/ScrollAreaEvent.h"
 #include "mozilla/dom/SimpleGestureEvent.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/StorageEvent.h"
 #include "mozilla/dom/TimeEvent.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "mozilla/dom/TransitionEvent.h"
@@ -1057,28 +1055,16 @@ EventDispatcher::CreateEvent(EventTarget
   if (aEventType.LowerCaseEqualsLiteral("beforeunloadevent")) {
     LOG_EVENT_CREATION(BEFOREUNLOADEVENT);
     return NS_NewDOMBeforeUnloadEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("scrollareaevent")) {
     LOG_EVENT_CREATION(SCROLLAREAEVENT);
     return NS_NewDOMScrollAreaEvent(aOwner, aPresContext, nullptr);
   }
-  // XXXkhuey Chrome supports popstateevent here, even though it provides no
-  // initPopStateEvent method.  This is nuts ... but copying it is unlikely to
-  // break the web.
-  if (aEventType.LowerCaseEqualsLiteral("popstateevent")) {
-    LOG_EVENT_CREATION(POPSTATEEVENT);
-    AutoJSContext cx;
-    RootedDictionary<PopStateEventInit> init(cx);
-    RefPtr<Event> event =
-      PopStateEvent::Constructor(aOwner, EmptyString(), init);
-    event->MarkUninitialized();
-    return event.forget();
-  }
   if (aEventType.LowerCaseEqualsLiteral("touchevent") &&
       TouchEvent::PrefEnabled(nsContentUtils::GetDocShellForEventTarget(aOwner))) {
     LOG_EVENT_CREATION(TOUCHEVENT);
     return NS_NewDOMTouchEvent(aOwner, aPresContext, nullptr);
   }
   if (aEventType.LowerCaseEqualsLiteral("hashchangeevent")) {
     LOG_EVENT_CREATION(HASHCHANGEEVENT);
     HashChangeEventInit init;
@@ -1093,24 +1079,16 @@ EventDispatcher::CreateEvent(EventTarget
   }
   if (aEventType.LowerCaseEqualsLiteral("storageevent")) {
     LOG_EVENT_CREATION(STORAGEEVENT);
     RefPtr<Event> event =
       StorageEvent::Constructor(aOwner, EmptyString(), StorageEventInit());
     event->MarkUninitialized();
     return event.forget();
   }
-  if (aEventType.LowerCaseEqualsLiteral("errorevent")) {
-    LOG_EVENT_CREATION(ERROREVENT);
-    RootedDictionary<ErrorEventInit> init(RootingCx());
-    RefPtr<Event> event =
-      ErrorEvent::Constructor(aOwner, EmptyString(), init);
-    event->MarkUninitialized();
-    return event.forget();
-  }
 
   // Only allow these events for chrome
   if (aCallerType == CallerType::System) {
     if (aEventType.LowerCaseEqualsLiteral("simplegestureevent")) {
       return NS_NewDOMSimpleGestureEvent(aOwner, aPresContext, nullptr);
     }
     if (aEventType.LowerCaseEqualsLiteral("xulcommandevent")) {
       LOG_EVENT_CREATION(XULCOMMANDEVENT);
--- a/dom/events/test/test_bug517851.html
+++ b/dom/events/test/test_bug517851.html
@@ -27,29 +27,27 @@ var target = document.createElement("div
 var target2 = $("subframe").contentDocument.body;
 target.setAttribute("onerror", "++window.handledCount; return window.testReturnValue;");
 target2.setAttribute("onerror", "++window.parent.handledCount; return window.parent.testReturnValue;");
 target.setAttribute("onmouseover", "++window.handledCount; return window.testReturnValue;");
 target.setAttribute("onbeforeunload", "++window.handledCount; return window.testReturnValue;");
 target2.setAttribute("onbeforeunload", "++window.parent.handledCount; return window.parent.testReturnValue;");
 target.setAttribute("onmousemove", "++window.handledCount; return window.testReturnValue;");                     
 
-var e = document.createEvent("ErrorEvent");
-e.initEvent("error", true, true);
+var e = new ErrorEvent("error", {bubbles: true, cancelable: true});
 window.testReturnValue = true;
 is(target.dispatchEvent(e), window.testReturnValue,
    "error event should not have reverse return value handling on div!");
 is(handledCount, 1, "Wrong event count!");
 window.testReturnValue = false;
 is(target.dispatchEvent(e), window.testReturnValue,
    "error event should not have reverse return value handling on div (2)!");
 is(handledCount, 2, "Wrong event count!");
 
-var e = document.createEvent("ErrorEvent");
-e.initEvent("error", true, true);
+var e = new ErrorEvent("error", {bubbles: true, cancelable: true});
 window.testReturnValue = false;
 is(target2.dispatchEvent(e), !window.testReturnValue,
    "error event should have reverse return value handling!");
 is(handledCount, 3, "Wrong event count!");
 window.testReturnValue = true;
 is(target2.dispatchEvent(e), !window.testReturnValue,
    "error event should have reverse return value handling (2)!");
 is(handledCount, 4, "Wrong event count!");
--- a/dom/html/test/file_fullscreen-api.html
+++ b/dom/html/test/file_fullscreen-api.html
@@ -300,17 +300,17 @@ function testNamespaces(followupTestFn) 
       addFullscreenErrorContinuation(() => {
         ok(!document.fullscreenElement,
            `Element named '${test.name}' in this namespace should not be allowed: ${test.ns}`);
         document.body.removeChild(elem);
         runNextNamespaceTest();
       });
     }
 
-    elem.requestFullscreen();
+    SimpleTest.waitForFocus(() => elem.requestFullscreen());
   }
 
   runNextNamespaceTest();
 }
 </script>
 </pre>
 <div id="full-screen-element"></div>
 </body>
--- a/dom/html/test/file_fullscreen-prefixed.html
+++ b/dom/html/test/file_fullscreen-prefixed.html
@@ -98,17 +98,17 @@ class TestCase {
             this.changeListeners("remove", eventType, handleEvent);
             TestCase.checkState(inFullscreen,
                                 `${msg} in test case ${this.number}`);
             resolve();
           });
         }
       };
       this.changeListeners("add", eventType, handleEvent);
-      actionCallback();
+      SimpleTest.waitForFocus(() => actionCallback());
     });
   }
 
   test() {
     return new Promise(resolve => {
       Promise.resolve().then(() => {
         return this.doTest(() => div.mozRequestFullScreen(),
                            "fullscreenchange", true, "after request");
--- a/dom/media/BufferMediaResource.h
+++ b/dom/media/BufferMediaResource.h
@@ -31,29 +31,25 @@ public:
   }
 
 protected:
   virtual ~BufferMediaResource()
   {
   }
 
 private:
-  nsresult Close() override { return NS_OK; }
-  void Suspend(bool aCloseImmediately) override {}
-  void Resume() override {}
   // Get the current principal for the channel
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
   {
     nsCOMPtr<nsIPrincipal> principal = mPrincipal;
     return principal.forget();
   }
   // These methods are called off the main thread.
   // The mode is initially MODE_PLAYBACK.
   void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
-  void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
   nsresult ReadAt(int64_t aOffset, char* aBuffer,
                   uint32_t aCount, uint32_t* aBytes) override
   {
     if (aOffset < 0 || aOffset > mLength) {
       return NS_ERROR_FAILURE;
     }
     *aBytes = std::min(mLength - static_cast<uint32_t>(aOffset), aCount);
     memcpy(aBuffer, mBuffer + aOffset, *aBytes);
@@ -62,17 +58,16 @@ private:
   }
   // Memory-based and no locks, caching discouraged.
   bool ShouldCacheReads() override { return false; }
 
   int64_t Tell() override { return mOffset; }
 
   void Pin() override {}
   void Unpin() override {}
-  double GetDownloadRate(bool* aIsReliable) override { *aIsReliable = false; return 0.; }
   int64_t GetLength() override { return mLength; }
   int64_t GetNextCachedData(int64_t aOffset) override { return aOffset; }
   int64_t GetCachedDataEnd(int64_t aOffset) override
   {
     return std::max(aOffset, int64_t(mLength));
   }
   bool IsDataCachedToEndOfResource(int64_t aOffset) override { return true; }
   bool IsSuspendedByCache() override { return false; }
@@ -85,21 +80,16 @@ private:
       return NS_ERROR_FAILURE;
     }
 
     uint32_t bytes = std::min(mLength - static_cast<uint32_t>(aOffset), aCount);
     memcpy(aBuffer, mBuffer + aOffset, bytes);
     return NS_OK;
   }
 
-  nsresult Open(nsIStreamListener** aStreamListener) override
-  {
-    return NS_ERROR_FAILURE;
-  }
-
   nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override
   {
     aRanges += MediaByteRange(0, int64_t(mLength));
     return NS_OK;
   }
 
   bool IsTransportSeekable() override { return true; }
 
--- a/dom/media/ChannelMediaDecoder.cpp
+++ b/dom/media/ChannelMediaDecoder.cpp
@@ -8,16 +8,21 @@
 #include "DecoderTraits.h"
 #include "MediaDecoderStateMachine.h"
 #include "MediaFormatReader.h"
 #include "MediaResource.h"
 #include "MediaShutdownManager.h"
 
 namespace mozilla {
 
+extern LazyLogModule gMediaDecoderLog;
+#define LOG(x, ...)                                                            \
+  MOZ_LOG(                                                                     \
+    gMediaDecoderLog, LogLevel::Debug, ("Decoder=%p " x, this, ##__VA_ARGS__))
+
 ChannelMediaDecoder::ResourceCallback::ResourceCallback(
   AbstractThread* aMainThread)
   : mAbstractMainThread(aMainThread)
 {
   MOZ_ASSERT(aMainThread);
 }
 
 void
@@ -146,18 +151,22 @@ ChannelMediaDecoder::ResourceCallback::N
     }
   });
   mAbstractMainThread->Dispatch(r.forget());
 }
 
 ChannelMediaDecoder::ChannelMediaDecoder(MediaDecoderInit& aInit)
   : MediaDecoder(aInit)
   , mResourceCallback(new ResourceCallback(aInit.mOwner->AbstractMainThread()))
+  , mWatchManager(this, aInit.mOwner->AbstractMainThread())
 {
   mResourceCallback->Connect(this);
+
+  // mIgnoreProgressData
+  mWatchManager.Watch(mLogicallySeeking, &ChannelMediaDecoder::SeekingChanged);
 }
 
 bool
 ChannelMediaDecoder::CanClone()
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mResource && mResource->CanClone();
 }
@@ -197,18 +206,25 @@ MediaDecoderStateMachine* ChannelMediaDe
   init.mResource = mResource;
   mReader = DecoderTraits::CreateReader(ContainerType(), init);
   return new MediaDecoderStateMachine(this, mReader);
 }
 
 void
 ChannelMediaDecoder::Shutdown()
 {
+  mWatchManager.Shutdown();
   mResourceCallback->Disconnect();
   MediaDecoder::Shutdown();
+
+  // Force any outstanding seek and byterange requests to complete
+  // to prevent shutdown from deadlocking.
+  if (mResource) {
+    mResource->Close();
+  }
 }
 
 nsresult
 ChannelMediaDecoder::OpenResource(nsIStreamListener** aStreamListener)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (aStreamListener) {
     *aStreamListener = nullptr;
@@ -264,9 +280,228 @@ ChannelMediaDecoder::Load(BaseMediaResou
   NS_ENSURE_SUCCESS(rv, rv);
 
   SetStateMachine(CreateStateMachine());
   NS_ENSURE_TRUE(GetStateMachine(), NS_ERROR_FAILURE);
 
   return InitializeStateMachine();
 }
 
+void
+ChannelMediaDecoder::NotifyDownloadEnded(nsresult aStatus)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
+  AbstractThread::AutoEnter context(AbstractMainThread());
+
+  LOG("NotifyDownloadEnded, status=%" PRIx32, static_cast<uint32_t>(aStatus));
+
+  if (aStatus == NS_BINDING_ABORTED) {
+    // Download has been cancelled by user.
+    GetOwner()->LoadAborted();
+    return;
+  }
+
+  UpdatePlaybackRate();
+
+  if (NS_SUCCEEDED(aStatus)) {
+    // A final progress event will be fired by the MediaResource calling
+    // DownloadSuspended on the element.
+    // Also NotifySuspendedStatusChanged() will be called to update readyState
+    // if download ended with success.
+  } else if (aStatus != NS_BASE_STREAM_CLOSED) {
+    NetworkError();
+  }
+}
+
+void
+ChannelMediaDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
+  AbstractThread::AutoEnter context(AbstractMainThread());
+
+  if (mIgnoreProgressData) {
+    return;
+  }
+
+  MOZ_ASSERT(GetStateMachine());
+  if (aOffset >= mDecoderPosition) {
+    mPlaybackStatistics.AddBytes(aBytes);
+  }
+  mDecoderPosition = aOffset + aBytes;
+}
+
+void
+ChannelMediaDecoder::SeekingChanged()
+{
+  // Stop updating the bytes downloaded for progress notifications when
+  // seeking to prevent wild changes to the progress notification.
+  MOZ_ASSERT(NS_IsMainThread());
+  mIgnoreProgressData = mLogicallySeeking;
+}
+
+bool
+ChannelMediaDecoder::CanPlayThroughImpl()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  NS_ENSURE_TRUE(GetStateMachine(), false);
+  return GetStatistics().CanPlayThrough();
+}
+
+void
+ChannelMediaDecoder::OnPlaybackEvent(MediaEventType aEvent)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MediaDecoder::OnPlaybackEvent(aEvent);
+  switch (aEvent) {
+    case MediaEventType::PlaybackStarted:
+      mPlaybackStatistics.Start();
+      break;
+    case MediaEventType::PlaybackStopped:
+      mPlaybackStatistics.Stop();
+      ComputePlaybackRate();
+      break;
+    default:
+      break;
+  }
+}
+
+void
+ChannelMediaDecoder::DurationChanged()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  AbstractThread::AutoEnter context(AbstractMainThread());
+  MediaDecoder::DurationChanged();
+  // Duration has changed so we should recompute playback rate
+  UpdatePlaybackRate();
+}
+
+void
+ChannelMediaDecoder::DownloadProgressed()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  AbstractThread::AutoEnter context(AbstractMainThread());
+  MediaDecoder::DownloadProgressed();
+  UpdatePlaybackRate();
+  mResource->ThrottleReadahead(ShouldThrottleDownload());
+}
+
+void
+ChannelMediaDecoder::ComputePlaybackRate()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(mResource);
+
+  int64_t length = mResource->GetLength();
+  if (mozilla::IsFinite<double>(mDuration) && mDuration > 0 && length >= 0) {
+    mPlaybackRateReliable = true;
+    mPlaybackBytesPerSecond = length / mDuration;
+    return;
+  }
+
+  bool reliable = false;
+  mPlaybackBytesPerSecond = mPlaybackStatistics.GetRateAtLastStop(&reliable);
+  mPlaybackRateReliable = reliable;
+}
+
+void
+ChannelMediaDecoder::UpdatePlaybackRate()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(mResource);
+
+  ComputePlaybackRate();
+  uint32_t rate = mPlaybackBytesPerSecond;
+
+  if (mPlaybackRateReliable) {
+    // Avoid passing a zero rate
+    rate = std::max(rate, 1u);
+  } else {
+    // Set a minimum rate of 10,000 bytes per second ... sometimes we just
+    // don't have good data
+    rate = std::max(rate, 10000u);
+  }
+
+  mResource->SetPlaybackRate(rate);
+}
+
+MediaStatistics
+ChannelMediaDecoder::GetStatistics()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  MOZ_ASSERT(mResource);
+
+  MediaStatistics result;
+  result.mDownloadRate =
+    mResource->GetDownloadRate(&result.mDownloadRateReliable);
+  result.mDownloadPosition = mResource->GetCachedDataEnd(mDecoderPosition);
+  result.mTotalBytes = mResource->GetLength();
+  result.mPlaybackRate = mPlaybackBytesPerSecond;
+  result.mPlaybackRateReliable = mPlaybackRateReliable;
+  result.mDecoderPosition = mDecoderPosition;
+  result.mPlaybackPosition = mPlaybackPosition;
+  return result;
+}
+
+bool
+ChannelMediaDecoder::ShouldThrottleDownload()
+{
+  // We throttle the download if either the throttle override pref is set
+  // (so that we can always throttle in Firefox on mobile) or if the download
+  // is fast enough that there's no concern about playback being interrupted.
+  MOZ_ASSERT(NS_IsMainThread());
+  NS_ENSURE_TRUE(GetStateMachine(), false);
+
+  int64_t length = mResource->GetLength();
+  if (length > 0 &&
+      length <= int64_t(MediaPrefs::MediaMemoryCacheMaxSize()) * 1024) {
+    // Don't throttle the download of small resources. This is to speed
+    // up seeking, as seeks into unbuffered ranges would require starting
+    // up a new HTTP transaction, which adds latency.
+    return false;
+  }
+
+  if (Preferences::GetBool("media.throttle-regardless-of-download-rate",
+                           false)) {
+    return true;
+  }
+
+  MediaStatistics stats = GetStatistics();
+  if (!stats.mDownloadRateReliable || !stats.mPlaybackRateReliable) {
+    return false;
+  }
+  uint32_t factor =
+    std::max(2u, Preferences::GetUint("media.throttle-factor", 2));
+  return stats.mDownloadRate > factor * stats.mPlaybackRate;
+}
+
+void
+ChannelMediaDecoder::SetLoadInBackground(bool aLoadInBackground)
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  if (mResource) {
+    mResource->SetLoadInBackground(aLoadInBackground);
+  }
+}
+
+void
+ChannelMediaDecoder::Suspend()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  if (mResource) {
+    mResource->Suspend(true);
+  }
+}
+
+void
+ChannelMediaDecoder::Resume()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  if (mResource) {
+    mResource->Resume();
+  }
+}
+
 } // namespace mozilla
+
+// avoid redefined macro in unified build
+#undef LOG
--- a/dom/media/ChannelMediaDecoder.h
+++ b/dom/media/ChannelMediaDecoder.h
@@ -49,16 +49,19 @@ class ChannelMediaDecoder : public Media
     // The decoder to send notifications. Main-thread only.
     ChannelMediaDecoder* mDecoder = nullptr;
     nsCOMPtr<nsITimer> mTimer;
     bool mTimerArmed = false;
     const RefPtr<AbstractThread> mAbstractMainThread;
   };
 
 protected:
+  void OnPlaybackEvent(MediaEventType aEvent) override;
+  void DurationChanged() override;
+  void DownloadProgressed() override;
   RefPtr<ResourceCallback> mResourceCallback;
   RefPtr<BaseMediaResource> mResource;
 
 public:
   explicit ChannelMediaDecoder(MediaDecoderInit& aInit);
 
   MediaDecoderStateMachine* CreateStateMachine() override;
 
@@ -70,17 +73,68 @@ public:
 
   // Create a new decoder of the same type as this one.
   already_AddRefed<ChannelMediaDecoder> Clone(MediaDecoderInit& aInit);
 
   nsresult Load(nsIChannel* aChannel,
                 bool aIsPrivateBrowsing,
                 nsIStreamListener** aStreamListener);
 
+  void SetLoadInBackground(bool aLoadInBackground) override;
+  void Suspend() override;
+  void Resume() override;
+
 private:
   virtual ChannelMediaDecoder* CloneImpl(MediaDecoderInit& aInit) = 0;
   nsresult OpenResource(nsIStreamListener** aStreamListener);
   nsresult Load(BaseMediaResource* aOriginal);
+
+  // Called by MediaResource when the download has ended.
+  // Called on the main thread only. aStatus is the result from OnStopRequest.
+  void NotifyDownloadEnded(nsresult aStatus);
+
+  // Called by the MediaResource to keep track of the number of bytes read
+  // from the resource. Called on the main by an event runner dispatched
+  // by the MediaResource read functions.
+  void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset);
+
+  void SeekingChanged();
+
+  bool CanPlayThroughImpl() override final;
+
+  // The actual playback rate computation.
+  void ComputePlaybackRate();
+
+  // Something has changed that could affect the computed playback rate,
+  // so recompute it.
+  void UpdatePlaybackRate();
+
+  // Return statistics. This is used for progress events and other things.
+  // This can be called from any thread. It's only a snapshot of the
+  // current state, since other threads might be changing the state
+  // at any time.
+  MediaStatistics GetStatistics();
+
+  bool ShouldThrottleDownload();
+
+  WatchManager<ChannelMediaDecoder> mWatchManager;
+
+  // True when seeking or otherwise moving the play position around in
+  // such a manner that progress event data is inaccurate. This is set
+  // during seek and duration operations to prevent the progress indicator
+  // from jumping around. Read/Write on the main thread only.
+  bool mIgnoreProgressData = false;
+
+  // Data needed to estimate playback data rate. The timeline used for
+  // this estimate is "decode time" (where the "current time" is the
+  // time of the last decoded video frame).
+  MediaChannelStatistics mPlaybackStatistics;
+
+  // Estimate of the current playback rate (bytes/second).
+  double mPlaybackBytesPerSecond = 0;
+
+  // True if mPlaybackBytesPerSecond is a reliable estimate.
+  bool mPlaybackRateReliable = true;
 };
 
 } // namespace mozilla
 
 #endif // ChannelMediaDecoder_h_
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -358,17 +358,16 @@ MediaDecoder::IsInfinite() const
 #define INIT_CANONICAL(name, val) \
   name(mOwner->AbstractMainThread(), val, "MediaDecoder::" #name " (Canonical)")
 
 MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
   : mWatchManager(this, aInit.mOwner->AbstractMainThread())
   , mLogicalPosition(0.0)
   , mDuration(std::numeric_limits<double>::quiet_NaN())
   , mCDMProxyPromise(mCDMProxyPromiseHolder.Ensure(__func__))
-  , mIgnoreProgressData(false)
   , mOwner(aInit.mOwner)
   , mAbstractMainThread(aInit.mOwner->AbstractMainThread())
   , mFrameStats(new FrameStatistics())
   , mVideoFrameContainer(aInit.mOwner->GetVideoFrameContainer())
   , mPinnedForSeek(false)
   , mAudioChannel(aInit.mAudioChannel)
   , mMinimizePreroll(aInit.mMinimizePreroll)
   , mFiredMetadataLoaded(false)
@@ -386,19 +385,16 @@ MediaDecoder::MediaDecoder(MediaDecoderI
   , INIT_MIRROR(mIsAudioDataAudible, false)
   , INIT_CANONICAL(mVolume, aInit.mVolume)
   , INIT_CANONICAL(mPreservesPitch, aInit.mPreservesPitch)
   , INIT_CANONICAL(mLooping, aInit.mLooping)
   , INIT_CANONICAL(mPlayState, PLAY_STATE_LOADING)
   , INIT_CANONICAL(mLogicallySeeking, false)
   , INIT_CANONICAL(mSameOriginMedia, false)
   , INIT_CANONICAL(mMediaPrincipalHandle, PRINCIPAL_HANDLE_NONE)
-  , INIT_CANONICAL(mPlaybackBytesPerSecond, 0.0)
-  , INIT_CANONICAL(mPlaybackRateReliable, true)
-  , INIT_CANONICAL(mDecoderPosition, 0)
   , mVideoDecodingOberver(new BackgroundVideoDecodingPermissionObserver(this))
   , mIsBackgroundVideoDecodingAllowed(false)
   , mTelemetryReported(false)
   , mContainerType(aInit.mContainerType)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mAbstractMainThread);
   MediaMemoryTracker::AddMediaDecoder(this);
@@ -417,19 +413,16 @@ MediaDecoder::MediaDecoder(MediaDecoderI
   // depends on the download rate.
   mWatchManager.Watch(mBuffered, &MediaDecoder::UpdateReadyState);
 
   // mLogicalPosition
   mWatchManager.Watch(mCurrentPosition, &MediaDecoder::UpdateLogicalPosition);
   mWatchManager.Watch(mPlayState, &MediaDecoder::UpdateLogicalPosition);
   mWatchManager.Watch(mLogicallySeeking, &MediaDecoder::UpdateLogicalPosition);
 
-  // mIgnoreProgressData
-  mWatchManager.Watch(mLogicallySeeking, &MediaDecoder::SeekingChanged);
-
   mWatchManager.Watch(mIsAudioDataAudible,
                       &MediaDecoder::NotifyAudibleStateChanged);
 
   MediaShutdownManager::InitStatics();
   mVideoDecodingOberver->RegisterEvent();
 }
 
 #undef INIT_MIRROR
@@ -477,22 +470,16 @@ MediaDecoder::Shutdown()
     nsCOMPtr<nsIRunnable> r =
       NS_NewRunnableFunction("MediaDecoder::Shutdown", [self]() {
         self->mVideoFrameContainer = nullptr;
         MediaShutdownManager::Instance().Unregister(self);
       });
     mAbstractMainThread->Dispatch(r.forget());
   }
 
-  // Force any outstanding seek and byterange requests to complete
-  // to prevent shutdown from deadlocking.
-  if (MediaResource* r = GetResource()) {
-    r->Close();
-  }
-
   // Ask the owner to remove its audio/video tracks.
   GetOwner()->RemoveMediaTracks();
 
   ChangeState(PLAY_STATE_SHUTDOWN);
   mVideoDecodingOberver->UnregisterEvent();
   mVideoDecodingOberver = nullptr;
   mOwner = nullptr;
 }
@@ -519,23 +506,16 @@ MediaDecoder::~MediaDecoder()
   MOZ_DIAGNOSTIC_ASSERT(IsShutdown());
   MediaMemoryTracker::RemoveMediaDecoder(this);
 }
 
 void
 MediaDecoder::OnPlaybackEvent(MediaEventType aEvent)
 {
   switch (aEvent) {
-    case MediaEventType::PlaybackStarted:
-      mPlaybackStatistics.Start();
-      break;
-    case MediaEventType::PlaybackStopped:
-      mPlaybackStatistics.Stop();
-      ComputePlaybackRate();
-      break;
     case MediaEventType::PlaybackEnded:
       PlaybackEnded();
       break;
     case MediaEventType::SeekStarted:
       SeekingStarted();
       break;
     case MediaEventType::Invalidate:
       Invalidate();
@@ -552,16 +532,19 @@ MediaDecoder::OnPlaybackEvent(MediaEvent
     case MediaEventType::CancelVideoSuspendTimer:
       GetOwner()->DispatchAsyncEvent(NS_LITERAL_STRING("mozcancelvideosuspendtimer"));
       break;
     case MediaEventType::VideoOnlySeekBegin:
       GetOwner()->DispatchAsyncEvent(NS_LITERAL_STRING("mozvideoonlyseekbegin"));
       break;
     case MediaEventType::VideoOnlySeekCompleted:
       GetOwner()->DispatchAsyncEvent(NS_LITERAL_STRING("mozvideoonlyseekcompleted"));
+      break;
+    default:
+      break;
   }
 }
 
 void
 MediaDecoder::OnPlaybackErrorEvent(const MediaResult& aError)
 {
   DecodeError(aError);
 }
@@ -922,188 +905,49 @@ MediaDecoder::PlaybackEnded()
 
   LOG("MediaDecoder::PlaybackEnded");
 
   ChangeState(PLAY_STATE_ENDED);
   InvalidateWithFlags(VideoFrameContainer::INVALIDATE_FORCE);
   GetOwner()->PlaybackEnded();
 }
 
-MediaStatistics
-MediaDecoder::GetStatistics()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MediaResource* r = GetResource();
-  MOZ_ASSERT(r);
-
-  MediaStatistics result;
-  result.mDownloadRate =
-    r->GetDownloadRate(&result.mDownloadRateReliable);
-  result.mDownloadPosition = r->GetCachedDataEnd(mDecoderPosition);
-  result.mTotalBytes = r->GetLength();
-  result.mPlaybackRate = mPlaybackBytesPerSecond;
-  result.mPlaybackRateReliable = mPlaybackRateReliable;
-  result.mDecoderPosition = mDecoderPosition;
-  result.mPlaybackPosition = mPlaybackPosition;
-  return result;
-}
-
-void
-MediaDecoder::ComputePlaybackRate()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(GetResource());
-
-  int64_t length = GetResource()->GetLength();
-  if (mozilla::IsFinite<double>(mDuration)
-      && mDuration > 0
-      && length >= 0) {
-    mPlaybackRateReliable = true;
-    mPlaybackBytesPerSecond = length / mDuration;
-    return;
-  }
-
-  bool reliable = false;
-  mPlaybackBytesPerSecond = mPlaybackStatistics.GetRateAtLastStop(&reliable);
-  mPlaybackRateReliable = reliable;
-}
-
-void
-MediaDecoder::UpdatePlaybackRate()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(GetResource());
-
-  ComputePlaybackRate();
-  uint32_t rate = mPlaybackBytesPerSecond;
-
-  if (mPlaybackRateReliable) {
-    // Avoid passing a zero rate
-    rate = std::max(rate, 1u);
-  } else {
-    // Set a minimum rate of 10,000 bytes per second ... sometimes we just
-    // don't have good data
-    rate = std::max(rate, 10000u);
-  }
-
-  GetResource()->SetPlaybackRate(rate);
-}
-
 void
 MediaDecoder::NotifySuspendedStatusChanged()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   AbstractThread::AutoEnter context(AbstractMainThread());
   if (MediaResource* r = GetResource()) {
     bool suspended = r->IsSuspendedByCache();
     GetOwner()->NotifySuspendedByCache(suspended);
   }
 }
 
-bool
-MediaDecoder::ShouldThrottleDownload()
-{
-  // We throttle the download if either the throttle override pref is set
-  // (so that we can always throttle in Firefox on mobile) or if the download
-  // is fast enough that there's no concern about playback being interrupted.
-  MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_TRUE(mDecoderStateMachine, false);
-
-  int64_t length = GetResource()->GetLength();
-  if (length > 0 &&
-      length <= int64_t(MediaPrefs::MediaMemoryCacheMaxSize()) * 1024) {
-    // Don't throttle the download of small resources. This is to speed
-    // up seeking, as seeks into unbuffered ranges would require starting
-    // up a new HTTP transaction, which adds latency.
-    return false;
-  }
-
-  if (Preferences::GetBool("media.throttle-regardless-of-download-rate",
-                           false)) {
-    return true;
-  }
-
-  MediaStatistics stats = GetStatistics();
-  if (!stats.mDownloadRateReliable || !stats.mPlaybackRateReliable) {
-    return false;
-  }
-  uint32_t factor =
-    std::max(2u, Preferences::GetUint("media.throttle-factor", 2));
-  return stats.mDownloadRate > factor * stats.mPlaybackRate;
-}
-
 void
 MediaDecoder::DownloadProgressed()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   AbstractThread::AutoEnter context(AbstractMainThread());
-  UpdatePlaybackRate();
   GetOwner()->DownloadProgressed();
-  GetResource()->ThrottleReadahead(ShouldThrottleDownload());
-}
-
-void
-MediaDecoder::NotifyDownloadEnded(nsresult aStatus)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
-  AbstractThread::AutoEnter context(AbstractMainThread());
-
-  LOG("NotifyDownloadEnded, status=%" PRIx32, static_cast<uint32_t>(aStatus));
-
-  if (aStatus == NS_BINDING_ABORTED) {
-    // Download has been cancelled by user.
-    GetOwner()->LoadAborted();
-    return;
-  }
-
-  UpdatePlaybackRate();
-
-  if (NS_SUCCEEDED(aStatus)) {
-    // A final progress event will be fired by the MediaResource calling
-    // DownloadSuspended on the element.
-    // Also NotifySuspendedStatusChanged() will be called to update readyState
-    // if download ended with success.
-  } else if (aStatus != NS_BASE_STREAM_CLOSED) {
-    NetworkError();
-  }
 }
 
 void
 MediaDecoder::NotifyPrincipalChanged()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   AbstractThread::AutoEnter context(AbstractMainThread());
   nsCOMPtr<nsIPrincipal> newPrincipal = GetCurrentPrincipal();
   mMediaPrincipalHandle = MakePrincipalHandle(newPrincipal);
   GetOwner()->NotifyDecoderPrincipalChanged();
 }
 
 void
-MediaDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
-  AbstractThread::AutoEnter context(AbstractMainThread());
-
-  if (mIgnoreProgressData) {
-    return;
-  }
-
-  MOZ_ASSERT(mDecoderStateMachine);
-  if (aOffset >= mDecoderPosition) {
-    mPlaybackStatistics.AddBytes(aBytes);
-  }
-  mDecoderPosition = aOffset + aBytes;
-}
-
-void
 MediaDecoder::OnSeekResolved()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   AbstractThread::AutoEnter context(AbstractMainThread());
   mSeekRequest.Complete();
 
   {
@@ -1200,19 +1044,16 @@ MediaDecoder::DurationChanged()
   }
 
   if (mDuration == oldDuration || IsNaN(mDuration)) {
     return;
   }
 
   LOG("Duration changed to %f", mDuration);
 
-  // Duration has changed so we should recompute playback rate
-  UpdatePlaybackRate();
-
   // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28822 for a discussion
   // of whether we should fire durationchange on explicit infinity.
   if (mFiredMetadataLoaded &&
       (!mozilla::IsInfinite<double>(mDuration) || mExplicitDuration.isSome())) {
     GetOwner()->DispatchAsyncEvent(NS_LITERAL_STRING("durationchange"));
   }
 
   if (CurrentPosition() > TimeUnit::FromSeconds(mDuration)) {
@@ -1392,43 +1233,16 @@ MediaDecoder::SetFragmentEndTime(double 
   MOZ_ASSERT(NS_IsMainThread());
   if (mDecoderStateMachine) {
     mDecoderStateMachine->DispatchSetFragmentEndTime(
       TimeUnit::FromSeconds(aTime));
   }
 }
 
 void
-MediaDecoder::Suspend()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  if (MediaResource* r = GetResource()) {
-    r->Suspend(true);
-  }
-}
-
-void
-MediaDecoder::Resume()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  if (MediaResource* r = GetResource()) {
-    r->Resume();
-  }
-}
-
-void
-MediaDecoder::SetLoadInBackground(bool aLoadInBackground)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  if (MediaResource* r = GetResource()) {
-    r->SetLoadInBackground(aLoadInBackground);
-  }
-}
-
-void
 MediaDecoder::SetPlaybackRate(double aPlaybackRate)
 {
   MOZ_ASSERT(NS_IsMainThread());
   AbstractThread::AutoEnter context(AbstractMainThread());
 
   double oldRate = mPlaybackRate;
   mPlaybackRate = aPlaybackRate;
   if (aPlaybackRate == 0) {
@@ -1622,18 +1436,24 @@ MediaDecoder::UnpinForSeek()
   mPinnedForSeek = false;
   resource->Unpin();
 }
 
 bool
 MediaDecoder::CanPlayThrough()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_TRUE(mDecoderStateMachine, false);
-  return GetStatistics().CanPlayThrough();
+  MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
+  AbstractThread::AutoEnter context(AbstractMainThread());
+  bool val = CanPlayThroughImpl();
+  if (val != mCanPlayThrough) {
+    mCanPlayThrough = val;
+    mDecoderStateMachine->DispatchCanPlayThrough(val);
+  }
+  return val;
 }
 
 RefPtr<MediaDecoder::CDMProxyPromise>
 MediaDecoder::RequestCDMProxy() const
 {
   return mCDMProxyPromise;
 }
 
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -229,31 +229,31 @@ public:
   // Invalidate the frame.
   void Invalidate();
   void InvalidateWithFlags(uint32_t aFlags);
 
   // Suspend any media downloads that are in progress. Called by the
   // media element when it is sent to the bfcache, or when we need
   // to throttle the download. Call on the main thread only. This can
   // be called multiple times, there's an internal "suspend count".
-  virtual void Suspend();
+  virtual void Suspend() {}
 
   // Resume any media downloads that have been suspended. Called by the
   // media element when it is restored from the bfcache, or when we need
   // to stop throttling the download. Call on the main thread only.
   // The download will only actually resume once as many Resume calls
   // have been made as Suspend calls.
-  virtual void Resume();
+  virtual void Resume() {}
 
   // Moves any existing channel loads into or out of background. Background
   // loads don't block the load event. This is called when we stop or restart
   // delaying the load event. This also determines whether any new loads
   // initiated (for example to seek) will be in the background.  This calls
   // SetLoadInBackground() on mResource.
-  void SetLoadInBackground(bool aLoadInBackground);
+  virtual void SetLoadInBackground(bool aLoadInBackground) {}
 
   MediaDecoderStateMachine* GetStateMachine() const;
   void SetStateMachine(MediaDecoderStateMachine* aStateMachine);
 
   // Constructs the time ranges representing what segments of the media
   // are buffered and playable.
   virtual media::TimeIntervals GetBuffered();
 
@@ -301,26 +301,19 @@ private:
   }
 
   layers::ImageContainer* GetImageContainer();
 
   // Fire timeupdate events if needed according to the time constraints
   // outlined in the specification.
   void FireTimeUpdate();
 
-  // Something has changed that could affect the computed playback rate,
-  // so recompute it. The monitor must be held.
-  virtual void UpdatePlaybackRate();
-
-  // The actual playback rate computation. The monitor must be held.
-  void ComputePlaybackRate();
-
   // Returns true if we can play the entire media through without stopping
   // to buffer, given the current download and playback rates.
-  virtual bool CanPlayThrough();
+  bool CanPlayThrough();
 
   dom::AudioChannel GetAudioChannel() { return mAudioChannel; }
 
   // Called from HTMLMediaElement when owner document activity changes
   virtual void SetElementVisibility(bool aIsDocumentVisible,
                                     Visibility aElementVisibility,
                                     bool aIsElementInTree);
 
@@ -348,24 +341,16 @@ private:
 
   // Called when the video has completed playing.
   // Call on the main thread only.
   void PlaybackEnded();
 
   void OnSeekRejected();
   void OnSeekResolved();
 
-  void SeekingChanged()
-  {
-    // Stop updating the bytes downloaded for progress notifications when
-    // seeking to prevent wild changes to the progress notification.
-    MOZ_ASSERT(NS_IsMainThread());
-    mIgnoreProgressData = mLogicallySeeking;
-  }
-
   // Seeking has started. Inform the element on the main thread.
   void SeekingStarted();
 
   void UpdateLogicalPositionInternal();
   void UpdateLogicalPosition()
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
@@ -409,22 +394,16 @@ private:
   static bool IsOpusEnabled();
   static bool IsWaveEnabled();
   static bool IsWebMEnabled();
 
 #ifdef MOZ_WMF
   static bool IsWMFEnabled();
 #endif
 
-  // Return statistics. This is used for progress events and other things.
-  // This can be called from any thread. It's only a snapshot of the
-  // current state, since other threads might be changing the state
-  // at any time.
-  MediaStatistics GetStatistics();
-
   // Return the frame decode/paint related statistics.
   FrameStatistics& GetFrameStatistics() { return *mFrameStats; }
 
   void UpdateReadyState()
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
     GetOwner()->UpdateReadyState();
@@ -452,35 +431,36 @@ protected:
   // by the state machine. Call on the main thread only.
   virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo,
                                 MediaDecoderEventVisibility aEventVisibility);
 
   void SetStateMachineParameters();
 
   bool IsShutdown() const;
 
-  // Called by the state machine to notify the decoder that the duration
-  // has changed.
-  void DurationChanged();
+  // Called to notify the decoder that the duration has changed.
+  virtual void DurationChanged();
 
   // State-watching manager.
   WatchManager<MediaDecoder> mWatchManager;
 
   double ExplicitDuration() { return mExplicitDuration.ref(); }
 
   void SetExplicitDuration(double aValue)
   {
     MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
     mExplicitDuration = Some(aValue);
 
     // We Invoke DurationChanged explicitly, rather than using a watcher, so
     // that it takes effect immediately, rather than at the end of the current task.
     DurationChanged();
   }
 
+  virtual void OnPlaybackEvent(MediaEventType aEvent);
+
   /******
    * The following members should be accessed with the decoder lock held.
    ******/
 
   // The logical playback position of the media resource in units of
   // seconds. This corresponds to the "official position" in HTML5. Note that
   // we need to store this as a double, rather than an int64_t (like
   // mCurrentPosition), so that |v.currentTime = foo; v.currentTime == foo|
@@ -520,31 +500,32 @@ private:
   // state machine. Call on the main thread only.
   void MetadataLoaded(UniquePtr<MediaInfo> aInfo,
                       UniquePtr<MetadataTags> aTags,
                       MediaDecoderEventVisibility aEventVisibility);
 
   // Called when the owner's activity changed.
   void NotifyCompositor();
 
-  void OnPlaybackEvent(MediaEventType aEvent);
   void OnPlaybackErrorEvent(const MediaResult& aError);
 
   void OnDecoderDoctorEvent(DecoderDoctorEvent aEvent);
 
   void OnMediaNotSeekable()
   {
     mMediaSeekable = false;
   }
 
   void FinishShutdown();
 
   void ConnectMirrors(MediaDecoderStateMachine* aObject);
   void DisconnectMirrors();
 
+  virtual bool CanPlayThroughImpl() = 0;
+
   // The state machine object for handling the decoding. It is safe to
   // call methods of this object from other threads. Its internal data
   // is synchronised on a monitor. The lifetime of this object is
   // after mPlayState is LOADING and before mPlayState is SHUTDOWN. It
   // is safe to access it during this period.
   //
   // Explicitly prievate to force access via accessors.
   RefPtr<MediaDecoderStateMachine> mDecoderStateMachine;
@@ -552,78 +533,55 @@ private:
   MozPromiseHolder<CDMProxyPromise> mCDMProxyPromiseHolder;
   RefPtr<CDMProxyPromise> mCDMProxyPromise;
 
 protected:
   void NotifyDataArrivedInternal();
   void DiscardOngoingSeekIfExists();
   virtual void CallSeek(const SeekTarget& aTarget);
 
-  // Called to recompute playback rate and notify 'progress' event.
-  // Call on the main thread only.
-  void DownloadProgressed();
+  // Called to notify fetching media data is in progress.
+  // Called on the main thread only.
+  virtual void DownloadProgressed();
 
   // Called by MediaResource when the "cache suspended" status changes.
   // If MediaResource::IsSuspendedByCache returns true, then the decoder
   // should stop buffering or otherwise waiting for download progress and
   // start consuming data, if possible, because the cache is full.
   void NotifySuspendedStatusChanged();
 
   // Called by MediaResource when the principal of the resource has
   // changed. Called on main thread only.
   void NotifyPrincipalChanged();
 
-  // Called by the MediaResource to keep track of the number of bytes read
-  // from the resource. Called on the main by an event runner dispatched
-  // by the MediaResource read functions.
-  void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset);
-
-  // Called by nsChannelToPipeListener or MediaResource when the
-  // download has ended. Called on the main thread only. aStatus is
-  // the result from OnStopRequest.
-  void NotifyDownloadEnded(nsresult aStatus);
-
   MozPromiseRequestHolder<SeekPromise> mSeekRequest;
 
-  // True when seeking or otherwise moving the play position around in
-  // such a manner that progress event data is inaccurate. This is set
-  // during seek and duration operations to prevent the progress indicator
-  // from jumping around. Read/Write on the main thread only.
-  bool mIgnoreProgressData;
-
   // Ensures our media stream has been pinned.
   void PinForSeek();
 
   // Ensures our media stream has been unpinned.
   void UnpinForSeek();
 
   const char* PlayStateStr();
 
   void OnMetadataUpdate(TimedMetadata&& aMetadata);
 
-  bool ShouldThrottleDownload();
-
   // This should only ever be accessed from the main thread.
   // It is set in the constructor and cleared in Shutdown when the element goes
   // away. The decoder does not add a reference the element.
   MediaDecoderOwner* mOwner;
 
   // The AbstractThread from mOwner.
   const RefPtr<AbstractThread> mAbstractMainThread;
 
   // Counters related to decode and presentation of frames.
   const RefPtr<FrameStatistics> mFrameStats;
 
   RefPtr<VideoFrameContainer> mVideoFrameContainer;
 
-  // Data needed to estimate playback data rate. The timeline used for
-  // this estimate is "decode time" (where the "current time" is the
-  // time of the last decoded video frame).
-  MediaChannelStatistics mPlaybackStatistics;
-
   // True when our media stream has been pinned. We pin the stream
   // while seeking.
   bool mPinnedForSeek;
 
   // Be assigned from media element during the initialization and pass to
   // AudioStream Class.
   const dom::AudioChannel mAudioChannel;
 
@@ -728,38 +686,32 @@ protected:
   // True if the media is same-origin with the element. Data can only be
   // passed to MediaStreams when this is true.
   Canonical<bool> mSameOriginMedia;
 
   // An identifier for the principal of the media. Used to track when
   // main-thread induced principal changes get reflected on MSG thread.
   Canonical<PrincipalHandle> mMediaPrincipalHandle;
 
-  // Estimate of the current playback rate (bytes/second).
-  Canonical<double> mPlaybackBytesPerSecond;
-
-  // True if mPlaybackBytesPerSecond is a reliable estimate.
-  Canonical<bool> mPlaybackRateReliable;
-
-  // Current decoding position in the stream. This is where the decoder
-  // is up to consuming the stream. This is not adjusted during decoder
-  // seek operations, but it's updated at the end when we start playing
-  // back again.
-  Canonical<int64_t> mDecoderPosition;
-
   // We can allow video decoding in background when we match some special
   // conditions, eg. when the cursor is hovering over the tab. This observer is
   // used to listen the related events.
   class BackgroundVideoDecodingPermissionObserver;
   RefPtr<BackgroundVideoDecodingPermissionObserver> mVideoDecodingOberver;
 
   // True if we want to resume video decoding even the media element is in the
   // background.
   bool mIsBackgroundVideoDecodingAllowed;
 
+  // Current decoding position in the stream. This is where the decoder
+  // is up to consuming the stream. This is not adjusted during decoder
+  // seek operations, but it's updated at the end when we start playing
+  // back again.
+  int64_t mDecoderPosition = 0;
+
 public:
   AbstractCanonical<double>* CanonicalVolume() { return &mVolume; }
   AbstractCanonical<bool>* CanonicalPreservesPitch()
   {
     return &mPreservesPitch;
   }
   AbstractCanonical<bool>* CanonicalLooping()
   {
@@ -773,32 +725,21 @@ public:
   AbstractCanonical<bool>* CanonicalSameOriginMedia()
   {
     return &mSameOriginMedia;
   }
   AbstractCanonical<PrincipalHandle>* CanonicalMediaPrincipalHandle()
   {
     return &mMediaPrincipalHandle;
   }
-  AbstractCanonical<double>* CanonicalPlaybackBytesPerSecond()
-  {
-    return &mPlaybackBytesPerSecond;
-  }
-  AbstractCanonical<bool>* CanonicalPlaybackRateReliable()
-  {
-    return &mPlaybackRateReliable;
-  }
-  AbstractCanonical<int64_t>* CanonicalDecoderPosition()
-  {
-    return &mDecoderPosition;
-  }
 
 private:
   // Notify owner when the audible state changed
   void NotifyAudibleStateChanged();
 
   bool mTelemetryReported;
   const MediaContainerType mContainerType;
+  bool mCanPlayThrough = false;
 };
 
 } // namespace mozilla
 
 #endif
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1851,26 +1851,17 @@ public:
 
   void Enter()
   {
     if (mMaster->IsPlaying()) {
       mMaster->StopPlayback();
     }
 
     mBufferingStart = TimeStamp::Now();
-
-    MediaStatistics stats = mMaster->GetStatistics();
-    SLOG("Playback rate: %.1lfKB/s%s download rate: %.1lfKB/s%s",
-         stats.mPlaybackRate / 1024,
-         stats.mPlaybackRateReliable ? "" : " (unreliable)",
-         stats.mDownloadRate / 1024,
-         stats.mDownloadRateReliable ? "" : " (unreliable)");
-
     mMaster->ScheduleStateMachineIn(TimeUnit::FromMicroseconds(USECS_PER_S));
-
     mMaster->UpdateNextFrameStatus(
       MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_BUFFERING);
   }
 
   void Step() override;
 
   State GetState() const override { return DECODER_STATE_BUFFERING; }
 
@@ -2578,17 +2569,17 @@ BufferingState::Step()
   MOZ_ASSERT(!mBufferingStart.IsNull(), "Must know buffering start time.");
 
   // With buffering heuristics we will remain in the buffering state if
   // we've not decoded enough data to begin playback, or if we've not
   // downloaded a reasonable amount of data inside our buffering time.
   if (Reader()->UseBufferingHeuristics()) {
     TimeDuration elapsed = now - mBufferingStart;
     bool isLiveStream = Resource()->IsLiveStream();
-    if ((isLiveStream || !mMaster->CanPlayThrough())
+    if ((isLiveStream || !mMaster->mCanPlayThrough)
         && elapsed
            < TimeDuration::FromSeconds(mBufferingWait * mMaster->mPlaybackRate)
         && mMaster->HasLowBufferedData(TimeUnit::FromSeconds(mBufferingWait))
         && IsExpectingMoreData()) {
       SLOG("Buffering: wait %ds, timeout in %.3lfs",
            mBufferingWait, mBufferingWait - elapsed.ToSeconds());
       mMaster->ScheduleStateMachineIn(TimeUnit::FromMicroseconds(USECS_PER_S));
       DispatchDecodeTasksIfNeeded();
@@ -2675,19 +2666,16 @@ ShutdownState::Enter()
   // Disconnect canonicals and mirrors before shutting down our task queue.
   master->mBuffered.DisconnectIfConnected();
   master->mPlayState.DisconnectIfConnected();
   master->mVolume.DisconnectIfConnected();
   master->mPreservesPitch.DisconnectIfConnected();
   master->mLooping.DisconnectIfConnected();
   master->mSameOriginMedia.DisconnectIfConnected();
   master->mMediaPrincipalHandle.DisconnectIfConnected();
-  master->mPlaybackBytesPerSecond.DisconnectIfConnected();
-  master->mPlaybackRateReliable.DisconnectIfConnected();
-  master->mDecoderPosition.DisconnectIfConnected();
 
   master->mDuration.DisconnectAll();
   master->mNextFrameStatus.DisconnectAll();
   master->mCurrentPosition.DisconnectAll();
   master->mPlaybackOffset.DisconnectAll();
   master->mIsAudioDataAudible.DisconnectAll();
 
   // Shut down the watch manager to stop further notifications.
@@ -2734,19 +2722,16 @@ MediaDecoderStateMachine::MediaDecoderSt
   mIsMSE(aDecoder->IsMSE()),
   INIT_MIRROR(mBuffered, TimeIntervals()),
   INIT_MIRROR(mPlayState, MediaDecoder::PLAY_STATE_LOADING),
   INIT_MIRROR(mVolume, 1.0),
   INIT_MIRROR(mPreservesPitch, true),
   INIT_MIRROR(mLooping, false),
   INIT_MIRROR(mSameOriginMedia, false),
   INIT_MIRROR(mMediaPrincipalHandle, PRINCIPAL_HANDLE_NONE),
-  INIT_MIRROR(mPlaybackBytesPerSecond, 0.0),
-  INIT_MIRROR(mPlaybackRateReliable, true),
-  INIT_MIRROR(mDecoderPosition, 0),
   INIT_CANONICAL(mDuration, NullableTimeUnit()),
   INIT_CANONICAL(mNextFrameStatus, MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE),
   INIT_CANONICAL(mCurrentPosition, TimeUnit::Zero()),
   INIT_CANONICAL(mPlaybackOffset, 0),
   INIT_CANONICAL(mIsAudioDataAudible, false)
 #ifdef XP_WIN
   , mShouldUseHiResTimers(Preferences::GetBool("media.hi-res-timers.enabled", true))
 #endif
@@ -2779,19 +2764,16 @@ MediaDecoderStateMachine::Initialization
   // Connect mirrors.
   mBuffered.Connect(mReader->CanonicalBuffered());
   mPlayState.Connect(aDecoder->CanonicalPlayState());
   mVolume.Connect(aDecoder->CanonicalVolume());
   mPreservesPitch.Connect(aDecoder->CanonicalPreservesPitch());
   mLooping.Connect(aDecoder->CanonicalLooping());
   mSameOriginMedia.Connect(aDecoder->CanonicalSameOriginMedia());
   mMediaPrincipalHandle.Connect(aDecoder->CanonicalMediaPrincipalHandle());
-  mPlaybackBytesPerSecond.Connect(aDecoder->CanonicalPlaybackBytesPerSecond());
-  mPlaybackRateReliable.Connect(aDecoder->CanonicalPlaybackRateReliable());
-  mDecoderPosition.Connect(aDecoder->CanonicalDecoderPosition());
 
   // Initialize watchers.
   mWatchManager.Watch(mBuffered,
                       &MediaDecoderStateMachine::BufferedRangeUpdated);
   mWatchManager.Watch(mVolume, &MediaDecoderStateMachine::VolumeChanged);
   mWatchManager.Watch(mPreservesPitch,
                       &MediaDecoderStateMachine::PreservesPitchChanged);
   mWatchManager.Watch(mPlayState, &MediaDecoderStateMachine::PlayStateChanged);
@@ -3641,39 +3623,16 @@ MediaDecoderStateMachine::UpdateNextFram
 {
   MOZ_ASSERT(OnTaskQueue());
   if (aStatus != mNextFrameStatus) {
     LOG("Changed mNextFrameStatus to %s", ToStr(aStatus));
     mNextFrameStatus = aStatus;
   }
 }
 
-bool
-MediaDecoderStateMachine::CanPlayThrough()
-{
-  MOZ_ASSERT(OnTaskQueue());
-  return GetStatistics().CanPlayThrough();
-}
-
-MediaStatistics
-MediaDecoderStateMachine::GetStatistics()
-{
-  MOZ_ASSERT(OnTaskQueue());
-  MediaStatistics result;
-  result.mDownloadRate =
-    mResource->GetDownloadRate(&result.mDownloadRateReliable);
-  result.mDownloadPosition = mResource->GetCachedDataEnd(mDecoderPosition);
-  result.mTotalBytes = mResource->GetLength();
-  result.mPlaybackRate = mPlaybackBytesPerSecond;
-  result.mPlaybackRateReliable = mPlaybackRateReliable;
-  result.mDecoderPosition = mDecoderPosition;
-  result.mPlaybackPosition = mPlaybackOffset;
-  return result;
-}
-
 void
 MediaDecoderStateMachine::ScheduleStateMachine()
 {
   MOZ_ASSERT(OnTaskQueue());
   if (mDispatchedStateMachine) {
     return;
   }
   mDispatchedStateMachine = true;
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -203,16 +203,27 @@ public:
         // A negative number means we don't have a fragment end time at all.
         self->mFragmentEndTime = aEndTime >= media::TimeUnit::Zero()
                                    ? aEndTime
                                    : media::TimeUnit::Invalid();
       });
     OwnerThread()->Dispatch(r.forget());
   }
 
+  void DispatchCanPlayThrough(bool aCanPlayThrough)
+  {
+    RefPtr<MediaDecoderStateMachine> self = this;
+    nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
+      "MediaDecoderStateMachine::DispatchCanPlayThrough",
+      [self, aCanPlayThrough]() {
+        self->mCanPlayThrough = aCanPlayThrough;
+      });
+    OwnerThread()->DispatchStateChange(r.forget());
+  }
+
   // Drop reference to mResource. Only called during shutdown dance.
   void BreakCycles() {
     MOZ_ASSERT(NS_IsMainThread());
     mResource = nullptr;
   }
 
   TimedMetadataEventSource& TimedMetadataEvent() {
     return mMetadataManager.TimedMetadataEvent();
@@ -285,20 +296,16 @@ private:
 
   // Update the playback position. This can result in a timeupdate event
   // and an invalidate of the frame being dispatched asynchronously if
   // there is no such event currently queued.
   // Only called on the decoder thread. Must be called with
   // the decode monitor held.
   void UpdatePlaybackPosition(const media::TimeUnit& aTime);
 
-  bool CanPlayThrough();
-
-  MediaStatistics GetStatistics();
-
   bool HasAudio() const { return mInfo.ref().HasAudio(); }
   bool HasVideo() const { return mInfo.ref().HasVideo(); }
   const MediaInfo& Info() const { return mInfo.ref(); }
 
   // Returns the state machine task queue.
   TaskQueue* OwnerThread() const { return mTaskQueue; }
 
   // Schedules the shared state machine thread to run the state machine.
@@ -571,16 +578,18 @@ private:
   MozPromiseRequestHolder<WaitForDataPromise> mVideoWaitRequest;
 
   const char* AudioRequestStatus() const;
   const char* VideoRequestStatus() const;
 
   void OnSuspendTimerResolved();
   void CancelSuspendTimer();
 
+  bool mCanPlayThrough = false;
+
   // True if we shouldn't play our audio (but still write it to any capturing
   // streams). When this is true, the audio thread will never start again after
   // it has stopped.
   bool mAudioCaptured;
 
   // True if all audio frames are already rendered.
   bool mAudioCompleted = false;
 
@@ -678,26 +687,16 @@ private:
   // True if the media is same-origin with the element. Data can only be
   // passed to MediaStreams when this is true.
   Mirror<bool> mSameOriginMedia;
 
   // An identifier for the principal of the media. Used to track when
   // main-thread induced principal changes get reflected on MSG thread.
   Mirror<PrincipalHandle> mMediaPrincipalHandle;
 
-  // Estimate of the current playback rate (bytes/second).
-  Mirror<double> mPlaybackBytesPerSecond;
-
-  // True if mPlaybackBytesPerSecond is a reliable estimate.
-  Mirror<bool> mPlaybackRateReliable;
-
-  // Current decoding position in the stream.
-  Mirror<int64_t> mDecoderPosition;
-
-
   // Duration of the media. This is guaranteed to be non-null after we finish
   // decoding the first frame.
   Canonical<media::NullableTimeUnit> mDuration;
 
   // The status of our next frame. Mirrored on the main thread and used to
   // compute ready state.
   Canonical<NextFrameStatus> mNextFrameStatus;
 
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -155,38 +155,22 @@ class MediaResource : public nsISupports
 public:
   // Our refcounting is threadsafe, and when our refcount drops to zero
   // we dispatch an event to the main thread to delete the MediaResource.
   // Note that this means it's safe for references to this object to be
   // released on a non main thread, but the destructor will always run on
   // the main thread.
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  // Close the resource, stop any listeners, channels, etc.
-  // Cancels any currently blocking Read request and forces that request to
-  // return an error.
-  virtual nsresult Close() = 0;
-  // Suspend any downloads that are in progress.
-  // If aCloseImmediately is set, resources should be released immediately
-  // since we don't expect to resume again any time soon. Otherwise we
-  // may resume again soon so resources should be held for a little
-  // while.
-  virtual void Suspend(bool aCloseImmediately) = 0;
-  // Resume any downloads that have been suspended.
-  virtual void Resume() = 0;
   // Get the current principal for the channel
   virtual already_AddRefed<nsIPrincipal> GetCurrentPrincipal() = 0;
 
   // These methods are called off the main thread.
   // The mode is initially MODE_PLAYBACK.
   virtual void SetReadMode(MediaCacheStream::ReadMode aMode) = 0;
-  // This is the client's estimate of the playback rate assuming
-  // the media plays continuously. The cache can't guess this itself
-  // because it doesn't know when the decoder was paused, buffering, etc.
-  virtual void SetPlaybackRate(uint32_t aBytesPerSecond) = 0;
   // Read up to aCount bytes from the stream. The read starts at
   // aOffset in the stream, seeking to that location initially if
   // it is not the current stream offset. The remaining arguments,
   // results and requirements are the same as per the Read method.
   virtual nsresult ReadAt(int64_t aOffset, char* aBuffer,
                           uint32_t aCount, uint32_t* aBytes) = 0;
   // Indicate whether caching data in advance of reads is worth it.
   // E.g. Caching lockless and memory-based MediaResource subclasses would be a
@@ -200,43 +184,30 @@ public:
     bool ok = bytes->SetLength(aCount, fallible);
     NS_ENSURE_TRUE(ok, nullptr);
     char* curr = reinterpret_cast<char*>(bytes->Elements());
     nsresult rv = ReadFromCache(curr, aOffset, aCount);
     NS_ENSURE_SUCCESS(rv, nullptr);
     return bytes.forget();
   }
 
-  // Pass true to limit the amount of readahead data (specified by
-  // "media.cache_readahead_limit") or false to read as much as the
-  // cache size allows.
-  virtual void ThrottleReadahead(bool bThrottle) { }
-
   // Report the current offset in bytes from the start of the stream.
   // This is used to approximate where we currently are in the playback of a
   // media.
   // A call to ReadAt will update this position.
   virtual int64_t Tell() = 0;
-  // Moves any existing channel loads into or out of background. Background
-  // loads don't block the load event. This also determines whether or not any
-  // new loads initiated (for example to seek) will be in the background.
-  virtual void SetLoadInBackground(bool aLoadInBackground) {}
   // Ensures that the value returned by IsSuspendedByCache below is up to date
   // (i.e. the cache has examined this stream at least once).
   virtual void EnsureCacheUpToDate() {}
 
   // These can be called on any thread.
   // Cached blocks associated with this stream will not be evicted
   // while the stream is pinned.
   virtual void Pin() = 0;
   virtual void Unpin() = 0;
-  // Get the estimated download rate in bytes per second (assuming no
-  // pausing of the channel is requested by Gecko).
-  // *aIsReliable is set to true if we think the estimate is useful.
-  virtual double GetDownloadRate(bool* aIsReliable) = 0;
   // Get the length of the stream in bytes. Returns -1 if not known.
   // This can change over time; after a seek operation, a misbehaving
   // server may give us a resource of a different length to what it had
   // reported previously --- or it may just lie in its Content-Length
   // header and give us more or less data than it reported. We will adjust
   // the result of GetLength to reflect the data that's actually arriving.
   virtual int64_t GetLength() = 0;
   // Returns the offset of the first byte of cached data at or after aOffset,
@@ -276,22 +247,16 @@ public:
                                  int64_t aOffset,
                                  uint32_t aCount) = 0;
   // Returns true if the resource can be seeked to unbuffered ranges, i.e.
   // for an HTTP network stream this returns true if HTTP1.1 Byte Range
   // requests are supported by the connection/server.
   virtual bool IsTransportSeekable() = 0;
 
   /**
-   * Open the stream. This creates a stream listener and returns it in
-   * aStreamListener; this listener needs to be notified of incoming data.
-   */
-  virtual nsresult Open(nsIStreamListener** aStreamListener) = 0;
-
-  /**
    * Fills aRanges with MediaByteRanges representing the data which is cached
    * in the media cache. Stream should be pinned during call and while
    * aRanges is being used.
    */
   virtual nsresult GetCachedRanges(MediaByteRangeSet& aRanges) = 0;
 
   // Returns true if the resource is a live stream.
   virtual bool IsLiveStream()
@@ -320,34 +285,73 @@ public:
    * Create a resource, reading data from the channel. Call on main thread only.
    * The caller must follow up by calling resource->Open().
    */
   static already_AddRefed<BaseMediaResource> Create(
     MediaResourceCallback* aCallback,
     nsIChannel* aChannel,
     bool aIsPrivateBrowsing);
 
+  // Close the resource, stop any listeners, channels, etc.
+  // Cancels any currently blocking Read request and forces that request to
+  // return an error.
+  virtual nsresult Close() = 0;
+
+  // Pass true to limit the amount of readahead data (specified by
+  // "media.cache_readahead_limit") or false to read as much as the
+  // cache size allows.
+  virtual void ThrottleReadahead(bool bThrottle) {}
+
+  // This is the client's estimate of the playback rate assuming
+  // the media plays continuously. The cache can't guess this itself
+  // because it doesn't know when the decoder was paused, buffering, etc.
+  virtual void SetPlaybackRate(uint32_t aBytesPerSecond) = 0;
+
+  // Get the estimated download rate in bytes per second (assuming no
+  // pausing of the channel is requested by Gecko).
+  // *aIsReliable is set to true if we think the estimate is useful.
+  virtual double GetDownloadRate(bool* aIsReliable) = 0;
+
+  // Moves any existing channel loads into or out of background. Background
+  // loads don't block the load event. This also determines whether or not any
+  // new loads initiated (for example to seek) will be in the background.
+  void SetLoadInBackground(bool aLoadInBackground);
+
+  // Suspend any downloads that are in progress.
+  // If aCloseImmediately is set, resources should be released immediately
+  // since we don't expect to resume again any time soon. Otherwise we
+  // may resume again soon so resources should be held for a little
+  // while.
+  virtual void Suspend(bool aCloseImmediately) = 0;
+
+  // Resume any downloads that have been suspended.
+  virtual void Resume() = 0;
+
+  /**
+   * Open the stream. This creates a stream listener and returns it in
+   * aStreamListener; this listener needs to be notified of incoming data.
+   */
+  virtual nsresult Open(nsIStreamListener** aStreamListener) = 0;
+
   // If this returns false, then we shouldn't try to clone this MediaResource
   // because its underlying resources are not suitable for reuse (e.g.
   // because the underlying connection has been lost, or this resource
   // just can't be safely cloned). If this returns true, CloneData could
   // still fail. If this returns false, CloneData should not be called.
   virtual bool CanClone() { return false; }
 
   // Create a new stream of the same type that refers to the same URI
   // with a new channel. Any cached data associated with the original
   // stream should be accessible in the new stream too.
   virtual already_AddRefed<BaseMediaResource> CloneData(
     MediaResourceCallback* aCallback)
   {
     return nullptr;
   }
 
-  void SetLoadInBackground(bool aLoadInBackground) override;
-
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     // Might be useful to track in the future:
     // - mChannel
     // - mURI (possibly owned, looks like just a ref from mChannel)
     // Not owned:
     // - mCallback
     size_t size = MediaResource::SizeOfExcludingThis(aMallocSizeOf);
--- a/dom/media/gtest/MockMediaResource.cpp
+++ b/dom/media/gtest/MockMediaResource.cpp
@@ -12,17 +12,17 @@ namespace mozilla
 
 MockMediaResource::MockMediaResource(const char* aFileName)
   : mFileHandle(nullptr)
   , mFileName(aFileName)
 {
 }
 
 nsresult
-MockMediaResource::Open(nsIStreamListener** aStreamListener)
+MockMediaResource::Open()
 {
   mFileHandle = fopen(mFileName, "rb");
   if (mFileHandle == nullptr) {
     printf_stderr("Can't open %s\n", mFileName);
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
--- a/dom/media/gtest/MockMediaResource.h
+++ b/dom/media/gtest/MockMediaResource.h
@@ -11,33 +11,28 @@
 
 namespace mozilla
 {
 
 class MockMediaResource : public MediaResource
 {
 public:
   explicit MockMediaResource(const char* aFileName);
-  nsresult Close() override { return NS_OK; }
-  void Suspend(bool aCloseImmediately) override {}
-  void Resume() override {}
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
   {
     return nullptr;
   }
   void SetReadMode(MediaCacheStream::ReadMode aMode) override {}
-  void SetPlaybackRate(uint32_t aBytesPerSecond) override {}
   nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount,
                   uint32_t* aBytes) override;
   // Data stored in file, caching recommended.
   bool ShouldCacheReads() override { return true; }
   int64_t Tell() override { return 0; }
   void Pin() override {}
   void Unpin() override {}
-  double GetDownloadRate(bool* aIsReliable) override { return 0; }
   int64_t GetLength() override;
   int64_t GetNextCachedData(int64_t aOffset) override;
   int64_t GetCachedDataEnd(int64_t aOffset) override;
   bool IsDataCachedToEndOfResource(int64_t aOffset) override
   {
     return false;
   }
   bool IsSuspendedByCache() override { return false; }
@@ -47,17 +42,17 @@ public:
   {
     uint32_t bytesRead = 0;
     nsresult rv = ReadAt(aOffset, aBuffer, aCount, &bytesRead);
     NS_ENSURE_SUCCESS(rv, rv);
     return bytesRead == aCount ? NS_OK : NS_ERROR_FAILURE;
   }
 
   bool IsTransportSeekable() override { return true; }
-  nsresult Open(nsIStreamListener** aStreamListener) override;
+  nsresult Open();
   nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override;
 
   void MockClearBufferedRanges();
   void MockAddBufferedRange(int64_t aStart, int64_t aEnd);
 
 protected:
   virtual ~MockMediaResource();
 
--- a/dom/media/gtest/TestMP3Demuxer.cpp
+++ b/dom/media/gtest/TestMP3Demuxer.cpp
@@ -303,17 +303,17 @@ protected:
       mTargets.push_back(res);
 
       streamRes.mResource = new MockMP3StreamMediaResource(streamRes.mFilePath);
       streamRes.mDemuxer = new MP3TrackDemuxer(streamRes.mResource);
       mTargets.push_back(streamRes);
     }
 
     for (auto& target: mTargets) {
-      ASSERT_EQ(NS_OK, target.mResource->Open(nullptr));
+      ASSERT_EQ(NS_OK, target.mResource->Open());
       ASSERT_TRUE(target.mDemuxer->Init());
     }
   }
 
   std::vector<MP3Resource> mTargets;
 };
 
 TEST_F(MP3DemuxerTest, ID3Tags) {
--- a/dom/media/gtest/TestMP4Demuxer.cpp
+++ b/dom/media/gtest/TestMP4Demuxer.cpp
@@ -38,17 +38,17 @@ public:
   MozPromiseHolder<GenericPromise> mCheckTrackSamples;
 
   explicit MP4DemuxerBinding(const char* aFileName = "dash_dashinit.mp4")
     : resource(new MockMediaResource(aFileName))
     , mDemuxer(new MP4Demuxer(resource))
     , mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK)))
     , mIndex(0)
   {
-    EXPECT_EQ(NS_OK, resource->Open(nullptr));
+    EXPECT_EQ(NS_OK, resource->Open());
   }
 
   template<typename Function>
   void RunTestAndWait(const Function& aFunction)
   {
     Function func(aFunction);
     RefPtr<MP4DemuxerBinding> binding = this;
     mDemuxer->Init()->Then(mTaskQueue, __func__, Move(func), DO_FAIL);
--- a/dom/media/gtest/TestMediaDataDecoder.cpp
+++ b/dom/media/gtest/TestMediaDataDecoder.cpp
@@ -45,30 +45,30 @@ private:
 
 TEST(MediaDataDecoder, H264)
 {
   if (!DecoderTraits::IsMP4SupportedType(
          MediaContainerType(MEDIAMIMETYPE("video/mp4")),
          /* DecoderDoctorDiagnostics* */ nullptr)) {
     EXPECT_TRUE(true);
   } else {
-    RefPtr<MediaResource> resource = new MockMediaResource("gizmo.mp4");
-    nsresult rv = resource->Open(nullptr);
+    RefPtr<MockMediaResource> resource = new MockMediaResource("gizmo.mp4");
+    nsresult rv = resource->Open();
     EXPECT_TRUE(NS_SUCCEEDED(rv));
 
     BenchmarkRunner runner(new Benchmark(new MP4Demuxer(resource)));
     EXPECT_GT(runner.Run(), 0u);
   }
 }
 
 TEST(MediaDataDecoder, VP9)
 {
   if (!WebMDecoder::IsSupportedType(MediaContainerType(MEDIAMIMETYPE("video/webm")))) {
     EXPECT_TRUE(true);
   } else {
-    RefPtr<MediaResource> resource = new MockMediaResource("vp9cake.webm");
-    nsresult rv = resource->Open(nullptr);
+    RefPtr<MockMediaResource> resource = new MockMediaResource("vp9cake.webm");
+    nsresult rv = resource->Open();
     EXPECT_TRUE(NS_SUCCEEDED(rv));
 
     BenchmarkRunner runner(new Benchmark(new WebMDemuxer(resource)));
     EXPECT_GT(runner.Run(), 0u);
   }
 }
--- a/dom/media/hls/HLSDecoder.cpp
+++ b/dom/media/hls/HLSDecoder.cpp
@@ -107,9 +107,27 @@ HLSDecoder::Pause()
 {
   MOZ_ASSERT(NS_IsMainThread());
   HLS_DEBUG("HLSDecoder", "MediaElement called Pause");
   auto resourceWrapper = mResource->GetResourceWrapper();
   resourceWrapper->Pause();
   return MediaDecoder::Pause();
 }
 
+void
+HLSDecoder::Suspend()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  if (mResource) {
+    mResource->Suspend();
+  }
+}
+
+void
+HLSDecoder::Resume()
+{
+  MOZ_ASSERT(NS_IsMainThread());
+  if (mResource) {
+    mResource->Resume();
+  }
+}
+
 } // namespace mozilla
--- a/dom/media/hls/HLSDecoder.h
+++ b/dom/media/hls/HLSDecoder.h
@@ -36,15 +36,25 @@ public:
   static bool IsSupportedType(const MediaContainerType& aContainerType);
 
   nsresult Load(nsIChannel* aChannel);
 
   nsresult Play() override;
 
   void Pause() override;
 
+  void Suspend() override;
+  void Resume() override;
+
 private:
+  bool CanPlayThroughImpl() override final
+  {
+    // TODO: We don't know how to estimate 'canplaythrough' for this decoder.
+    // For now we just return true for 'autoplay' can work.
+    return true;
+  }
+
   RefPtr<HLSResource> mResource;
 };
 
 } // namespace mozilla
 
 #endif /* HLSDecoder_h_ */
--- a/dom/media/hls/HLSResource.cpp
+++ b/dom/media/hls/HLSResource.cpp
@@ -77,17 +77,18 @@ HLSResource::onError(int aErrorCode)
   HLS_DEBUG("HLSResource", "onError(%d)", aErrorCode);
   // Since HLS source should be from the Internet, we treat all resource errors
   // from GeckoHlsPlayer as network errors.
   if (mDecoder) {
     mDecoder->NetworkError();
   }
 }
 
-void HLSResource::Suspend(bool aCloseImmediately)
+void
+HLSResource::Suspend()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Don't call on non-main thread");
   HLS_DEBUG("HLSResource", "Should suspend the resource fetching.");
   mHLSResourceWrapper->Suspend();
 }
 
 void HLSResource::Resume()
 {
--- a/dom/media/hls/HLSResource.h
+++ b/dom/media/hls/HLSResource.h
@@ -41,35 +41,31 @@ private:
   HLSResource* mResource;
 };
 
 class HLSResource final : public MediaResource
 {
 public:
   HLSResource(HLSDecoder* aDecoder, nsIChannel* aChannel, nsIURI* aURI);
   ~HLSResource();
-  nsresult Close() override { return NS_OK; }
-  void Suspend(bool aCloseImmediately) override;
-  void Resume() override;
+  void Suspend();
+  void Resume();
   void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); }
-  void SetPlaybackRate(uint32_t aBytesPerSecond) override  { UNIMPLEMENTED(); }
   nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
   bool ShouldCacheReads() override { UNIMPLEMENTED(); return false; }
   int64_t Tell() override { UNIMPLEMENTED(); return -1; }
   void Pin() override { UNIMPLEMENTED(); }
   void Unpin() override { UNIMPLEMENTED(); }
-  double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; }
   int64_t GetLength() override { UNIMPLEMENTED(); return -1; }
   int64_t GetNextCachedData(int64_t aOffset) override { UNIMPLEMENTED(); return -1; }
   int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; }
   bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; }
   bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; }
   bool IsSuspended() override { UNIMPLEMENTED(); return false; }
   nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
-  nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_OK; }
 
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
   {
     NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
 
     nsCOMPtr<nsIPrincipal> principal;
     nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
     if (!secMan || !mChannel)
--- a/dom/media/mediasource/MediaSourceDecoder.cpp
+++ b/dom/media/mediasource/MediaSourceDecoder.cpp
@@ -297,17 +297,17 @@ MediaSourceDecoder::NextFrameBufferedSta
     currentPosition,
     currentPosition + DEFAULT_NEXT_FRAME_AVAILABLE_BUFFERED);
   return buffered.ContainsStrict(ClampIntervalToEnd(interval))
          ? MediaDecoderOwner::NEXT_FRAME_AVAILABLE
          : MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
 }
 
 bool
-MediaSourceDecoder::CanPlayThrough()
+MediaSourceDecoder::CanPlayThroughImpl()
 {
   MOZ_ASSERT(NS_IsMainThread());
   AbstractThread::AutoEnter context(AbstractMainThread());
 
   if (NextFrameBufferedStatus() == MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE) {
     return false;
   }
 
--- a/dom/media/mediasource/MediaSourceDecoder.h
+++ b/dom/media/mediasource/MediaSourceDecoder.h
@@ -64,25 +64,25 @@ public:
 
   // Returns a string describing the state of the MediaSource internal
   // buffered data. Used for debugging purposes.
   void GetMozDebugReaderData(nsACString& aString) override;
 
   void AddSizeOfResources(ResourceSizes* aSizes) override;
 
   MediaDecoderOwner::NextFrameStatus NextFrameBufferedStatus() override;
-  bool CanPlayThrough() override;
 
   bool IsMSE() const override { return true; }
 
   void NotifyInitDataArrived();
 
 private:
   void DoSetMediaSourceDuration(double aDuration);
   media::TimeInterval ClampIntervalToEnd(const media::TimeInterval& aInterval);
+  bool CanPlayThroughImpl() override;
 
   RefPtr<MediaSourceResource> mResource;
 
   // The owning MediaSource holds a strong reference to this decoder, and
   // calls Attach/DetachMediaSource on this decoder to set and clear
   // mMediaSource.
   dom::MediaSource* mMediaSource;
   RefPtr<MediaSourceDemuxer> mDemuxer;
--- a/dom/media/mediasource/MediaSourceResource.h
+++ b/dom/media/mediasource/MediaSourceResource.h
@@ -27,35 +27,29 @@ class MediaSourceResource final : public
 {
 public:
   explicit MediaSourceResource(nsIPrincipal* aPrincipal = nullptr)
     : mPrincipal(aPrincipal)
     , mMonitor("MediaSourceResource")
     , mEnded(false)
     {}
 
-  nsresult Close() override { return NS_OK; }
-  void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); }
-  void Resume() override { UNIMPLEMENTED(); }
   void SetReadMode(MediaCacheStream::ReadMode aMode) override { UNIMPLEMENTED(); }
-  void SetPlaybackRate(uint32_t aBytesPerSecond) override  { UNIMPLEMENTED(); }
   nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount, uint32_t* aBytes) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
   bool ShouldCacheReads() override { UNIMPLEMENTED(); return false; }
   int64_t Tell() override { UNIMPLEMENTED(); return -1; }
   void Pin() override { UNIMPLEMENTED(); }
   void Unpin() override { UNIMPLEMENTED(); }
-  double GetDownloadRate(bool* aIsReliable) override { UNIMPLEMENTED(); *aIsReliable = false; return 0; }
   int64_t GetLength() override { UNIMPLEMENTED(); return -1; }
   int64_t GetNextCachedData(int64_t aOffset) override { UNIMPLEMENTED(); return -1; }
   int64_t GetCachedDataEnd(int64_t aOffset) override { UNIMPLEMENTED(); return -1; }
   bool IsDataCachedToEndOfResource(int64_t aOffset) override { UNIMPLEMENTED(); return false; }
   bool IsSuspendedByCache() override { UNIMPLEMENTED(); return false; }
   bool IsSuspended() override { UNIMPLEMENTED(); return false; }
   nsresult ReadFromCache(char* aBuffer, int64_t aOffset, uint32_t aCount) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
-  nsresult Open(nsIStreamListener** aStreamListener) override { UNIMPLEMENTED(); return NS_ERROR_FAILURE; }
 
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
   {
     return RefPtr<nsIPrincipal>(mPrincipal).forget();
   }
 
   nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override
   {
--- a/dom/media/mediasource/SourceBufferResource.h
+++ b/dom/media/mediasource/SourceBufferResource.h
@@ -34,44 +34,35 @@ class SourceBuffer;
 
 } // namespace dom
 
 // SourceBufferResource is not thread safe.
 class SourceBufferResource final : public MediaResource
 {
 public:
   SourceBufferResource();
-  nsresult Close() override;
-  void Suspend(bool aCloseImmediately) override { UNIMPLEMENTED(); }
-  void Resume() override { UNIMPLEMENTED(); }
+  nsresult Close();
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
   {
     UNIMPLEMENTED();
     return nullptr;
   }
   void SetReadMode(MediaCacheStream::ReadMode aMode) override
   {
     UNIMPLEMENTED();
   }
-  void SetPlaybackRate(uint32_t aBytesPerSecond) override { UNIMPLEMENTED(); }
   nsresult ReadAt(int64_t aOffset,
                   char* aBuffer,
                   uint32_t aCount,
                   uint32_t* aBytes) override;
   // Memory-based and no locks, caching discouraged.
   bool ShouldCacheReads() override { return false; }
   int64_t Tell() override { return mOffset; }
   void Pin() override { UNIMPLEMENTED(); }
   void Unpin() override { UNIMPLEMENTED(); }
-  double GetDownloadRate(bool* aIsReliable) override
-  {
-    UNIMPLEMENTED();
-    *aIsReliable = false;
-    return 0;
-  }
   int64_t GetLength() override { return mInputBuffer.GetLength(); }
   int64_t GetNextCachedData(int64_t aOffset) override
   {
     MOZ_ASSERT(OnTaskQueue());
     MOZ_ASSERT(aOffset >= 0);
     if (uint64_t(aOffset) < mInputBuffer.GetOffset()) {
       return mInputBuffer.GetOffset();
     } else if (aOffset == GetLength()) {
@@ -104,21 +95,16 @@ public:
   nsresult ReadFromCache(char* aBuffer,
                          int64_t aOffset,
                          uint32_t aCount) override;
   bool IsTransportSeekable() override
   {
     UNIMPLEMENTED();
     return true;
   }
-  nsresult Open(nsIStreamListener** aStreamListener) override
-  {
-    UNIMPLEMENTED();
-    return NS_ERROR_FAILURE;
-  }
 
   nsresult GetCachedRanges(MediaByteRangeSet& aRanges) override
   {
     MOZ_ASSERT(OnTaskQueue());
     if (mInputBuffer.GetLength()) {
       aRanges += MediaByteRange(mInputBuffer.GetOffset(),
                                 mInputBuffer.GetLength());
     }
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1169,21 +1169,21 @@ fails-if(Android) fails-if(usesRepeatRes
 fails-if(Android) fails-if(usesRepeatResampling) == 446100-1c.html about:blank
 fails-if(usesRepeatResampling) == 446100-1d.html about:blank
 fails-if(usesRepeatResampling) == 446100-1e.html about:blank
 == 446100-1f.html about:blank
 fails-if(usesRepeatResampling) fails-if(Android) == 446100-1g.html about:blank
 == 446100-1h.html about:blank
 == 447749-1.html 447749-1-ref.html
 fuzzy(127,2) == 448193.html 448193-ref.html
-fails-if((cocoaWidget||gtkWidget)&&styloVsGecko) != 449149-1a.html about:blank
-fails-if((cocoaWidget||gtkWidget)&&styloVsGecko) != 449149-1b.html about:blank
+!= 449149-1a.html about:blank
+!= 449149-1b.html about:blank
 # Retry the above with XBL scopes
-test-pref(dom.use_xbl_scopes_for_remote_xul,true) fails-if((cocoaWidget||gtkWidget)&&styloVsGecko) != 449149-1a.html about:blank
-test-pref(dom.use_xbl_scopes_for_remote_xul,true) fails-if((cocoaWidget||gtkWidget)&&styloVsGecko) != 449149-1b.html about:blank
+test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1a.html about:blank
+test-pref(dom.use_xbl_scopes_for_remote_xul,true) != 449149-1b.html about:blank
 == 449149-2.html 449149-2-ref.html
 == 449171-1.html 449171-ref.html
 == 449362-1.html 449362-1-ref.html
 == 449519-1.html 449519-1-ref.html
 == 450670-1.html 450670-1-ref.html
 == 451168-1.html 451168-1-ref.html
 == 451876-1.html 451876-1-ref.html
 == 451876-2.html 451876-2-ref.html
@@ -1983,17 +1983,17 @@ random-if(Android) fuzzy-if(skiaContent,
 fuzzy-if(Android,27,874) fuzzy-if(gtkWidget,14,29) == 1313772.xhtml 1313772-ref.xhtml # Bug 1128229
 fuzzy(2,320000) == 1315113-1.html 1315113-1-ref.html
 fuzzy(2,20000) == 1315113-2.html 1315113-2-ref.html
 == 1315632-1.html 1315632-1-ref.html
 fuzzy(2,40000) fuzzy-if(webrender,1-2,349-349) == 1316719-1a.html 1316719-1-ref.html
 fuzzy(2,40000) fuzzy-if(webrender,1-2,349-349) == 1316719-1b.html 1316719-1-ref.html
 fuzzy(2,40000) fuzzy-if(webrender,1-1,323-323) == 1316719-1c.html 1316719-1-ref.html
 skip-if(Android) != 1318769-1.html 1318769-1-ref.html
-fails-if((cocoaWidget||gtkWidget)&&styloVsGecko) == 1322512-1.html 1322512-1-ref.html
+== 1322512-1.html 1322512-1-ref.html
 == 1330051.svg 1330051-ref.svg
 == 1348481-1.html 1348481-ref.html
 == 1348481-2.html 1348481-ref.html
 == 1352464-1.html 1352464-1-ref.html
 == 1358375-1.html 1358375-ref.html
 == 1358375-2.html 1358375-ref.html
 == 1358375-3.html 1358375-ref.html
 == 1364280-1.html 1364280-1-ref.html
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -28,16 +28,17 @@
 #include "mozilla/css/Loader.h"
 #include "GeckoProfiler.h"
 #include "nsIScriptError.h"
 #include "nsIScriptContext.h"
 #include "mozilla/Preferences.h"
 #include "nsIHTMLDocument.h"
 #include "nsIViewSourceChannel.h"
 #include "xpcpublic.h"
+#include "mozilla/IdleTaskRunner.h"
 
 using namespace mozilla;
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHtml5TreeOpExecutor)
   NS_INTERFACE_TABLE_INHERITED(nsHtml5TreeOpExecutor,
                                nsIContentSink)
 NS_INTERFACE_TABLE_TAIL_INHERITING(nsHtml5DocumentBuilder)
 
@@ -57,17 +58,17 @@ class nsHtml5ExecutorReflusher : public 
     NS_IMETHOD Run() override
     {
       mExecutor->RunFlushLoop();
       return NS_OK;
     }
 };
 
 static mozilla::LinkedList<nsHtml5TreeOpExecutor>* gBackgroundFlushList = nullptr;
-static nsITimer* gFlushTimer = nullptr;
+StaticRefPtr<IdleTaskRunner> gBackgroundFlushRunner;
 
 nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor()
   : nsHtml5DocumentBuilder(false)
   , mSuppressEOF(false)
   , mReadingFromStage(false)
   , mStreamParser(nullptr)
   , mPreloadedURLs(23)  // Mean # of preloadable resources per page on dmoz
   , mSpeculationReferrerPolicy(mozilla::net::RP_Unset)
@@ -81,19 +82,19 @@ nsHtml5TreeOpExecutor::nsHtml5TreeOpExec
 nsHtml5TreeOpExecutor::~nsHtml5TreeOpExecutor()
 {
   if (gBackgroundFlushList && isInList()) {
     mOpQueue.Clear();
     removeFrom(*gBackgroundFlushList);
     if (gBackgroundFlushList->isEmpty()) {
       delete gBackgroundFlushList;
       gBackgroundFlushList = nullptr;
-      if (gFlushTimer) {
-        gFlushTimer->Cancel();
-        NS_RELEASE(gFlushTimer);
+      if (gBackgroundFlushRunner) {
+        gBackgroundFlushRunner->Cancel();
+        gBackgroundFlushRunner = nullptr;
       }
     }
   }
   NS_ASSERTION(mOpQueue.IsEmpty(), "Somehow there's stuff in the op queue.");
 }
 
 // nsIContentSink
 NS_IMETHODIMP
@@ -245,29 +246,31 @@ nsHtml5TreeOpExecutor::MarkAsBroken(nsre
     if (NS_FAILED(mDocument->Dispatch(TaskCategory::Network,
                                       terminator.forget()))) {
       NS_WARNING("failed to dispatch executor flush event");
     }
   }
   return aReason;
 }
 
-void
-FlushTimerCallback(nsITimer* aTimer, void* aClosure)
+static bool
+BackgroundFlushCallback(TimeStamp /*aDeadline*/)
 {
   RefPtr<nsHtml5TreeOpExecutor> ex = gBackgroundFlushList->popFirst();
   if (ex) {
     ex->RunFlushLoop();
   }
   if (gBackgroundFlushList && gBackgroundFlushList->isEmpty()) {
     delete gBackgroundFlushList;
     gBackgroundFlushList = nullptr;
-    gFlushTimer->Cancel();
-    NS_RELEASE(gFlushTimer);
+    gBackgroundFlushRunner->Cancel();
+    gBackgroundFlushRunner = nullptr;
+    return true;
   }
+  return true;
 }
 
 void
 nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync()
 {
   if (!mDocument || !mDocument->IsInBackgroundWindow()) {
     nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
     if (NS_FAILED(mDocument->Dispatch(TaskCategory::Network,
@@ -276,26 +279,27 @@ nsHtml5TreeOpExecutor::ContinueInterrupt
     }
   } else {
     if (!gBackgroundFlushList) {
       gBackgroundFlushList = new mozilla::LinkedList<nsHtml5TreeOpExecutor>();
     }
     if (!isInList()) {
       gBackgroundFlushList->insertBack(this);
     }
-    if (!gFlushTimer) {
-      nsCOMPtr<nsITimer> t = do_CreateInstance("@mozilla.org/timer;1");
-      t.swap(gFlushTimer);
-      // The timer value 50 should not hopefully slow down background pages too
-      // much, yet lets event loop to process enough between ticks.
-      // See bug 734015.
-      gFlushTimer->InitWithNamedFuncCallback(FlushTimerCallback, nullptr,
-                                             50, nsITimer::TYPE_REPEATING_SLACK,
-                                             "FlushTimerCallback");
+    if (gBackgroundFlushRunner) {
+      NS_WARNING("We've already scheduled a task for background list flush.");
+      return;
     }
+    // Now we set up a repetitive idle scheduler for flushing background list.
+    gBackgroundFlushRunner =
+      IdleTaskRunner::Create(&BackgroundFlushCallback,
+                             250, // The hard deadline: 250ms.
+                             nsContentSink::sInteractiveParseTime / 1000, // Required budget.
+                             true, // repeating
+                             []{ return false; }); // MayStopProcessing
   }
 }
 
 void
 nsHtml5TreeOpExecutor::FlushSpeculativeLoads()
 {
   nsTArray<nsHtml5SpeculativeLoad> speculativeLoadQueue;
   mStage.MoveSpeculativeLoadsTo(speculativeLoadQueue);
--- a/security/.eslintrc.js
+++ b/security/.eslintrc.js
@@ -44,20 +44,16 @@ module.exports = {
 
     // Disallow case statement fallthrough without explicit `// falls through`
     // annotation.
     "no-fallthrough": "error",
 
     // No reassigning native JS objects or read only globals.
     "no-global-assign": "error",
 
-    // Disallow primitive wrapper instances like `new Boolean(false)`, which
-    // seem like they should act like primitives but don't.
-    "no-new-wrappers": "error",
-
     // Disallow use of assignment in return statement.
     "no-return-assign": ["error", "always"],
 
     // Disallow use of the comma operator.
     "no-sequences": "error",
 
     // Disallow template literal placeholder syntax in regular strings.
     "no-template-curly-in-string": "error",
--- a/services/sync/modules/engines.js
+++ b/services/sync/modules/engines.js
@@ -1004,16 +1004,19 @@ SyncEngine.prototype = {
       engineData.syncID = this.syncID;
 
       // Put the new data back into meta/global and mark for upload
       engines[this.name] = engineData;
       metaGlobal.payload.engines = engines;
       metaGlobal.changed = true;
     } else if (engineData.version > this.version) {
       // Don't sync this engine if the server has newer data
+
+      // Changes below need to be processed in bug 1295510 that's why eslint is ignored
+      // eslint-disable-next-line no-new-wrappers
       let error = new String("New data: " + [engineData.version, this.version]);
       error.failureCode = VERSION_OUT_OF_DATE;
       throw error;
     } else if (engineData.syncID != this.syncID) {
       // Changes to syncID mean we'll need to upload everything
       this._log.debug("Engine syncIDs: " + [engineData.syncID, this.syncID]);
       this.syncID = engineData.syncID;
       await this._resetClient();
--- a/services/sync/modules/engines/bookmarks.js
+++ b/services/sync/modules/engines/bookmarks.js
@@ -352,16 +352,19 @@ BookmarksEngine.prototype = {
           continue;
       }
 
       let parentName = parent.title || "";
       if (guidMap[parentName] == null)
         guidMap[parentName] = {};
 
       // If the entry already exists, remember that there are explicit dupes.
+
+      // Changes below need to be processed in bug 1295510 that's why eslint is ignored
+      // eslint-disable-next-line no-new-wrappers
       let entry = new String(guid);
       entry.hasDupe = guidMap[parentName][key] != null;
 
       // Remember this item's GUID for its parent-name/key pair.
       guidMap[parentName][key] = entry;
       this._log.trace("Mapped: " + [parentName, key, entry, entry.hasDupe]);
     }
 
--- a/services/sync/modules/resource.js
+++ b/services/sync/modules/resource.js
@@ -296,16 +296,18 @@ AsyncResource.prototype = {
         this._log.warn("The response body's length of: " + data.length +
                        " doesn't match the header's content-length of: " +
                        contentLength + ".");
       }
     } catch (ex) {
       this._log.debug("Caught exception visiting headers in _onComplete", ex);
     }
 
+    // Changes below need to be processed in bug 1295510 that's why eslint is ignored
+    // eslint-disable-next-line no-new-wrappers
     let ret     = new String(data);
     ret.url     = channel.URI.spec;
     ret.status  = status;
     ret.success = success;
     ret.headers = headers;
 
     if (!success) {
       this._log.warn(`${action} request to ${ret.url} failed with status ${status}`);
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -233,17 +233,16 @@ impl<'ln> GeckoNode<'ln> {
     #[inline]
     fn may_have_anonymous_children(&self) -> bool {
         self.get_bool_flag(nsINode_BooleanFlag::ElementMayHaveAnonymousChildren)
     }
 
     /// This logic is duplicated in Gecko's nsIContent::IsInAnonymousSubtree.
     #[inline]
     fn is_in_anonymous_subtree(&self) -> bool {
-        use gecko_bindings::structs::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE;
         use gecko_bindings::structs::NODE_IS_IN_SHADOW_TREE;
         self.flags() & (NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE as u32) != 0 ||
         ((self.flags() & (NODE_IS_IN_SHADOW_TREE as u32) == 0) &&
          self.as_element().map_or(false, |e| e.has_xbl_binding_parent()))
     }
 }
 
 impl<'ln> NodeInfo for GeckoNode<'ln> {
@@ -1139,17 +1138,17 @@ impl<'le> TElement for GeckoElement<'le>
     }
 
     fn skip_root_and_item_based_display_fixup(&self) -> bool {
         // We don't want to fix up display values of native anonymous content.
         // Additionally, we want to skip root-based display fixup for document
         // level native anonymous content subtree roots, since they're not
         // really roots from the style fixup perspective.  Checking that we
         // are NAC handles both cases.
-        self.flags() & (NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE as u32) != 0
+        self.is_native_anonymous()
     }
 
     unsafe fn set_selector_flags(&self, flags: ElementSelectorFlags) {
         debug_assert!(!flags.is_empty());
         self.set_flags(selector_flags_to_node_flags(flags));
     }
 
     fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool {
--- a/servo/components/style/selector_map.rs
+++ b/servo/components/style/selector_map.rs
@@ -196,39 +196,16 @@ impl SelectorMap<Rule> {
                                         flags_setter,
                                         cascade_level);
 
         // Sort only the rules we just added.
         sort_by_key(&mut matching_rules_list[init_len..],
                     |block| (block.specificity, block.source_order()));
     }
 
-    /// Append to `rule_list` all universal Rules (rules with selector `*|*`) in
-    /// `self` sorted by specificity and source order.
-    pub fn get_universal_rules(&self,
-                               cascade_level: CascadeLevel)
-                               -> Vec<ApplicableDeclarationBlock> {
-        debug_assert!(!cascade_level.is_important());
-        if self.is_empty() {
-            return vec![];
-        }
-
-        let mut rules_list = vec![];
-        for rule in self.other.iter() {
-            if rule.selector.is_universal() {
-                rules_list.push(rule.to_applicable_declaration_block(cascade_level))
-            }
-        }
-
-        sort_by_key(&mut rules_list,
-                    |block| (block.specificity, block.source_order()));
-
-        rules_list
-    }
-
     /// Adds rules in `rules` that match `element` to the `matching_rules` list.
     fn get_matching_rules<E, V, F>(element: &E,
                                    rules: &[Rule],
                                    matching_rules: &mut V,
                                    context: &mut MatchingContext,
                                    flags_setter: &mut F,
                                    cascade_level: CascadeLevel)
         where E: TElement,
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -398,23 +398,16 @@ impl Stylist {
         let sheets_to_add = doc_stylesheets.filter(|s| {
             !author_style_disabled || s.origin(guards.author) != Origin::Author
         });
 
         for stylesheet in sheets_to_add {
             self.add_stylesheet(stylesheet, guards.author, extra_data);
         }
 
-        SelectorImpl::each_precomputed_pseudo_element(|pseudo| {
-            if let Some(map) = self.cascade_data.user_agent.pseudos_map.remove(&pseudo) {
-                let declarations = map.get_universal_rules(CascadeLevel::UANormal);
-                self.precomputed_pseudo_element_decls.insert(pseudo, declarations);
-            }
-        });
-
         self.is_device_dirty = false;
         true
     }
 
     /// clear the stylist and then rebuild it.  Chances are, you want to use
     /// either clear() or rebuild(), with the latter done lazily, instead.
     pub fn update<'a, 'b, I, S>(
         &mut self,
@@ -465,27 +458,58 @@ impl Stylist {
         for rule in stylesheet.effective_rules(&self.device, guard) {
             match *rule {
                 CssRule::Style(ref locked) => {
                     let style_rule = locked.read_with(&guard);
                     self.num_declarations += style_rule.block.read_with(&guard).len();
                     for selector in &style_rule.selectors.0 {
                         self.num_selectors += 1;
 
+                        let map = match selector.pseudo_element() {
+                            Some(pseudo) if pseudo.is_precomputed() => {
+                                if !selector.is_universal() ||
+                                   !matches!(origin, Origin::UserAgent) {
+                                    // ::-moz-tree selectors may appear in
+                                    // non-UA sheets (even though they never
+                                    // match).
+                                    continue;
+                                }
+
+                                self.precomputed_pseudo_element_decls
+                                    .entry(pseudo.canonical())
+                                    .or_insert_with(Vec::new)
+                                    .push(ApplicableDeclarationBlock::new(
+                                        StyleSource::Style(locked.clone()),
+                                        self.rules_source_order,
+                                        CascadeLevel::UANormal,
+                                        selector.specificity()
+                                    ));
+
+                                continue;
+                            }
+                            None => &mut origin_cascade_data.element_map,
+                            Some(pseudo) => {
+                                origin_cascade_data
+                                    .pseudos_map
+                                    .entry(pseudo.canonical())
+                                    .or_insert_with(SelectorMap::new)
+                            }
+                        };
+
                         let hashes =
                             AncestorHashes::new(&selector, self.quirks_mode);
 
-                        origin_cascade_data
-                            .borrow_mut_for_pseudo_or_insert(selector.pseudo_element())
-                            .insert(
-                                Rule::new(selector.clone(),
-                                          hashes.clone(),
-                                          locked.clone(),
-                                          self.rules_source_order),
-                                self.quirks_mode);
+                        let rule = Rule::new(
+                            selector.clone(),
+                            hashes.clone(),
+                            locked.clone(),
+                            self.rules_source_order
+                        );
+
+                        map.insert(rule, self.quirks_mode);
 
                         self.invalidation_map.note_selector(selector, self.quirks_mode);
                         let mut visitor = StylistSelectorVisitor {
                             needs_revalidation: false,
                             passed_rightmost_selector: false,
                             attribute_dependencies: &mut self.attribute_dependencies,
                             style_attribute_dependency: &mut self.style_attribute_dependency,
                             state_dependencies: &mut self.state_dependencies,
@@ -1655,28 +1679,16 @@ impl PerOriginCascadeData {
     #[inline]
     fn borrow_for_pseudo(&self, pseudo: Option<&PseudoElement>) -> Option<&SelectorMap<Rule>> {
         match pseudo {
             Some(pseudo) => self.pseudos_map.get(&pseudo.canonical()),
             None => Some(&self.element_map),
         }
     }
 
-    #[inline]
-    fn borrow_mut_for_pseudo_or_insert(&mut self, pseudo: Option<&PseudoElement>) -> &mut SelectorMap<Rule> {
-        match pseudo {
-            Some(pseudo) => {
-                self.pseudos_map
-                    .entry(pseudo.canonical())
-                    .or_insert_with(SelectorMap::new)
-            }
-            None => &mut self.element_map,
-        }
-    }
-
     fn clear(&mut self) {
         *self = Self::new();
     }
 
     fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool {
         // FIXME(emilio): We should probably make the pseudos map be an
         // enumerated array.
         self.pseudos_map.contains_key(pseudo)
@@ -1715,24 +1727,27 @@ impl SelectorMapEntry for Rule {
 impl Rule {
     /// Returns the specificity of the rule.
     pub fn specificity(&self) -> u32 {
         self.selector.specificity()
     }
 
     /// Turns this rule into an `ApplicableDeclarationBlock` for the given
     /// cascade level.
-    pub fn to_applicable_declaration_block(&self,
-                                           level: CascadeLevel)
-                                           -> ApplicableDeclarationBlock {
+    pub fn to_applicable_declaration_block(
+        &self,
+        level: CascadeLevel
+    ) -> ApplicableDeclarationBlock {
         let source = StyleSource::Style(self.style_rule.clone());
-        ApplicableDeclarationBlock::new(source,
-                                        self.source_order,
-                                        level,
-                                        self.specificity())
+        ApplicableDeclarationBlock::new(
+            source,
+            self.source_order,
+            level,
+            self.specificity()
+        )
     }
 
     /// Creates a new Rule.
     pub fn new(selector: Selector<SelectorImpl>,
                hashes: AncestorHashes,
                style_rule: Arc<Locked<StyleRule>>,
                source_order: u32)
                -> Self
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -1818,29 +1818,49 @@ pub extern "C" fn Servo_ComputedValues_E
     second: ServoComputedDataBorrowed
 ) -> bool {
     first.get_custom_properties() == second.get_custom_properties()
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoStyleContextBorrowed,
                                                         rules: RawGeckoServoStyleRuleListBorrowedMut) {
-    if let Some(ref rule_node) = values.rules {
-        let mut result = vec![];
-        for node in rule_node.self_and_ancestors() {
-            if let &StyleSource::Style(ref rule) = node.style_source() {
-                result.push(rule);
+    let rule_node = match values.rules {
+        Some(ref r) => r,
+        None => return,
+    };
+
+    let global_style_data = &*GLOBAL_STYLE_DATA;
+    let guard = global_style_data.shared_lock.read();
+
+    // TODO(emilio): Will benefit from SmallVec.
+    let mut result = vec![];
+    for node in rule_node.self_and_ancestors() {
+        let style_rule = match *node.style_source() {
+            StyleSource::Style(ref rule) => rule,
+            _ => continue,
+        };
+
+        if node.importance().important() {
+            let block = style_rule.read_with(&guard).block.read_with(&guard);
+            if block.any_normal() {
+                // We'll append it when we find the normal rules in our
+                // parent chain.
+                continue;
             }
         }
-        unsafe { rules.set_len(result.len() as u32) };
-        for (ref src, ref mut dest) in result.into_iter().zip(rules.iter_mut()) {
-            src.with_raw_offset_arc(|arc| {
-                **dest = *Locked::<StyleRule>::arc_as_borrowed(arc);
-            })
-        }
+
+        result.push(style_rule);
+    }
+
+    unsafe { rules.set_len(result.len() as u32) };
+    for (ref src, ref mut dest) in result.into_iter().zip(rules.iter_mut()) {
+        src.with_raw_offset_arc(|arc| {
+            **dest = *Locked::<StyleRule>::arc_as_borrowed(arc);
+        })
     }
 }
 
 /// See the comment in `Device` to see why it's ok to pass an owned reference to
 /// the pres context (hint: the context outlives the StyleSet, that holds the
 /// device alive).
 #[no_mangle]
 pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned)
--- a/servo/tests/unit/style/stylist.rs
+++ b/servo/tests/unit/style/stylist.rs
@@ -217,26 +217,16 @@ fn test_insert() {
     let mut selector_map = SelectorMap::new();
     selector_map.insert(rules_list[1][0].clone(), QuirksMode::NoQuirks);
     assert_eq!(1, selector_map.id_hash.get(&Atom::from("top"), QuirksMode::NoQuirks).unwrap()[0].source_order);
     selector_map.insert(rules_list[0][0].clone(), QuirksMode::NoQuirks);
     assert_eq!(0, selector_map.class_hash.get(&Atom::from("intro"), QuirksMode::NoQuirks).unwrap()[0].source_order);
     assert!(selector_map.class_hash.get(&Atom::from("foo"), QuirksMode::NoQuirks).is_none());
 }
 
-#[test]
-fn test_get_universal_rules() {
-    thread_state::initialize(thread_state::LAYOUT);
-    let (map, _shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]);
-
-    let decls = map.get_universal_rules(CascadeLevel::UserNormal);
-
-    assert_eq!(decls.len(), 1, "{:?}", decls);
-}
-
 fn mock_stylist() -> Stylist {
     let device = Device::new(MediaType::Screen, TypedSize2D::new(0f32, 0f32), ScaleFactor::new(1.0));
     Stylist::new(device, QuirksMode::NoQuirks)
 }
 
 #[test]
 fn test_stylist_device_accessors() {
     let stylist = mock_stylist();
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -34,17 +34,17 @@ const LOG_LEVELS = new class extends Map
       ["info", Log.Level.Info],
       ["config", Log.Level.Config],
       ["debug", Log.Level.Debug],
       ["trace", Log.Level.Trace],
     ]);
   }
 
   get(level) {
-    let s = new String(level).toLowerCase();
+    let s = String(level).toLowerCase();
     if (!this.has(s)) {
       return DEFAULT_LOG_LEVEL;
     }
     return super.get(s);
   }
 };
 
 // Complements -marionette flag for starting the Marionette server.
--- a/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini
+++ b/testing/web-platform/meta/dom/events/EventTarget-dispatchEvent.html.ini
@@ -1,50 +1,6 @@
 [EventTarget-dispatchEvent.html]
   type: testharness
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (AnimationEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (CloseEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
   [If the event's initialized flag is not set, an InvalidStateError must be thrown (FocusEvent).]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/362, 1314303
 
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (IDBVersionChangeEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (PageTransitionEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (ProgressEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGZoomEvent).]
-    expected: FAIL
-    bug: 1314388
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (SVGZoomEvents).]
-    expected: FAIL
-    bug: 1314388
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (TrackEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (TransitionEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (WebGLContextEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [If the event's initialized flag is not set, an InvalidStateError must be thrown (WheelEvent).]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
--- a/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini
+++ b/testing/web-platform/meta/dom/nodes/Document-createEvent.html.ini
@@ -1,58 +1,10 @@
 [Document-createEvent.html]
   type: testharness
-  [AnimationEvent should be an alias for AnimationEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('AnimationEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [animationevent should be an alias for AnimationEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('animationevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [ANIMATIONEVENT should be an alias for AnimationEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('ANIMATIONEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [CloseEvent should be an alias for CloseEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('CloseEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [closeevent should be an alias for CloseEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('closeevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [CLOSEEVENT should be an alias for CloseEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('CLOSEEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
   [FocusEvent should be an alias for FocusEvent.]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/362, 1314303
 
   [createEvent('FocusEvent') should be initialized correctly.]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/362, 1314303
 
@@ -67,184 +19,16 @@
   [FOCUSEVENT should be an alias for FocusEvent.]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/362, 1314303
 
   [createEvent('FOCUSEVENT') should be initialized correctly.]
     expected: FAIL
     bug: https://github.com/whatwg/dom/issues/362, 1314303
 
-  [IDBVersionChangeEvent should be an alias for IDBVersionChangeEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('IDBVersionChangeEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [idbversionchangeevent should be an alias for IDBVersionChangeEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('idbversionchangeevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [IDBVERSIONCHANGEEVENT should be an alias for IDBVersionChangeEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('IDBVERSIONCHANGEEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [PageTransitionEvent should be an alias for PageTransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('PageTransitionEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [pagetransitionevent should be an alias for PageTransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('pagetransitionevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [PAGETRANSITIONEVENT should be an alias for PageTransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('PAGETRANSITIONEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [ProgressEvent should be an alias for ProgressEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('ProgressEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [progressevent should be an alias for ProgressEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('progressevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [PROGRESSEVENT should be an alias for ProgressEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('PROGRESSEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [TrackEvent should be an alias for TrackEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('TrackEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [trackevent should be an alias for TrackEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('trackevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [TRACKEVENT should be an alias for TrackEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('TRACKEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [TransitionEvent should be an alias for TransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('TransitionEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [transitionevent should be an alias for TransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('transitionevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [TRANSITIONEVENT should be an alias for TransitionEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('TRANSITIONEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [WebGLContextEvent should be an alias for WebGLContextEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('WebGLContextEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [webglcontextevent should be an alias for WebGLContextEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('webglcontextevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [WEBGLCONTEXTEVENT should be an alias for WebGLContextEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('WEBGLCONTEXTEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [WheelEvent should be an alias for WheelEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('WheelEvent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [wheelevent should be an alias for WheelEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('wheelevent') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [WHEELEVENT should be an alias for WheelEvent.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
-  [createEvent('WHEELEVENT') should be initialized correctly.]
-    expected: FAIL
-    bug: https://github.com/whatwg/dom/issues/362, 1314303
-
   [Should throw NOT_SUPPORTED_ERR for pluralized non-legacy event interface "KeyEvents"]
     expected: FAIL
     bug: 1251198
 
   [Should throw NOT_SUPPORTED_ERR for pluralized non-legacy event interface "MouseScrollEvents"]
     expected: FAIL
     bug: 1251198
 
--- a/testing/web-platform/tests/dom/nodes/Document-createEvent.html
+++ b/testing/web-platform/tests/dom/nodes/Document-createEvent.html
@@ -66,32 +66,36 @@ test(function() {
 
 /*
  * The following are event interfaces which do actually exist, but must still
  * throw since they're absent from the table in the spec for
  * document.createEvent().  This list is not exhaustive, but includes all
  * interfaces that it is known some UA does or did not throw for.
  */
 var someNonCreateableEvents = [
+  "AnimationEvent",
   "AnimationPlaybackEvent",
   "AnimationPlayerEvent",
   "ApplicationCacheErrorEvent",
   "AudioProcessingEvent",
   "AutocompleteErrorEvent",
   "BeforeInstallPromptEvent",
   "BlobEvent",
   "ClipboardEvent",
+  "CloseEvent",
   "CommandEvent",
   "DataContainerEvent",
+  "ErrorEvent",
   "ExtendableEvent",
   "ExtendableMessageEvent",
   "FetchEvent",
   "FontFaceSetLoadEvent",
   "GamepadEvent",
   "GeofencingEvent",
+  "IDBVersionChangeEvent",
   "InstallEvent",
   "KeyEvent",
   "MIDIConnectionEvent",
   "MIDIMessageEvent",
   "MediaEncryptedEvent",
   "MediaKeyEvent",
   "MediaKeyMessageEvent",
   "MediaQueryListEvent",
@@ -99,17 +103,19 @@ var someNonCreateableEvents = [
   "MediaStreamTrackEvent",
   "MouseScrollEvent",
   "MutationEvent",
   "NotificationEvent",
   "NotifyPaintEvent",
   "OfflineAudioCompletionEvent",
   "OrientationEvent",
   "PageTransition", // Yes, with no "Event"
+  "PageTransitionEvent",
   "PointerEvent",
+  "PopStateEvent",
   "PopUpEvent",
   "PresentationConnectionAvailableEvent",
   "PresentationConnectionCloseEvent",
   "ProgressEvent",
   "PromiseRejectionEvent",
   "PushEvent",
   "RTCDTMFToneChangeEvent",
   "RTCDataChannelEvent",
@@ -123,18 +129,22 @@ var someNonCreateableEvents = [
   "ServicePortConnectEvent",
   "ServiceWorkerMessageEvent",
   "SimpleGestureEvent",
   "SpeechRecognitionError",
   "SpeechRecognitionEvent",
   "SpeechSynthesisEvent",
   "SyncEvent",
   "TimeEvent",
+  "TrackEvent",
+  "TransitionEvent",
+  "WebGLContextEvent",
   "WebKitAnimationEvent",
   "WebKitTransitionEvent",
+  "WheelEvent",
   "XULCommandEvent",
 ];
 someNonCreateableEvents.forEach(function (eventInterface) {
   // SVGEvents is allowed, but not SVGEvent.  Make sure we only test if it's
   // not whitelisted.
   if (!(eventInterface in aliases)) {
     test(function () {
       assert_throws("NOT_SUPPORTED_ERR", function () {
--- a/testing/web-platform/tests/dom/nodes/Document-createEvent.js
+++ b/testing/web-platform/tests/dom/nodes/Document-createEvent.js
@@ -1,33 +1,23 @@
 var aliases = {
-  "AnimationEvent": "AnimationEvent",
   "BeforeUnloadEvent": "BeforeUnloadEvent",
-  "CloseEvent": "CloseEvent",
   "CompositionEvent": "CompositionEvent",
   "CustomEvent": "CustomEvent",
   "DeviceMotionEvent": "DeviceMotionEvent",
   "DeviceOrientationEvent": "DeviceOrientationEvent",
   "DragEvent": "DragEvent",
-  "ErrorEvent": "ErrorEvent",
   "Event": "Event",
   "Events": "Event",
   "FocusEvent": "FocusEvent",
   "HashChangeEvent": "HashChangeEvent",
   "HTMLEvents": "Event",
-  "IDBVersionChangeEvent": "IDBVersionChangeEvent",
   "KeyboardEvent": "KeyboardEvent",
   "MessageEvent": "MessageEvent",
   "MouseEvent": "MouseEvent",
   "MouseEvents": "MouseEvent",
-  "PageTransitionEvent": "PageTransitionEvent",
-  "PopStateEvent": "PopStateEvent",
   "StorageEvent": "StorageEvent",
   "SVGEvents": "Event",
   "TextEvent": "CompositionEvent",
   "TouchEvent": "TouchEvent",
-  "TrackEvent": "TrackEvent",
-  "TransitionEvent": "TransitionEvent",
   "UIEvent": "UIEvent",
   "UIEvents": "UIEvent",
-  "WebGLContextEvent": "WebGLContextEvent",
-  "WheelEvent": "WheelEvent",
 };
--- a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html
@@ -1,22 +1,16 @@
 <!doctype html>
 <meta charset=utf-8>
 <title>Synthetic popstate events</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
 test(function () {
-  var e = document.createEvent('PopStateEvent');
-  var eProto = Object.getPrototypeOf(e);
-  assert_equals(eProto, PopStateEvent.prototype);
-}, 'document.createEvent');
-
-test(function () {
   assert_false('initPopStateEvent' in PopStateEvent.prototype,
                'There should be no PopStateEvent#initPopStateEvent');
 }, 'initPopStateEvent');
 
 test(function () {
   var state = history.state;
   var data;
   window.addEventListener('popstate', function (e) {
--- a/testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm
+++ b/testing/web-platform/tests/workers/Worker_dispatchEvent_ErrorEvent.htm
@@ -20,18 +20,12 @@ async_test(function(t) {
     assert_equals(e.colno, colno, 'colno');
     assert_equals(e.error, error, 'error');
   }), true);
   var e = new ErrorEvent(event, {bubbles:true, cancelable:true, message:message, filename:filename, lineno:lineno, colno:colno, error:error});
   worker.dispatchEvent(e);
 });
 
 test(function() {
-  var e = document.createEvent("ErrorEvent");
-  var eProto = Object.getPrototypeOf(e);
-  assert_equals(eProto, ErrorEvent.prototype);
-}, "document.createEvent('ErrorEvent')");
-
-test(function() {
   var e = new ErrorEvent("error");
   assert_false("initErrorEvent" in e, "should not be supported");
 }, "initErrorEvent");
 </script>
--- a/toolkit/components/contentprefs/tests/unit/test_stringGroups.js
+++ b/toolkit/components/contentprefs/tests/unit/test_stringGroups.js
@@ -10,16 +10,19 @@ function run_test() {
   var statement = cps.DBConnection.createStatement("PRAGMA synchronous");
   statement.executeStep();
   do_check_eq(0, statement.getInt32(0));
 
   // These are the different types of aGroup arguments we'll test.
   var anObject = {"foo": "bar"};                               // a simple object
   var uri = ContentPrefTest.getURI("http://www.example.com/"); // nsIURI
   var stringURI = "www.example.com";                           // typeof = "string"
+
+  // Test wants to check for a String object
+  // eslint-disable-next-line no-new-wrappers
   var stringObjectURI = new String("www.example.com");         // typeof = "object"
 
   // First check that all the methods work or don't work.
   function simple_test_methods(aGroup, shouldThrow) {
     var prefName = "test.pref.0";
     var prefValue = Math.floor(Math.random() * 100);
 
     if (shouldThrow) {
--- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js
+++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js
@@ -1,13 +1,15 @@
 /* -*-  indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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/. */
 
+/* eslint-disable no-new-wrappers */
+
 try {
   // We might be running without privileges, in which case it's up to the
   // harness to give us the 'ctypes' object.
   Components.utils.import("resource://gre/modules/ctypes.jsm");
 } catch (e) {
 }
 
 const CTYPES_TEST_LIB = ctypes.libraryName("jsctypes-test");
--- a/toolkit/components/extensions/.eslintrc.js
+++ b/toolkit/components/extensions/.eslintrc.js
@@ -296,13 +296,10 @@ module.exports = {
     // Disallow Yoda conditions (where literal value comes first).
     "yoda": "error",
 
     // Disallow function or variable declarations in nested blocks
     "no-inner-declarations": "error",
 
     // Disallow labels that share a name with a variable
     "no-label-var": "error",
-
-    // Disallow creating new instances of String, Number, and Boolean
-    "no-new-wrappers": "error",
   },
 };
--- a/toolkit/components/jsdownloads/test/unit/test_Downloads.js
+++ b/toolkit/components/jsdownloads/test/unit/test_Downloads.js
@@ -106,18 +106,18 @@ add_task(async function test_fetch_objec
  * Tests "fetch" with string arguments.
  */
 add_task(async function test_fetch_string_arguments() {
   let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
   await Downloads.fetch(httpUrl("source.txt"), targetPath);
   await promiseVerifyContents(targetPath, TEST_DATA_SHORT);
 
   targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
-  await Downloads.fetch(new String(httpUrl("source.txt")),
-                        new String(targetPath));
+  await Downloads.fetch(httpUrl("source.txt"),
+                        targetPath);
   await promiseVerifyContents(targetPath, TEST_DATA_SHORT);
 });
 
 /**
  * Tests that the getList function returns the same list when called multiple
  * times with the same argument, but returns different lists when called with
  * different arguments.  More detailed tests are implemented separately for the
  * DownloadList module.
--- a/toolkit/components/payments/.eslintrc.js
+++ b/toolkit/components/payments/.eslintrc.js
@@ -35,17 +35,16 @@ module.exports = {
     "new-parens": "error",
     "no-caller": "error",
     "no-console": "error",
     "no-fallthrough": "error",
     "no-multi-str": "error",
     "no-multiple-empty-lines": ["error", {
       max: 2,
     }],
-    "no-new-wrappers": "error",
     "no-proto": "error",
     "no-throw-literal": "error",
     "no-unused-expressions": "error",
     "no-unused-vars": ["error", {
       args: "none",
       varsIgnorePattern: "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
     }],
     "no-use-before-define": ["error", {
--- a/toolkit/components/places/nsINavBookmarksService.idl
+++ b/toolkit/components/places/nsINavBookmarksService.idl
@@ -8,17 +8,17 @@
 interface nsIFile;
 interface nsIURI;
 interface nsITransaction;
 interface nsINavHistoryBatchCallback;
 
 /**
  * Observer for bookmarks changes.
  */
-[scriptable, uuid(c06b4e7d-15b1-4d4f-bdf7-147d2be9084a)]
+[scriptable, uuid(4d00c221-2c4a-47ab-a617-abb324110492)]
 interface nsINavBookmarkObserver : nsISupports
 {
   /*
    * This observer should not be called for items that are tags.
    */
   readonly attribute boolean skipTags;
 
   /*
@@ -607,37 +607,16 @@ interface nsINavBookmarksService : nsISu
 
   /**
    * Get an item's type (bookmark, separator, folder).
    * The type is one of the TYPE_* constants defined above.
    */
   unsigned short getItemType(in long long aItemId);
 
   /**
-   * Returns true if the given URI is in any bookmark folder. If you want the
-   * results to be redirect-aware, use getBookmarkedURIFor()
-   */
-  boolean isBookmarked(in nsIURI aURI);
-
-  /**
-   * Used to see if the given URI is bookmarked, or any page that redirected to
-   * it is bookmarked. For example, if I bookmark "mozilla.org" by manually
-   * typing it in, and follow the bookmark, I will get redirected to
-   * "www.mozilla.org". Logically, this new page is also bookmarked. This
-   * function, if given "www.mozilla.org", will return the URI of the bookmark,
-   * in this case "mozilla.org".
-   *
-   * If there is no bookmarked page found, it will return NULL.
-   *
-   * @note The function will only return bookmarks in the first 2 levels of
-   *       redirection (1 -> 2 -> aURI).
-   */
-  nsIURI getBookmarkedURIFor(in nsIURI aURI);
-
-  /**
    * Change the bookmarked URI for a bookmark.
    * This changes which "place" the bookmark points at,
    * which means all annotations, etc are carried along.
    */
   void changeBookmarkURI(in long long aItemId,
                          in nsIURI aNewURI,
                          [optional] in unsigned short aSource);
 
--- a/toolkit/components/places/nsNavBookmarks.cpp
+++ b/toolkit/components/places/nsNavBookmarks.cpp
@@ -151,18 +151,17 @@ inline bool
 NeedsTombstone(const BookmarkData& aBookmark) {
   return aBookmark.syncStatus == nsINavBookmarksService::SYNC_STATUS_NORMAL;
 }
 
 } // namespace
 
 
 nsNavBookmarks::nsNavBookmarks()
-  : mItemCount(0)
-  , mRoot(0)
+  : mRoot(0)
   , mMenuRoot(0)
   , mTagsRoot(0)
   , mUnfiledRoot(0)
   , mToolbarRoot(0)
   , mMobileRoot(0)
   , mCanNotify(false)
   , mCacheObservers("bookmark-observers")
   , mBatching(false)
@@ -283,38 +282,16 @@ nsNavBookmarks::EnsureRoots()
 
   if (!mRoot || !mMenuRoot || !mToolbarRoot || !mTagsRoot || !mUnfiledRoot ||
       !mMobileRoot)
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
-// nsNavBookmarks::IsBookmarkedInDatabase
-//
-//    This checks to see if the specified place_id is actually bookmarked.
-
-nsresult
-nsNavBookmarks::IsBookmarkedInDatabase(int64_t aPlaceId,
-                                       bool* aIsBookmarked)
-{
-  nsCOMPtr<mozIStorageStatement> stmt = mDB->GetStatement(
-    "SELECT 1 FROM moz_bookmarks WHERE fk = :page_id"
-  );
-  NS_ENSURE_STATE(stmt);
-  mozStorageStatementScoper scoper(stmt);
-
-  nsresult rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("page_id"), aPlaceId);
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = stmt->ExecuteStep(aIsBookmarked);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return NS_OK;
-}
-
-
 nsresult
 nsNavBookmarks::AdjustIndices(int64_t aFolderId,
                               int32_t aStartIndex,
                               int32_t aEndIndex,
                               int32_t aDelta)
 {
   NS_ASSERTION(aStartIndex >= 0 && aEndIndex <= INT32_MAX &&
                aStartIndex <= aEndIndex, "Bad indices");
@@ -2379,127 +2356,16 @@ nsNavBookmarks::FetchFolderInfo(int64_t 
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsNavBookmarks::IsBookmarked(nsIURI* aURI, bool* aBookmarked)
-{
-  NS_ENSURE_ARG(aURI);
-  NS_ENSURE_ARG_POINTER(aBookmarked);
-
-  nsCOMPtr<mozIStorageStatement> stmt = mDB->GetStatement(
-    "SELECT 1 FROM moz_bookmarks b "
-    "JOIN moz_places h ON b.fk = h.id "
-    "WHERE h.url_hash = hash(:page_url) AND h.url = :page_url"
-  );
-  NS_ENSURE_STATE(stmt);
-  mozStorageStatementScoper scoper(stmt);
-
-  nsresult rv = URIBinder::Bind(stmt, NS_LITERAL_CSTRING("page_url"), aURI);
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = stmt->ExecuteStep(aBookmarked);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsNavBookmarks::GetBookmarkedURIFor(nsIURI* aURI, nsIURI** _retval)
-{
-  NS_ENSURE_ARG(aURI);
-  NS_ENSURE_ARG_POINTER(_retval);
-
-  *_retval = nullptr;
-
-  nsNavHistory* history = nsNavHistory::GetHistoryService();
-  NS_ENSURE_TRUE(history, NS_ERROR_OUT_OF_MEMORY);
-  int64_t placeId;
-  nsAutoCString placeGuid;
-  nsresult rv = history->GetIdForPage(aURI, &placeId, placeGuid);
-  NS_ENSURE_SUCCESS(rv, rv);
-  if (!placeId) {
-    // This URI is unknown, just return null.
-    return NS_OK;
-  }
-
-  // Check if a bookmark exists in the redirects chain for this URI.
-  // The query will also check if the page is directly bookmarked, and return
-  // the first found bookmark in case.  The check is directly on moz_bookmarks
-  // without special filtering.
-  // The next query finds the bookmarked ancestors in a redirects chain.
-  // It won't go further than 3 levels of redirects (a->b->c->your_place_id).
-  // To make this path 100% correct (up to any level) we would need either:
-  //  - A separate hash, build through recursive querying of the database.
-  //    This solution was previously implemented, but it had a negative effect
-  //    on startup since at each startup we have to recursively query the
-  //    database to rebuild a hash that is always the same across sessions.
-  //    It must be updated at each visit and bookmarks change too.  The code to
-  //    manage it is complex and prone to errors, sometimes causing incorrect
-  //    data fetches (for example wrong favicon for a redirected bookmark).
-  //  - A better way to track redirects for a visit.
-  //    We would need a separate table to track redirects, in the table we would
-  //    have visit_id, redirect_session.  To get all sources for
-  //    a visit then we could just join this table and get all visit_id that
-  //    are in the same redirect_session as our visit.  This has the drawback
-  //    that we can't ensure data integrity in the downgrade -> upgrade path,
-  //    since an old version would not update the table on new visits.
-  //
-  // For most cases these levels of redirects should be fine though, it's hard
-  // to hit a page that is 4 or 5 levels of redirects below a bookmarked page.
-  //
-  // As a bonus the query also checks first if place_id is already a bookmark,
-  // so you don't have to check that apart.
-
-  nsCString query = nsPrintfCString(
-    "SELECT url FROM moz_places WHERE id = ( "
-      "SELECT :page_id FROM moz_bookmarks WHERE fk = :page_id "
-      "UNION ALL "
-      "SELECT COALESCE(grandparent.place_id, parent.place_id) AS r_place_id "
-      "FROM moz_historyvisits dest "
-      "LEFT JOIN moz_historyvisits parent ON parent.id = dest.from_visit "
-                                        "AND dest.visit_type IN (%d, %d) "
-      "LEFT JOIN moz_historyvisits grandparent ON parent.from_visit = grandparent.id "
-                                             "AND parent.visit_type IN (%d, %d) "
-      "WHERE dest.place_id = :page_id "
-      "AND EXISTS(SELECT 1 FROM moz_bookmarks WHERE fk = r_place_id) "
-      "LIMI