blob: 507835c3ed98c8de7007ce4f9e5121722d08e8b1 [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>',
'<h1>hello</h1> |world',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<h1>hello|world</h1>',
'</div>',
].join('')),
'Delete a space to merge into H1');
test(() => assert_selection(
[
'<div contenteditable dir="ltr">',
'<h1>hello</h1><p>|world</p>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable dir="ltr">',
'<h1>hello|world</h1>',
'</div>',
].join('')),
'Delete P to merge into H1 with DIR');
test(() => assert_selection(
[
'<div contenteditable dir="ltr">',
'<h1>hello</h1><p><b>|worl</b>d</p>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable dir="ltr">',
'<h1>hello|<b>worl</b>d</h1>',
'</div>',
].join('')),
'Delete B to merge into H1 with DIR and keeping B');
test(() => assert_selection(
[
'<div contenteditable>',
'<h1>hello</h1><em>|world</em>',
'</div>',
].join(''),
'delete',
[
'<div contenteditable>',
'<h1>hello|<em>world</em></h1>',
'</div>',
].join('')),
'Delete EM to merge into H1 with keeping EM');
</script>