Initialize Tizen 2.3
[framework/web/webkit-efl.git] / LayoutTests / accessibility / inline-continuations.html
1 <!DOCTYPE html>
2 <head>
3 <title>Inline continuations - accessibility tree linkage</title>
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 <script>
6 if (window.testRunner)
7     testRunner.dumpAsText();
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
19 <div contentEditable="true" id="test"><span>1<div role="group">2</div>3</span><span>4</span><div role="group">5</div></div>
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);
30         if (!child.role.match(/group/i))
31             result++;
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
47 </script>
48
49 <script src="../fast/js/resources/js-test-post.js"></script>
50 </body>