| <p>This tests to see that a line break inserted in a textarea is serialized as a '\n'.</p> |
| <textarea rows="5" id="textarea"></textarea> |
| <ul id="console"></ul> |
| |
| <script> |
| function log(str) { |
| var li = document.createElement("li"); |
| li.appendChild(document.createTextNode(str)); |
| var console = document.getElementById("console"); |
| console.appendChild(li); |
| } |
| |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| |
| var textarea = document.getElementById("textarea"); |
| textarea.focus(); |
| document.execCommand("InsertText", false, "foo"); |
| document.execCommand("InsertLineBreak"); |
| document.execCommand("InsertText", false, "bar"); |
| |
| if (textarea.value != "foo\nbar") |
| log("Failure"); |
| else |
| log("Success"); |
| </script> |