mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-08 16:03:21 +00:00
Bug 1474108 - Convert listbox accessibility tests to use the "richlistbox" element. r=surkov
This prepares for the removal of the "listbox" element and binding. MozReview-Commit-ID: G1OxRGBphmw --HG-- extra : source : 65d7ca38bd086abe7df0e50e9e5a9ba1d70202c3
This commit is contained in:
parent
abd0ca0a65
commit
ce01b10ab3
@ -146,12 +146,12 @@
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<listbox>
|
||||
<listitem label="listitem1" id="listitem1"/>
|
||||
<listitem label="listitem2" id="listitem2" type="checkbox"/>
|
||||
<listitem label="listitem3" id="listitem3" type="checkbox"/>
|
||||
<listitem label="listitem4" id="listitem4"/>
|
||||
</listbox>
|
||||
<richlistbox>
|
||||
<richlistitem id="listitem1"/>
|
||||
<richlistitem id="listitem2"><label value="listitem2"/></richlistitem>
|
||||
<richlistitem id="listitem3"/>
|
||||
<richlistitem id="listitem4"><label value="listitem4"/></richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<menubar>
|
||||
<menu label="item1" id="menu_item1">
|
||||
|
@ -63,10 +63,10 @@
|
||||
|
||||
<vbox flex="1">
|
||||
<label control="listbox1" value="listbox: "/>
|
||||
<listbox id="listbox1">
|
||||
<listitem label="item1" id="item1"/>
|
||||
<listitem label="item2" id="item2"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox1">
|
||||
<richlistitem id="item1"><label value="item1"/></richlistitem>
|
||||
<richlistitem id="item1"><label value="item2"/></richlistitem>
|
||||
</richlistbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
|
@ -30,16 +30,6 @@
|
||||
// Test focus events.
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new synthFocus("listbox", new focusChecker("lb_item1")));
|
||||
gQueue.push(new synthDownKey("lb_item1", new focusChecker("lb_item2")));
|
||||
gQueue.push(new synthTab("lb_item2", new focusChecker("mslb_item1")));
|
||||
gQueue.push(new synthDownKey("mslb_item1", new focusChecker("mslb_item2"), { shiftKey: true }));
|
||||
gQueue.push(new synthTab("mslb_item2", new focusChecker("emptylistbox")));
|
||||
gQueue.push(new synthFocus("mcolumnlistbox", new focusChecker("mclb_item1")));
|
||||
gQueue.push(new synthDownKey("mclb_item1", new focusChecker("mclb_item2")));
|
||||
gQueue.push(new synthFocus("headerlistbox", new focusChecker("hlb_item1")));
|
||||
gQueue.push(new synthDownKey("hlb_item1", new focusChecker("hlb_item2")));
|
||||
|
||||
gQueue.push(new synthFocus("richlistbox", new focusChecker("rlb_item1")));
|
||||
gQueue.push(new synthDownKey("rlb_item1", new focusChecker("rlb_item2")));
|
||||
gQueue.push(new synthFocus("multiselrichlistbox", new focusChecker("msrlb_item1")));
|
||||
@ -70,9 +60,8 @@ if (!MAC) {
|
||||
|
||||
// no focus events for unfocused list controls when current item is
|
||||
// changed.
|
||||
gQueue.push(new synthFocus("emptylistbox"));
|
||||
gQueue.push(new synthFocus("emptyrichlistbox"));
|
||||
|
||||
gQueue.push(new changeCurrentItem("listbox", "lb_item1"));
|
||||
gQueue.push(new changeCurrentItem("richlistbox", "rlb_item1"));
|
||||
if (!MAC) {
|
||||
gQueue.push(new changeCurrentItem("menulist", WIN ? "ml_marmalade" : "ml_tangerine"));
|
||||
@ -110,48 +99,6 @@ if (!MAC) {
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
<listbox id="listbox" rows="3">
|
||||
<listitem id="lb_item1" label="item1"/>
|
||||
<listitem id="lb_item2" label="item1"/>
|
||||
</listbox>
|
||||
<listbox id="multisellistbox" rows="3" seltype="multiple">
|
||||
<listitem id="mslb_item1" label="item1"/>
|
||||
<listitem id="mslb_item2" label="item1"/>
|
||||
</listbox>
|
||||
<listbox id="emptylistbox" rows="3"/>
|
||||
<listbox id="mcolumnlistbox" rows="3">
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol/>
|
||||
</listcols>
|
||||
<listitem id="mclb_item1">
|
||||
<listcell label="George"/>
|
||||
<listcell label="House Painter"/>
|
||||
</listitem>
|
||||
<listitem id="mclb_item2">
|
||||
<listcell label="Mary Ellen"/>
|
||||
<listcell label="Candle Maker"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
<listbox id="headerlistbox" rows="3">
|
||||
<listhead>
|
||||
<listheader label="Name"/>
|
||||
<listheader label="Occupation"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem id="hlb_item1">
|
||||
<listcell label="George"/>
|
||||
<listcell label="House Painter"/>
|
||||
</listitem>
|
||||
<listitem id="hlb_item2">
|
||||
<listcell label="Mary Ellen"/>
|
||||
<listcell label="Candle Maker"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
|
||||
<richlistbox id="richlistbox">
|
||||
<richlistitem id="rlb_item1">
|
||||
<description>A XUL Description!</description>
|
||||
|
@ -166,9 +166,12 @@
|
||||
gQueue.push(new advanceTab("tabs", 1, "tab3"));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// listbox
|
||||
gQueue.push(new synthClick("lb1_item1",
|
||||
new invokerChecker(EVENT_SELECTION, "lb1_item1")));
|
||||
// single selection listbox, the first item is selected by default
|
||||
|
||||
gQueue.push(new synthClick("lb1_item2",
|
||||
new invokerChecker(EVENT_SELECTION, "lb1_item2")));
|
||||
gQueue.push(new synthUpKey("lb1_item2",
|
||||
new invokerChecker(EVENT_SELECTION, "lb1_item1")));
|
||||
gQueue.push(new synthDownKey("lb1_item1",
|
||||
new invokerChecker(EVENT_SELECTION, "lb1_item2")));
|
||||
|
||||
@ -234,20 +237,20 @@
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
||||
<listbox id="listbox">
|
||||
<listitem id="lb1_item1" label="item1"/>
|
||||
<listitem id="lb1_item2" label="item2"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox">
|
||||
<richlistitem id="lb1_item1"><label value="item1"/></richlistitem>
|
||||
<richlistitem id="lb1_item2"><label value="item2"/></richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<listbox id="listbox2" seltype="multiple">
|
||||
<listitem id="lb2_item1" label="item1"/>
|
||||
<listitem id="lb2_item2" label="item2"/>
|
||||
<listitem id="lb2_item3" label="item3"/>
|
||||
<listitem id="lb2_item4" label="item4"/>
|
||||
<listitem id="lb2_item5" label="item5"/>
|
||||
<listitem id="lb2_item6" label="item6"/>
|
||||
<listitem id="lb2_item7" label="item7"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox2" seltype="multiple">
|
||||
<richlistitem id="lb2_item1"><label value="item1"/></richlistitem>
|
||||
<richlistitem id="lb2_item2"><label value="item2"/></richlistitem>
|
||||
<richlistitem id="lb2_item3"><label value="item3"/></richlistitem>
|
||||
<richlistitem id="lb2_item4"><label value="item4"/></richlistitem>
|
||||
<richlistitem id="lb2_item5"><label value="item5"/></richlistitem>
|
||||
<richlistitem id="lb2_item6"><label value="item6"/></richlistitem>
|
||||
<richlistitem id="lb2_item7"><label value="item7"/></richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
</hbox>
|
||||
</window>
|
||||
|
@ -95,10 +95,10 @@
|
||||
<treechildren id="treechildren"/>
|
||||
</tree>
|
||||
|
||||
<listbox id="listbox">
|
||||
<listitem id="listitem1">item1</listitem>
|
||||
<listitem id="listitem2">item2</listitem>
|
||||
</listbox>
|
||||
<richlistbox id="listbox">
|
||||
<richlistitem id="listitem1"><label value="item1"/></richlistitem>
|
||||
<richlistitem id="listitem2"><label value="item2"/></richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<vbox id="eventdump"/>
|
||||
</vbox>
|
||||
|
@ -276,10 +276,11 @@
|
||||
label="labeled element"/>
|
||||
|
||||
<!-- nsIDOMXULSelectControlItemElement -->
|
||||
<listbox>
|
||||
<listitem id="li_nsIDOMXULSelectControlItemElement"
|
||||
label="select control item"/>
|
||||
</listbox>
|
||||
<richlistbox>
|
||||
<richlistitem id="li_nsIDOMXULSelectControlItemElement">
|
||||
<label value="select control item"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<!-- not nsIDOMXULSelectControlElement -->
|
||||
<box id="box_not_nsIDOMXULSelectControlElement" role="group" label="box"/>
|
||||
@ -359,11 +360,12 @@
|
||||
|
||||
<!-- bug 441991; create name from other menuitem label listitem's own label -->
|
||||
<hbox>
|
||||
<listbox>
|
||||
<listitem id="li_labelledby"
|
||||
label="The moment the event starts"
|
||||
aria-labelledby="menuitem-DISPLAY li_labelledby"/>
|
||||
</listbox>
|
||||
<richlistbox>
|
||||
<richlistitem id="li_labelledby"
|
||||
aria-labelledby="menuitem-DISPLAY li_labelledby">
|
||||
<label value="The moment the event starts"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
<menulist>
|
||||
<menupopup>
|
||||
<menuitem id="menuitem-DISPLAY"
|
||||
|
@ -32,13 +32,14 @@
|
||||
function doTest()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// single selectable listbox
|
||||
// single selectable listbox, the first item is selected by default
|
||||
|
||||
var id = "listbox";
|
||||
ok(isAccessible(id, [nsIAccessibleSelectable]),
|
||||
"No selectable accessible for list of " + id);
|
||||
|
||||
var select = getAccessible(id, [nsIAccessibleSelectable]);
|
||||
select.removeItemFromSelection(0);
|
||||
testSelectableSelection(select, [ ]);
|
||||
|
||||
select.addItemToSelection(1);
|
||||
@ -114,35 +115,27 @@
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
<listbox id="listbox">
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem id="lb1_item1">
|
||||
<listcell label="cell0"/>
|
||||
<listcell label="cell1"/>
|
||||
</listitem>
|
||||
<listitem id="lb1_item2">
|
||||
<listcell label="cell3"/>
|
||||
<listcell label="cell4"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
<richlistbox id="listbox">
|
||||
<richlistitem id="lb1_item1">
|
||||
<label value="cell0"/>
|
||||
<label value="cell1"/>
|
||||
</richlistitem>
|
||||
<richlistitem id="lb1_item2">
|
||||
<label value="cell3"/>
|
||||
<label value="cell4"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<listbox id="listbox2" seltype="multiple">
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem id="lb2_item1">
|
||||
<listcell label="cell0"/>
|
||||
<listcell label="cell1"/>
|
||||
</listitem>
|
||||
<listitem id="lb2_item2">
|
||||
<listcell label="cell3"/>
|
||||
<listcell label="cell4"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
<richlistbox id="listbox2" seltype="multiple">
|
||||
<richlistitem id="lb2_item1">
|
||||
<label value="cell0"/>
|
||||
<label value="cell1"/>
|
||||
</richlistitem>
|
||||
<richlistitem id="lb2_item2">
|
||||
<label value="cell3"/>
|
||||
<label value="cell4"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<vbox id="debug"/>
|
||||
</vbox>
|
||||
|
@ -155,7 +155,7 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
|
||||
"Mixed element cannot be state checked!");
|
||||
|
||||
// selected/selectable
|
||||
if (state & STATE_SELECTED) {
|
||||
if ((state & STATE_SELECTED) && !(aAbsentState & STATE_SELECTABLE)) {
|
||||
isState(state & STATE_SELECTABLE, STATE_SELECTABLE, false,
|
||||
"Selected element must be selectable!");
|
||||
}
|
||||
|
@ -64,9 +64,9 @@
|
||||
testStates("combobox", STATE_FOCUSABLE | STATE_HASPOPUP, 0, STATE_UNAVAILABLE);
|
||||
testStates("combobox-disabled", STATE_UNAVAILABLE | STATE_HASPOPUP, 0, STATE_FOCUSABLE);
|
||||
testStates("listbox", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("listitem", STATE_FOCUSABLE | STATE_SELECTABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("listitem", STATE_FOCUSABLE | STATE_SELECTABLE | STATE_SELECTED, 0, STATE_UNAVAILABLE);
|
||||
testStates("listbox-disabled", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
|
||||
testStates("listitem-disabledlistbox", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
|
||||
testStates("listitem-disabledlistbox", STATE_UNAVAILABLE | STATE_SELECTED, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
|
||||
testStates("menubar", 0, 0, STATE_FOCUSABLE);
|
||||
testStates("menu", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("menu-disabled", STATE_UNAVAILABLE, 0, STATE_FOCUSABLE | STATE_SELECTABLE);
|
||||
@ -135,13 +135,17 @@
|
||||
</menupopup>
|
||||
</menulist>
|
||||
|
||||
<listbox id="listbox">
|
||||
<listitem id="listitem" label="list item"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox">
|
||||
<richlistitem id="listitem">
|
||||
<label value="list item"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<listbox id="listbox-disabled" disabled="true">
|
||||
<listitem id="listitem-disabledlistbox" label="list item"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox-disabled" disabled="true">
|
||||
<richlistitem id="listitem-disabledlistbox">
|
||||
<label value="list item"/>
|
||||
</richlistitem>
|
||||
</richlistbox>
|
||||
|
||||
<toolbox>
|
||||
<menubar id="menubar">
|
||||
|
@ -5,22 +5,18 @@ support-files =
|
||||
[test_css_tables.html]
|
||||
[test_headers_ariagrid.html]
|
||||
[test_headers_ariatable.html]
|
||||
[test_headers_listbox.xul]
|
||||
[test_headers_table.html]
|
||||
[test_headers_tree.xul]
|
||||
[test_indexes_ariagrid.html]
|
||||
[test_indexes_listbox.xul]
|
||||
[test_indexes_table.html]
|
||||
[test_indexes_tree.xul]
|
||||
[test_layoutguess.html]
|
||||
[test_mtable.html]
|
||||
[test_sels_ariagrid.html]
|
||||
[test_sels_listbox.xul]
|
||||
[test_sels_table.html]
|
||||
[test_sels_tree.xul]
|
||||
[test_struct_ariagrid.html]
|
||||
[test_struct_ariatreegrid.html]
|
||||
[test_struct_listbox.xul]
|
||||
[test_struct_table.html]
|
||||
[test_struct_tree.xul]
|
||||
[test_table_1.html]
|
||||
|
@ -1,194 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Table header information cells for XUL listbox">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../table.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function doTest()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// XUL listbox
|
||||
|
||||
var headerInfoMap = [
|
||||
{
|
||||
cell: "lb1_cell0",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header1" ]
|
||||
},
|
||||
{
|
||||
cell: "lb1_cell1",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header2" ]
|
||||
},
|
||||
{
|
||||
cell: "lb1_cell2",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header3" ]
|
||||
},
|
||||
{
|
||||
cell: "lb1_cell3",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header1" ]
|
||||
},
|
||||
{
|
||||
cell: "lb1_cell4",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header2" ]
|
||||
},
|
||||
{
|
||||
cell: "lb1_cell5",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb1_header3" ]
|
||||
},
|
||||
];
|
||||
|
||||
testHeaderCells(headerInfoMap);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// XUL listbox with ARIA
|
||||
|
||||
headerInfoMap = [
|
||||
{
|
||||
cell: "lb2_cell0",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: []
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell1",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: []
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell2",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: []
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell3",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb2_cell0" ]
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell4",
|
||||
rowHeaderCells: [ "lb2_cell3" ],
|
||||
columnHeaderCells: [ "lb2_cell1" ]
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell5",
|
||||
rowHeaderCells: [ "lb2_cell3" ],
|
||||
columnHeaderCells: [ "lb2_cell2" ]
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell6",
|
||||
rowHeaderCells: [],
|
||||
columnHeaderCells: [ "lb2_cell0" ]
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell7",
|
||||
rowHeaderCells: [ "lb2_cell6" ],
|
||||
columnHeaderCells: [ "lb2_cell1" ]
|
||||
},
|
||||
{
|
||||
cell: "lb2_cell8",
|
||||
rowHeaderCells: [ "lb2_cell6" ],
|
||||
columnHeaderCells: [ "lb2_cell2" ]
|
||||
}
|
||||
];
|
||||
|
||||
testHeaderCells(headerInfoMap);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424"
|
||||
title="implement IAccessibleTable2">
|
||||
Mozilla Bug 512424
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<label control="listbox" value="multicolumn listbox with header"/>
|
||||
<listbox id="listbox">
|
||||
<listhead>
|
||||
<listheader id="lb1_header1" label="header1"/>
|
||||
<listheader id="lb1_header2" label="header2"/>
|
||||
<listheader id="lb1_header3" label="header3"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell id="lb1_cell0" label="cell0"/>
|
||||
<listcell id="lb1_cell1" label="cell1"/>
|
||||
<listcell id="lb1_cell2" label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell id="lb1_cell3" label="cell3"/>
|
||||
<listcell id="lb1_cell4" label="cell4"/>
|
||||
<listcell id="lb1_cell5" label="cell5"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell id="lb1_cell6" label="cell6"/>
|
||||
<listcell id="lb1_cell7" label="cell7"/>
|
||||
<listcell id="lb1_cell8" label="cell8"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
|
||||
<label control="listbox2" value="multicolumn listbox with ARIA headers"/>
|
||||
<listbox id="listbox2">
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell role="columnheader" id="lb2_cell0" label="cell0"/>
|
||||
<listcell role="columnheader" id="lb2_cell1" label="cell1"/>
|
||||
<listcell role="columnheader" id="lb2_cell2" label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell role="rowheader" id="lb2_cell3" label="cell3"/>
|
||||
<listcell id="lb2_cell4" label="cell4"/>
|
||||
<listcell id="lb2_cell5" label="cell5"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell role="rowheader" id="lb2_cell6" label="cell6"/>
|
||||
<listcell id="lb2_cell7" label="cell7"/>
|
||||
<listcell id="lb2_cell8" label="cell8"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
@ -1,85 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Table indices of accessible table for XUL listbox">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../table.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function doTest()
|
||||
{
|
||||
var idxes = [
|
||||
[0, 1, 2],
|
||||
[3, 4, 5],
|
||||
[6, 7, 8]
|
||||
];
|
||||
testTableIndexes("listbox", idxes);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424"
|
||||
title="implement IAccessibleTable2">
|
||||
Mozilla Bug 512424
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<label control="listbox" value="multicolumn listbox with header"/>
|
||||
<listbox id="listbox">
|
||||
<listhead>
|
||||
<listheader label="header1"/>
|
||||
<listheader label="header2"/>
|
||||
<listheader label="header3"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell label="cell0"/>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell3"/>
|
||||
<listcell label="cell4"/>
|
||||
<listcell label="cell5"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell6"/>
|
||||
<listcell label="cell7"/>
|
||||
<listcell label="cell8"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
@ -1,247 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="nsIAccessibleTable selection methods on xul:listbox test.">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../table.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function doTest()
|
||||
{
|
||||
var id = "listbox3";
|
||||
var acc = getAccessible(id, [nsIAccessibleTable]);
|
||||
|
||||
var rowCount = acc.rows;
|
||||
var colsCount = acc.columns;
|
||||
|
||||
// columns selection
|
||||
testColumnSelection(id, acc, colsCount, 0, null);
|
||||
acc.selectColumn(0);
|
||||
testColumnSelection(id, acc, colsCount, 0, null);
|
||||
|
||||
// rows selection
|
||||
testRowSelection(id, acc, rowCount, 0, null);
|
||||
acc.selectRow(0);
|
||||
testRowSelection(id, acc, rowCount, 1, [0]);
|
||||
acc.selectRow(1);
|
||||
testRowSelection(id, acc, rowCount, 1, [1]);
|
||||
acc.unselectRow(1);
|
||||
testRowSelection(id, acc, rowCount, 0, null);
|
||||
|
||||
// cells selection
|
||||
testCellSelection(id, acc, rowCount, colsCount, 0, null);
|
||||
acc.selectRow(2);
|
||||
testCellSelection(id, acc, rowCount, colsCount, 3, [6, 7, 8]);
|
||||
acc.unselectRow(2);
|
||||
testCellSelection(id, acc, rowCount, colsCount, 0, null);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to test isColumnSelected(), selectedColumnCount and
|
||||
* getSelectedColumn() methods.
|
||||
*/
|
||||
function testColumnSelection(aId, aAcc, aCount, aSelCount, aSelIndexesArray)
|
||||
{
|
||||
// isColumnSelected
|
||||
for (var col = 0; col < aCount; col++) {
|
||||
if (aSelIndexesArray && aSelIndexesArray.includes(col)) {
|
||||
is(aAcc.isColumnSelected(col), true,
|
||||
aId + ": column " + col + " should be selected");
|
||||
} else {
|
||||
is(aAcc.isColumnSelected(col), false,
|
||||
aId + ": column " + col + " shouldn't be selected");
|
||||
}
|
||||
}
|
||||
|
||||
// selectedColumnCount
|
||||
is(aAcc.selectedColumnCount, aSelCount,
|
||||
aId + ": wrong number of selected columns");
|
||||
|
||||
// getSelectedColumns
|
||||
var selColsCount = {}, selCols = {};
|
||||
aAcc.getSelectedColumnIndices(selColsCount, selCols);
|
||||
|
||||
is(selColsCount.value, aSelCount,
|
||||
aId + ": wrong number of selected columns");
|
||||
|
||||
if (!aSelIndexesArray) {
|
||||
is(selCols.value, undefined,
|
||||
aId + ": no columns should be selected");
|
||||
} else {
|
||||
for (var i = 0; i < selCols.length; i++) {
|
||||
is(selCols[i], aSelIndexesArray[i],
|
||||
aId + ": wrong selected column index " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to test isRowSelected(), selectedRowCount() and
|
||||
* getSelectedRow() methods.
|
||||
*/
|
||||
function testRowSelection(aId, aAcc, aCount, aSelCount, aSelIndexesArray)
|
||||
{
|
||||
// isRowSelected
|
||||
for (var row = 0; row < aCount; row++) {
|
||||
if (aSelIndexesArray && aSelIndexesArray.includes(row)) {
|
||||
is(aAcc.isRowSelected(row), true,
|
||||
aId + ": row " + row + " should be selected");
|
||||
} else {
|
||||
is(aAcc.isRowSelected(row), false,
|
||||
aId + ": row " + row + " shouldn't be selected");
|
||||
}
|
||||
}
|
||||
|
||||
// selectedRowCount
|
||||
is(aAcc.selectedRowCount, aSelCount,
|
||||
aId + ": wrong number of selected rows");
|
||||
|
||||
// getSelectedRows
|
||||
var selColsCount = {}, selCols = {};
|
||||
aAcc.getSelectedRowIndices(selColsCount, selCols);
|
||||
|
||||
is(selColsCount.value, aSelCount,
|
||||
aId + ": wrong number of selected rows");
|
||||
|
||||
if (!aSelIndexesArray) {
|
||||
is(selCols.value, undefined,
|
||||
aId + ": no row should be selected");
|
||||
} else {
|
||||
for (var i = 0; i < selCols.length; i++) {
|
||||
is(selCols[i], aSelIndexesArray[i],
|
||||
aId + ": wrong selected row index " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to test isCellSelected(), selectedCellCount() and
|
||||
* getSelectedCells() methods.
|
||||
*/
|
||||
function testCellSelection(aId, aAcc, aRowCount, aColCount,
|
||||
aSelCount, aSelIndexesArray)
|
||||
{
|
||||
// isCellSelected
|
||||
for (var row = 0; row < aRowCount; row++) {
|
||||
for (var col = 0; col < aColCount; col++) {
|
||||
var index = aAcc.getIndexAt(row, col);
|
||||
if (aSelIndexesArray && aSelIndexesArray.includes(index)) {
|
||||
is(aAcc.isCellSelected(row, col), true,
|
||||
aId + ": cell (" + row + ", " + col + ") should be selected");
|
||||
} else {
|
||||
is(aAcc.isCellSelected(row, col), false,
|
||||
aId + ": cell (" + row + ", " + col + ") shouldn't be selected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// selectedCellCount
|
||||
is(aAcc.selectedCellCount, aSelCount,
|
||||
aId + ": wrong number of selected cells");
|
||||
|
||||
// getSelectedCells
|
||||
var selColsCount = {}, selCols = {};
|
||||
aAcc.getSelectedCellIndices(selColsCount, selCols);
|
||||
|
||||
is(selColsCount.value, aSelCount,
|
||||
aId + ": wrong number of selected cells");
|
||||
|
||||
if (!aSelIndexesArray) {
|
||||
is(selCols.value, undefined,
|
||||
aId + ": no cells should be selected");
|
||||
} else {
|
||||
for (var i = 0; i < selCols.length; i++) {
|
||||
is(selCols[i], aSelIndexesArray[i],
|
||||
aId + ": wrong selected cell index " + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=418371"
|
||||
title="implement the rest of methods of nsIAccessibleTable on xul:listbox">
|
||||
Mozilla Bug 418371
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424"
|
||||
title="implement IAccessibleTable2">
|
||||
Mozilla Bug 512424
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<label control="listbox2" value="multicolumn listbox: "/>
|
||||
<listbox id="listbox2">
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
|
||||
<label control="listbox3" value="multicolumn listbox with header"/>
|
||||
<listbox id="listbox3">
|
||||
<listhead>
|
||||
<listheader label="header1"/>
|
||||
<listheader label="header2"/>
|
||||
<listheader label="header3"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell label="cell0"/>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell3"/>
|
||||
<listcell label="cell4"/>
|
||||
<listcell label="cell5"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell6"/>
|
||||
<listcell label="cell7"/>
|
||||
<listcell label="cell8"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Table accessible tree and table interface tests for XUL listboxes">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../table.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function doTest()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Multicolumn listbox.
|
||||
|
||||
var cellsArray = [
|
||||
[kDataCell, kDataCell],
|
||||
[kDataCell, kDataCell]
|
||||
];
|
||||
|
||||
testTableStruct("listbox1", cellsArray);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Multicolumn listbox with header.
|
||||
|
||||
var cellsArray = [
|
||||
[kDataCell, kDataCell, kDataCell],
|
||||
[kDataCell, kDataCell, kDataCell],
|
||||
[kDataCell, kDataCell, kDataCell]
|
||||
];
|
||||
|
||||
testTableStruct("listbox2", cellsArray, kListboxColumnHeader);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=512424"
|
||||
title="implement IAccessibleTable2">
|
||||
Mozilla Bug 512424
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<label control="listbox1" value="multicolumn listbox: "/>
|
||||
<listbox id="listbox1">
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
|
||||
<label control="listbox2" value="multicolumn listbox with header"/>
|
||||
<listbox id="listbox2">
|
||||
<listhead>
|
||||
<listheader label="header1"/>
|
||||
<listheader label="header2"/>
|
||||
<listheader label="header3"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
<listitem>
|
||||
<listcell label="cell0"/>
|
||||
<listcell label="cell1"/>
|
||||
<listcell label="cell2"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell3"/>
|
||||
<listcell label="cell4"/>
|
||||
<listcell label="cell5"/>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<listcell label="cell6"/>
|
||||
<listcell label="cell7"/>
|
||||
<listcell label="cell8"/>
|
||||
</listitem>
|
||||
</listbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
@ -25,8 +25,10 @@
|
||||
{
|
||||
this.listboxNode = getNode(aListboxID);
|
||||
|
||||
this.listitemNode = document.createElement("listitem");
|
||||
this.listitemNode.setAttribute("label", "item1");
|
||||
this.listitemNode = document.createElement("richlistitem");
|
||||
var label = document.createElement("label");
|
||||
label.setAttribute("value", "item1");
|
||||
this.listitemNode.appendChild(label);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_SHOW, this.listitemNode),
|
||||
@ -168,11 +170,11 @@
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
<listbox id="listbox" rows="2">
|
||||
<listitem label="item2"/>
|
||||
<listitem label="item3"/>
|
||||
<listitem label="item4"/>
|
||||
</listbox>
|
||||
<richlistbox id="listbox">
|
||||
<richlistitem><label value="item2"/></richlistitem>
|
||||
<richlistitem><label value="item3"/></richlistitem>
|
||||
<richlistitem><label value="item4"/></richlistitem>
|
||||
</richlistbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user