1 <body style=
"margin: 0;">
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>.
7 <input id=
"field" disabled
>
8 dragging
<span id=
"text">this text
</span> into the text field should not succeed.
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"
32 resultText
= "PASS -- http://bugs.webkit.org/show_bug.cgi?id=10177";
33 document
.body
.innerText
= resultText
;