OLD | NEW |
1 <script src="../resources/js-test.js"></script> | 1 <script src="../resources/js-test.js"></script> |
| 2 <script src="../resources/accessibility-helper.js"></script> |
2 <body id="body"> | 3 <body id="body"> |
3 <div role="grid"> | 4 <div role="grid"> |
4 <div role="row"> | 5 <div role="row"> |
5 <div role="columnheader">col head</div> | 6 <div role="columnheader">col head</div> |
6 <div role="columnheader">col head</div> | 7 <div role="columnheader">col head</div> |
7 <div role="columnheader">col head</div> | 8 <div role="columnheader">col head</div> |
8 </div> | 9 </div> |
9 <div role="row"> | 10 <div role="row"> |
10 <div role="rowheader">row head</div> | 11 <div role="rowheader">row head</div> |
11 <div role="gridcell">data</div> | 12 <div role="gridcell">data</div> |
12 <div role="rowheader">row head</div> | 13 <div role="rowheader">row head</div> |
13 </div> | 14 </div> |
14 <div role="row"> | 15 <div role="row"> |
15 <div role="rowheader">row head</div> | 16 <div role="rowheader">row head</div> |
16 <div role="rowheader">row head</div> | 17 <div role="rowheader">row head</div> |
17 <div role="columnheader">col head</div> | 18 <div role="columnheader">col head</div> |
18 </div> | 19 </div> |
19 </div> | 20 </div> |
20 </body> | 21 </body> |
21 <p>End of test</p> | 22 <p>End of test</p> |
22 <p id="description"></p> | 23 <p id="description"></p> |
23 <div id="console"></div> | 24 <div id="console"></div> |
24 <script> | 25 <script> |
25 function buildAccessibilityTree(accessibilityObject, i) { | |
26 if(accessibilityObject.stringValue.indexOf('End of test') >= 0) | |
27 return false; | |
28 | |
29 if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObjec
t.role == 'AXRole: AXTableHeaderContainer') | |
30 return true; | |
31 | |
32 var indent = ""; | |
33 for (var k = 0; k < i; k++) | |
34 indent += " "; | |
35 debug(indent + accessibilityObject.role + " " + accessibilityObject.stri
ngValue); | |
36 var childrenCount = accessibilityObject.childrenCount; | |
37 for (var j = 0; j < childrenCount; j++) { | |
38 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(j), i +
1)) | |
39 return false; | |
40 } | |
41 return true; | |
42 } | |
43 | |
44 if (window.accessibilityController) { | 26 if (window.accessibilityController) { |
45 document.getElementById("body").focus(); | 27 document.getElementById("body").focus(); |
46 buildAccessibilityTree(accessibilityController.focusedElement, 0); | 28 buildAccessibilityTree(accessibilityController.focusedElement, 0, 1, ['AXCol
umn', 'AXTableHeaderContainer']); |
47 } | 29 } |
48 </script> | 30 </script> |
OLD | NEW |