Bug 1451256 - Remove extends from toolbarpalleteitem. r=dao draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 04 Apr 2018 11:15:18 +0200
changeset 792602 b928280e1209efd6097ecb73b4a8696bc1990b58
parent 792522 cb96c8338b5d1b624e148a1e6bb5d3538691caa5
child 792603 8993df98cdb2d5cdcc7bc65a7cfb7aeceb4cfc5e
push id109159
push userpaolo.mozmail@amadzone.org
push dateTue, 08 May 2018 18:24:52 +0000
reviewersdao
bugs1451256
milestone62.0a1
Bug 1451256 - Remove extends from toolbarpalleteitem. r=dao Right now it uses extends="xul:button" so that the element it wraps doesn't get mouse events. There's a way to do that with CSS, using pointer-events: none on the child. MozReview-Commit-ID: 29QZAoJPFt6
toolkit/content/widgets/toolbar.xml
toolkit/content/xul.css
--- a/toolkit/content/widgets/toolbar.xml
+++ b/toolkit/content/widgets/toolbar.xml
@@ -120,17 +120,17 @@
                      this.getAttribute("customizing") != "true";
             };
           } catch (e) {}
         }
       ]]></constructor>
     </implementation>
   </binding>
 
-  <binding id="toolbarpaletteitem" extends="xul:button">
+  <binding id="toolbarpaletteitem">
     <content>
       <xul:hbox class="toolbarpaletteitem-box" flex="1" xbl:inherits="type,place">
         <children/>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="toolbarpaletteitem-palette" extends="chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem">
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -310,16 +310,21 @@ toolbarpaletteitem {
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem");
 }
 
 toolbarpaletteitem[place="palette"] {
   -moz-box-orient: vertical;
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbarpaletteitem-palette");
 }
 
+.toolbarpaletteitem-box {
+  /* Prevent children from getting events */
+  pointer-events: none;
+}
+
 /********* menu ***********/
 
 menubar > menu {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menu-menubar");
 }
 
 menubar > menu.menu-iconic {
   -moz-binding: url("chrome://global/content/bindings/menu.xml#menu-menubar-iconic");