Skip to content
Newer
Older
100644 79 lines (69 sloc) 2.95 KB
7c7b5f3 <rdar://problem/4003764> Expose tables as AXTables
cfleizach@apple.com authored Aug 19, 2008
1 <html>
2 <script>
3 if (window.layoutTestController)
4 layoutTestController.dumpAsText();
5 </script>
6 <body id="body">
7
8
9 <table id="testTable" align="center" border="1" cellpadding="5" cellspacing="0">
10 <caption> Example #1: Nested Stubs </caption>
11 <tr>
12 <th class="center" colspan="2" rowspan="2">Ruritanian<br> Population
13 <br> Survey</th>
14 <th class="center" rowspan="2">All<br> Genders</th>
15
16 <th class="center" colspan="2">By Gender</th>
17 </tr>
18 <tr>
19 <th class="center">Males</th>
20 <th class="center">Females</th>
21 </tr>
22 <tr>
23
24 <th align="left" rowspan="2">All Regions</th>
25 <th>North</th>
26 <td align="right">3333</td>
27 <td align="right">1111</td>
28 <td align="right">2222</td>
29 </tr>
30
31 <tr>
32 <th>South</th>
33 <td align="right">3333</td>
34 <td align="right">1111</td>
35 <td align="right">2222</td>
36 </tr>
37 <tr>
38 <th>South</th>
39 <td align="right">3333</td>
40 <td align="right" colspan="2">1111</td>
41 <td align="right">2222</td>
42 </tr>
43 <tr>
44 <th>South</th>
45 <td align="right" colspan="2">3333</td>
46 <td align="right">1111</td>
47 <td align="right">2222</td>
48 </tr>
49 </table>
50
51 <div id="result"></div>
52
53 <script>
54 if (window.accessibilityController) {
55 var result = document.getElementById("result");
56
57 var body = document.getElementById("body");
58 body.focus();
59 var table = accessibilityController.focusedElement.childAtIndex(0);
60
61 result.innerText += "------------------------\n";
62 result.innerText += "[0,0]\n" + table.cellForColumnAndRow(0,0).allAttributes() + "\n";
63 result.innerText += "------------------------\n";
64 result.innerText += "[3,1]\n" + table.cellForColumnAndRow(3,1).allAttributes() + "\n";
65 result.innerText += "------------------------\n";
66 result.innerText += "[1,1]\n" + table.cellForColumnAndRow(1,1).allAttributes() + "\n";
67 result.innerText += "------------------------\n";
68 result.innerText += "[2,2]\n" + table.cellForColumnAndRow(2,2).allAttributes() + "\n";
69 result.innerText += "------------------------\n";
70 result.innerText += "[3,5]\n" + table.cellForColumnAndRow(3,5).allAttributes() + "\n";
71 result.innerText += "------------------------\n";
72 result.innerText += "[100,0]\n" + table.cellForColumnAndRow(100,0).allAttributes() + "\n";
73 result.innerText += "------------------------\n";
74 result.innerText += "[0,100]\n" + table.cellForColumnAndRow(0,100).allAttributes() + "\n";
75 }
76 </script>
77 </body>
78 </html>
Something went wrong with that request. Please try again.