| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <head> |
| 3 <title>Inline continuations - accessibility tree linkage</title> | 3 <title>Inline continuations - accessibility tree linkage</title> |
| 4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.js"></script> |
| 5 <script> | 5 <script> |
| 6 if (window.testRunner) | 6 if (window.testRunner) |
| 7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
| 8 </script> | 8 </script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| 11 | 11 |
| 12 <h2>Inline continuations - accessibility tree linkage</h2> | 12 <h2>Inline continuations - accessibility tree linkage</h2> |
| 13 | 13 |
| 14 <p>This test checks that the right accessibility tree is generated in | 14 <p>This test checks that the right accessibility tree is generated in |
| 15 the presence of inline continuations. Each of the five numbers | 15 the presence of inline continuations. Each of the five numbers |
| 16 below should be visited only ones traversing the accessibility | 16 below should be visited only ones traversing the accessibility |
| 17 tree.</p> | 17 tree.</p> |
| 18 | 18 |
| 19 <div contentEditable="true" id="test"><span>1<div role="group">2</div>3</span><s
pan>4</span><div role="group">5</div></div> | 19 <div contentEditable="true" id="test"><span>1<div role="group">2</div>3</span><s
pan>4</span><div role="group">5</div></div> |
| 20 | 20 |
| 21 <div id="console"></div> | 21 <div id="console"></div> |
| 22 | 22 |
| 23 <script> | 23 <script> |
| 24 function nonGroupDescendants(elt) | 24 function nonGroupDescendants(elt) |
| 25 { | 25 { |
| 26 var result = 0; | 26 var result = 0; |
| 27 var count = elt.childrenCount; | 27 var count = elt.childrenCount; |
| 28 for (var i = 0; i < count; ++i) { | 28 for (var i = 0; i < count; ++i) { |
| 29 var child = elt.childAtIndex(i); | 29 var child = elt.childAtIndex(i); |
| 30 if (!child.role.match(/group/i)) | 30 if (child.role != 'AXRole: AXGroup' && child.role != 'AXRole: AXInlineTe
xtBox') |
| 31 result++; | 31 result++; |
| 32 result += nonGroupDescendants(child); | 32 result += nonGroupDescendants(child); |
| 33 } | 33 } |
| 34 return result; | 34 return result; |
| 35 } | 35 } |
| 36 | 36 |
| 37 if (window.accessibilityController) { | 37 if (window.accessibilityController) { |
| 38 var result = document.getElementById("result"); | 38 var result = document.getElementById("result"); |
| 39 document.getElementById("test").focus(); | 39 document.getElementById("test").focus(); |
| 40 shouldBe("nonGroupDescendants(accessibilityController.focusedElement)", "5")
; | 40 shouldBe("nonGroupDescendants(accessibilityController.focusedElement)", "5")
; |
| 41 | 41 |
| 42 // This should pass (and is a simpler test than above) if anonymous blocks w
ere not in the AX tree | 42 // This should pass (and is a simpler test than above) if anonymous blocks w
ere not in the AX tree |
| 43 // shouldBe("accessibilityController.focusedElement.childrenCount", "5"); | 43 // shouldBe("accessibilityController.focusedElement.childrenCount", "5"); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 </script> | 47 </script> |
| 48 | 48 |
| 49 <script src="../fast/js/resources/js-test-post.js"></script> | 49 <script src="../fast/js/resources/js-test-post.js"></script> |
| 50 </body> | 50 </body> |
| OLD | NEW |