| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../resources/gc.js"></script> | 2 <script src="../resources/gc.js"></script> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 | 5 |
| 6 <!-- | 6 <!-- |
| 7 | 7 |
| 8 Accessibility Object Model | 8 Accessibility Object Model |
| 9 Explainer: https://github.com/WICG/aom/blob/master/explainer.md | 9 Explainer: https://github.com/WICG/aom/blob/master/explainer.md |
| 10 Spec: https://wicg.github.io/aom/spec/ | 10 Spec: https://wicg.github.io/aom/spec/ |
| 11 | 11 |
| 12 --> | 12 --> |
| 13 | 13 |
| 14 <button id="button">Click Me</button> | 14 <button id="button">Click Me</button> |
| 15 | 15 |
| 16 <script> | 16 <script> |
| 17 if (window.internals) | 17 test(function(t) { |
| 18 internals.runtimeFlags.accessibilityObjectModelEnabled = true; | 18 assert_true(internals.runtimeFlags.accessibilityObjectModelEnabled); |
| 19 }, "Make sure that Accessibility Object Model is enabled"); |
| 19 | 20 |
| 20 test(function(t) { | 21 test(function(t) { |
| 21 var button = document.getElementById("button"); | 22 var button = document.getElementById("button"); |
| 22 assert_equals(button.nodeType, Node.ELEMENT_NODE); | 23 assert_equals(button.nodeType, Node.ELEMENT_NODE); |
| 23 assert_not_equals(button.accessibleNode, null); | 24 assert_not_equals(button.accessibleNode, null); |
| 24 }, "DOM Elements have an AccessibleNode"); | 25 }, "DOM Elements have an AccessibleNode"); |
| 25 | 26 |
| 26 test(function(t) { | 27 test(function(t) { |
| 27 var button = document.getElementById("button"); | 28 var button = document.getElementById("button"); |
| 28 var staticText = button.firstChild; | 29 var staticText = button.firstChild; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 (function() { | 188 (function() { |
| 188 var button = document.getElementById("button4"); | 189 var button = document.getElementById("button4"); |
| 189 button.parentElement.removeChild(button); | 190 button.parentElement.removeChild(button); |
| 190 })(); | 191 })(); |
| 191 gc(); | 192 gc(); |
| 192 | 193 |
| 193 assert_equals(aomButton.role, "checkbox"); | 194 assert_equals(aomButton.role, "checkbox"); |
| 194 assert_equals(aomButton.label, "Check Me"); | 195 assert_equals(aomButton.label, "Check Me"); |
| 195 }, "An AccessibleNode keeps its element alive."); | 196 }, "An AccessibleNode keeps its element alive."); |
| 196 </script> | 197 </script> |
| OLD | NEW |