blob: dddbf1a32a9442fe32ce22a47bec0fdf52b48cb7 [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 style="color: green">hello</div>|',
'</div>',
].join(''),
'formatBlock h1',
[
'<div contenteditable>',
'<h1 style="color: green">^hello|</h1>',
'</div>',
].join('')), 'Block');
test(() => assert_selection(
[
'<div contenteditable>',
'^<div style="color: green"><br></div>|',
'</div>',
].join(''),
'formatBlock h1',
[
'<div contenteditable>',
'<h1 style="color: green">|<br></h1>',
'</div>',
].join('')), 'Block with BR');
test(() => assert_selection(
[
'<div contenteditable>',
'^<span style="color: green">hello</span>|',
'</div>',
].join(''),
'formatBlock h1',
[
'<div contenteditable>',
'<h1><span style="color: green">^hello|</span></h1>',
'</div>',
].join('')), 'Inline');
</script>