Bug 1434860 - Part 2 - Remove support for menu-button toolbar buttons. r=enn
MozReview-Commit-ID: MTLaIPzg7a
--- a/accessible/tests/mochitest/tree/test_button.xul
+++ b/accessible/tests/mochitest/tree/test_button.xul
@@ -48,17 +48,17 @@
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
- title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
+ title="Ensure accessible children for toolbarbutton types 'menu'">
Mozilla Bug 249292
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
--- a/accessible/tests/mochitest/tree/test_combobox.xul
+++ b/accessible/tests/mochitest/tree/test_combobox.xul
@@ -167,17 +167,17 @@
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
- title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
+ title="Ensure accessible children for toolbarbutton types 'menu'">
Mozilla Bug 249292
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=626660"
title="Cache rendered text on a11y side">
Mozilla Bug 626660
</a><br/>
<p id="display"></p>
--- a/accessible/tests/mochitest/treeupdate/test_colorpicker.xul
+++ b/accessible/tests/mochitest/treeupdate/test_colorpicker.xul
@@ -120,17 +120,17 @@
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
- title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
+ title="Ensure accessible children for toolbarbutton types 'menu'">
Mozilla Bug 249292
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486"
title="Don't force accessible creation for popup children.">
Mozilla Bug 630486
</a>
<br/>
--- a/accessible/tests/mochitest/treeupdate/test_menu.xul
+++ b/accessible/tests/mochitest/treeupdate/test_menu.xul
@@ -91,17 +91,17 @@
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
- title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
+ title="Ensure accessible children for toolbarbutton types 'menu'">
Mozilla Bug 249292
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486"
title="Don't force accessible creation for popup children.">
Mozilla Bug 630486
</a>
<br/>
--- a/accessible/tests/mochitest/treeupdate/test_menubutton.xul
+++ b/accessible/tests/mochitest/treeupdate/test_menubutton.xul
@@ -59,89 +59,45 @@
}
this.getID = function openMenu_getID()
{
return "open menu of the button " + prettyName(aButtonID);
}
}
- function openMenuButton(aButtonID)
- {
- this.buttonNode = getNode(aButtonID);
- this.menupoupNode = this.buttonNode.firstChild;
-
- this.eventSeq = [
- new invokerChecker(EVENT_REORDER, this.menupoupNode)
- ];
-
- this.invoke = function openMenu_invoke()
- {
- var tree =
- { PUSHBUTTON: [
- { MENUPOPUP: [ ] },
- { PUSHBUTTON: [ ] }
- ] };
- testAccessibleTree(this.buttonNode, tree);
-
- this.buttonNode.open = true;
- }
-
- this.finalCheck = function openMenu_finalCheck()
- {
- var tree =
- { PUSHBUTTON: [
- { MENUPOPUP: [
- { MENUITEM: [ ] },
- { MENUITEM: [ ] }
- ] },
- { PUSHBUTTON: [ ] }
- ] };
- testAccessibleTree(this.buttonNode, tree);
-
- this.buttonNode.open = false;
- }
-
- this.getID = function openMenu_getID()
- {
- return "open menu for menu button " + prettyName(aButtonID);
- }
- }
-
////////////////////////////////////////////////////////////////////////////
// Do test
gA11yEventDumpToConsole = true; // debug stuff
var gQueue = null;
function doTest()
{
gQueue = new eventQueue();
gQueue.push(new openMenu("button1"));
- gQueue.push(new openMenuButton("button2"));
gQueue.push(new openMenu("button3"));
- gQueue.push(new openMenuButton("button4"));
var columnPickerBtn = getAccessible("tree").firstChild.lastChild;
gQueue.push(new openMenu(columnPickerBtn, ROLE_CHECK_MENU_ITEM));
gQueue.invoke(); // SimpleTest.finish()
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
- title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
+ title="Ensure accessible children for toolbarbutton types 'menu'">
Bug 249292
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=630486"
title="Don't force accessible creation for popup children">
Bug 630486
</a>
<a target="_blank"
@@ -159,35 +115,23 @@
<vbox flex="1">
<button id="button1" type="menu" label="button">
<menupopup>
<menuitem label="menuitem"/>
<menuitem label="menuitem"/>
</menupopup>
</button>
- <button id="button2" type="menu-button" label="menu button">
- <menupopup>
- <menuitem label="menuitem"/>
- <menuitem label="menuitem"/>
- </menupopup>
- </button>
<toolbarbutton id="button3" type="menu" label="toolbarbutton">
<menupopup>
<menuitem label="menuitem"/>
<menuitem label="menuitem"/>
</menupopup>
</toolbarbutton>
- <toolbarbutton id="button4" type="menu-button" label="menu toolbarbutton">
- <menupopup>
- <menuitem label="menuitem"/>
- <menuitem label="menuitem"/>
- </menupopup>
- </toolbarbutton>
<tree id="tree" flex="1">
<treecols>
<treecol id="col" flex="1" primary="true" label="column"/>
<treecol id="col2" flex="1" label="another column"/>
</treecols>
<treechildren/>
</tree>
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -960,18 +960,17 @@ var PlacesMenuDNDHandler = {
/**
* Determines if a XUL element represents a static container.
* @returns true if the element is a container element (menu or
*` menu-toolbarbutton), false otherwise.
*/
_isStaticContainer: function PMDH__isContainer(node) {
let isMenu = node.localName == "menu" ||
(node.localName == "toolbarbutton" &&
- (node.getAttribute("type") == "menu" ||
- node.getAttribute("type") == "menu-button"));
+ node.getAttribute("type") == "menu");
let isStatic = !("_placesNode" in node) && node.lastChild &&
node.lastChild.hasAttribute("placespopup") &&
!node.parentNode.hasAttribute("placespopup");
return isMenu && isStatic;
},
/**
* Called when the user drags over the <menu> element.
--- a/browser/themes/shared/bookmarked-notification.inc.css
+++ b/browser/themes/shared/bookmarked-notification.inc.css
@@ -50,19 +50,15 @@
}
@media (min-resolution: 2dppx) {
#bookmarked-notification-anchor[notification="finish"] > #bookmarked-notification {
background-image: url("chrome://browser/skin/places/bookmarks-notification-finish@2x.png");
}
}
-#bookmarks-menu-button[notification="finish"] > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
- fill: transparent;
-}
-
#bookmarked-notification-dropmarker-anchor[notification="finish"] > #bookmarked-notification-dropmarker-icon {
visibility: visible;
animation: animation-bookmarkPulse 300ms;
animation-delay: 600ms;
animation-timing-function: ease-out;
}
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -1149,19 +1149,17 @@ menuitem.panel-subview-footer@menuStateA
#PanelUI-recentlyClosedTabs > toolbarbutton > .toolbarbutton-icon,
#PanelUI-historyItems > toolbarbutton > .toolbarbutton-icon {
width: 16px;
height: 16px;
}
toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menu-dropmarker,
#bookmarks-menu-button[cui-areatype="menu-panel"] > .toolbarbutton-menu-dropmarker,
-#bookmarks-menu-button[overflowedItem] > .toolbarbutton-menu-dropmarker,
-toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
-#bookmarks-menu-button[cui-areatype="menu-panel"] > .toolbarbutton-menubutton-dropmarker {
+#bookmarks-menu-button[overflowedItem] > .toolbarbutton-menu-dropmarker {
display: none;
}
#search-container[cui-areatype="menu-panel"] {
padding-top: 6px;
padding-bottom: 6px;
}
--- a/toolkit/content/tests/chrome/test_bug557987.xul
+++ b/toolkit/content/tests/chrome/test_bug557987.xul
@@ -4,34 +4,34 @@
<!--
XUL Widget Test for bug 557987
-->
<window title="Bug 557987" width="400" height="400"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <toolbarbutton id="button" type="menu-button" label="Test bug 557987"
- onclick="eventReceived('click');"
- oncommand="eventReceived('command');">
+ <toolbarbutton id="button" type="menu" label="Test bug 557987"
+ onclick="eventReceived('click');">
<menupopup onpopupshowing="eventReceived('popupshowing'); return false;" />
</toolbarbutton>
<menulist id="menulist" editable="true" value="Test bug 557987"
onfocus="eventReceived('focus')" />
<!-- 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[
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(test);
-// Tests that mouse events are correctly dispatched to <toolbarbutton type="menu-button"/>
+// Tests that mouse events are correctly dispatched to <toolbarbutton type="menu"/>
+// This used to test menu buttons, and was updated when this button type was removed.
function test() {
disableNonTestMouseEvents(true);
let button = $("button");
let rightEdge = button.getBoundingClientRect().width - 2;
let centerX = button.getBoundingClientRect().width / 2;
let centerY = button.getBoundingClientRect().height / 2;
@@ -47,26 +47,24 @@ function test() {
synthesizeMouse(document.getElementsByTagName("body")[0], 0, 0, {}, window);
disableNonTestMouseEvents(false);
SimpleTest.executeSoon(finishTest);
}
function finishTest() {
- is(eventCount.command, 1, "Correct number of command events received");
is(eventCount.popupshowing, 1, "Correct number of popupshowing events received");
is(eventCount.click, 2, "Correct number of click events received");
is(eventCount.focus, 1, "Correct number of focus events received");
SimpleTest.finish();
}
let eventCount = {
- command: 0,
popupshowing: 0,
click: 0,
focus: 0
};
function eventReceived(eventName) {
eventCount[eventName]++;
}
--- a/toolkit/content/tests/chrome/test_menu_anchored.xul
+++ b/toolkit/content/tests/chrome/test_menu_anchored.xul
@@ -9,31 +9,31 @@
onload="setTimeout(runTest, 0,'tb1');"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="xul_selectcontrol.js"/>
<hbox>
-<toolbarbutton id="tb1" type="menu-button" label="Open" anchor="dropmarker">
+<toolbarbutton id="tb1" type="menu" label="Open" anchor="dropmarker">
<menupopup id="popup1"
onpopupshown="checkPopup(this, document.getAnonymousElementByAttribute(this.parentNode, 'anonid', 'dropmarker'))"
onpopuphidden="runTest('tb2')">
<menuitem label="Item"/>
</menupopup>
</toolbarbutton>
-<toolbarbutton id="tb2" type="menu-button" label="Open" anchor="someanchor">
+<toolbarbutton id="tb2" type="menu" label="Open" anchor="someanchor">
<menupopup id="popup2" onpopupshown="checkPopup(this, $('someanchor'))" onpopuphidden="runTest('tb3')">
<menuitem label="Item"/>
</menupopup>
</toolbarbutton>
-<toolbarbutton id="tb3" type="menu-button" label="Open" anchor="noexist">
+<toolbarbutton id="tb3" type="menu" label="Open" anchor="noexist">
<menupopup id="popup3" onpopupshown="checkPopup(this, this.parentNode)" onpopuphidden="SimpleTest.finish()">
<menuitem label="Item"/>
</menupopup>
</toolbarbutton>
</hbox>
<hbox pack="end" width="180">
--- a/toolkit/content/widgets/toolbarbutton.xml
+++ b/toolkit/content/widgets/toolbarbutton.xml
@@ -35,33 +35,16 @@
xbl:inherits="value=label,accesskey,crop,dragover-top,wrap"/>
<xul:label class="toolbarbutton-multiline-text" flex="1"
xbl:inherits="xbl:text=label,accesskey,wrap"/>
<xul:dropmarker anonid="dropmarker" type="menu"
class="toolbarbutton-menu-dropmarker" xbl:inherits="disabled,label"/>
</content>
</binding>
- <binding id="menu-button" display="xul:menu"
- extends="chrome://global/content/bindings/button.xml#menu-button-base">
- <resources>
- <stylesheet src="chrome://global/skin/toolbarbutton.css"/>
- </resources>
-
- <content>
- <children includes="observes|template|menupopup|panel|tooltip"/>
- <xul:toolbarbutton class="box-inherit toolbarbutton-menubutton-button"
- anonid="button" flex="1" allowevents="true"
- xbl:inherits="disabled,crop,image,label,accesskey,command,wrap,badge,
- align,dir,pack,orient,tooltiptext=buttontooltiptext"/>
- <xul:dropmarker type="menu-button" class="toolbarbutton-menubutton-dropmarker"
- anonid="dropmarker" xbl:inherits="align,dir,pack,orient,disabled,label,open,consumeanchor"/>
- </content>
- </binding>
-
<binding id="toolbarbutton-badged"
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
<content>
<children includes="observes|template|menupopup|panel|tooltip"/>
<xul:stack class="toolbarbutton-badge-stack">
<children/>
<xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label,consumeanchor"/>
<xul:label class="toolbarbutton-badge" xbl:inherits="value=badge,style=badgeStyle" top="0" end="0" crop="none"/>
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -139,20 +139,16 @@ toolbarbutton[type="panel"] {
-moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#menu");
}
toolbarbutton.badged-button[type="menu"],
toolbarbutton.badged-button[type="panel"] {
-moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged-menu");
}
-toolbarbutton[type="menu-button"] {
- -moz-binding: url("chrome://global/content/bindings/toolbarbutton.xml#menu-button");
-}
-
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"] {
display: none;
-moz-binding: none;
}
--- a/toolkit/themes/linux/global/toolbarbutton.css
+++ b/toolkit/themes/linux/global/toolbarbutton.css
@@ -74,40 +74,16 @@ toolbarbutton:-moz-lwtheme:not(:hover):n
padding: 0;
margin: 0;
}
.toolbarbutton-menu-dropmarker[disabled="true"] {
padding: 0 !important;
}
-/* ::::: toolbarbutton menu-button ::::: */
-
-toolbarbutton[type="menu-button"] {
- -moz-box-align: stretch;
- -moz-appearance: dualbutton;
- -moz-box-orient: horizontal !important;
-}
-
-toolbarbutton[type="menu-button"],
-toolbarbutton[type="menu-button"]:hover,
-toolbarbutton[type="menu-button"]:hover:active,
-toolbarbutton[type="menu-button"][open="true"],
-toolbarbutton[type="menu-button"][disabled="true"],
-toolbarbutton[type="menu-button"][disabled="true"]:hover,
-toolbarbutton[type="menu-button"][disabled="true"]:hover:active {
- padding: 0 !important;
-}
-
-.toolbarbutton-menubutton-button {
- -moz-box-align: center;
- -moz-box-pack: center;
- -moz-box-orient: vertical;
-}
-
/* ::::: toolbarbutton badged ::::: */
.toolbarbutton-badge-stack > .toolbarbutton-icon[label]:not([label=""]) {
margin-inline-end: 0;
}
.toolbarbutton-badge {
background-color: #d90000;
font-size: 10px;
@@ -121,17 +97,8 @@ toolbarbutton[type="menu-button"][disabl
margin: -6px 0 0 !important;
margin-inline-end: -8px !important;
min-width: 14px;
max-width: 28px;
line-height: 10px;
text-align: center;
-moz-stack-sizing: ignore;
}
-
-/* .......... dropmarker .......... */
-
-.toolbarbutton-menubutton-dropmarker {
- margin: 0 3px;
- -moz-appearance: toolbarbutton-dropdown !important;
- list-style-image: none;
- -moz-image-region: auto;
-}
--- a/toolkit/themes/osx/global/toolbarbutton.css
+++ b/toolkit/themes/osx/global/toolbarbutton.css
@@ -39,40 +39,16 @@ toolbarbutton[disabled="true"][open="tru
}
.toolbarbutton-menu-dropmarker[disabled="true"] {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.png");
padding: 0;
padding-inline-start: 2px;
}
-/* ::::: toolbarbutton menu-button ::::: */
-
-toolbarbutton[type="menu-button"] {
- -moz-box-align: stretch;
- -moz-box-orient: horizontal !important;
-}
-
-toolbarbutton[type="menu-button"],
-toolbarbutton[type="menu-button"]:hover,
-toolbarbutton[type="menu-button"]:hover:active,
-toolbarbutton[type="menu-button"][open="true"],
-toolbarbutton[type="menu-button"][disabled="true"],
-toolbarbutton[type="menu-button"][disabled="true"]:hover,
-toolbarbutton[type="menu-button"][disabled="true"]:hover:active {
- background-color: transparent;
-}
-
-.toolbarbutton-menubutton-button {
- -moz-box-align: center;
- -moz-box-pack: center;
- -moz-box-orient: vertical;
- text-shadow: inherit;
-}
-
/* ::::: toolbarbutton badged ::::: */
.toolbarbutton-badge {
background-color: #d90000;
font-size: 9px;
padding: 1px 2px;
color: #fff;
text-shadow: none;
@@ -94,26 +70,11 @@ toolbarbutton[type="menu-button"][disabl
box-shadow: none;
color: rgb(192,192,192);
}
toolbar[mode="icons"] > *|* > .toolbarbutton-badge {
margin-inline-end: -10px !important;
}
-/* .......... dropmarker .......... */
-
-.toolbarbutton-menubutton-dropmarker {
- -moz-appearance: none;
- border: none;
- background-color: transparent !important;
- list-style-image: url("chrome://global/skin/arrow/arrow-dn.png");
- width: auto;
- padding: 0 5px;
-}
-
-.toolbarbutton-menubutton-dropmarker[disabled="true"] {
- list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.png");
-}
-
toolbarbutton.tabbable {
-moz-user-focus: normal !important;
}
--- a/toolkit/themes/windows/global/toolbarbutton.css
+++ b/toolkit/themes/windows/global/toolbarbutton.css
@@ -93,39 +93,16 @@ toolbarbutton[checked="true"]:not([disab
.toolbarbutton-menu-dropmarker {
-moz-appearance: none !important;
padding: 0;
width: auto;
height: auto;
margin-top: 1px;
}
-/* ::::: toolbarbutton menu-button ::::: */
-
-toolbarbutton[type="menu-button"] {
- -moz-box-align: stretch;
- -moz-box-orient: horizontal !important;
-}
-
-toolbarbutton[type="menu-button"],
-toolbarbutton[type="menu-button"]:hover,
-toolbarbutton[type="menu-button"]:hover:active,
-toolbarbutton[type="menu-button"][open="true"],
-toolbarbutton[type="menu-button"][disabled="true"],
-toolbarbutton[type="menu-button"][disabled="true"]:hover,
-toolbarbutton[type="menu-button"][disabled="true"]:hover:active {
- padding: 0 !important;
-}
-
-.toolbarbutton-menubutton-button {
- -moz-box-align: center;
- -moz-box-pack: center;
- -moz-box-orient: vertical;
-}
-
/* ::::: toolbarbutton badged ::::: */
.toolbarbutton-badge-stack > .toolbarbutton-icon[label]:not([label=""]) {
margin-inline-end: 0;
}
.toolbarbutton-badge {
background-color: #d90000;
@@ -141,16 +118,8 @@ toolbarbutton[type="menu-button"][disabl
margin: -6px 0 0 !important;
margin-inline-end: -8px !important;
min-width: 14px;
max-width: 28px;
line-height: 10px;
text-align: center;
-moz-stack-sizing: ignore;
}
-
-/* .......... dropmarker .......... */
-
-.toolbarbutton-menubutton-dropmarker {
- -moz-appearance: none;
- padding: 3px 7px;
- width: auto;
-}