| <html> |
| <head> |
| <script type="text/javascript"> |
| function print(message) |
| { |
| var paragraph = document.createElement("li"); |
| paragraph.appendChild(document.createTextNode(message)); |
| document.getElementById("console").appendChild(paragraph); |
| } |
| function test() |
| { |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| } |
| var elt = document.getElementById("text"); |
| elt.defaultValue = "\ntesting"; |
| compare(elt.defaultValue, "\ntesting"); |
| elt.defaultValue = "\n\ntesting"; |
| compare(elt.defaultValue, "\n\ntesting"); |
| elt.defaultValue = "\n\n\ntesting"; |
| compare(elt.defaultValue, "\n\n\ntesting"); |
| elt.defaultValue = ""; |
| } |
| function compare(val, exp) |
| { |
| if (val == exp) { |
| print("Passed"); |
| } else { |
| print("Failed"); |
| } |
| } |
| </script> |
| </head> |
| <body onload="test();"> |
| <p>This test attempts to set a leading newline in a text area's default value.</p> |
| <p>If the test passes, you should see a 3 lines saying "Passed" below.</p> |
| <hr> |
| <form> |
| <textarea id="text"></textarea> |
| </form> |
| <hr> |
| <p><ol id="console"></ol></p> |
| </body> |
| </html> |