| <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> |