| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML> | |
| 2 <link rel="help" href="https://w3c.github.io/selection-api/#idl-def-Selection"> | |
| 3 <script src="../../../resources/testharness.js"></script> | |
| 4 <script src="../../../resources/testharnessreport.js"></script> | |
| 5 <script> | |
| 6 test(function() { | |
| 7 function assert_enumerable(p, isReadOnly) { | |
| 8 assert_true(p in Selection.prototype); | |
| 9 assert_true(Selection.prototype.propertyIsEnumerable(p)); | |
| 10 if (isReadOnly) | |
| 11 assert_equals(Object.getOwnPropertyDescriptor(Selection.prototype, p
).set, undefined); | |
| 12 } | |
| 13 | |
| 14 assert_true('Selection' in self); | |
| 15 | |
| 16 var readOnly = true; | |
| 17 | |
| 18 // Verify spec interface coverage (only.) | |
| 19 | |
| 20 assert_enumerable('anchorNode', readOnly); | |
| 21 assert_enumerable('anchorOffset', readOnly); | |
| 22 assert_enumerable('focusNode', readOnly); | |
| 23 assert_enumerable('focusOffset', readOnly); | |
| 24 assert_enumerable('isCollapsed', readOnly); | |
| 25 assert_enumerable('rangeCount', readOnly); | |
| 26 assert_enumerable('type', readOnly); | |
| 27 | |
| 28 assert_enumerable('getRangeAt'); | |
| 29 assert_enumerable('addRange'); | |
| 30 // Not implemented: crbug.com/391673 | |
| 31 //assert_enumerable('removeRange'); | |
| 32 assert_enumerable('removeAllRanges'); | |
| 33 assert_enumerable('empty'); | |
| 34 assert_enumerable('collapse'); | |
| 35 assert_enumerable('setPosition'); | |
| 36 assert_enumerable('collapseToStart'); | |
| 37 assert_enumerable('collapseToEnd'); | |
| 38 assert_enumerable('extend'); | |
| 39 assert_enumerable('setBaseAndExtent'); | |
| 40 assert_enumerable('selectAllChildren'); | |
| 41 assert_enumerable('deleteFromDocument'); | |
| 42 assert_enumerable('containsNode'); | |
| 43 assert_enumerable('toString'); | |
| 44 }, 'Selection interface'); | |
| 45 </script> | |
| OLD | NEW |