Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: LayoutTests/accessibility/table-headers.html

Issue 862543003: Table headers are not retrieved properly by Accessibility API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minor fixes, correct comment and very small refactoring Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/accessibility/table-headers-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body id="body"> 6 <body id="body">
7 7
8 <table id="table1"> 8 <table id="table1" border="1">
9 <thead> 9 <thead>
10 <tr> 10 <tr>
11 <th>No</th> 11 <th>No</th>
12 <th>Month</th> 12 <th>Month</th>
13 <th>Expenses</th> 13 <th>Expenses</th>
14 </tr> 14 </tr>
15 </thead> 15 </thead>
16 <tbody> 16 <tbody>
17 <tr> 17 <tr>
18 <th>1</th> 18 <th>1</th>
19 <td>Jan</td> 19 <td>Jan</td>
20 <td>100</td> 20 <td>100</td>
21 </tr> 21 </tr>
22 <tr> 22 <tr>
23 <th>2</th> 23 <th>2</th>
24 <td>Feb</td> 24 <td>Feb</td>
25 <td>150</td> 25 <td>150</td>
26 </tr> 26 </tr>
27 <tr> 27 <tr>
28 <th>3</th> 28 <th>3</th>
29 <td>Mar</td> 29 <td>Mar</td>
30 <td>200</td> 30 <td>200</td>
31 </tr> 31 </tr>
32 </tbody> 32 </tbody>
33 </table> 33 </table>
34 34
35 <table id="table2" border="1">
36 <caption>
37 scope test
38 </caption>
39 <tr>
40 <th scope="col">col head</th>
41 <th scope="row">row head</th>
42 <th>col head</th>
43 </tr>
44 <tr>
45 <th scope="col">col head</th>
46 <td scope="row">data</td>
47 <th>row head</th>
48 </tr>
49 <tr>
50 <th>row head</th>
51 <td>data</td>
52 <th scope="col">col head</th>
53 </tr>
54 </table>
55
56 <table id="table3" border="1">
57 <caption>
58 row header and column header (1)
59 </caption>
60 <tr>
61 <td>data</td>
62 <th>row head</th>
63 <th>column head</th>
64 </tr>
65 <tr>
66 <th>column head</th>
67 <th>column head</th>
68 <td>data</td>
69 </tr>
70 <tr>
71 <th>row head</th>
72 <td>data</td>
73 <th>row head</th>
74 </tr>
75 </table>
76
77 <table id="table4" border="1">
78 <caption>
79 row header and column header (2)
80 </caption>
81 <tr>
82 <th>row head</th>
83 <td>data</td>
84 <td>data</td>
85 </tr>
86 <tr>
87 <th>column head</th>
88 <th>column head</th>
89 <th>column head</th>
90 </tr>
91 <tr>
92 <td>data</td>
93 <td>data</td>
94 <td>data</td>
95 </tr>
96 </table>
97
98 <table id="table5" border="1">
99 <caption>
100 scope and rowspan
101 </caption>
102 <tr>
103 <th rowspan="2" scope="rowgroup">row head</th>
104 <th scope="col">col head</th>
105 </tr>
106 <tr>
107 <th scope="row">row head</th>
108 </tr>
109 </table>
110
111 <table id="table6" border="1">
112 <caption>
113 scope and colspan
114 </caption>
115 <tr>
116 <th scope="col">col head</th>
117 <th scope="col">col head</th>
118 <th scope="col">col head</th>
119 </tr>
120 <tr>
121 <td>data</td>
122 <td>data</td>
123 <td>data</td>
124 </tr>
125 <tr>
126 <th colspan="2" scope="colgroup">col head</th>
127 <th>col head</th>
128 </tr>
129 <tr>
130 <td>data</td>
131 <td>data</td>
132 <th>row head</td>
133 </tr>
134 </table>
135
35 <p id="description"></p> 136 <p id="description"></p>
36 <div id="console"></div> 137 <div id="console"></div>
37 138
38 <script> 139 <script>
39 140
40 description("Check whether column and row headers are reported correctly"); 141 description("Check whether column and row headers are reported correctly");
41 142
42 if (window.accessibilityController) { 143 if (window.accessibilityController) {
43 var table = accessibilityController.accessibleElementById("table1"); 144 var table = accessibilityController.accessibleElementById("table1");
44 // Row headers 145 // Row headers
45 shouldBeTrue("table.rowHeaderAtIndex(0).isEqual(table.cellForColumnAndRo w(0, 0))"); 146 shouldBeTrue("table.rowHeaderAtIndex(0).isEqual(table.cellForColumnAndRo w(0, 1))");
46 shouldBeTrue("table.rowHeaderAtIndex(1).isEqual(table.cellForColumnAndRo w(0, 1))"); 147 shouldBeTrue("table.rowHeaderAtIndex(1).isEqual(table.cellForColumnAndRo w(0, 2))");
47 shouldBeTrue("table.rowHeaderAtIndex(2).isEqual(table.cellForColumnAndRo w(0, 2))"); 148 shouldBeTrue("table.rowHeaderAtIndex(2).isEqual(table.cellForColumnAndRo w(0, 3))");
48 shouldBeTrue("table.rowHeaderAtIndex(3).isEqual(table.cellForColumnAndRo w(0, 3))"); 149 shouldBe("table.rowHeadersCount", "3");
49
50 // Column headers 150 // Column headers
51 shouldBeTrue("table.columnHeaderAtIndex(0).isEqual(table.cellForColumnAn dRow(0, 0))"); 151 shouldBeTrue("table.columnHeaderAtIndex(0).isEqual(table.cellForColumnAn dRow(0, 0))");
52 shouldBeTrue("table.columnHeaderAtIndex(1).isEqual(table.cellForColumnAn dRow(1, 0))"); 152 shouldBeTrue("table.columnHeaderAtIndex(1).isEqual(table.cellForColumnAn dRow(1, 0))");
53 shouldBeTrue("table.columnHeaderAtIndex(2).isEqual(table.cellForColumnAn dRow(2, 0))"); 153 shouldBeTrue("table.columnHeaderAtIndex(2).isEqual(table.cellForColumnAn dRow(2, 0))");
154 shouldBe("table.columnHeadersCount", "3");
155
156 var table2 = accessibilityController.accessibleElementById("table2");
157 // Row headers
158 shouldBeTrue("table2.rowHeaderAtIndex(0).isEqual(table2.cellForColumnAnd Row(1, 0))");
159 shouldBeTrue("table2.rowHeaderAtIndex(1).isEqual(table2.cellForColumnAnd Row(2, 1))");
160 shouldBeTrue("table2.rowHeaderAtIndex(2).isEqual(table2.cellForColumnAnd Row(0, 2))");
161 shouldBe("table2.rowHeadersCount", "3");
162 // Column headers
163 shouldBeTrue("table2.columnHeaderAtIndex(0).isEqual(table2.cellForColumn AndRow(0, 0))");
164 shouldBeTrue("table2.columnHeaderAtIndex(1).isEqual(table2.cellForColumn AndRow(0, 1))");
165 shouldBeTrue("table2.columnHeaderAtIndex(2).isEqual(table2.cellForColumn AndRow(2, 0))");
166 shouldBeTrue("table2.columnHeaderAtIndex(3).isEqual(table2.cellForColumn AndRow(2, 2))");
167 shouldBe("table2.columnHeadersCount", "4");
168
169 var table3 = accessibilityController.accessibleElementById("table3");
170 // Row headers
171 shouldBeTrue("table3.rowHeaderAtIndex(0).isEqual(table3.cellForColumnAnd Row(1, 0))");
172 shouldBeTrue("table3.rowHeaderAtIndex(1).isEqual(table3.cellForColumnAnd Row(0, 2))");
173 shouldBeTrue("table3.rowHeaderAtIndex(2).isEqual(table3.cellForColumnAnd Row(2, 2))");
174 shouldBe("table3.rowHeadersCount", "3");
175 // Column headers
176 shouldBeTrue("table3.columnHeaderAtIndex(0).isEqual(table3.cellForColumn AndRow(0, 1))");
177 shouldBeTrue("table3.columnHeaderAtIndex(1).isEqual(table3.cellForColumn AndRow(1, 1))");
178 shouldBeTrue("table3.columnHeaderAtIndex(2).isEqual(table3.cellForColumn AndRow(2, 0))");
179 shouldBe("table3.columnHeadersCount", "3");
180
181 var table4 = accessibilityController.accessibleElementById("table4");
182 // Row headers
183 shouldBeTrue("table4.rowHeaderAtIndex(0).isEqual(table4.cellForColumnAnd Row(0, 0))");
184 shouldBe("table4.rowHeadersCount", "1");
185 // Column headers
186 shouldBeTrue("table4.columnHeaderAtIndex(0).isEqual(table4.cellForColumn AndRow(0, 1))");
187 shouldBeTrue("table4.columnHeaderAtIndex(1).isEqual(table4.cellForColumn AndRow(1, 1))");
188 shouldBeTrue("table4.columnHeaderAtIndex(2).isEqual(table4.cellForColumn AndRow(2, 1))");
189 shouldBe("table4.columnHeadersCount", "3");
190
191 var table5 = accessibilityController.accessibleElementById("table5");
192 // Row headers
193 shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAnd Row(0, 0))"); // rowspan=2
194 shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAnd Row(0, 1))"); // rowspan=2
195 shouldBeTrue("table5.rowHeaderAtIndex(1).isEqual(table5.cellForColumnAnd Row(1, 1))");
196 shouldBe("table5.rowHeadersCount", "2");
197 // Column headers
198 shouldBeTrue("table5.columnHeaderAtIndex(0).isEqual(table5.cellForColumn AndRow(1, 0))");
199 shouldBe("table5.columnHeadersCount", "1");
200
201 var table6 = accessibilityController.accessibleElementById("table6");
202 // Row headers
203 shouldBeTrue("table6.rowHeaderAtIndex(0).isEqual(table6.cellForColumnAnd Row(2, 3))");
204 shouldBe("table6.rowHeadersCount", "1");
205 // Column headers
206 shouldBeTrue("table6.columnHeaderAtIndex(0).isEqual(table6.cellForColumn AndRow(0, 0))");
207 shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumn AndRow(0, 2))"); // colspan=2
208 shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumn AndRow(1, 2))"); // colspan=2
209 shouldBeTrue("table6.columnHeaderAtIndex(2).isEqual(table6.cellForColumn AndRow(1, 0))");
210 shouldBeTrue("table6.columnHeaderAtIndex(3).isEqual(table6.cellForColumn AndRow(2, 0))");
211 shouldBeTrue("table6.columnHeaderAtIndex(4).isEqual(table6.cellForColumn AndRow(2, 2))");
212 shouldBe("table6.columnHeadersCount", "5");
54 } 213 }
55 214
56 </script> 215 </script>
57 216
58 </body> 217 </body>
59 </html> 218 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/accessibility/table-headers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698