| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 function test() | 2 function test() |
| 3 { | 3 { |
| 4 if (window.testRunner) | 4 if (window.testRunner) |
| 5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
| 6 var ta = document.getElementById("ta"); | 6 var ta = document.getElementById("ta"); |
| 7 ta.value = "abc\n"; | 7 ta.value = "abc\n"; |
| 8 ta.focus(); | 8 ta.focus(); |
| 9 ta.setSelectionRange(0, 4); | 9 ta.setSelectionRange(0, 4); |
| 10 document.execCommand("cut"); | 10 document.execCommand("cut"); |
| 11 document.execCommand("paste"); | 11 document.execCommand("paste"); |
| 12 var result1 = ta.value; | 12 var result1 = ta.value; |
| 13 ta.setSelectionRange(0, 0); | 13 ta.setSelectionRange(0, 0); |
| 14 document.execCommand("paste"); | 14 document.execCommand("paste"); |
| 15 var result2 = ta.value; | 15 var result2 = ta.value; |
| 16 | 16 |
| 17 if (result1 == "abc\n" && result2 == "abc\nabc\n") | 17 if (result1 == "abc\n" && result2 == "abc\nabc\n") |
| 18 document.write("<p>Hooray, the test was successful!</p>"); | 18 document.write("<p>Hooray, the test was successful!</p>"); |
| 19 else if (result1 == "") | 19 else if (result1 == "") |
| 20 document.write("<p>The test failed; doesn't work in release builds of Sa
fari because paste is not allowed.</p>"); | 20 document.write("<p>The test failed; doesn't work in release builds of Sa
fari because paste is not allowed.</p>"); |
| 21 else | 21 else |
| 22 document.write("<p>The test failed, result 1 was '" + result1.replace("\
n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>"); | 22 document.write("<p>The test failed, result 1 was '" + result1.replace("\
n", "\\n") + "' and result 2 was '" + result2.replace("\n", "\\n") + "'.</p>"); |
| 23 } | 23 } |
| 24 </script> | 24 </script> |
| 25 <body onload="test()"> | 25 <body onload="test()"> |
| 26 <p><textarea id="ta"></textarea></p> | 26 <p><textarea id="ta"></textarea></p> |
| OLD | NEW |