| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script type="text/javascript"> | |
| 4 function print(message) | |
| 5 { | |
| 6 var paragraph = document.createElement("li"); | |
| 7 paragraph.appendChild(document.createTextNode(message)); | |
| 8 document.getElementById("console").appendChild(paragraph); | |
| 9 } | |
| 10 function test() | |
| 11 { | |
| 12 if (window.testRunner) { | |
| 13 testRunner.dumpAsText(); | |
| 14 } | |
| 15 var elt = document.getElementById("text"); | |
| 16 elt.defaultValue = "\ntesting"; | |
| 17 compare(elt.defaultValue, "\ntesting"); | |
| 18 elt.defaultValue = "\n\ntesting"; | |
| 19 compare(elt.defaultValue, "\n\ntesting"); | |
| 20 elt.defaultValue = "\n\n\ntesting"; | |
| 21 compare(elt.defaultValue, "\n\n\ntesting"); | |
| 22 elt.defaultValue = ""; | |
| 23 } | |
| 24 function compare(val, exp) | |
| 25 { | |
| 26 if (val == exp) { | |
| 27 print("Passed"); | |
| 28 } else { | |
| 29 print("Failed"); | |
| 30 } | |
| 31 } | |
| 32 </script> | |
| 33 </head> | |
| 34 <body onload="test();"> | |
| 35 <p>This test attempts to set a leading newline in a text area's default
value.</p> | |
| 36 <p>If the test passes, you should see a 3 lines saying "Passed" below.</
p> | |
| 37 <hr> | |
| 38 <form> | |
| 39 <textarea id="text"></textarea> | |
| 40 </form> | |
| 41 <hr> | |
| 42 <p><ol id="console"></ol></p> | |
| 43 </body> | |
| 44 </html> | |
| OLD | NEW |