Update ReadMe.md
[qtwebkit.git] / LayoutTests / accessibility / table-headers.html
blobc802f4928609cee051befe7418db24cfd7b245d6
1 <!-- This test was made after noticing that all th elements in the table were included in the columnHeaders,
2 and the only criterion for including a cell to rowHeaders was only scope attribute (but not th).
3 -->
4 <html>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
8 </script>
9 <body>
11 <table id="table1">
12 <thead>
13 <tr>
14 <th>No</th>
15 <th>Country</th>
16 <th>Capital</th>
17 </tr>
18 </thead>
19 <tbody>
20 <tr>
21 <th>1.</th>
22 <td>Poland</td>
23 <td>Warsaw</td>
24 </tr>
25 <tr>
26 <th>2.</th>
27 <td>Russia</td>
28 <td>Moscow</td>
29 </tr>
30 <tr>
31 <th>3.</th>
32 <td>Ukraine</td>
33 <td>Kiev</td>
34 </tr>
35 </tbody>
36 </table>
38 <br>
39 <br>
40 <p>This tests that the columnHeaders() and rowHeaders() functions return the correct headers for a table cell.</p>
41 <div id="result"></div>
43 <script>
44 if (window.accessibilityController) {
45 var table = accessibilityController.accessibleElementById("table1");
46 var cell1 = table.cellForColumnAndRow(0, 3);
47 var colHeaders1 = cell1.columnHeaders();
48 var rowHeaders1 = cell1.rowHeaders();
49 var cell2 = table.cellForColumnAndRow(1, 2);
50 var colHeaders2 = cell2.columnHeaders();
51 var rowHeaders2 = cell2.rowHeaders();
53 result.innerText += "The table cell at (0,3) should have exactly one column header, currently it has " + colHeaders1.length + " column header(s).\n";
54 result.innerText += "The table cell at (0,3) should have exactly 0 row headers, currently it has " + rowHeaders1.length + " row header(s).\n\n";
55 result.innerText += "The table cell at (1,2) should have exactly one column header, currently it has " + colHeaders2.length + " column header(s).\n";
56 result.innerText += "The table cell at (1,2) should have exactly one row header, currently it has " + rowHeaders2.length + " row header(s).\n\n";
58 </script>
60 </body>
61 </html>