OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Selection UseCounters</title> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 test(function() { |
| 7 var SelectionCollapseNull = 1083; // From UseCounter.h |
| 8 assert_false(internals.isUseCounted(document, SelectionCollapseNull)); |
| 9 document.getSelection().collapse(null, -1); |
| 10 assert_true(internals.isUseCounted(document, SelectionCollapseNull)); |
| 11 }, 'selection.collapse(null, -1)'); |
| 12 |
| 13 test(function() { |
| 14 var SelectionSetBaseAndExtentNull = 1084; // From UseCounter.h |
| 15 assert_false(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
| 16 assert_throws('IndexSizeError', function() { |
| 17 document.getSelection().setBaseAndExtent(null, -1, null, -1); |
| 18 }); |
| 19 assert_false(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
| 20 document.getSelection().setBaseAndExtent(null, 0, null, 0) |
| 21 assert_true(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
| 22 }, 'selection.setBaseAndExtent(null, 0, null, 0)'); |
| 23 </script> |
OLD | NEW |