Bug 722265 - Column header selection popup no longer exposed to accessibility APIs, r=tbsaunde

This commit is contained in:
Alexander Surkov 2013-06-21 09:01:57 +09:00
parent 4c8d4c188d
commit b1a994b7bc
3 changed files with 45 additions and 34 deletions

View File

@ -167,24 +167,14 @@ 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,
bool isMenuButton = mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
nsGkAtoms::menuButton, eCaseMatters);
NS_ENSURE_TRUE_VOID(mDoc);
if (!isMenu && !isMenuButton)
return;
Accessible* menupopup = nullptr;
Accessible* button = nullptr;

View File

@ -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));

View File

@ -8,6 +8,8 @@
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
<script type="application/javascript"
src="../common.js" />
@ -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 @@
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=249292"
title="Ensure accessible children for toolbarbutton types 'menu' and 'menu-button'">
Mozilla Bug 249292
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
title="Don't force accessible creation for popup children">
Bug 630486
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=722265"
title="Column header selection popup no longer exposed to accessibility APIs">
Bug 722265
</a>
<br/>
<p id="display"></p>
@ -145,31 +158,39 @@
</body>
<vbox flex="1">
<button id="button1" type="menu" label="hello">
<button id="button1" type="menu" label="button">
<menupopup>
<menuitem label="menuitem"/>
<menuitem label="menuitem"/>
</menupopup>
</button>
<button id="button2" type="menu-button" label="hello">
<button id="button2" type="menu-button" label="menu button">
<menupopup>
<menuitem label="menuitem"/>
<menuitem label="menuitem"/>
</menupopup>
</button>
<toolbarbutton id="button3" type="menu" label="hello">
<toolbarbutton id="button3" type="menu" label="toolbarbutton">
<menupopup>
<menuitem label="menuitem"/>
<menuitem label="menuitem"/>
</menupopup>
</toolbarbutton>
<toolbarbutton id="button4" type="menu-button" label="hello">
<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>
</vbox>
</hbox>