blob: ec4d55b436abad517a1ff44dde473007b3b7c4a7 [file] [log] [blame]
rniwa@webkit.orgf3971942013-08-18 18:54:12 +00001<!DOCTYPE html>
2<html>
3<body>
mark.lam@apple.com3a182c72013-09-08 02:36:06 +00004<script src="../../resources/js-test-pre.js"></script>
rniwa@webkit.orgf3971942013-08-18 18:54:12 +00005<script>
6
7description("This tests pasting a multi-line text into a textarea that contains a single new line. WebKit should preserve the number of new lines.");
8
9var textarea = document.createElement("textarea");
10textarea.value = "\n";
11textarea.rows = 10;
12document.body.appendChild(textarea);
13textarea.focus();
zsun@igalia.com11729692022-03-17 09:19:29 +000014textarea.setSelectionRange(0, 0);
rniwa@webkit.orgf3971942013-08-18 18:54:12 +000015shouldBe("document.execCommand('InsertHTML', false, 'first<br><br>third'); textarea.value", "'first\\n\\nthird\\n'");
16
17var successfullyParsed = true;
18
19</script>
mark.lam@apple.com3a182c72013-09-08 02:36:06 +000020<script src="../../resources/js-test-post.js"></script>
rniwa@webkit.orgf3971942013-08-18 18:54:12 +000021</body>
22</html>