blob: 63ab34268cfd225b2369885d72b4d25c03a65174 [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>',
selection => {
selection.document.execCommand('bold');
selection.document.execCommand('insertText', false, 'abc');
},
'<div contenteditable><b>abc|</b></div>'),
'bold+insertText');
test(() => assert_selection(
'<div contenteditable>^abc|</div>',
'bold',
'<div contenteditable><b>^abc|</b></div>'),
'add bold');
test(() => assert_selection(
'<div contenteditable><b>^abc def|</b></div>',
'bold',
'<div contenteditable>^abc def|</div>'),
'remove bold fully');
test(() => assert_selection(
'<div contenteditable><b>abc ^def| ghi</b></div>',
'bold',
'<div contenteditable><b>abc </b>^def|<b> ghi</b></div>'),
'remove bold partially');
</script>