Bug 1451406 - Always use type="menu" instead of the type="panel" alias for buttons. r=bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Wed, 04 Apr 2018 18:06:42 +0100
changeset 777356 77bdbca1582f26d109e8d10fc2d658fcda802cf7
parent 777348 bd1c3d575c5380831412d314b61f88d366b9d135
push id105177
push userpaolo.mozmail@amadzone.org
push dateWed, 04 Apr 2018 17:08:19 +0000
reviewersbgrins
bugs1451406
milestone61.0a1
Bug 1451406 - Always use type="menu" instead of the type="panel" alias for buttons. r=bgrins MozReview-Commit-ID: CMFd4J4n6rk
toolkit/content/tests/chrome/test_button.xul
toolkit/content/tests/chrome/test_panelfrommenu.xul
toolkit/content/xul.css
--- a/toolkit/content/tests/chrome/test_button.xul
+++ b/toolkit/content/tests/chrome/test_button.xul
@@ -13,18 +13,17 @@
 
 <button id="one" label="One" />
 <button id="two" label="Two"/>
 <hbox>
   <button id="three" label="Three" open="true"/>
 </hbox>
 <hbox>
   <button id="four" type="menu" label="Four"/>
-  <button id="five" type="panel" label="Five"/>
-  <button id="six" label="Six"/>
+  <button id="five" label="Five"/>
 </hbox>
 
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
 
 <script type="application/javascript">
 <![CDATA[
 
@@ -43,19 +42,16 @@ function test_button()
     $("one").focus();
     synthesizeKey("KEY_ArrowDown");
     is(document.activeElement, $("three"), "key cursor down on button");
 
     synthesizeKey("KEY_ArrowRight");
     is(document.activeElement, $("four"), "key cursor right on button");
     synthesizeKey("KEY_ArrowDown");
     is(document.activeElement, $("four"), "key cursor down on menu button");
-    $("five").focus();
-    synthesizeKey("KEY_ArrowDown");
-    is(document.activeElement, $("five"), "key cursor down on panel button");
 
     $("three").focus();
     synthesizeKey("KEY_ArrowUp");
     is(document.activeElement, $("one"), "key cursor up on button");
   }
 
   $("two").focus();
   ok(document.activeElement != $("two"), "focus disabled button");
--- a/toolkit/content/tests/chrome/test_panelfrommenu.xul
+++ b/toolkit/content/tests/chrome/test_panelfrommenu.xul
@@ -31,24 +31,24 @@
 
 <panel id="hiddenpanel" hidden="true"/>
 
 <panel id="panel" onpopupshown="panelOpened()"
                   onpopuphidden="$('button').focus(); $('button').open = true">
   <textbox/>
 </panel>
 
-<button id="button" type="panel" label="Button">
+<button id="button" type="menu" label="Button">
   <panel onpopupshown="panelOnButtonOpened(this)"
          onpopuphidden="$('tbutton').open = true;">
     <button label="OK" oncommand="this.parentNode.parentNode.open = false"/>
   </panel>
 </button>
 
-<toolbarbutton id="tbutton" type="panel" label="Toolbarbutton">
+<toolbarbutton id="tbutton" type="menu" label="Toolbarbutton">
   <panel onpopupshown="panelOnToolbarbuttonOpened(this)"
          onpopuphidden="SimpleTest.finish()">
     <textbox/>
   </panel>
 </toolbarbutton>
 
 <script class="testbody" type="application/javascript">
 <![CDATA[
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -105,17 +105,17 @@ vbox {
 button {
   -moz-binding: url("chrome://global/content/bindings/button.xml#button");
 }
 
 button[type="repeat"] {
   -moz-binding: url("chrome://global/content/bindings/button.xml#button-repeat");
 }
 
-button[type="menu"], button[type="panel"] {
+button[type="menu"] {
   -moz-binding: url("chrome://global/content/bindings/button.xml#menu");
 }
 
 button[type="menu-button"] {
   -moz-binding: url("chrome://global/content/bindings/button.xml#menu-button");
 }
 
 /********** toolbarbutton **********/
@@ -129,23 +129,21 @@ toolbarbutton.badged-button {
   -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged");
 }
 
 .toolbarbutton-badge:not([value]),
 .toolbarbutton-badge[value=""] {
   display: none;
 }
 
-toolbarbutton[type="menu"],
-toolbarbutton[type="panel"] {
+toolbarbutton[type="menu"] {
   -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#menu");
 }
 
-toolbarbutton.badged-button[type="menu"],
-toolbarbutton.badged-button[type="panel"] {
+toolbarbutton.badged-button[type="menu"] {
   -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged-menu");
 }
 
 toolbar[mode="icons"] .toolbarbutton-text,
 toolbar[mode="icons"] .toolbarbutton-multiline-text,
 toolbar[mode="text"] .toolbarbutton-icon,
 .toolbarbutton-multiline-text:not([wrap="true"]),
 .toolbarbutton-text[wrap="true"] {