Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / textfield-drag-into-disabled.html
blob4d22ae519415e2fa0938d6637bc01dd2582522a1
1 <body style="margin: 0;">
2 <p>
3 Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=10177">http://bugs.webkit.org/show_bug.cgi?id=10177</a>
4 REGRESSION: Successfully dragging text into a disabled field</i>.
5 </p>
6 <hr>
7 <input id="field" disabled>
8 dragging <span id="text">this text</span> into the text field should not succeed.
9 <script>
10 var text = document.getElementById("text");
11 var textX = text.offsetLeft + text.offsetWidth / 2;
12 var textY = text.offsetTop + text.offsetHeight / 2;
14 var field = document.getElementById("field");
15 var fieldX = field.offsetLeft + field.offsetWidth / 2;
16 var fieldY = field.offsetTop + field.offsetHeight / 2;
18 window.getSelection().setBaseAndExtent(text, 0, text, 1);
20 if (window.testRunner) {
21 eventSender.mouseMoveTo(textX, textY);
22 eventSender.mouseDown();
23 // leap forward so mouseDown will kick off a drag instead of starting a new selection.
24 eventSender.leapForward(1000);
26 eventSender.mouseMoveTo(fieldX, fieldY);
27 eventSender.mouseUp();
29 testRunner.dumpAsText();
30 var resultText = "FAIL"
31 if (!field.value)
32 resultText = "PASS -- http://bugs.webkit.org/show_bug.cgi?id=10177";
33 document.body.innerText = resultText;
35 </script>
36 </body>