Bug 1430028 - Part 1 - Always use type="menu" instead of the type="panel" alias. r=enn draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Tue, 06 Mar 2018 14:47:37 +0000
changeset 769452 a71e1ecaa122dea65eefe174f1bd8ff16e4aa682
parent 769422 081c6bcea0b8530febf0ea18ad7930d8440e330c
child 769453 31288a225fe7eeb19d6bd23e8b3c9c381803ce64
push id103126
push userpaolo.mozmail@amadzone.org
push dateMon, 19 Mar 2018 16:20:34 +0000
reviewersenn
bugs1430028
milestone61.0a1
Bug 1430028 - Part 1 - Always use type="menu" instead of the type="panel" alias. r=enn MozReview-Commit-ID: LcrG9J2OWSh
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"] {