Bug 1443561 - Part 1b: Move #navigator-toolbox rule back to browser/base/content to avoid CSP issues. r=me
☠☠ backed out by a92aacd177b5 ☠ ☠
authorTim Nguyen <ntim.bugs@gmail.com>
Wed, 22 Aug 2018 09:01:38 +0100
changeset 432791 054c113b5cb18011f4a386bdeced1ff05aecbe0d
parent 432774 c3bb26f985552814f9e35639a15acd10a15878bb
child 432792 a92aacd177b541c80474ea95f50dbc3c3bd5d57e
push id34488
push usernerli@mozilla.com
push dateWed, 22 Aug 2018 16:28:54 +0000
treeherdermozilla-central@d6e4d3e69d4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1443561
milestone63.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
Bug 1443561 - Part 1b: Move #navigator-toolbox rule back to browser/base/content to avoid CSP issues. r=me
browser/base/content/browser.css
browser/components/syncedtabs/sidebar.js
browser/components/syncedtabs/sidebar.xhtml
browser/themes/shared/browser.inc.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -23,16 +23,24 @@
   background-image: var(--lwt-header-image) !important;
   background-position: right top !important;
 }
 
 :root:-moz-lwtheme:-moz-window-inactive {
   background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color)) !important;
 }
 
+/* Set additional backgrounds alignment relative to toolbox */
+
+#navigator-toolbox:-moz-lwtheme {
+  background-image: var(--lwt-additional-images);
+  background-position: var(--lwt-background-alignment);
+  background-repeat: var(--lwt-background-tiling);
+}
+
 #main-window:not([chromehidden~="toolbar"]) {
 %ifdef XP_MACOSX
   min-width: 335px;
 %else
   min-width: 300px;
 %endif
 }
 
--- a/browser/components/syncedtabs/sidebar.js
+++ b/browser/components/syncedtabs/sidebar.js
@@ -2,27 +2,36 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://services-sync/SyncedTabs.jsm");
 ChromeUtils.import("resource:///modules/syncedtabs/SyncedTabsDeckComponent.js");
+ChromeUtils.import("resource:///actors/LightweightThemeChild.jsm");
 
 ChromeUtils.defineModuleGetter(this, "fxAccounts",
                                "resource://gre/modules/FxAccounts.jsm");
 
 var syncedTabsDeckComponent = new SyncedTabsDeckComponent({window, SyncedTabs, fxAccounts});
 
+let themeListener;
+
 let onLoaded = () => {
+  themeListener = new LightweightThemeChild({
+    content: window,
+    chromeOuterWindowID: window.top.windowUtils.outerWindowID,
+    docShell: window.docShell,
+  });
   syncedTabsDeckComponent.init();
   document.getElementById("template-container").appendChild(syncedTabsDeckComponent.container);
 };
 
 let onUnloaded = () => {
+  themeListener.cleanup();
   removeEventListener("DOMContentLoaded", onLoaded);
   removeEventListener("unload", onUnloaded);
   syncedTabsDeckComponent.uninit();
 };
 
 addEventListener("DOMContentLoaded", onLoaded);
 addEventListener("unload", onUnloaded);
--- a/browser/components/syncedtabs/sidebar.xhtml
+++ b/browser/components/syncedtabs/sidebar.xhtml
@@ -12,16 +12,17 @@
   %globalDTD;
   <!ENTITY % syncBrandDTD
     SYSTEM "chrome://browser/locale/syncBrand.dtd">
   %syncBrandDTD;
 ]>
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <head>
+    <script src="chrome://browser/content/contentTheme.js"></script>
     <script src="chrome://browser/content/syncedtabs/sidebar.js" type="application/javascript"></script>
     <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
 
     <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/skin/syncedtabs/sidebar.css"/>
     <link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/"/>
     <link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/textbox.css"/>
     <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/content/browser.css"/>
     <title>&syncedTabs.sidebar.label;</title>
--- a/browser/themes/shared/browser.inc.css
+++ b/browser/themes/shared/browser.inc.css
@@ -24,24 +24,16 @@
 }
 
 /* Increase contrast of UI links on dark themes */
 
 :root[lwt-popup-brighttext] panel .text-link {
   color: @lwtPopupBrighttextLinkColor@;
 }
 
-/* Set additional backgrounds alignment relative to toolbox*/
-
-#navigator-toolbox:-moz-lwtheme {
-  background-image: var(--lwt-additional-images);
-  background-position: var(--lwt-background-alignment);
-  background-repeat: var(--lwt-background-tiling);
-}
-
 /* Toolbar / content area border */
 
 #navigator-toolbox::after {
   content: "";
   display: -moz-box;
   border-bottom: 1px solid var(--toolbox-border-bottom-color);
 }