| Index: third_party/WebKit/LayoutTests/editing/selection/set_base_and_extent/set_null.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/selection/set_base_and_extent/set_null.html b/third_party/WebKit/LayoutTests/editing/selection/set_base_and_extent/set_null.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cca44b4acc4891475eec3915e66ac9ec23e9cb12
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/editing/selection/set_base_and_extent/set_null.html
|
| @@ -0,0 +1,38 @@
|
| +<!doctype html>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<script src="../../assert_selection.js"></script>
|
| +<div id="log"></div>
|
| +<script>
|
| +test(() => {
|
| +assert_selection(
|
| + '<div>^foo|</div>',
|
| + selection => {
|
| + selection.setBaseAndExtent(null, 0, null, 0);
|
| + },
|
| + '<div>foo</div>',
|
| + 'Setting both null clears selection');
|
| +
|
| +assert_selection(
|
| + '<div>^foo|</div>',
|
| + selection => {
|
| + selection.setBaseAndExtent(null, 1, null, 2);
|
| + },
|
| + '<div>foo</div>',
|
| + 'Setting both null clears selection');
|
| +
|
| +assert_selection(
|
| + '<div>^foo|</div>',
|
| + selection => selection.setBaseAndExtent(null, 1, selection.document.querySelector('div'), 1),
|
| + '<div>foo</div>',
|
| + 'Setting only base null clears selection');
|
| +
|
| +assert_selection(
|
| + '<div>foo</div>',
|
| + selection => selection.setBaseAndExtent(selection.document.querySelector('div'), 0, null, 2),
|
| + '<div>|foo</div>',
|
| + 'Setting base non-null and extent null behaves as collapse.' +
|
| + 'This is under discussion: https://github.com/w3c/selection-api/issues/72');
|
| +
|
| +}, 'setBaseAndExtent with null.');
|
| +</script>
|
|
|