Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / table-cells-with-colspan.html
blobf44f05b019ce107183115d1a73f1e4e251ea0277
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body id="body">
7 <table id="table1" border="1">
8 <tr>
9 <td colspan="10">data</td>
10 <th scope="colgroup" colspan="5">col head</td>a
11 <td colspan="2">data</td>
12 </tr>
13 </table>
14 <table id="table2" border="1">
15 <tr>
16 <td rowspan="2" colspan="3">data</td>
17 <th scope="colgroup" colspan="2">col head</th>
18 </tr>
19 <tr>
20 <th scope="col">col head</th>
21 <th scope="col">col head</th>
22 </tr>
23 </table>
24 <p id="description"></p>
25 <div id="console"></div>
27 <script>
29 description("Check whether cells with colspan are reported properly");
31 if (window.accessibilityController) {
32 var table1 = accessibilityController.accessibleElementById("table1");
33 shouldBe("table1.columnCount", "3");
35 var cell_0_0 = table1.cellForColumnAndRow(0, 0);
36 shouldBe("cell_0_0.role", "'AXRole: AXCell'");
37 shouldBe("cell_0_0.columnIndexRange()", "'{0, 1}'");
39 var cell_0_1 = table1.cellForColumnAndRow(1, 0);
40 shouldBe("cell_0_1.role", "'AXRole: AXColumnHeader'");
41 shouldBe("cell_0_1.columnIndexRange()", "'{1, 1}'");
43 var cell_0_2 = table1.cellForColumnAndRow(2, 0);
44 shouldBe("cell_0_2.role", "'AXRole: AXCell'");
45 shouldBe("cell_0_2.columnIndexRange()", "'{2, 1}'");
47 var table2 = accessibilityController.accessibleElementById("table2");
48 shouldBe("table2.columnCount", "3");
49 shouldBe("table2.columnHeadersCount", "3");
51 var cell_0_1 = table2.cellForColumnAndRow(1, 0)
52 shouldBe("cell_0_1.columnIndexRange()", "'{1, 2}'");
53 var cell_0_2 = table2.cellForColumnAndRow(2, 0);
54 shouldBe("cell_0_2.columnIndexRange()", "'{1, 2}'");
55 shouldBeTrue("table2.columnHeaderAtIndex(0).isEqual(cell_0_1)")
56 shouldBeTrue("table2.columnHeaderAtIndex(0).isEqual(cell_0_2)");
57 shouldBeTrue("table2.columnHeaderAtIndex(1).isEqual(table2.cellForColumnAndRow(1, 1))")
58 shouldBeTrue("table2.columnHeaderAtIndex(2).isEqual(table2.cellForColumnAndRow(2, 1))");
61 </script>
63 </body>
64 </html>