blob: 4f72001c6da9630a6c80ea54a78b268c3126323b [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.layoutTestController)
layoutTestController.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>