1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
<html>
<head>
<title>nsIAccessibleSelectable ARIA widgets testing</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</style>
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript"
src="../states.js"></script>
<script type="application/javascript"
src="../selectable.js"></script>
<script type="application/javascript">
function testSelectable(aID, aSelectableChildren) {
var acc = getAccessible(aID, [nsIAccessibleSelectable]);
testSelectableSelection(acc, []);
acc.selectAll();
testSelectableSelection(acc, aSelectableChildren);
acc.unselectAll();
testSelectableSelection(acc, []);
}
function doTest() {
// ////////////////////////////////////////////////////////////////////////
// role="tablist"
let id = "tablist_single";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="tablist" aria-multiselectable
id = "tablist_multi";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
let select = getAccessible(id, [nsIAccessibleSelectable]);
select.addItemToSelection(0);
testSelectableSelection(id, [ "tab_multi1" ]);
select.removeItemFromSelection(0);
testSelectableSelection(id, [ ]);
select.selectAll();
testSelectableSelection(id, [ "tab_multi1", "tab_multi2" ]);
select.unselectAll();
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="listbox"
id = "listbox1";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="listbox" aria-multiselectable
id = "listbox2";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
select = getAccessible(id, [nsIAccessibleSelectable]);
select.addItemToSelection(0);
testSelectableSelection(id, [ "listbox2_item1" ]);
select.removeItemFromSelection(0);
testSelectableSelection(id, [ ]);
select.selectAll();
testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
select.unselectAll();
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="grid"
id = "grid1";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="tree"
id = "tree1";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="treegrid"
id = "treegrid1";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectableSelection(id, [ ]);
// ////////////////////////////////////////////////////////////////////////
// role="grid" aria-multiselectable, selectable children in subtree
id = "grid2";
ok(isAccessible(id, [nsIAccessibleSelectable]),
"No selectable accessible for " + id);
testSelectable(id,
["grid2_colhead1", "grid2_colhead2", "grid2_colhead3",
"grid2_rowhead", "grid2_cell1", "grid2_cell2"]);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=530014"
title="ARIA single selectable widget should implement nsIAccessibleSelectable">
Mozilla Bug 530014
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=566551"
title="ARIA grid and accessible selectable methods shouldn't use GetNextSibling">
Mozilla Bug 566551
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
title="add pseudo SelectAccessible interface">
Mozilla Bug 590176
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=804040"
title="Selection event not fired when selection of ARIA tab changes">
Mozilla Bug 804040
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div role="tablist" id="tablist_single">
<div role="tab">tab1</div>
<div role="tab">tab2</div>
</div>
<div role="tablist" id="tablist_multi" aria-multiselectable="true">
<div role="tab" id="tab_multi1">tab1</div>
<div role="tab" id="tab_multi2">tab2</div>
</div>
<div role="listbox" id="listbox1">
<div role="option">item1</div>
<div role="option">item2</div>
</div>
<div role="listbox" id="listbox2" aria-multiselectable="true">
<div role="option" id="listbox2_item1">item1</div>
<div role="option" id="listbox2_item2">item2</div>
</div>
<div role="grid" id="grid1">
<div role="row">
<span role="gridcell">cell</span>
<span role="gridcell">cell</span>
</div>
<div role="row">
<span role="gridcell">cell</span>
<span role="gridcell">cell</span>
</div>
</div>
<div role="tree" id="tree1">
<div role="treeitem">
item1
<div role="group">
<div role="treeitem">item1.1</div>
</div>
</div>
<div>item2</div>
</div>
<div role="treegrid" id="treegrid1">
<div role="row" aria-level="1">
<span role="gridcell">cell</span>
<span role="gridcell">cell</span>
</div>
<div role="row" aria-level="2">
<span role="gridcell">cell</span>
<span role="gridcell">cell</span>
</div>
<div role="row" aria-level="1">
<span role="gridcell">cell</span>
<span role="gridcell">cell</span>
</div>
</div>
<table tabindex="0" border="2" cellspacing="0" id="grid2" role="grid"
aria-multiselectable="true">
<thead>
<tr>
<th tabindex="-1" role="columnheader" id="grid2_colhead1"
style="width:6em">Entry #</th>
<th tabindex="-1" role="columnheader" id="grid2_colhead2"
style="width:10em">Date</th>
<th tabindex="-1" role="columnheader" id="grid2_colhead3"
style="width:20em">Expense</th>
</tr>
</thead>
<tbody>
<tr>
<td tabindex="-1" role="rowheader" id="grid2_rowhead"
aria-readonly="true">1</td>
<td tabindex="-1" role="gridcell" id="grid2_cell1"
aria-selected="false">03/14/05</td>
<td tabindex="-1" role="gridcell" id="grid2_cell2"
aria-selected="false">Conference Fee</td>
</tr>
</tobdy>
</table>
</body>
</html>
|