Bug 1546340 - [de-xbl] remove toolbarpaletteitem and toolbarpaletteitem-palette bindings. r=mkmelin
authorAlessandro Castellani <alessandro@thunderbird.net>
Fri, 21 Jun 2019 00:08:52 +0200
changeset 35906 451a275be8a60ea6b73cf3a4dc7adbf7fb061d66
parent 35905 3252789dc29605fca55494a949c380dc24b95948
child 35907 166aaa29faa1927224e29ae7c8fedbd943d26bb4
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1546340
Bug 1546340 - [de-xbl] remove toolbarpaletteitem and toolbarpaletteitem-palette bindings. r=mkmelin
common/bindings/toolbar.xml
common/src/customizeToolbar.css
mail/base/content/bindings.css
mail/themes/linux/mail/customizeToolbar.css
mail/themes/linux/mail/messenger.css
mail/themes/osx/mail/messenger.css
mail/themes/windows/mail/messenger.css
--- a/common/bindings/toolbar.xml
+++ b/common/bindings/toolbar.xml
@@ -385,31 +385,9 @@
                                           .split(",")
                                           .concat(["separator", "spacer", "spring"]);
           return aCurrentSet.split(",").some(item => !defaultOrNoninteractive.includes(item));
         ]]></body>
       </method>
     </implementation>
   </binding>
 
-  <binding id="toolbarpaletteitem">
-    <content>
-      <xul:hbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
-        <children/>
-      </xul:hbox>
-    </content>
-  </binding>
-
-  <binding id="toolbarpaletteitem-palette"
-#ifdef MOZ_SUITE
-           extends="chrome://communicator/content/bindings/toolbar.xml#toolbarpaletteitem">
-#else
-           extends="chrome://messenger/content/toolbar.xml#toolbarpaletteitem">
-#endif
-    <content>
-      <xul:hbox class="toolbarpaletteitem-box" xbl:inherits="type,place">
-        <children/>
-      </xul:hbox>
-      <xul:label xbl:inherits="value=title"/>
-    </content>
-  </binding>
-
 </bindings>
--- a/common/src/customizeToolbar.css
+++ b/common/src/customizeToolbar.css
@@ -6,32 +6,47 @@
 @namespace html url("http://www.w3.org/1999/xhtml");
 
 #palette-box {
   overflow: auto;
   display: block;
   min-height: 3em;
 }
 
-#palette-box > toolbarpaletteitem {
-  width: 110px;
-  height: 94px;
-  overflow: hidden;
-  display: inline-block;
+toolbarpaletteitem {
+  -moz-window-dragging: no-drag;
+  -moz-box-pack: start;
 }
 
-.toolbarpaletteitem-box {
+toolbarpaletteitem[place="palette"] {
+  -moz-box-orient: vertical;
+  width: 10em;
+  max-width: 10em;
+  /* icon (16) + margin (9 + 12) + 4 lines of text: */
+  height: calc(39px + 4em);
+  margin-bottom: 5px;
+  margin-inline-end: 24px;
+  overflow: visible;
+  display: inline-block;
+  vertical-align: top;
+}
+
+toolbarpaletteitem[place=palette]::after {
+  content: attr(title);
+  display: block;
+  text-align: center;
+}
+
+toolbarpaletteitem > toolbarbutton,
+toolbarpaletteitem > toolbarseparator,
+toolbarpaletteitem > toolbaritem {
+  /* Prevent children from getting events */
+  pointer-events: none;
   -moz-box-pack: center;
   -moz-box-flex: 1;
-  width: 110px !important;
-  max-width: 110px;
-}
-
-toolbarpaletteitem > label {
-  text-align: center;
 }
 
 #main-box > box {
   overflow: hidden;
 }
 
 /* Hide the toolbarbutton label because we replicate it on the wrapper */
 .toolbarbutton-text {
--- a/mail/base/content/bindings.css
+++ b/mail/base/content/bindings.css
@@ -8,18 +8,8 @@
 
 toolbox {
   -moz-binding: url("chrome://messenger/content/toolbar.xml#toolbox");
 }
 
 toolbar {
   -moz-binding: url("chrome://messenger/content/toolbar.xml#toolbar");
 }
-
-toolbarpaletteitem {
-  -moz-binding: url("chrome://messenger/content/toolbar.xml#toolbarpaletteitem");
-}
-
-toolbarpaletteitem[place="palette"] {
-  -moz-box-orient: vertical;
-  -moz-binding: url("chrome://messenger/content/toolbar.xml#toolbarpaletteitem-palette");
-}
-
--- a/mail/themes/linux/mail/customizeToolbar.css
+++ b/mail/themes/linux/mail/customizeToolbar.css
@@ -14,10 +14,9 @@ dialog {
 
 #palette-box {
   -moz-appearance: listbox;
   margin: 0 0 10px;
 }
 
 #palette-box > toolbarpaletteitem {
   padding: 8px 2px;
-  margin: 0 8px;
 }
--- a/mail/themes/linux/mail/messenger.css
+++ b/mail/themes/linux/mail/messenger.css
@@ -281,48 +281,45 @@ menulist > menupopup >
 menulist > menupopup >
   menu:-moz-any(.menuitem-iconic, [type="radio"], [type="checkbox"]) >
   .menu-iconic-left {
   display: -moz-box;
 }
 
 /* ::::: Toolbar customization ::::: */
 
-.toolbarpaletteitem-box[type="spacer"],
-.toolbarpaletteitem-box[type="spring"] {
+toolbarpaletteitem[type="spacer"] toolbarspacer,
+toolbarpaletteitem[type="spring"] toolbarspring {
   border: 1px solid #808080;
   background-color: #fff !important;
 }
 
 toolbarpaletteitem[place="toolbar"] > toolbarspacer {
   width: 11px;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="toolbar"],
-.toolbarpaletteitem-box[type="spring"][place="toolbar"] {
+toolbarpaletteitem[type="spacer"][place="toolbar"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="toolbar"] toolbarspring {
   margin-top: 2px;
   margin-bottom: 2px;
   margin-inline-start: 0;
   margin-inline-end: 2px;
 }
 
-.toolbarpaletteitem-box[type="separator"][place="palette"] {
-  width: 2px;
-  height: 50px;
+toolbarpaletteitem[type="spacer"][place="palette"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
+  margin-bottom: 2px;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="palette"],
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
-  margin-bottom: 2px;
-  width: 50px;
-  height: 50px;
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
+  background: url("chrome://messenger/skin/icons/spring.png") no-repeat center;
 }
 
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
-  background: url("chrome://messenger/skin/icons/spring.png") no-repeat center;
+toolbarpaletteitem[type="separator"][place="palette"] toolbarseparator {
+  width: 2px;
 }
 
 /* ::::: toolbarbutton menu-button ::::: */
 
 toolbarbutton[type="menu-button"] {
   -moz-box-align: stretch;
   -moz-appearance: dualbutton;
   -moz-box-orient: horizontal !important;
--- a/mail/themes/osx/mail/messenger.css
+++ b/mail/themes/osx/mail/messenger.css
@@ -159,52 +159,46 @@ toolbar[brighttext] {
 }
 
 #titlebar:-moz-lwtheme {
   -moz-appearance: none;
 }
 
 /* ::::: Toolbar customization ::::: */
 
-.toolbarpaletteitem-box[type="spacer"] {
+toolbarpaletteitem[type="spacer"] toolbarspacer {
   border: 1px solid #a3a3a3;
   background-color: #eee;
-  width: 32px;
-  margin-top: 18px;
 }
 
-.toolbarpaletteitem-box[type="spring"] {
+toolbarpaletteitem[type="spring"] toolbarspring {
   border: 1px solid #a3a3a3;
   background: url("chrome://messenger/skin/icons/spring.png") #fff no-repeat;
-  width: 32px;
-  margin-top: 18px;
 }
 
-.toolbarpaletteitem-box[type="spring"][place="toolbar"] {
+toolbarpaletteitem[type="spring"][place="toolbar"] toolbarspring {
   background: #eee;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="toolbar"],
-.toolbarpaletteitem-box[type="spring"][place="toolbar"] {
+toolbarpaletteitem[type="spacer"][place="toolbar"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="toolbar"] toolbarspring {
   margin: 2px;
 }
 
-.toolbarpaletteitem-box[type="separator"][place="palette"] {
+toolbarpaletteitem[type="separator"][place="palette"] toolbarseparator {
   width: 2px;
-  height: 50px;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="palette"],
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
+toolbarpaletteitem[type="spacer"][place="palette"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
   margin-top: 0;
   margin-bottom: 2px;
-  height: 32px;
 }
 
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
   background-position: center;
   margin-left: 8px;
   margin-right: 8px;
 }
 
 /* ::::: toolbarbutton menu-button ::::: */
 
 toolbarbutton[type="menu-button"] {
--- a/mail/themes/windows/mail/messenger.css
+++ b/mail/themes/windows/mail/messenger.css
@@ -176,47 +176,45 @@ toolbar[brighttext] {
 
 menubar > menu[disabled="true"]:-moz-lwtheme {
   color: inherit;
   opacity: .4;
 }
 
 /* ::::: Toolbar customization ::::: */
 
-.toolbarpaletteitem-box[type="spacer"],
-.toolbarpaletteitem-box[type="spring"] {
+toolbarpaletteitem[type="spacer"] toolbarspacer,
+toolbarpaletteitem[type="spring"] toolbarspring {
   border: 1px solid #808080;
   background-color: #fff !important;
 }
 
 toolbarpaletteitem[place="toolbar"] > toolbarspacer {
   width: 11px;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="toolbar"],
-.toolbarpaletteitem-box[type="spring"][place="toolbar"] {
+toolbarpaletteitem[type="spacer"][place="toolbar"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="toolbar"] toolbarspring {
   margin-top: 2px;
   margin-bottom: 2px;
   margin-inline-start: 0;
   margin-inline-end: 2px;
 }
 
-.toolbarpaletteitem-box[type="separator"][place="palette"] {
+toolbarpaletteitem[type="separator"][place="palette"] toolbarseparator {
   width: 2px;
   height: 50px;
 }
 
-.toolbarpaletteitem-box[type="spacer"][place="palette"],
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
+toolbarpaletteitem[type="spacer"][place="palette"] toolbarspacer,
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
   margin-bottom: 2px;
-  width: 50px;
-  height: 50px;
 }
 
-.toolbarpaletteitem-box[type="spring"][place="palette"] {
+toolbarpaletteitem[type="spring"][place="palette"] toolbarspring {
   background: url("chrome://messenger/skin/icons/spring.png") no-repeat center;
 }
 
 /* ::::: toolbarbutton ::::: */
 
 .toolbarbutton-1 {
   -moz-box-orient: vertical;
   -moz-context-properties: fill, fill-opacity;