2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
6 .hideAllContainers .container { display: none; }
9 <div class=
"container">
10 <ul id=
"future_parent" aria-owns=
"future_child"></ul>
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);
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.");
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>
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(
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.");
73 if (window
.testRunner
)
74 document
.body
.className
= "hideAllContainers";