1 <p>This tests smart paste of a fragment that ends in a select element. There should be no spaces added because the paste is performed in an empty paragraph.</p>
2 <div contenteditable="true" id="copy">foo<select><option>1</option><option>2</option><option>3</option></select></div>
3 <div contenteditable="true" id="paste"></div>
6 var copy = document.getElementById("copy");
7 var paste = document.getElementById("paste");
8 var sel = window.getSelection();
10 sel.setPosition(copy, 0);
11 sel.modify("extend", "forward", "word");
12 sel.modify("extend", "forward", "word");
13 document.execCommand("Copy");
15 sel.setPosition(paste, 0);
16 document.execCommand("Paste");