blob: bbb3ca2f83aa879ff41f737c34cc94ca0eeae2a7 [file] [log] [blame]
<p>This tests smart paste of a fragment that ends in a select element. There should be spaces added before and after the inserted content.</p>
<div contenteditable="true" id="copy"><select><option>1</option><option>2</option><option>3</option></select></div>
<div contenteditable="true" id="paste">xx</div>
<script>
var copy = document.getElementById("copy");
var paste = document.getElementById("paste");
var sel = window.getSelection();
sel.setPosition(copy, 0);
sel.modify("extend", "forward", "word");
document.execCommand("Copy");
sel.setPosition(paste, 0);
sel.modify("move", "forward", "character");
document.execCommand("Paste");
</script>