Bug 1451406 - Always use type="menu" instead of the type="panel" alias for buttons. r=bgrins
MozReview-Commit-ID: CMFd4J4n6rk
--- 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"] {