blob: 5b801448419eeefc5bd5d6d3faa590ee5bdb385a [file] [log] [blame]
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is ^some text.</div>',
'<div>This is| some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is\u{00A0}| some text.',
'</div>',
'</div>',
].join('')),
'Select without surrounding whitespace');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is ^some text.</div>',
'<div>This is |some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is |some text.',
'</div>',
'</div>',
].join('')),
'Select with trailing whitespace');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is^ some text.</div>',
'<div>This is| some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is| some text.',
'</div>',
'</div>',
].join('')),
'Select with surrounding whitespace');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is^ some text.</div>',
'<div>This is| some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is| some text.',
'</div>',
'</div>',
].join('')),
'Select leading multiple whitespaces');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is^ some text.</div>',
'<div>This is| some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is| some text.',
'</div>',
'</div>',
].join('')),
'Squash whitespaces around selection');
test(() => assert_selection(
[
'<div contenteditable>',
'<div>',
'<div>This is ^some text.</div>',
'<div>This is| some text.</div>',
'</div>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<div>',
'This is\u{00A0}| some text.',
'</div>',
'</div>',
].join('')),
'Squash whitespaces around selection with nbsp');
</script>