diff --git a/accessible/src/xul/XULFormControlAccessible.cpp b/accessible/src/xul/XULFormControlAccessible.cpp
index 140250a64bd..7964499c87b 100644
--- a/accessible/src/xul/XULFormControlAccessible.cpp
+++ b/accessible/src/xul/XULFormControlAccessible.cpp
@@ -167,23 +167,13 @@ XULButtonAccessible::CacheChildren()
{
// In general XUL button has not accessible children. Nevertheless menu
// buttons can have button (@type="menu-button") and popup accessibles
- // (@type="menu-button" or @type="menu").
+ // (@type="menu-button", @type="menu" or columnpicker.
// XXX: no children until the button is menu button. Probably it's not
// totally correct but in general AT wants to have leaf buttons.
- bool isMenu = mContent->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::type,
- nsGkAtoms::menu,
- eCaseMatters);
- bool isMenuButton = isMenu ?
- false :
- mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
- nsGkAtoms::menuButton, eCaseMatters);
-
- NS_ENSURE_TRUE_VOID(mDoc);
- if (!isMenu && !isMenuButton)
- return;
+ bool isMenuButton = mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+ nsGkAtoms::menuButton, eCaseMatters);
Accessible* menupopup = nullptr;
Accessible* button = nullptr;
diff --git a/accessible/tests/mochitest/tree/test_tree.xul b/accessible/tests/mochitest/tree/test_tree.xul
index 001c4ab9f0e..60a1b116bcf 100644
--- a/accessible/tests/mochitest/tree/test_tree.xul
+++ b/accessible/tests/mochitest/tree/test_tree.xul
@@ -76,9 +76,9 @@
var columnCount = treeBoxObject.columns.count;
for (var idx = 0; idx < columnCount; idx++)
- accTreeForColumns.children.push({ role: ROLE_COLUMNHEADER, children: []});
+ accTreeForColumns.children.push({ COLUMNHEADER: [ ] });
if (!aTree.hasAttribute("hidecolumnpicker"))
- accTreeForColumns.children.push({ role: ROLE_PUSHBUTTON, children: []});
+ accTreeForColumns.children.push({ PUSHBUTTON: [ { MENUPOPUP: [] } ] });
for (var idx = 0; idx < view.rowCount; idx++)
accTreeForTree.children.push(getTreeItemAccTree(aRole, columnCount));
diff --git a/accessible/tests/mochitest/treeupdate/test_menubutton.xul b/accessible/tests/mochitest/treeupdate/test_menubutton.xul
index 60d1592b41a..4821a265bdb 100644
--- a/accessible/tests/mochitest/treeupdate/test_menubutton.xul
+++ b/accessible/tests/mochitest/treeupdate/test_menubutton.xul
@@ -8,6 +8,8 @@
+
@@ -22,14 +24,14 @@
////////////////////////////////////////////////////////////////////////////
// Invokers
- function openMenu(aButtonID)
+ function openMenu(aButtonID, aMenuItemRole)
{
- this.buttonNode = getNode(aButtonID);
- this.menupoupNode = this.buttonNode.firstChild;
+ var menuItemRole = aMenuItemRole || ROLE_MENUITEM;
+ this.button = getAccessible(aButtonID);
+ this.menupopup = this.button.firstChild;
- this.eventSeq = [
- new invokerChecker(EVENT_REORDER, this.menupoupNode)
- ];
+ var checker = new invokerChecker(EVENT_REORDER, this.menupopup);
+ this.__proto__ = new synthClick(aButtonID, checker);
this.invoke = function openMenu_invoke()
{
@@ -37,9 +39,9 @@
{ PUSHBUTTON: [
{ MENUPOPUP: [ ] }
] };
- testAccessibleTree(this.buttonNode, tree);
+ testAccessibleTree(this.button, tree);
- this.buttonNode.open = true;
+ this.__proto__.invoke();
}
this.finalCheck = function openMenu_finalCheck()
@@ -47,16 +49,18 @@
var tree =
{ PUSHBUTTON: [
{ MENUPOPUP: [
- { MENUITEM: [ ] },
- { MENUITEM: [ ] }
+ { role: menuItemRole, children: [ ] },
+ { role: menuItemRole, children: [ ] }
] }
] };
- testAccessibleTree(this.buttonNode, tree);
+ testAccessibleTree(this.button, tree);
+
+ synthesizeKey("VK_ESCAPE", { });
}
this.getID = function openMenu_getID()
{
- return "open menu for button " + prettyName(aButtonID);
+ return "open menu of the button " + prettyName(aButtonID);
}
}
@@ -92,6 +96,8 @@
{ PUSHBUTTON: [ ] }
] };
testAccessibleTree(this.buttonNode, tree);
+
+ this.buttonNode.open = false;
}
this.getID = function openMenu_getID()
@@ -116,6 +122,8 @@
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()
}
@@ -129,12 +137,17 @@
- Mozilla Bug 249292
+ Bug 249292
- Mozilla Bug 630486
+ title="Don't force accessible creation for popup children">
+ Bug 630486
+
+
+ Bug 722265