| 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 { | 6 .hideAllContainers .container { |
| 7 display: none; | 7 display: none; |
| 8 } | 8 } |
| 9 </style> | 9 </style> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 <button id="labelledby1" aria-labelledby="label1" aria-label="Label">Content
s</button> | 48 <button id="labelledby1" aria-labelledby="label1" aria-label="Label">Content
s</button> |
| 49 <div id="label1">Labelledby 1</div> | 49 <div id="label1">Labelledby 1</div> |
| 50 </div> | 50 </div> |
| 51 | 51 |
| 52 <script> | 52 <script> |
| 53 test(function(t) { | 53 test(function(t) { |
| 54 var axLabelledby1 = accessibilityController.accessibleElementById("labelledb
y1"); | 54 var axLabelledby1 = accessibilityController.accessibleElementById("labelledb
y1"); |
| 55 assert_equals(axLabelledby1.name, "Labelledby 1"); | 55 assert_equals(axLabelledby1.name, "Labelledby 1"); |
| 56 assert_equals(axLabelledby1.nameFrom, "relatedElement"); | 56 assert_equals(axLabelledby1.nameFrom, "relatedElement"); |
| 57 assert_equals(axLabelledby1.nameElementCount(), 1); | 57 assert_equals(axLabelledby1.nameElementCount(), 1); |
| 58 assert_equals(axLabelledby1.nameElementAtIndex(0).role, "AXRole: AXDiv"); | 58 assert_equals(axLabelledby1.nameElementAtIndex(0).role, "AXRole: AXGenericCo
ntainer"); |
| 59 }, "aria-labelledby trumps both aria-label and contents."); | 59 }, "aria-labelledby trumps both aria-label and contents."); |
| 60 </script> | 60 </script> |
| 61 | 61 |
| 62 <div class="container"> | 62 <div class="container"> |
| 63 <button id="labelledby2" aria-labelledby="label2">Contents</button> | 63 <button id="labelledby2" aria-labelledby="label2">Contents</button> |
| 64 <div id="label2" aria-label="Label 2 label">Contents 2</div> | 64 <div id="label2" aria-label="Label 2 label">Contents 2</div> |
| 65 </div> | 65 </div> |
| 66 | 66 |
| 67 <script> | 67 <script> |
| 68 test(function(t) { | 68 test(function(t) { |
| 69 var axLabelledby2 = accessibilityController.accessibleElementById("labelledb
y2"); | 69 var axLabelledby2 = accessibilityController.accessibleElementById("labelledb
y2"); |
| 70 assert_equals(axLabelledby2.name, "Label 2 label"); | 70 assert_equals(axLabelledby2.name, "Label 2 label"); |
| 71 assert_equals(axLabelledby2.nameFrom, "relatedElement"); | 71 assert_equals(axLabelledby2.nameFrom, "relatedElement"); |
| 72 assert_equals(axLabelledby2.nameElementCount(), 1); | 72 assert_equals(axLabelledby2.nameElementCount(), 1); |
| 73 assert_equals(axLabelledby2.nameElementAtIndex(0).role, "AXRole: AXDiv"); | 73 assert_equals(axLabelledby2.nameElementAtIndex(0).role, "AXRole: AXGenericCo
ntainer"); |
| 74 }, "Button with aria-labelledby referencing an element with an aria-label uses t
he aria-label as text alternative."); | 74 }, "Button with aria-labelledby referencing an element with an aria-label uses t
he aria-label as text alternative."); |
| 75 </script> | 75 </script> |
| 76 | 76 |
| 77 <div class="container"> | 77 <div class="container"> |
| 78 <button id="labelledby3" aria-labelledby="label3">Contents</button> | 78 <button id="labelledby3" aria-labelledby="label3">Contents</button> |
| 79 <div id="label3" aria-label="">Contents 3</div> | 79 <div id="label3" aria-label="">Contents 3</div> |
| 80 </div> | 80 </div> |
| 81 | 81 |
| 82 <script> | 82 <script> |
| 83 test(function(t) { | 83 test(function(t) { |
| 84 var axLabelledby3 = accessibilityController.accessibleElementById("labelledb
y3"); | 84 var axLabelledby3 = accessibilityController.accessibleElementById("labelledb
y3"); |
| 85 assert_equals(axLabelledby3.name, "Contents 3"); | 85 assert_equals(axLabelledby3.name, "Contents 3"); |
| 86 assert_equals(axLabelledby3.nameFrom, "relatedElement"); | 86 assert_equals(axLabelledby3.nameFrom, "relatedElement"); |
| 87 assert_equals(axLabelledby3.nameElementCount(), 1); | 87 assert_equals(axLabelledby3.nameElementCount(), 1); |
| 88 assert_equals(axLabelledby3.nameElementAtIndex(0).role, "AXRole: AXDiv"); | 88 assert_equals(axLabelledby3.nameElementAtIndex(0).role, "AXRole: AXGenericCo
ntainer"); |
| 89 }, "aria-labelledby reference to element with empty aria-label."); | 89 }, "aria-labelledby reference to element with empty aria-label."); |
| 90 </script> | 90 </script> |
| 91 | 91 |
| 92 <div class="container"> | 92 <div class="container"> |
| 93 <button id="labelledby4" aria-labelledby="label4">Contents</button> | 93 <button id="labelledby4" aria-labelledby="label4">Contents</button> |
| 94 <div id="label4" aria-label="Label 4 label" aria-labelledby="label4chained">
Contents 4</div> | 94 <div id="label4" aria-label="Label 4 label" aria-labelledby="label4chained">
Contents 4</div> |
| 95 <p id="label4chained">Contents 4 chained</p> | 95 <p id="label4chained">Contents 4 chained</p> |
| 96 </div> | 96 </div> |
| 97 | 97 |
| 98 <script> | 98 <script> |
| 99 test(function(t) { | 99 test(function(t) { |
| 100 var axLabelledby4 = accessibilityController.accessibleElementById("labelledb
y4"); | 100 var axLabelledby4 = accessibilityController.accessibleElementById("labelledb
y4"); |
| 101 assert_equals(axLabelledby4.name, "Label 4 label"); | 101 assert_equals(axLabelledby4.name, "Label 4 label"); |
| 102 assert_equals(axLabelledby4.nameFrom, "relatedElement"); | 102 assert_equals(axLabelledby4.nameFrom, "relatedElement"); |
| 103 assert_equals(axLabelledby4.nameElementCount(), 1); | 103 assert_equals(axLabelledby4.nameElementCount(), 1); |
| 104 assert_equals(axLabelledby4.nameElementAtIndex(0).role, "AXRole: AXDiv"); | 104 assert_equals(axLabelledby4.nameElementAtIndex(0).role, "AXRole: AXGenericCo
ntainer"); |
| 105 }, "Recursive aria-labelledby references aren't followed even in presence of ari
a-label, even though aria-labelledby normally trumps aria-label."); | 105 }, "Recursive aria-labelledby references aren't followed even in presence of ari
a-label, even though aria-labelledby normally trumps aria-label."); |
| 106 </script> | 106 </script> |
| 107 | 107 |
| 108 <script> | 108 <script> |
| 109 if (window.testRunner) | 109 if (window.testRunner) |
| 110 document.body.className = "hideAllContainers"; | 110 document.body.className = "hideAllContainers"; |
| 111 </script> | 111 </script> |
| OLD | NEW |