Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / table-roles-hierarchy.html
1 <html>
2 <head>
3   <script src="../resources/js-test.js"></script>
4   <script>
5     var tableAXObject;
6     var indentLevel = 0;
7
8     function indent(count) {
9       var spaces = "                                                      ";
10       return spaces.substr(0, count);
11     }
12
13     function dumpObject(axObject) {
14       debug(indent(indentLevel) + "role: " + axObject.role);
15       if (axObject.subrole && axObject.subrole != 'AXSubrole: ') debug(indent(indentLevel) + "subrole: " + axObject.subrole);
16     }
17
18     function dumpChildren(axObject) {
19       var count = axObject.childrenCount
20       if (!count)
21         return;
22
23       indentLevel += 4;
24       for (var ndx = 0; ndx < count; ndx++) {
25         var childAXObject = axObject.childAtIndex(ndx);
26         dumpObject(childAXObject);
27         if (childAXObject.childrenCount) {
28           // don't bother dumping static text children
29           if (childAXObject.role != "AXRole: AXStaticText")
30             dumpChildren(childAXObject);
31         }
32       }
33       indentLevel -= 4;
34     }
35     function dumpTableAX()
36     {
37       if (!window.accessibilityController)
38         return;
39       var table = accessibilityController.accessibleElementById("table1");
40
41       dumpObject(table);
42       dumpChildren(table);
43     }
44   </script>
45 </head>
46 <body onload="dumpTableAX()">
47
48 <table id="table1">
49   <thead>
50   <tr>
51     <th>No</th>
52     <th>Country</th>
53     <th>Capital</th>
54   </tr>
55   </thead>
56   <tbody>
57   <tr>
58     <th>1.</th>
59     <td>Poland</td>
60     <td>Warsaw</td>
61   </tr>
62   <tr>
63     <th>2.</th>
64     <td>Russia</td>
65     <td>Moscow</td>
66   </tr>
67    <tr>
68     <th>3.</th>
69     <td>Ukraine</td>
70     <td>Kiev</td>
71   </tr>
72   </tbody>
73   <tfoot>
74   <tr>
75     <th>All</th>
76     <td>3 countries</td>
77     <td>3 capitals</td>
78   </tr>
79   </tfoot>
80 </table>
81
82 <br>
83 <br>
84 <br>
85
86 <p>This shows the hierarchy of table roles.</p>
87
88 <div id=console></div>
89
90 </body>
91 </html>