Bug 1046563 - Use inverted icons on Classic. r=philipp,r=josiah,a=Standard8
authorRichard Marti <richard.marti@gmail.com>
Sun, 17 Aug 2014 12:52:10 +0200
changeset 18545 00106aeb7a626d5c7efd6004d578b18201e7b237
parent 18544 8145b442b3912be8b7cf97e455d408c1d3c1f47a
child 18546 f0cda6a8fe3c4fc8dfc882cf6698652d0a911023
push id1275
push usermbanner@mozilla.com
push dateThu, 28 Aug 2014 07:57:55 +0000
treeherdercomm-aurora@00106aeb7a62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp, josiah, Standard8
bugs1046563
Bug 1046563 - Use inverted icons on Classic. r=philipp,r=josiah,a=Standard8
calendar/base/themes/windows/win-aero/lightning-toolbar.css
calendar/base/themes/windows/win-aero/lightning.css
mail/base/content/messageWindow.js
mail/base/content/messageWindow.xul
mail/base/content/messenger.xul
mail/base/content/msgMail3PaneWindow.js
mail/base/content/toolbarIconColor.js
mail/base/jar.mn
mail/themes/windows/mail/messageWindow-aero.css
mail/themes/windows/mail/messageWindow.css
mail/themes/windows/mail/primaryToolbar-aero.css
mail/themes/windows/mail/tabmail-aero.css
mail/themes/windows/mail/tabmail.css
mail/themes/windows/mail/tabs/separator.png
--- a/calendar/base/themes/windows/win-aero/lightning-toolbar.css
+++ b/calendar/base/themes/windows/win-aero/lightning-toolbar.css
@@ -15,17 +15,18 @@
 }
 
 /* Toolbar buttons */
 
 .calbar-toolbarbutton-1 {
   list-style-image: url(chrome://calendar/skin/toolbar-aero.png);
 }
 
-.calbar-toolbarbutton-1:-moz-lwtheme-brighttext {
+#calendar-toolbox > toolbar[brighttext] .calbar-toolbarbutton-1,
+#task-toolbox > toolbar[brighttext] .calbar-toolbarbutton-1 {
   list-style-image: url(chrome://calendar/skin/toolbar-aero-inverted.png);
 }
 
 #calendar-synchronize-button,
 #task-synchronize-button {
   -moz-image-region: rect(1px 17px 17px 1px);
 }
 
@@ -69,61 +70,31 @@
 }
 
 #extractTaskButton,
 #hdrExtractTaskButton {
   list-style-image: url(chrome://calendar/skin/toolbar-aero.png);
   -moz-image-region: rect(1px 71px 17px 55px);
 }
 
-#extractTaskButton:-moz-lwtheme-brighttext,
-#extractEventButton:-moz-lwtheme-brighttext {
+#tabs-toolbar[brighttext] #extractTaskButton,
+#tabs-toolbar[brighttext] #extractEventButton,
+#mail-toolbox > toolbar[brighttext] #extractTaskButton,
+#mail-toolbox > toolbar[brighttext] #extractEventButton {
   list-style-image: url(chrome://calendar/skin/toolbar-aero-inverted.png) !important;
 }
 
-.button-appmenu:-moz-lwtheme-brighttext {
+toolbar[brighttext] .button-appmenu {
   list-style-image: url(chrome://messenger/skin/icons/mail-toolbar-inverted.png);
 }
 
 @media (-moz-windows-glass) {
   #calendar-toolbox:not(:-moz-lwtheme) {
     border-bottom-color: #AABCCF;
   }
 }
 
-@media (-moz-windows-glass) {
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #lightning-button-calendar,
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #lightning-button-tasks {
-    list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
-  }
-
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #extractTaskButton,
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #extractEventButton {
-    list-style-image: url(chrome://calendar/skin/toolbar-aero-inverted.png);
-  }
-}
-
-@media (-moz-os-version: windows-win8) {
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #lightning-button-calendar,
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #lightning-button-tasks {
-    list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
-  }
-
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #extractTaskButton,
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #extractEventButton {
-    list-style-image: url(chrome://calendar/skin/toolbar-aero-inverted.png);
-  }
-}
-
-#mail-bar3:-moz-lwtheme-brighttext #lightning-button-calendar,
-#mail-bar3:-moz-lwtheme-brighttext #lightning-button-tasks,
-#tabbar-toolbar:-moz-lwtheme-brighttext #lightning-button-calendar,
-#tabbar-toolbar:-moz-lwtheme-brighttext #lightning-button-tasks {
+#tabs-toolbar[brighttext] #lightning-button-calendar,
+#tabs-toolbar[brighttext] #lightning-button-tasks,
+#mail-toolbox > toolbar[brighttext] #lightning-button-calendar,
+#mail-toolbox > toolbar[brighttext] #lightning-button-tasks {
   list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
 }
--- a/calendar/base/themes/windows/win-aero/lightning.css
+++ b/calendar/base/themes/windows/win-aero/lightning.css
@@ -30,36 +30,18 @@
 }
 
 #button-newmsg #newMsgButton-calendar-menuitem,
 #button-newmsg #newMsgButton-task-menuitem,
 #calendar-show-todaypane-panel > #calendar-status-todaypane-button > stack > .toolbarbutton-icon-begin {
   list-style-image: url(chrome://calendar/skin/toolbar-small-aero.png);
 }
 
-@media (-moz-windows-glass) {
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #calendar-tab-button,
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) #task-tab-button {
-    list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
-  }
-}
-
-@media (-moz-os-version: windows-win8) {
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #calendar-tab-button,
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  #task-tab-button {
-    list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
-  }
-}
-
-#tabbar-toolbar:-moz-lwtheme-brighttext #calendar-tab-button,
-#tabbar-toolbar:-moz-lwtheme-brighttext #task-tab-button {
+#tabs-toolbar[brighttext] #calendar-tab-button,
+#tabs-toolbar[brighttext] #task-tab-button {
   list-style-image: url(chrome://lightning/skin/mode-switch-icons-inverted.png);
 }
 
 .imipAcceptButton {
   list-style-image: url(chrome://lightning/skin/imip-aero.png);
   -moz-image-region: rect(0px 16px 16px 0px);
 }
 
--- a/mail/base/content/messageWindow.js
+++ b/mail/base/content/messageWindow.js
@@ -337,16 +337,18 @@ function OnLoadMessageWindow()
       document.documentElement.setAttribute("sizemode", "maximized");
 
     document.documentElement.setAttribute("width", defaultWidth);
     document.documentElement.setAttribute("height", defaultHeight);
     // Make sure we're safe at the left/top edge of screen
     document.documentElement.setAttribute("screenX", screen.availLeft);
     document.documentElement.setAttribute("screenY", screen.availTop);
   }
+
+  ToolbarIconColor.init();
   setTimeout(delayedOnLoadMessageWindow, 0); // when debugging, set this to 5000, so you can see what happens after the window comes up.
 }
 
 function delayedOnLoadMessageWindow()
 {
   HideMenus();
   ShowMenus();
   MailOfflineMgr.init();
@@ -734,16 +736,17 @@ function OnUnloadMessageWindow()
     gFolderDisplay._magicTreeSelection.tree = null;
     gFolderDisplay._magicTreeSelection = null;
   }
   gFolderDisplay.close();
   UnloadCommandUpdateHandlers();
   // FIX ME - later we will be able to use onunload from the overlay
   OnUnloadMsgHeaderPane();
   gPhishingDetector.shutdown();
+  ToolbarIconColor.uninit();
   OnMailWindowUnload();
 }
 
 function GetSelectedMsgFolders()
 {
   if (gFolderDisplay.displayedFolder)
     return [gFolderDisplay.displayedFolder];
   return [];
--- a/mail/base/content/messageWindow.xul
+++ b/mail/base/content/messageWindow.xul
@@ -56,16 +56,17 @@
   <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
   <script type="application/javascript" src="chrome://messenger/content/nsContextMenu.js"/>
   <script type="application/javascript" src="chrome://messenger/content/mailContextMenus.js"/>
   <script type="application/javascript" src="chrome://messenger/content/phishingDetector.js"/>
   <script type="application/javascript" src="chrome://communicator/content/contentAreaClick.js"/>
   <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
   <script type="application/javascript" src="chrome://messenger/content/msgViewNavigation.js"/>
   <script type="application/javascript" src="chrome://messenger/content/editContactOverlay.js"/>
+  <script type="application/javascript" src="chrome://messenger/content/toolbarIconColor.js"/>
 
   <commandset id="mailCommands">
     <commandset id="mailFileMenuItems"/>
     <commandset id="mailViewMenuItems"/>
     <commandset id="mailEditMenuItems"/>
     <commandset id="mailSearchMenuItems"/>
     <commandset id="mailGoMenuItems"/>
     <commandset id="mailMessageMenuItems"/>
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -81,16 +81,17 @@
 <script type="application/javascript" src="chrome://messenger/content/nsContextMenu.js"/>
 <script type="application/javascript" src="chrome://messenger/content/mailContextMenus.js"/>
 <script type="application/javascript" src="chrome://messenger/content/accountUtils.js"/>
 <script type="application/javascript" src="chrome://messenger/content/folderPane.js"/>
 <script type="application/javascript" src="chrome://messenger/content/phishingDetector.js"/>
 <script type="application/javascript" src="chrome://communicator/content/contentAreaClick.js"/>
 <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
 <script type="application/javascript" src="chrome://messenger/content/editContactOverlay.js"/>
+<script type="application/javascript" src="chrome://messenger/content/toolbarIconColor.js"/>
 
 
 <!-- move needed functions into a single js file -->
 <script type="application/javascript" src="chrome://messenger/content/threadPane.js"/>
 
 <commandset id="mailCommands">
   <commandset id="mailFileMenuItems"/>
   <commandset id="mailViewMenuItems"/>
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -435,16 +435,18 @@ function OnLoadMessenger()
     let foregroundLuminance = 0; // Default to black for foreground text.
     let contrastRatio = (backgroundLuminance + 0.05) / (foregroundLuminance + 0.05);
     if (contrastRatio < 3) {
       document.documentElement.setAttribute("darkwindowframe", "true");
     }
   }
 #endif
 
+  ToolbarIconColor.init();
+
   // Set a sane starting width/height for all resolutions on new profiles.
   // Do this before the window loads.
   if (!document.documentElement.hasAttribute("width"))
   {
     // Prefer 1024xfull height.
     let defaultHeight = screen.availHeight;
     let defaultWidth = (screen.availWidth <= 1024) ? screen.availWidth : 1024;
 
@@ -697,16 +699,18 @@ function OnUnloadMessenger()
   accountManager.removeIncomingServerListener(gThreePaneIncomingServerListener);
   Services.prefs.removeObserver("mail.pane_config.dynamic", MailPrefObserver);
   Services.prefs.removeObserver("mail.showCondensedAddresses", MailPrefObserver);
 
   sessionStoreManager.unloadingWindow(window);
 
   TabsInTitlebar.uninit();
 
+  ToolbarIconColor.uninit();
+
   LightweightThemeListener.uninit();
 
   let tabmail = document.getElementById("tabmail");
   tabmail._teardown();
 
   webSearchTabType.shutdown();
 
   MailServices.mailSession.RemoveFolderListener(folderListener);
@@ -1964,16 +1968,18 @@ let TabsInTitlebar = {
       updateTitlebarDisplay();
 
       // Reset the margins and padding that might have been modified:
       titlebarContent.style.marginTop = "";
       titlebarContent.style.marginBottom = "";
       titlebar.style.marginBottom = "";
       menubar.style.paddingBottom = "";
     }
+
+    ToolbarIconColor.inferFromText();
   },
 
   _sizePlaceholder: function (type, width) {
     Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
                   function (node) { node.width = width; });
   },
 #endif
 
new file mode 100644
--- /dev/null
+++ b/mail/base/content/toolbarIconColor.js
@@ -0,0 +1,72 @@
+/** ***** BEGIN LICENSE BLOCK *****
+ * 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/. */
+
+let ToolbarIconColor = {
+  init: function () {
+    this._initialized = true;
+
+    window.addEventListener("activate", this);
+    window.addEventListener("deactivate", this);
+    Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
+
+    // If the window isn't active now, we assume that it has never been active
+    // before and will soon become active such that inferFromText will be
+    // called from the initial activate event.
+    if (Services.focus.activeWindow == window)
+      this.inferFromText();
+  },
+
+  uninit: function () {
+    this._initialized = false;
+
+    window.removeEventListener("activate", this);
+    window.removeEventListener("deactivate", this);
+    Services.obs.removeObserver(this, "lightweight-theme-styling-update");
+  },
+
+  handleEvent: function (event) {
+    switch (event.type) {
+      case "activate":
+      case "deactivate":
+        this.inferFromText();
+        break;
+    }
+  },
+
+  observe: function (aSubject, aTopic, aData) {
+    switch (aTopic) {
+      case "lightweight-theme-styling-update":
+        // inferFromText needs to run after LightweightThemeConsumer.jsm's
+        // lightweight-theme-styling-update observer.
+        setTimeout(() => { this.inferFromText(); }, 0);
+        break;
+    }
+  },
+
+  inferFromText: function () {
+    if (!this._initialized)
+      return;
+
+    function parseRGB(aColorString) {
+      let rgb = aColorString.match(/^rgba?\((\d+), (\d+), (\d+)/);
+      rgb.shift();
+      return rgb.map(x => parseInt(x));
+    }
+
+    let toolbarSelector = "toolbox > toolbar:not([collapsed=true])";
+#ifdef XP_MACOSX
+    toolbarSelector += ":not([type=menubar])";
+#endif
+
+    for (let toolbar of document.querySelectorAll(toolbarSelector)) {
+      let [r, g, b] = parseRGB(getComputedStyle(toolbar).color);
+      let luminance = 0.2125 * r + 0.7154 * g + 0.0721 * b;
+      if (luminance <= 110)
+        toolbar.removeAttribute("brighttext");
+      else
+        toolbar.setAttribute("brighttext", "true");
+    }
+  }
+}
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -106,16 +106,17 @@ messenger.jar:
     content/messenger/browserRequest.js             (content/browserRequest.js)
     content/messenger/browserRequest.xul            (content/browserRequest.xul)
 *   content/messenger/safeMode.xul                  (content/safeMode.xul)
     content/messenger/safeMode.js                   (content/safeMode.js)
     content/messenger/sanitize.xul                  (content/sanitize.xul)
     content/messenger/sanitize.js                   (content/sanitize.js)
     content/messenger/sanitizeDialog.css            (content/sanitizeDialog.css)
     content/messenger/sanitizeDialog.js             (content/sanitizeDialog.js)
+*   content/messenger/toolbarIconColor.js           (content/toolbarIconColor.js)
 # the following files are mail-specific overrides
 *+  content/messenger/license.html                  (/mozilla/toolkit/content/license.html)
 % override chrome://global/content/license.html chrome://messenger/content/license.html
 
 comm.jar:
 % content communicator %content/communicator/
    content/communicator/charsetOverlay.xul          (content/charsetOverlay.xul)
    content/communicator/contentAreaClick.js         (content/contentAreaClick.js)
--- a/mail/themes/windows/mail/messageWindow-aero.css
+++ b/mail/themes/windows/mail/messageWindow-aero.css
@@ -18,16 +18,20 @@
 }
 
 #messagepanebox {
   -moz-appearance: toolbox;
   text-shadow: none;
   background-color: -moz-dialog;
 }
 
+#mail-toolbox:-moz-lwtheme {
+  text-shadow: none;
+}
+
 /* ..... message header borders ..... */
 
 @media all and (-moz-windows-compositor) {
   #status-bar {
     -moz-appearance: none;
     border: none;
     border-top: 1px solid ThreeDShadow;
     background-color: hsl(210, 75%, 92%);
--- a/mail/themes/windows/mail/messageWindow.css
+++ b/mail/themes/windows/mail/messageWindow.css
@@ -12,17 +12,21 @@
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
 #messagepanebox {
   text-shadow: none;
   background-color: -moz-dialog;
 }
 
-#mail-toolbox {
+#mail-toolbox:not(:-moz-lwtheme) {
   -moz-appearance: toolbox;
 }
 
+#mail-toolbox:-moz-lwtheme {
+  text-shadow: none;
+}
+
 /* ::::: message header borders ::::: */
 
 .main-header-area {
   border-top: 2px groove ThreeDFace;
 }
--- a/mail/themes/windows/mail/primaryToolbar-aero.css
+++ b/mail/themes/windows/mail/primaryToolbar-aero.css
@@ -404,40 +404,16 @@ toolbox[labelalign="end"] > toolbar[mode
     height: 0;
     margin: 0 60px; /* (30px + 30px) from box-shadow */
     position: absolute;
     pointer-events: none;
     top: 50%;
     width: -moz-available;
     z-index: -1;
   }
-
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) .toolbarbutton-1 {
-    list-style-image: url("chrome://messenger/skin/icons/mail-toolbar-inverted.png");
-  }
-
-  #tabbar-toolbar:not(:-moz-lwtheme-darktext) .toolbarbutton-1 .dropmarker-icon {
-    list-style-image: url("chrome://messenger/skin/icons/toolbarbutton-arrow-inverted.png");
-  }
-}
-
-@media (-moz-os-version: windows-win8) {
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  .toolbarbutton-1,
-  #tabbar-toolbar:-moz-lwtheme-brighttext .toolbarbutton-1 {
-    list-style-image: url("icons/mail-toolbar-inverted.png");
-  }
-
-  #messengerWindow[darkwindowframe="true"]
-  #tabbar-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive)
-  .toolbarbutton-1 .dropmarker-icon,
-  #tabbar-toolbar:-moz-lwtheme-brighttext .toolbarbutton-1 .dropmarker-icon {
-    list-style-image: url("icons/toolbarbutton-arrow-inverted.png");
-  }
 }
 
 @media not all and (-moz-windows-compositor) {
   @media (-moz-windows-default-theme) {
     #messengerWindow {
       background-color: rgb(185, 209, 234);
     }
     #messengerWindow:-moz-window-inactive {
@@ -471,23 +447,44 @@ toolbox[labelalign="end"] > toolbar[mode
     }
   }
 
   #print-preview-toolbar:not(:-moz-lwtheme) {
     -moz-appearance: -moz-win-browsertabbar-toolbox;
   }
 }
 
-#mail-bar3:-moz-lwtheme-brighttext .toolbarbutton-1,
-#tabbar-toolbar:-moz-lwtheme-brighttext .toolbarbutton-1 {
+@media (-moz-os-version: windows-win8) {
+  @media not all and (-moz-windows-default-theme) {
+    #messengerWindow:not([tabsintitlebar]) #tabs-toolbar:not(:-moz-lwtheme),
+    #messengerWindow:not([tabsintitlebar]) #mail-menubar >
+      menu:not(:-moz-lwtheme) {
+      color: CaptionText;
+    }
+
+    #messengerWindow:not([tabsintitlebar])
+      #tabs-toolbar:not(:-moz-lwtheme):-moz-window-inactive,
+    #messengerWindow:not([tabsintitlebar]) #mail-menubar >
+      menu:not(:-moz-lwtheme):-moz-window-inactive {
+      color: InactiveCaptionText;
+    }
+
+    #messengerWindow:not([tabsintitlebar]) #mail-menubar > menu {
+      -moz-appearance: none;
+    }
+  }
+}
+
+#mail-toolbox > toolbar[brighttext] .toolbarbutton-1,
+#navigation-toolbox > toolbar[brighttext] .toolbarbutton-1 {
   list-style-image: url("chrome://messenger/skin/icons/mail-toolbar-inverted.png");
 }
 
-.toolbarbutton-1 .toolbarbutton-menu-dropmarker:-moz-lwtheme-brighttext,
-.toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:-moz-lwtheme-brighttext {
+toolbar[brighttext] .toolbarbutton-1 .toolbarbutton-menu-dropmarker,
+toolbar[brighttext] .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker {
   list-style-image: url("chrome://messenger/skin/icons/toolbarbutton-arrow-inverted.png");
 }
 
 #button-getmsg {
   list-style-image: url("chrome://messenger/skin/icons/mail-toolbar.png");
   -moz-image-region: rect(1px, 17px, 17px, 1px);
 }
 
--- a/mail/themes/windows/mail/tabmail-aero.css
+++ b/mail/themes/windows/mail/tabmail-aero.css
@@ -9,19 +9,28 @@
 
 @media (-moz-windows-default-theme) and (-moz-os-version: windows-vista),
        (-moz-windows-default-theme) and (-moz-os-version: windows-win7) {
   .tab-background-middle[selected=true]:not(:-moz-lwtheme) {
     background-color: var(--customToolbarColor);
   }
 }
 
-#messengerWindow[tabsintitlebar]
-.tabmail-tab:not([selected]):not(:-moz-lwtheme):-moz-window-inactive {
-  color: InactiveCaptionText;
+@media (-moz-os-version: windows-win8) {
+  @media not all and (-moz-windows-default-theme) {
+    #tabs-toolbar:not(:-moz-lwtheme) {
+      color: CaptionText;
+    }
+
+    #tabs-toolbar:not(:-moz-lwtheme):-moz-window-inactive,
+    #messengerWindow:not([tabsintitlebar])
+      .tabmail-tab:not([selected]):not(:-moz-lwtheme):-moz-window-inactive {
+      color: InactiveCaptionText;
+    }
+  }
 }
 
 .tabmail-tab[selected] > .tab-stack > .tab-content > .tab-close-button {
   /* Make this button focusable so clicking on it will not focus the tab while
      it's getting closed */
   -moz-user-focus: normal;
 }
 
@@ -43,56 +52,38 @@
 
 .tabs-alltabs-button {
   margin-bottom: -1px;
   width: 18px;
   list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow.png);
   -moz-image-region: rect(0, 13px, 11px, 0);
 }
 
-.tabs-alltabs-button:-moz-system-metric(windows-glass):not(:-moz-lwtheme),
-.tabs-alltabs-button:-moz-lwtheme-brighttext {
+#tabs-toolbar[brighttext] .tabs-alltabs-button {
   list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
 }
 
 /* Apply only on Win8 */
 @media (-moz-windows-default-theme) and (-moz-os-version: windows-win8) {
   #messengerWindow[darkwindowframe="true"]
   #tabs-toolbar:not(:-moz-lwtheme):not(:-moz-window-inactive),
   #messengerWindow[darkwindowframe="true"]
   .tabmail-tab:not([selected="true"]):not(:-moz-lwtheme):not(:-moz-window-inactive) {
     color: white;
   }
 
-  #messengerWindow[darkwindowframe="true"] .tabmail-tab:not([selected="true"])
-  .tab-close-button:not(:-moz-any(:hover,:active)):not(:-moz-lwtheme):not(:-moz-window-inactive) {
-    -moz-image-region: rect(0, 64px, 16px, 48px);
-  }
-
-  #messengerWindow[darkwindowframe="true"] .tabmail-arrowscrollbox >
-  .scrollbutton-up:not(:-moz-lwtheme):not(:-moz-window-inactive),
-  #messengerWindow[darkwindowframe="true"] .tabmail-arrowscrollbox
-  > stack > .scrollbutton-down:not(:-moz-lwtheme):not(:-moz-window-inactive) {
-    list-style-image: url(tabs/arrow-left-inverted.png);
-  }
-
   #messengerWindow[darkwindowframe="true"]
   .tabs-alltabs-button:not(:-moz-lwtheme):-moz-window-inactive {
     list-style-image: url(icons/toolbarbutton-arrow.png);
     -moz-image-region: rect(0, 9px, 7px, 0);
     padding-top: 1px;
     -moz-padding-start: 5px;
     -moz-padding-end: 5px;
   }
 
-  #messengerWindow[darkwindowframe="true"]
-  .tabs-alltabs-button:not(:-moz-lwtheme):not(:-moz-window-inactive) {
-    list-style-image: url(icons/mainwindow-dropdown-arrow-inverted.png);
-  }
-
   .tabs-alltabs-button > .toolbarbutton-icon {
     margin: 4px 0 0;
   }
 }
 
 /**
  * Toolbarbuttons on tab bar
  */
--- a/mail/themes/windows/mail/tabmail.css
+++ b/mail/themes/windows/mail/tabmail.css
@@ -52,16 +52,21 @@
   }
 }
 
 #messengerWindow[tabsintitlebar]
 .tabmail-tab:not([selected]):not(:-moz-lwtheme) {
   color: CaptionText;
 }
 
+#messengerWindow[tabsintitlebar]
+.tabmail-tab:not([selected]):not(:-moz-lwtheme):-moz-window-inactive {
+  color: InactiveCaptionText;
+}
+
 .tabmail-tab[busy],
 .tabmail-tab[thinking] {
   list-style-image: url("chrome://messenger/skin/icons/loading.png") !important;
   -moz-image-region: auto !important;
 }
 
 .tabmail-tab[type="glodaSearch"] {
   list-style-image: url("chrome://global/skin/icons/Search-glass.png");
@@ -138,33 +143,21 @@ tabpanels {
 .tabs-closebutton {
   -moz-appearance: none;
   -moz-image-region: rect(0, 16px, 16px, 0);
   border: none;
   cursor: default;
   list-style-image: url(icons/closeTab.png);
 }
 
-.tabs-closebutton:not(:hover):not(:active):-moz-lwtheme-brighttext,
-.tab-close-button:not(:hover):not(:active):-moz-lwtheme-brighttext {
+#tabs-toolbar[brighttext] .tabs-closebutton:not(:hover):not(:active),
+#tabs-toolbar[brighttext] .tab-close-button:not(:hover):not([selected="true"]) {
   -moz-image-region: rect(0, 64px, 16px, 48px);
 }
 
-%ifndef WINDOWS_AERO
-@media (-moz-windows-theme: luna-blue),
-       (-moz-windows-theme: royale),
-       (-moz-windows-theme: zune) {
-  #messengerWindow[tabsintitlebar] .tabs-closebutton,
-  #messengerWindow[tabsintitlebar] .tabmail-tab:not([selected]) > .tab-stack >
-    .tab-content > .tab-close-button:not(:hover):not(:active) {
-    -moz-image-region: rect(0, 64px, 16px, 48px);
-  }
-}
-%endif
-
 .tabs-closebutton-box > .tabs-closebutton {
   padding: 0 2px;
 }
 
 .tab-close-button {
 %ifndef WINDOWS_AERO
   -moz-margin-start: 6px;
   -moz-padding-start: 0 !important;
@@ -238,24 +231,18 @@ tabpanels {
 .tabmail-arrowscrollbox > stack > .scrollbutton-down > .toolbarbutton-icon {
   margin-top: 2px;
   margin-bottom: 0px;
   -moz-margin-start: 1px;
   -moz-margin-end: 0px;
 }
 %endif
 
-%ifdef WINDOWS_AERO
-.tabmail-arrowscrollbox >
-  .scrollbutton-up:-moz-system-metric(windows-glass):not(:-moz-lwtheme),
-.tabmail-arrowscrollbox > stack >
-  .scrollbutton-down:-moz-system-metric(windows-glass):not(:-moz-lwtheme),
-%endif
-.tabmail-arrowscrollbox > .scrollbutton-up:-moz-lwtheme-brighttext,
-.tabmail-arrowscrollbox > stack > .scrollbutton-down:-moz-lwtheme-brighttext {
+#tabs-toolbar[brighttext] .tabmail-arrowscrollbox > .scrollbutton-up,
+#tabs-toolbar[brighttext] .tabmail-arrowscrollbox > stack > .scrollbutton-down {
   list-style-image: url(tabs/arrow-left-inverted.png);
 }
 
 .tabmail-arrowscrollbox > .scrollbutton-up[disabled],
 .tabmail-arrowscrollbox > stack > .scrollbutton-down[disabled] {
   opacity: .4;
 }
 
@@ -298,27 +285,18 @@ tabpanels {
 
 .tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
 %ifndef WINDOWS_AERO
   -moz-margin-end: 3px !important;
   list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow.png);
   -moz-image-region: rect(0, 13px, 11px, 0);
 }
 
-.tabs-alltabs-button > .toolbarbutton-menu-dropmarker:-moz-lwtheme-brighttext {
+#tabs-toolbar[brighttext] .tabs-alltabs-button > .toolbarbutton-menu-dropmarker {
   list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
-}
-
-@media (-moz-windows-theme: luna-blue),
-       (-moz-windows-theme: royale),
-       (-moz-windows-theme: zune) {
-  #messengerWindow[tabsintitlebar] .tabs-alltabs-button:not(:hover) >
-    .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme) {
-    list-style-image: url(chrome://messenger/skin/icons/mainwindow-dropdown-arrow-inverted.png);
-  }
 %else
   display: none;
 %endif
 }
 
 /**
  * All Tabs Menupopup
  */
index b4192f776e91b155a907592175310c33119343a2..67af32ee9ffca4ab8322833d2b02995cf70ba6d5
GIT binary patch
literal 232
zc$@*~02lv>P)<h;3K|Lk000e1NJLTq000930015c1^@s6>0qS#00025Nkl<Zc-nQ(
zF>=E|3`5ZeYNeIsGvx$1K<?kTbLBc>3OO@r!VWXU2f)AgdOntq&#&=%K9<o@SUbK;
zdSHeOodsLBv(gq!lIqy7OK*h*H;h8PMO7F$!l=Fg$Mu#>9NiRWa1*o0hC4>}g}$e$
zT<E(PCB5Qkw$d4wC!@%p9CC?PopZivvm(K*W2x?|D5^?t?+I(2QrJoTHrQLQzq9u%
ir!z4VRnmn`TYdn|J1b8}fyTZ70000<MNUMnLSTY6Ibw_e