1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../resources/js-test.js"></script>
8 <table id=
"table1" border=
"1">
35 <table id=
"table2" border=
"1">
40 <th scope=
"col">col head
</th>
41 <th scope=
"row">row head
</th>
45 <th scope=
"col">col head
</th>
46 <td scope=
"row">data
</td>
52 <th scope=
"col">col head
</th>
56 <table id=
"table3" border=
"1">
58 row header and column header (
1)
77 <table id=
"table4" border=
"1">
79 row header and column header (
2)
98 <table id=
"table5" border=
"1">
103 <th rowspan=
"2" scope=
"rowgroup">row head
</th>
104 <th scope=
"col">col head
</th>
107 <th scope=
"row">row head
</th>
111 <table id=
"table6" border=
"1">
116 <th scope=
"col">col head
</th>
117 <th scope=
"col">col head
</th>
118 <th scope=
"col">col head
</th>
126 <th colspan=
"2" scope=
"colgroup">col head
</th>
135 <div id=
"table7" role=
"grid">
137 <div role=
"columnheader">col head
</div>
138 <div role=
"columnheader">col head
</div>
139 <div role=
"columnheader">col head
</div>
142 <div role=
"rowheader">row head
</div>
143 <div role=
"gridcell">data
</div>
144 <div role=
"rowheader">row head
</div>
147 <div role=
"rowheader">row head
</div>
148 <div role=
"rowheader">row head
</div>
149 <div role=
"columnheader">col head
</div>
152 <p id=
"description"></p>
153 <div id=
"console"></div>
157 description("Check whether column and row headers are reported correctly");
159 if (window
.accessibilityController
) {
160 var table
= accessibilityController
.accessibleElementById("table1");
162 shouldBeTrue("table.rowHeaderAtIndex(0).isEqual(table.cellForColumnAndRow(0, 1))");
163 shouldBeTrue("table.rowHeaderAtIndex(1).isEqual(table.cellForColumnAndRow(0, 2))");
164 shouldBeTrue("table.rowHeaderAtIndex(2).isEqual(table.cellForColumnAndRow(0, 3))");
165 shouldBe("table.rowHeadersCount", "3");
167 shouldBeTrue("table.columnHeaderAtIndex(0).isEqual(table.cellForColumnAndRow(0, 0))");
168 shouldBeTrue("table.columnHeaderAtIndex(1).isEqual(table.cellForColumnAndRow(1, 0))");
169 shouldBeTrue("table.columnHeaderAtIndex(2).isEqual(table.cellForColumnAndRow(2, 0))");
170 shouldBe("table.columnHeadersCount", "3");
172 var table2
= accessibilityController
.accessibleElementById("table2");
174 shouldBeTrue("table2.rowHeaderAtIndex(0).isEqual(table2.cellForColumnAndRow(1, 0))");
175 shouldBeTrue("table2.rowHeaderAtIndex(1).isEqual(table2.cellForColumnAndRow(2, 1))");
176 shouldBeTrue("table2.rowHeaderAtIndex(2).isEqual(table2.cellForColumnAndRow(0, 2))");
177 shouldBe("table2.rowHeadersCount", "3");
179 shouldBeTrue("table2.columnHeaderAtIndex(0).isEqual(table2.cellForColumnAndRow(0, 0))");
180 shouldBeTrue("table2.columnHeaderAtIndex(1).isEqual(table2.cellForColumnAndRow(0, 1))");
181 shouldBeTrue("table2.columnHeaderAtIndex(2).isEqual(table2.cellForColumnAndRow(2, 0))");
182 shouldBeTrue("table2.columnHeaderAtIndex(3).isEqual(table2.cellForColumnAndRow(2, 2))");
183 shouldBe("table2.columnHeadersCount", "4");
185 var table3
= accessibilityController
.accessibleElementById("table3");
187 shouldBeTrue("table3.rowHeaderAtIndex(0).isEqual(table3.cellForColumnAndRow(1, 0))");
188 shouldBeTrue("table3.rowHeaderAtIndex(1).isEqual(table3.cellForColumnAndRow(0, 2))");
189 shouldBeTrue("table3.rowHeaderAtIndex(2).isEqual(table3.cellForColumnAndRow(2, 2))");
190 shouldBe("table3.rowHeadersCount", "3");
192 shouldBeTrue("table3.columnHeaderAtIndex(0).isEqual(table3.cellForColumnAndRow(0, 1))");
193 shouldBeTrue("table3.columnHeaderAtIndex(1).isEqual(table3.cellForColumnAndRow(1, 1))");
194 shouldBeTrue("table3.columnHeaderAtIndex(2).isEqual(table3.cellForColumnAndRow(2, 0))");
195 shouldBe("table3.columnHeadersCount", "3");
197 var table4
= accessibilityController
.accessibleElementById("table4");
199 shouldBeTrue("table4.rowHeaderAtIndex(0).isEqual(table4.cellForColumnAndRow(0, 0))");
200 shouldBe("table4.rowHeadersCount", "1");
202 shouldBeTrue("table4.columnHeaderAtIndex(0).isEqual(table4.cellForColumnAndRow(0, 1))");
203 shouldBeTrue("table4.columnHeaderAtIndex(1).isEqual(table4.cellForColumnAndRow(1, 1))");
204 shouldBeTrue("table4.columnHeaderAtIndex(2).isEqual(table4.cellForColumnAndRow(2, 1))");
205 shouldBe("table4.columnHeadersCount", "3");
207 var table5
= accessibilityController
.accessibleElementById("table5");
209 shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(0, 0))"); // rowspan=2
210 shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(0, 1))"); // rowspan=2
211 shouldBeTrue("table5.rowHeaderAtIndex(1).isEqual(table5.cellForColumnAndRow(1, 1))");
212 shouldBe("table5.rowHeadersCount", "2");
214 shouldBeTrue("table5.columnHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(1, 0))");
215 shouldBe("table5.columnHeadersCount", "1");
217 var table6
= accessibilityController
.accessibleElementById("table6");
219 shouldBeTrue("table6.rowHeaderAtIndex(0).isEqual(table6.cellForColumnAndRow(2, 3))");
220 shouldBe("table6.rowHeadersCount", "1");
222 shouldBeTrue("table6.columnHeaderAtIndex(0).isEqual(table6.cellForColumnAndRow(0, 0))");
223 shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumnAndRow(0, 2))"); // colspan=2
224 shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumnAndRow(1, 2))"); // colspan=2
225 shouldBeTrue("table6.columnHeaderAtIndex(2).isEqual(table6.cellForColumnAndRow(1, 0))");
226 shouldBeTrue("table6.columnHeaderAtIndex(3).isEqual(table6.cellForColumnAndRow(2, 0))");
227 shouldBeTrue("table6.columnHeaderAtIndex(4).isEqual(table6.cellForColumnAndRow(2, 2))");
228 shouldBe("table6.columnHeadersCount", "5");
231 var table7
= accessibilityController
.accessibleElementById("table7");
233 shouldBeTrue("table7.rowHeaderAtIndex(0).isEqual(table7.cellForColumnAndRow(0, 1))");
234 shouldBeTrue("table7.rowHeaderAtIndex(1).isEqual(table7.cellForColumnAndRow(2, 1))");
235 shouldBeTrue("table7.rowHeaderAtIndex(2).isEqual(table7.cellForColumnAndRow(0, 2))");
236 shouldBeTrue("table7.rowHeaderAtIndex(3).isEqual(table7.cellForColumnAndRow(1, 2))");
237 shouldBe("table7.rowHeadersCount", "4");
239 shouldBeTrue("table7.columnHeaderAtIndex(0).isEqual(table7.cellForColumnAndRow(0, 0))");
240 shouldBeTrue("table7.columnHeaderAtIndex(1).isEqual(table7.cellForColumnAndRow(1, 0))");
241 shouldBeTrue("table7.columnHeaderAtIndex(2).isEqual(table7.cellForColumnAndRow(2, 0))");
242 shouldBeTrue("table7.columnHeaderAtIndex(3).isEqual(table7.cellForColumnAndRow(2, 2))");
243 shouldBe("table7.columnHeadersCount", "4");