Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / input / paste-linebreak-into-initially-hidden-textarea.html
blobc1c337fc459d7c176e3f4e2100d9059c83d3cbd6
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This tests pasting into a textarea that starts with a line break that didn't initially have a renderer (display: none).
5 WebKit should still be able to paste text with line breaks.</p>
6 <textarea id="test" style="display: none" cols="50" rows="10"></textarea>
7 <div id="log"></div>
8 <script type="text/javascript">
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 var textarea = document.querySelector('textarea');
14 textarea.value = "\nwebkit";
15 textarea.style.display = "";
17 textarea.focus();
18 textarea.selectionStart = textarea.selectionEnd = 0;
19 document.execCommand('insertHTML', false, 'hello\nworld\n');
21 var expected = 'hello\nworld\nwebkit';
22 if (textarea.value == expected)
23 document.getElementById('log').innerText = 'PASS';
24 else
25 document.getElementById('log').innerText = 'FAILED: expected "' + expected + '" but got "' + textarea.value + '"';
27 </script>
28 </body>
29 </html>