OLD | NEW |
(Empty) | |
| 1 <script src="../resources/js-test.js"></script> |
| 2 <table width="50%" border="1"> |
| 3 <caption> |
| 4 scope test |
| 5 </caption> |
| 6 <tr> |
| 7 <th scope="col">col head</th> |
| 8 <th scope="row">row head</th> |
| 9 <th>col head</th> |
| 10 </tr> |
| 11 <tr> |
| 12 <th scope="col">col head</th> |
| 13 <td scope="row">data</td> |
| 14 <th>row head</th> |
| 15 </tr> |
| 16 <tr> |
| 17 <th>row head</th> |
| 18 <td>data</td> |
| 19 <th scope="col">col head</th> |
| 20 </tr> |
| 21 </table> |
| 22 <table width="50%" border="1"> |
| 23 <caption> |
| 24 row header and column header (1) |
| 25 </caption> |
| 26 <tr> |
| 27 <td>data</td> |
| 28 <th>row head</th> |
| 29 <th>column head</th> |
| 30 </tr> |
| 31 <tr> |
| 32 <th>column head</th> |
| 33 <th>column head</th> |
| 34 <td>data</td> |
| 35 </tr> |
| 36 <tr> |
| 37 <th>row head</th> |
| 38 <td>data</td> |
| 39 <th>row head</th> |
| 40 </tr> |
| 41 </table> |
| 42 <table width="50%" border="1"> |
| 43 <caption> |
| 44 row header and column header (2) |
| 45 </caption> |
| 46 <tr> |
| 47 <th>row head</th> |
| 48 <td>data</td> |
| 49 <td>data</td> |
| 50 </tr> |
| 51 <tr> |
| 52 <th>column head</th> |
| 53 <th>column head</th> |
| 54 <th>column head</th> |
| 55 </tr> |
| 56 <tr> |
| 57 <td>data</td> |
| 58 <td>data</td> |
| 59 <td>data</td> |
| 60 </tr> |
| 61 </table> |
| 62 <p>End of test</p> |
| 63 <p id="description"></p> |
| 64 <div id="console"></div> |
| 65 <script> |
| 66 description("This tests that AXRoles for header cells are assigned."); |
| 67 |
| 68 if (window.testRunner) |
| 69 testRunner.dumpAsText(); |
| 70 |
| 71 function buildAccessibilityTree(accessibilityObject, indent) { |
| 72 if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObject.ro
le == 'AXRole: AXTableHeaderContainer') |
| 73 return true; |
| 74 var str = ""; |
| 75 for (var i = 0; i < indent; i++) |
| 76 str += " "; |
| 77 str += accessibilityObject.role; |
| 78 str += " " + accessibilityObject.stringValue; |
| 79 |
| 80 if (accessibilityObject.role == '') |
| 81 str += accessibilityObject.allAttributes(); |
| 82 |
| 83 str += "\n"; |
| 84 document.getElementById("console").innerText += str; |
| 85 |
| 86 if (accessibilityObject.stringValue.indexOf('End of test') >= 0) |
| 87 return false; |
| 88 |
| 89 var count = accessibilityObject.childrenCount; |
| 90 for (var i = 0; i < count; ++i) { |
| 91 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent
+ 1)) |
| 92 return false; |
| 93 } |
| 94 |
| 95 return true; |
| 96 } |
| 97 |
| 98 if (window.accessibilityController) { |
| 99 var body = accessibilityController.focusedElement; |
| 100 buildAccessibilityTree(body, 0); |
| 101 } |
| 102 </script> |
OLD | NEW |