| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 | 4 |
| 5 <style> | 5 <style> |
| 6 .hideAllContainers .container { display: none; } | 6 .hideAllContainers .container { display: none; } |
| 7 </style> | 7 </style> |
| 8 | 8 |
| 9 <div class="container"> | 9 <div class="container"> |
| 10 <ul id="list1" aria-owns="item3"> | 10 <ul id="list1" role="listbox" aria-owns="item3"> |
| 11 <li>One</li> | 11 <li role="option">One</li> |
| 12 <li>Two</li> | 12 <li role="option">Two</li> |
| 13 </ul> | 13 </ul> |
| 14 <ul id="list2"> | 14 <ul role="listbox" id="list2"> |
| 15 <li id="item3">Three</li> | 15 <li role="option" id="item3">Three</li> |
| 16 <li>Four</li> | 16 <li role="option">Four</li> |
| 17 </ul> | 17 </ul> |
| 18 </div> | 18 </div> |
| 19 | 19 |
| 20 <script> | 20 <script> |
| 21 test(function(t) | 21 test(function(t) |
| 22 { | 22 { |
| 23 var axList1 = accessibilityController.accessibleElementById("list1"); | 23 var axList1 = accessibilityController.accessibleElementById("list1"); |
| 24 assert_equals(axList1.role, "AXRole: AXList"); | 24 assert_equals(axList1.role, "AXRole: AXListBox"); |
| 25 assert_equals(axList1.childrenCount, 3); | 25 assert_equals(axList1.childrenCount, 3); |
| 26 | 26 |
| 27 var axItem = axList1.childAtIndex(0); | 27 var axItem = axList1.childAtIndex(0); |
| 28 assert_equals(axList1.childAtIndex(0).name, "One"); | 28 assert_equals(axList1.childAtIndex(0).name, "One"); |
| 29 assert_equals(axList1.childAtIndex(1).name, "Two"); | 29 assert_equals(axList1.childAtIndex(1).name, "Two"); |
| 30 assert_equals(axList1.childAtIndex(2).name, "Three"); | 30 assert_equals(axList1.childAtIndex(2).name, "Three"); |
| 31 | 31 |
| 32 var axList2 = accessibilityController.accessibleElementById("list2"); | 32 var axList2 = accessibilityController.accessibleElementById("list2"); |
| 33 assert_equals(axList2.role, "AXRole: AXList"); | 33 assert_equals(axList2.role, "AXRole: AXListBox"); |
| 34 assert_equals(axList2.childrenCount, 1); | 34 assert_equals(axList2.childrenCount, 1); |
| 35 assert_equals(axList2.childAtIndex(0).name, "Four"); | 35 assert_equals(axList2.childAtIndex(0).name, "Four"); |
| 36 }, "Aria-owns moves an element from one part of the tree to another."); | 36 }, "Aria-owns moves an element from one part of the tree to another."); |
| 37 </script> | 37 </script> |
| 38 | 38 |
| 39 <div class="container"> | 39 <div class="container"> |
| 40 <ul id="parent1" aria-owns="child"></ul> | 40 <ul id="parent1" role="listbox" aria-owns="child"></ul> |
| 41 <ul id="parent2" aria-owns="child"></ul> | 41 <ul id="parent2" role="listbox" aria-owns="child"></ul> |
| 42 <ul id="parent3"> | 42 <ul id="parent3" role="listbox"> |
| 43 <li id="child">Child</li> | 43 <li id="child" role="option">Child</li> |
| 44 </ul> | 44 </ul> |
| 45 </div> | 45 </div> |
| 46 | 46 |
| 47 <script> | 47 <script> |
| 48 test(function(t) | 48 test(function(t) |
| 49 { | 49 { |
| 50 var axParent1 = accessibilityController.accessibleElementById("parent1"); | 50 var axParent1 = accessibilityController.accessibleElementById("parent1"); |
| 51 var axParent2 = accessibilityController.accessibleElementById("parent2"); | 51 var axParent2 = accessibilityController.accessibleElementById("parent2"); |
| 52 var axParent3 = accessibilityController.accessibleElementById("parent3"); | 52 var axParent3 = accessibilityController.accessibleElementById("parent3"); |
| 53 var axChild = accessibilityController.accessibleElementById("child"); | 53 var axChild = accessibilityController.accessibleElementById("child"); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 var orphan = document.getElementById("orphan"); | 178 var orphan = document.getElementById("orphan"); |
| 179 orphan.setAttribute("id", "o2"); | 179 orphan.setAttribute("id", "o2"); |
| 180 orphan.setAttribute("id", "orphan"); | 180 orphan.setAttribute("id", "orphan"); |
| 181 }, "No crash if an aria-owns parent is deleted and the child is re-added."); | 181 }, "No crash if an aria-owns parent is deleted and the child is re-added."); |
| 182 </script> | 182 </script> |
| 183 | 183 |
| 184 <script> | 184 <script> |
| 185 if (window.testRunner) | 185 if (window.testRunner) |
| 186 document.body.className = "hideAllContainers"; | 186 document.body.className = "hideAllContainers"; |
| 187 </script> | 187 </script> |
| OLD | NEW |