Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / aria-owns-dynamic-changes.html
blob8cb5f416342a0a76440f852def8a6dc32ce5aa10
1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <style>
6 .hideAllContainers .container { display: none; }
7 </style>
9 <div class="container">
10 <ul id="future_parent" aria-owns="future_child"></ul>
11 </div>
13 <script>
14 test(function(t)
16 var axFutureParent = accessibilityController.accessibleElementById("future_parent");
17 assert_equals(axFutureParent.childrenCount, 0);
18 var futureParent = document.getElementById("future_parent");
19 var child = document.createElement("li");
20 child.id = "future_child";
21 assert_equals(axFutureParent.childrenCount, 0);
23 futureParent.parentElement.appendChild(child);
24 assert_equals(axFutureParent.childrenCount, 1);
26 child.id = "";
27 assert_equals(axFutureParent.childrenCount, 0);
29 child.id = "future_child";
30 assert_equals(axFutureParent.childrenCount, 1);
32 futureParent.setAttribute("aria-owns", "");
33 assert_equals(axFutureParent.childrenCount, 0);
35 futureParent.setAttribute("aria-owns", "future_child");
36 assert_equals(axFutureParent.childrenCount, 1);
37 }, "Aria-owns is dynamically recomputed.");
38 </script>
40 <div class="container">
41 <div id="logical_parent" role="group" aria-owns="logical_1 logical_2 logical_3 logical_4">
42 <div id="logical_3">3</div>
43 <div id="logical_4">4</div>
44 <div id="logical_2">2</div>
45 <div id="logical_1">1</div>
46 </div>
47 </div>
49 <script>
50 test(function(t)
52 var axLogicalParent = accessibilityController.accessibleElementById("logical_parent");
54 assert_equals(axLogicalParent.childrenCount, 4);
55 assert_equals(axLogicalParent.childAtIndex(0).childAtIndex(0).name, "1");
56 assert_equals(axLogicalParent.childAtIndex(1).childAtIndex(0).name, "2");
57 assert_equals(axLogicalParent.childAtIndex(2).childAtIndex(0).name, "3");
58 assert_equals(axLogicalParent.childAtIndex(3).childAtIndex(0).name, "4");
60 document.getElementById("logical_parent").setAttribute(
61 "aria-owns",
62 "logical_2 logical_4 logical_1 logical_3");
64 assert_equals(axLogicalParent.childrenCount, 4);
65 assert_equals(axLogicalParent.childAtIndex(0).childAtIndex(0).name, "2");
66 assert_equals(axLogicalParent.childAtIndex(1).childAtIndex(0).name, "4");
67 assert_equals(axLogicalParent.childAtIndex(2).childAtIndex(0).name, "1");
68 assert_equals(axLogicalParent.childAtIndex(3).childAtIndex(0).name, "3");
69 }, "A parent can use aria-owns to reorder its children into a more logical AX ordering.");
70 </script>
72 <script>
73 if (window.testRunner)
74 document.body.className = "hideAllContainers";
75 </script>