| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | |
| 5 | |
| 6 function buildAccessibilityTree(accessibilityObject, indent) { | |
| 7 var str = ""; | |
| 8 for (var i = 0; i < indent; i++) | |
| 9 str += " "; | |
| 10 str += accessibilityObject.role; | |
| 11 str += " " + accessibilityObject.stringValue; | |
| 12 str += "\n"; | |
| 13 document.getElementById("tree").innerText += str; | |
| 14 | |
| 15 if (accessibilityObject.stringValue.indexOf('End of test') >= 0) | |
| 16 return false; | |
| 17 | |
| 18 var count = accessibilityObject.childrenCount; | |
| 19 for (var i = 0; i < count; ++i) { | |
| 20 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), ind
ent + 1)) | |
| 21 return false; | |
| 22 } | |
| 23 | |
| 24 return true; | |
| 25 } | |
| 26 </script> | |
| 27 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="../resources/accessibility-helper.js"></script> |
| 28 </head> | 6 </head> |
| 29 <body> | 7 <body> |
| 30 | 8 |
| 31 <span><div></div></span><span>x<div>y</div>z</span> | 9 <span><div></div></span><span>x<div>y</div>z</span> |
| 32 | 10 |
| 33 <div>End of test</div> | 11 <div>End of test</div> |
| 34 | 12 |
| 35 <p id="description"></p> | 13 <p id="description"></p> |
| 36 <pre id="tree"></pre> | |
| 37 <div id="console"></div> | 14 <div id="console"></div> |
| 38 | 15 |
| 39 <script> | 16 <script> |
| 40 description("Make sure that a debug assert is not triggered when constructin
g the accessibility tree for this page."); | 17 description("Make sure that a debug assert is not triggered when constructin
g the accessibility tree for this page."); |
| 41 | 18 |
| 42 if (window.accessibilityController) { | 19 if (window.accessibilityController) { |
| 43 // Build the accessibility tree up until 'End of test' is encountered. | 20 // Build the accessibility tree up until 'End of test' is encountered. |
| 44 document.body.focus(); | 21 document.body.focus(); |
| 45 buildAccessibilityTree(accessibilityController.focusedElement, 0); | 22 buildAccessibilityTree(accessibilityController.focusedElement, 0); |
| 46 } | 23 } |
| 47 | 24 |
| 48 </script> | 25 </script> |
| 49 | 26 |
| 50 </body> | 27 </body> |
| 51 </html> | 28 </html> |
| OLD | NEW |