blob: 58f4e70068b944e273b05ebf6879ccc6bde3f2e4 [file] [log] [blame]
justing28032332006-10-27 20:42:17 +00001<p>This tests to see that a line break inserted in a textarea is serialized as a '\n'.</p>
2<textarea rows="5" id="textarea"></textarea>
3<ul id="console"></ul>
4
5<script>
6function log(str) {
7 var li = document.createElement("li");
8 li.appendChild(document.createTextNode(str));
9 var console = document.getElementById("console");
10 console.appendChild(li);
11}
12
rniwa@webkit.orgea3cf922012-06-22 06:52:33 +000013if (window.testRunner)
14 window.testRunner.dumpAsText();
justing28032332006-10-27 20:42:17 +000015
16var textarea = document.getElementById("textarea");
17textarea.focus();
18document.execCommand("InsertText", false, "foo");
19document.execCommand("InsertLineBreak");
20document.execCommand("InsertText", false, "bar");
21
22if (textarea.value != "foo\nbar")
23 log("Failure");
24else
25 log("Success");
26</script>