blob: a0055ded0b7c2e872c6bea19bd96110281724d45 [file] [log] [blame]
<p>This tests for a bug where text pasted into a textarea would appear one character before the position where it was pasted.</p>
<textarea rows=5 id="test">xx</textarea>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var e = document.getElementById("test");
e.setSelectionRange(1, 1);
document.execCommand("InsertHTML", false, "(There should be one 'x' before and after this sentence.)");
if (e.value == "x(There should be one 'x' before and after this sentence.)x")
document.write("<p>Hooray, test succeeded.</p>");
else
document.write("<p>Test failed, value is '" + e.value + "'.</p>");
</script>