Bug 1204845 - Remove the menuitem-iconic-both binding. r=enndeakin
authorDão Gottwald <dao@mozilla.com>
Thu, 17 Sep 2015 10:13:27 +0200
changeset 262986 c868ce24344c8a59f703d4a0cb64067288c7512c
parent 262985 47f4d82b8129c8183fb4e3566850510e59b60acb
child 262987 e5b69f126a0628a4a1d18b1b06b185acb2e4dc4a
push id29386
push userkwierso@gmail.com
push dateThu, 17 Sep 2015 21:54:55 +0000
treeherdermozilla-central@214fe6c504ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs1204845
milestone43.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 1204845 - Remove the menuitem-iconic-both binding. r=enndeakin
browser/base/content/tabbrowser.xml
browser/themes/linux/browser.css
browser/themes/osx/browser.css
browser/themes/windows/browser.css
toolkit/content/widgets/menu.xml
toolkit/content/xul.css
toolkit/themes/osx/global/menu.css
toolkit/themes/windows/global/menu.css
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -6206,22 +6206,33 @@
           else
             aMenuitem.removeAttribute("pending");
 
           if (aTab.selected)
             aMenuitem.setAttribute("selected", "true");
           else
             aMenuitem.removeAttribute("selected");
 
+          function addEndImage() {
+            let endImage = document.createElement("image");
+            endImage.setAttribute("class", "alltabs-endimage");
+            let endImageContainer = document.createElement("hbox");
+            endImageContainer.setAttribute("align", "center");
+            endImageContainer.setAttribute("pack", "center");
+            endImageContainer.appendChild(endImage);
+            aMenuitem.appendChild(endImageContainer);
+            return endImage;
+          }
+
+          if (aMenuitem.firstChild)
+            aMenuitem.firstChild.remove();
           if (aTab.hasAttribute("muted"))
-            aMenuitem.setAttribute("endimage", "chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted");
+            addEndImage().setAttribute("muted", "true");
           else if (aTab.hasAttribute("soundplaying"))
-            aMenuitem.setAttribute("endimage", "chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio");
-          else
-            aMenuitem.removeAttribute("endimage");
+            addEndImage().setAttribute("soundplaying", "true");
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
       <handler event="popupshowing">
       <![CDATA[
         document.getElementById("alltabs_undoCloseTab").disabled =
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -326,17 +326,17 @@ menuitem.bookmark-item {
 }
 
 .bookmark-item[cutting] > .toolbarbutton-text,
 .bookmark-item[cutting] > .menu-iconic-left > .menu-iconic-text {
   opacity: 0.7;
 }
 
 /* Stock icons for the menu bar items */
-menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip):not([endimage]) {
+menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
 }
 
 #placesContext_open\:newwindow,
 #menu_newNavigator,
 #context-openlink,
 #context-openframe {
   list-style-image: url("chrome://browser/skin/Toolbar-small.png");
@@ -1631,16 +1631,24 @@ richlistitem[type~="action"][actiontype=
   list-style-image: url("chrome://global/skin/icons/loading_16.png");
 }
 
 .alltabs-item[tabIsVisible] {
   /* box-shadow instead of background-color to work around native styling */
   box-shadow: inset -5px 0 ThreeDShadow;
 }
 
+.alltabs-endimage[muted] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
+}
+
+.alltabs-endimage[soundplaying] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
+}
+
 /* Sidebar */
 #sidebar-throbber[loading="true"] {
   list-style-image: url("chrome://global/skin/icons/loading_16.png");
   -moz-margin-end: 4px;
 }
 
 toolbarbutton.chevron {
   list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -2953,16 +2953,24 @@ toolbarbutton.chevron > .toolbarbutton-m
   list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
 }
 
 .alltabs-item[tabIsVisible] {
   /* box-shadow instead of background-color to work around native styling */
   box-shadow: inset -5px 0 ThreeDShadow;
 }
 
+.alltabs-endimage[muted] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
+}
+
+.alltabs-endimage[soundplaying] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
+}
+
 /* Bookmarks toolbar */
 #PlacesToolbarDropIndicator {
   list-style-image: url(chrome://browser/skin/places/toolbarDropMarker.png);
 }
 
 /* Bookmark drag and drop styles */
 
 .bookmark-item[dragover-into="true"] {
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -2240,16 +2240,24 @@ richlistitem[type~="action"][actiontype=
   list-style-image: url("chrome://global/skin/icons/loading_16.png");
 }
 
 .alltabs-item[tabIsVisible] {
   /* box-shadow instead of background-color to work around native styling */
   box-shadow: inset -5px 0 ThreeDShadow;
 }
 
+.alltabs-endimage[muted] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted);
+}
+
+.alltabs-endimage[soundplaying] {
+  list-style-image: url(chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio);
+}
+
 toolbarbutton.chevron {
   list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
 }
 
 toolbar[brighttext] toolbarbutton.chevron {
   list-style-image: url("chrome://global/skin/toolbar/chevron-inverted.png") !important;
 }
 
--- a/toolkit/content/widgets/menu.xml
+++ b/toolkit/content/widgets/menu.xml
@@ -212,35 +212,23 @@
 
   <binding id="menuitem-iconic" extends="chrome://global/content/bindings/menu.xml#menuitem">
     <content>
       <xul:hbox class="menu-iconic-left" align="center" pack="center"
                 xbl:inherits="selected,_moz-menuactive,disabled,checked">
         <xul:image class="menu-iconic-icon" xbl:inherits="src=image,validate,src"/>
       </xul:hbox>
       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
+      <children/>
       <xul:hbox class="menu-accel-container" anonid="accel">
         <xul:label class="menu-iconic-accel" xbl:inherits="value=acceltext"/>
       </xul:hbox>
     </content>
   </binding>
 
-  <binding id="menuitem-iconic-both" extends="chrome://global/content/bindings/menu.xml#menuitem">
-    <content>
-      <xul:hbox class="menu-iconic-left" align="center" pack="center"
-                xbl:inherits="selected,_moz-menuactive,disabled,checked">
-        <xul:image class="menu-iconic-icon" xbl:inherits="src=image,validate,src"/>
-      </xul:hbox>
-      <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
-      <xul:hbox class="menu-iconic-right" align="center" pack="center">
-        <xul:image class="menu-iconic-icon" xbl:inherits="src=endimage"/>
-      </xul:hbox>
-    </content>
-  </binding>
-
   <binding id="menuitem-iconic-noaccel" extends="chrome://global/content/bindings/menu.xml#menuitem">
     <content>
       <xul:hbox class="menu-iconic-left" align="center" pack="center"
                 xbl:inherits="selected,disabled,checked">
         <xul:image class="menu-iconic-icon" xbl:inherits="src=image,validate,src"/>
       </xul:hbox>
       <xul:label class="menu-iconic-text" flex="1" xbl:inherits="value=label,accesskey,crop" crop="right"/>
     </content>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -383,20 +383,16 @@ menuitem[type="checkbox"],
 menuitem[type="radio"] {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
 }
 
 menuitem.menuitem-non-iconic {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menubutton-item");
 }
 
-menuitem.menuitem-iconic[endimage] {
-  -moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic-both");
-}
-
 menucaption {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menucaption");
 }
 
 .menu-text {
   -moz-box-flex: 1;
 }
 
--- a/toolkit/themes/osx/global/menu.css
+++ b/toolkit/themes/osx/global/menu.css
@@ -72,22 +72,16 @@ menuitem[src] {
 .menuitem-iconic > .menu-iconic-left > .menu-iconic-icon,
 .menu-iconic > .menu-iconic-left > .menu-iconic-icon,
 menuitem[image] > .menu-iconic-left > .menu-iconic-icon,
 menuitem[src] > .menu-iconic-left > .menu-iconic-icon {
   -moz-margin-start: 0;
   width: 16px;
 }
 
-menuitem[endimage] > .menu-iconic-right > .menu-iconic-icon {
-  -moz-margin-start: 2px;
-  -moz-margin-end: 0;
-  width: 16px;
-}
-
 /* ..... menu arrow box ..... */
 
 .menu-right,
 .menu-accel-container {
   -moz-margin-start: 21px;
   -moz-margin-end: -9px;
   -moz-box-pack: end;
 }
--- a/toolkit/themes/windows/global/menu.css
+++ b/toolkit/themes/windows/global/menu.css
@@ -98,28 +98,21 @@ menucaption > .menu-iconic-text {
 
 .menu-iconic-icon {
   width: 16px;
   height: 16px;
 }
 
 menu.menu-iconic > .menu-iconic-left,
 menuitem.menuitem-iconic > .menu-iconic-left,
-.splitmenu-menuitem[iconic="true"] > .menu-iconic-left,
-menuitem[endimage] > .menu-iconic-right {
+.splitmenu-menuitem[iconic="true"] > .menu-iconic-left {
   -moz-appearance: menuimage;
   padding-top: 2px;
 }
 
-menuitem[endimage] > .menu-iconic-right > .menu-iconic-icon {
-  -moz-margin-start: 2px;
-  -moz-margin-end: 5px;
-  width: 16px;
-}
-
 /* ..... menu arrow box ..... */
 
 .menu-right {
   -moz-appearance: menuarrow;
   -moz-margin-end: -2px;
   list-style-image: none;
   min-width: 1.28em;
   padding-top: 1px;