Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / copy-paste-pre-line-content.html
blobfcc2542f2cc67edd6811f0bf575595bfe7df58da
1 <!DOCTYPE html>
2 <html>
3 <body>
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
8 some other text
9 </pre>
11 <textarea cols="10" rows="5" oninput="document.getElementById('console').textContent = textarea.value;"></textarea>
12 <pre id="console"></pre>
13 <script>
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);
26 textarea.focus();
27 document.execCommand('paste', false, null);
28 document.execCommand('paste', false, null);
32 </script>
33 </body>
34 </html>