Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / textarea-paste-newline.html
blob8a52a9d54a56b7195f8b1c19cdafbfea30c77a03
1 <script>
2 function test()
4 if (window.testRunner)
5 testRunner.dumpAsText();
6 var ta = document.getElementById("ta");
7 ta.value = "abc\n";
8 ta.focus();
9 ta.setSelectionRange(0, 4);
10 document.execCommand("cut");
11 document.execCommand("paste");
12 var result1 = ta.value;
13 ta.setSelectionRange(0, 0);
14 document.execCommand("paste");
15 var result2 = ta.value;
17 if (result1 == "abc\n" && result2 == "abc\nabc\n")
18 document.write("<p>Hooray, the test was successful!</p>");
19 else if (result1 == "")
20 document.write("<p>The test failed; doesn't work in release builds of Safari because paste is not allowed.</p>");
21 else
22 document.write("<p>The test failed, result 1 was '" + result1.replace("\n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>");
24 </script>
25 <body onload="test()">
26 <p><textarea id="ta"></textarea></p>