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