blob: b34106f1ff468c750bcb25ab7dcd3eb28f3daf71 [file] [log] [blame]
mjs@apple.coma37664e2010-04-23 05:47:06 +00001<!DOCTYPE html>
2<head>
eric@webkit.org1decac62010-05-31 07:16:01 +00003<title>Inline continuations - accessibility tree linkage</title>
mark.lam@apple.coma931ab22013-09-08 01:18:24 +00004<script src="../resources/js-test-pre.js"></script>
mjs@apple.coma37664e2010-04-23 05:47:06 +00005<script>
rniwa@webkit.org3526ecc32012-06-12 20:37:15 +00006if (window.testRunner)
7 testRunner.dumpAsText();
mjs@apple.coma37664e2010-04-23 05:47:06 +00008</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.comf3cf2c42012-09-07 23:46:45 +000019<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.coma37664e2010-04-23 05:47:06 +000020
21<div id="console"></div>
22
23<script>
24function 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.comf3cf2c42012-09-07 23:46:45 +000030 if (!child.role.match(/group/i))
31 result++;
mjs@apple.coma37664e2010-04-23 05:47:06 +000032 result += nonGroupDescendants(child);
33 }
34 return result;
35}
36
37if (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.coma37664e2010-04-23 05:47:06 +000047</script>
48
mark.lam@apple.coma931ab22013-09-08 01:18:24 +000049<script src="../resources/js-test-post.js"></script>
mjs@apple.coma37664e2010-04-23 05:47:06 +000050</body>