mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <head> |
eric@webkit.org | 1decac6 | 2010-05-31 07:16:01 +0000 | [diff] [blame] | 3 | <title>Inline continuations - accessibility tree linkage</title> |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame^] | 4 | <script src="../resources/js-test-pre.js"></script> |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 5 | <script> |
rniwa@webkit.org | 3526ecc3 | 2012-06-12 20:37:15 +0000 | [diff] [blame] | 6 | if (window.testRunner) |
| 7 | testRunner.dumpAsText(); |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 8 | </script> |
| 9 | </head> |
| 10 | <body> |
| 11 | |
| 12 | <h2>Inline continuations - accessibility tree linkage</h2> |
| 13 | |
| 14 | <p>This test checks that the right accessibility tree is generated in |
| 15 | the presence of inline continuations. Each of the five numbers |
| 16 | below should be visited only ones traversing the accessibility |
| 17 | tree.</p> |
| 18 | |
dmazzoni@google.com | f3cf2c4 | 2012-09-07 23:46:45 +0000 | [diff] [blame] | 19 | <div contentEditable="true" id="test"><span>1<div role="group">2</div>3</span><span>4</span><div role="group">5</div></div> |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 20 | |
| 21 | <div id="console"></div> |
| 22 | |
| 23 | <script> |
| 24 | function nonGroupDescendants(elt) |
| 25 | { |
| 26 | var result = 0; |
| 27 | var count = elt.childrenCount; |
| 28 | for (var i = 0; i < count; ++i) { |
| 29 | var child = elt.childAtIndex(i); |
dmazzoni@google.com | f3cf2c4 | 2012-09-07 23:46:45 +0000 | [diff] [blame] | 30 | if (!child.role.match(/group/i)) |
| 31 | result++; |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 32 | result += nonGroupDescendants(child); |
| 33 | } |
| 34 | return result; |
| 35 | } |
| 36 | |
| 37 | if (window.accessibilityController) { |
| 38 | var result = document.getElementById("result"); |
| 39 | document.getElementById("test").focus(); |
| 40 | shouldBe("nonGroupDescendants(accessibilityController.focusedElement)", "5"); |
| 41 | |
| 42 | // This should pass (and is a simpler test than above) if anonymous blocks were not in the AX tree |
| 43 | // shouldBe("accessibilityController.focusedElement.childrenCount", "5"); |
| 44 | } |
| 45 | |
| 46 | |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 47 | </script> |
| 48 | |
mark.lam@apple.com | a931ab2 | 2013-09-08 01:18:24 +0000 | [diff] [blame^] | 49 | <script src="../resources/js-test-post.js"></script> |
mjs@apple.com | a37664e | 2010-04-23 05:47:06 +0000 | [diff] [blame] | 50 | </body> |