Update device orientation & motion permission native SPI as per latest proposal
[WebKit-https.git] / LayoutTests / accessibility / aria-tables.html
1 <html>
2 <script>
3     if (window.testRunner)
4         testRunner.dumpAsText();
5 </script>
6 <body id="body">
7     
8     <!-- This test performs a number of tests on ARIA tables to make sure they conform as expected -->
9
10     <div role="grid">
11       <div role="row">
12         <div role="columnheader" id="h1">header 1</div>
13         <div role="columnheader">header 2</div>
14         <div role="columnheader">header 3</div>
15       </div>
16       <div role="row">
17         <div role="gridcell" headers="h1">cell </div>
18         <div role="gridcell">cell </div>
19         <div role="gridcell">cell </div>
20       </div>
21       <div role="row">
22         <div role="gridcell">cell </div>
23         <div role="gridcell">cell </div>
24         <div headers="h1" role="rowheader">cell </div>
25       </div>
26     </div>
27
28     <table border=1 role="grid">
29       <tr role="row">
30         <th role="columnheader">header 1</th>
31         <th role="columnheader">header 2</th>
32         <th role="columnheader">header 2</th>
33       </tr>
34       <tr role="row">
35         <td role="rowheader">cell</td>
36         <td role="gridcell">cell</td>
37         <td role="gridcell">cell</td>
38       </tr>
39       <tr role="row">
40         <td role="gridcell">cell</td>
41       </tr>
42     </table>
43
44     <div id="result"></div>
45     
46     <script>
47         if (window.accessibilityController) {
48             var result = document.getElementById("result");
49
50             var body = document.getElementById("body");
51             body.focus();
52             var focusedElement = accessibilityController.focusedElement;
53             var table1 = focusedElement.childAtIndex(0);
54             var table2 = focusedElement.childAtIndex(1);
55
56             var failed = 0;
57             <!-- make sure they are tables -->
58             result.innerText += table1.role + "\n";
59             result.innerText += table2.role + "\n";
60
61             <!-- Make sure we can use cell for column and row and it works -->
62             result.innerText += table1.cellForColumnAndRow(0,0).role + "\n";
63             result.innerText += table2.cellForColumnAndRow(0,0).role + "\n";
64             result.innerText += table1.cellForColumnAndRow(2,2).role + "\n";
65             result.innerText += table2.cellForColumnAndRow(1,1).role + "\n";
66
67             <!-- now make sure we can call all the relevant methods without crashing -->
68             table1.attributesOfColumnHeaders();
69             table2.attributesOfColumnHeaders();
70
71             table1.attributesOfRowHeaders();
72             table2.attributesOfRowHeaders();
73     
74             table1.attributesOfColumns();
75             table2.attributesOfColumns();
76
77             table1.attributesOfRows();
78             table2.attributesOfRows();
79
80             table1.attributesOfHeader();
81             table2.attributesOfHeader();
82
83             result.innerText += "Test passed\n";
84         }
85     </script>
86 </body>
87 </html>