Bug 984188 - Don't invert icons for -moz-lwtheme-brighttext in the overflow panel. r=mikedeboer, a=sylvestre
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Tue, 18 Mar 2014 12:26:09 -0700
changeset 192180 09c64c10cdb6a59ebb890878b2f3725133b3f7c3
parent 192179 14833d153e6a26386884b05fb6bb1b74101723d8
child 192181 22ea5f3e20df4c3dba3433eb0ef0946dac4594fb
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, sylvestre
bugs984188
milestone30.0a2
Bug 984188 - Don't invert icons for -moz-lwtheme-brighttext in the overflow panel. r=mikedeboer, a=sylvestre [Australis]
browser/base/content/browser.xul
browser/components/customizableui/src/CustomizableWidgets.jsm
browser/themes/osx/browser.css
browser/themes/shared/toolbarbuttons.inc.css
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -634,22 +634,24 @@
       <hbox id="nav-bar-customization-target" flex="1">
         <toolbaritem id="urlbar-container" flex="400" persist="width"
                      forwarddisabled="true" title="&locationItem.title;" removable="false"
                      cui-areatype="toolbar"
                      class="chromeclass-location" overflows="false">
           <toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                          label="&backCmd.label;"
                          command="Browser:BackOrBackDuplicate"
+                         cui-areatype="toolbar"
                          onclick="checkForMiddleClick(this, event);"
                          tooltip="back-button-tooltip"
                          context="backForwardMenu"/>
           <toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                          label="&forwardCmd.label;"
                          command="Browser:ForwardOrForwardDuplicate"
+                         cui-areatype="toolbar"
                          onclick="checkForMiddleClick(this, event);"
                          tooltip="forward-button-tooltip"
                          context="backForwardMenu"/>
           <dummyobservertarget hidden="true"
                                onbroadcast="if (this.getAttribute('disabled') == 'true')
                                               this.parentNode.setAttribute('forwarddisabled', 'true');
                                             else
                                               this.parentNode.removeAttribute('forwarddisabled');">
@@ -888,24 +890,27 @@
                        label="&sharePageCmd.label;"
                        tooltiptext="&sharePageCmd.label;"
                        cui-areatype="toolbar"
                        command="Social:SharePage"/>
       </hbox>
 
       <toolbarbutton id="nav-bar-overflow-button"
                      class="toolbarbutton-1 chromeclass-toolbar-additional overflow-button"
+                     cui-areatype="toolbar"
                      skipintoolbarset="true"
                      tooltiptext="&navbarOverflow.label;"/>
 
       <toolbaritem id="PanelUI-button"
                    class="chromeclass-toolbar-additional"
+                   cui-areatype="toolbar"
                    removable="false">
         <toolbarbutton id="PanelUI-menu-button"
                        class="toolbarbutton-1"
+                       cui-areatype="toolbar"
                        label="&brandShortName;"
                        tooltiptext="&appmenu.tooltip;"/>
       </toolbaritem>
 
       <hbox id="window-controls" hidden="true" pack="end" skipintoolbarset="true"
             ordinal="1000">
         <toolbarbutton id="minimize-button"
                        tooltiptext="&fullScreenMinimize.tooltip;"
--- a/browser/components/customizableui/src/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/src/CustomizableWidgets.jsm
@@ -68,16 +68,17 @@ function setAttributes(aNode, aAttrs) {
 
 function updateCombinedWidgetStyle(aNode, aArea, aModifyCloseMenu) {
   let inPanel = (aArea == CustomizableUI.AREA_PANEL);
   let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
   let attrs = {class: cls};
   if (aModifyCloseMenu) {
     attrs.closemenu = inPanel ? "none" : null;
   }
+  attrs["cui-areatype"] = aArea ? CustomizableUI.getAreaType(aArea) : null;
   for (let i = 0, l = aNode.childNodes.length; i < l; ++i) {
     if (aNode.childNodes[i].localName == "separator")
       continue;
     setAttributes(aNode.childNodes[i], attrs);
   }
 }
 
 const CustomizableWidgets = [{
@@ -426,42 +427,31 @@ const CustomizableWidgets = [{
     id: "zoom-controls",
     type: "custom",
     defaultArea: CustomizableUI.AREA_PANEL,
     onBuild: function(aDocument) {
       const kPanelId = "PanelUI-popup";
       let areaType = CustomizableUI.getAreaType(this.currentArea);
       let inPanel = areaType == CustomizableUI.TYPE_MENU_PANEL;
       let inToolbar = areaType == CustomizableUI.TYPE_TOOLBAR;
-      let closeMenu = inPanel ? "none" : null;
-      let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
-
-      if (!this.currentArea)
-        cls = null;
 
       let buttons = [{
         id: "zoom-out-button",
-        closemenu: closeMenu,
         command: "cmd_fullZoomReduce",
-        class: cls,
         label: true,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_fullZoomReduce",
       }, {
         id: "zoom-reset-button",
-        closemenu: closeMenu,
         command: "cmd_fullZoomReset",
-        class: cls,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_fullZoomReset",
       }, {
         id: "zoom-in-button",
-        closemenu: closeMenu,
         command: "cmd_fullZoomEnlarge",
-        class: cls,
         label: true,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_fullZoomEnlarge",
       }];
 
       let node = aDocument.createElementNS(kNSXUL, "toolbaritem");
       node.setAttribute("id", "zoom-controls");
       node.setAttribute("label", CustomizableUI.getLocalizedProperty(this, "label"));
@@ -510,16 +500,17 @@ const CustomizableWidgets = [{
         panel.addEventListener("popupshowing", updateZoomResetButton);
       } else {
         if (inToolbar) {
           let container = window.gBrowser.tabContainer;
           container.addEventListener("TabSelect", updateZoomResetButton);
         }
         updateZoomResetButton();
       }
+      updateCombinedWidgetStyle(node, this.currentArea, true);
 
       let listener = {
         onWidgetAdded: function(aWidgetId, aArea, aPosition) {
           if (aWidgetId != this.id)
             return;
 
           updateCombinedWidgetStyle(node, aArea, true);
           updateZoomResetButton();
@@ -604,40 +595,31 @@ const CustomizableWidgets = [{
 
       return node;
     }
   }, {
     id: "edit-controls",
     type: "custom",
     defaultArea: CustomizableUI.AREA_PANEL,
     onBuild: function(aDocument) {
-      let inPanel = (this.currentArea == CustomizableUI.AREA_PANEL);
-      let cls = inPanel ? "panel-combined-button" : "toolbarbutton-1 toolbarbutton-combined";
-
-      if (!this.currentArea)
-        cls = null;
-
       let buttons = [{
         id: "cut-button",
         command: "cmd_cut",
-        class: cls,
         label: true,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_cut",
       }, {
         id: "copy-button",
         command: "cmd_copy",
-        class: cls,
         label: true,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_copy",
       }, {
         id: "paste-button",
         command: "cmd_paste",
-        class: cls,
         label: true,
         tooltiptext: "tooltiptext2",
         shortcutId: "key_paste",
       }];
 
       let node = aDocument.createElementNS(kNSXUL, "toolbaritem");
       node.setAttribute("id", "edit-controls");
       node.setAttribute("label", CustomizableUI.getLocalizedProperty(this, "label"));
@@ -651,16 +633,18 @@ const CustomizableWidgets = [{
       buttons.forEach(function(aButton, aIndex) {
         if (aIndex != 0)
           node.appendChild(aDocument.createElementNS(kNSXUL, "separator"));
         let btnNode = aDocument.createElementNS(kNSXUL, "toolbarbutton");
         setAttributes(btnNode, aButton);
         node.appendChild(btnNode);
       });
 
+      updateCombinedWidgetStyle(node, this.currentArea);
+
       let listener = {
         onWidgetAdded: function(aWidgetId, aArea, aPosition) {
           if (aWidgetId != this.id)
             return;
           updateCombinedWidgetStyle(node, aArea);
         }.bind(this),
 
         onWidgetRemoved: function(aWidgetId, aPrevArea) {
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -743,18 +743,18 @@ toolbar .toolbarbutton-1 > .toolbarbutto
   /* Whitelist built-in buttons, instead of .toolbarbutton-1,
      to avoid potentially breaking add-on toolbar buttons. */
 
   :-moz-any(@primaryToolbarButtons@),
   #bookmarks-menu-button[cui-areatype="toolbar"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
     list-style-image: url("chrome://browser/skin/Toolbar@2x.png");
   }
 
-  :-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext,
-  #bookmarks-menu-button[cui-areatype="toolbar"]:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
+  :-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
+  #bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
     list-style-image: url("chrome://browser/skin/Toolbar-inverted@2x.png");
   }
 
   #back-button {
     -moz-image-region: rect(0, 72px, 36px, 36px);
   }
 
   #back-button:hover:active:not([disabled="true"]) {
--- a/browser/themes/shared/toolbarbuttons.inc.css
+++ b/browser/themes/shared/toolbarbuttons.inc.css
@@ -1,15 +1,15 @@
 :-moz-any(@primaryToolbarButtons@),
 #bookmarks-menu-button > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
   list-style-image: url("chrome://browser/skin/Toolbar.png");
 }
 
-:-moz-any(@primaryToolbarButtons@):-moz-lwtheme-brighttext,
-#bookmarks-menu-button:-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
+:-moz-any(@primaryToolbarButtons@):not(@inAnyPanel@):-moz-lwtheme-brighttext,
+#bookmarks-menu-button:not(@inAnyPanel@):-moz-lwtheme-brighttext > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
   list-style-image: url(chrome://browser/skin/Toolbar-inverted.png);
 }
 
 #back-button {
   -moz-image-region: rect(0, 36px, 18px, 18px);
 }
 
 #forward-button {