4 <p>This tests pasting two lines of text copied from pre content.
5 To manually test, copy the selected text (including the new line) and paste it into textarea twice.
6 There should be no blank line between two pasted lines.
</p>
7 <pre oncopy=
"setTimeout(function () { textarea.focus(); }, 0);">A line of text
11 <textarea cols=
"10" rows=
"5" oninput=
"document.getElementById('console').textContent = textarea.value;"></textarea>
12 <pre id=
"console"></pre>
15 if (window
.testRunner
)
16 testRunner
.dumpAsText();
18 var textarea
= document
.querySelector('textarea');
20 getSelection().collapse(document
.querySelector('pre'), 0);
21 getSelection().modify('extend', 'forward', 'line');
23 if (document
.queryCommandSupported('paste')) {
24 document
.execCommand('copy', false, null);
27 document
.execCommand('paste', false, null);
28 document
.execCommand('paste', false, null);