| color: rgba(0, 0, 0, 0.2); |
| -webkit-font-smoothing: none; |
| This tests smart pasting in a text control. |
| To manually test, double click the middle word in the text area below. Then cut and paste. |
| It should result in the original text. The space before the middle word should not be lost. |
| <textarea id="textarea">Hello world test</textarea> |
| if (window.eventSender) { |
| function doubleClick(x, y) { |
| eventSender.mouseMoveTo(x, y); |
| var target = document.getElementById("textarea"); |
| var x = target.offsetLeft + 120; |
| var y = target.offsetTop + 10; |
| document.execCommand("Cut"); |
| document.execCommand("Paste"); |
| if (target.value == "Hello world test") |
| document.write("PASS: Smart cutting and pasting result in the original text."); |
| document.write("FAIL: Smart cutting and pasting do not result in the original text."); |
| document.write("This test can't run automatically in web browser without eventSender."); |