blob: 61ac3a72b28caa09d8c43666839e9d31366b5d87 [file] [log] [blame]
<!doctype HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This tests to make sure that insertion over a fully selected special element
// doesn't do expansion.
selection_test(
[
'<div contenteditable>',
'<ul><li><a href="http://www.google.com/" id="anchor">^ab|</a></li></ul>',
'</div>',
],
selection => {
const anchor = selection.document.getElementById('anchor');
selection.document.execCommand('insertText', false, 'CD');
assert_equals(anchor, selection.document.getElementById('anchor'),
'We should keep an A element');
},
[
'<div contenteditable>',
'<ul><li><a href="http://www.google.com/" id="anchor">CD|</a></li></ul>',
'</div>',
],
'insertText to replace contents of A');
</script>