| <body style="margin: 0;"> |
| <p> |
| Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=10177">http://bugs.webkit.org/show_bug.cgi?id=10177</a> |
| REGRESSION: Successfully dragging text into a disabled field</i>. |
| </p> |
| <hr> |
| <input id="field" disabled> |
| dragging <span id="text">this text</span> into the text field should not succeed. |
| <script> |
| var text = document.getElementById("text"); |
| var textX = text.offsetLeft + text.offsetWidth / 2; |
| var textY = text.offsetTop + text.offsetHeight / 2; |
| |
| var field = document.getElementById("field"); |
| var fieldX = field.offsetLeft + field.offsetWidth / 2; |
| var fieldY = field.offsetTop + field.offsetHeight / 2; |
| |
| window.getSelection().setBaseAndExtent(text, 0, text, 1); |
| |
| if (window.testRunner) { |
| eventSender.mouseMoveTo(textX, textY); |
| eventSender.mouseDown(); |
| // leap forward so mouseDown will kick off a drag instead of starting a new selection. |
| eventSender.leapForward(1000); |
| |
| eventSender.mouseMoveTo(fieldX, fieldY); |
| eventSender.mouseUp(); |
| |
| testRunner.dumpAsText(); |
| var resultText = "FAIL" |
| if (!field.value) |
| resultText = "PASS -- http://bugs.webkit.org/show_bug.cgi?id=10177"; |
| document.body.innerText = resultText; |
| } |
| </script> |
| </body> |