blob: 7e1e6353dc3e8e32b3eed82488c8ddc67276af58 [file] [log] [blame]
<div id="container">
<div contenteditable="true" id="sample">foo <input type="button" value="bar"> baz</div>
</div>
<script src="../../resources/js-test.js"></script>
<script>
function $(id) { return document.getElementById(id); }
var range = document.createRange();
range.setStartAfter(document.querySelector('input'));
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
document.execCommand('Delete');
document.execCommand('InsertText', false, 'quux');
shouldBeEqualToString('$("sample").innerHTML', 'foo quux&nbsp;baz');
if (window.testRunner)
$('container').outerHTML = '';
</script>
</body>