2 Test for
<i><a href=
"http://bugs.webkit.org/show_bug.cgi?id=14347">http://bugs.webkit.org/show_bug.cgi?id=
14347</a>
3 REGRESSION (r21291): Initiating a drag near the edge of a selection deselects it
</i>.
6 Drag the selected letter W into the yellow rectangle.
8 <div id=
"source" style=
"font-size: 72px">W
</div>
9 <div contenteditable=
"true" id=
"destination" style=
"font-size: 72px; background: #ffc;"></div>
11 var source
= document
.getElementById("source");
12 var destination
= document
.getElementById("destination");
14 getSelection().setBaseAndExtent(source
, 0, source
, 1);
16 var x
= document
.body
.offsetLeft
+ source
.offsetLeft
+ 1;
17 var srcY
= document
.body
.offsetTop
+ source
.offsetTop
+ source
.offsetHeight
/ 2;
18 var dstY
= document
.body
.offsetTop
+ destination
.offsetTop
+ source
.offsetHeight
/ 2;
20 if (window
.eventSender
) {
21 eventSender
.mouseMoveTo(x
, srcY
);
22 eventSender
.mouseDown();
23 eventSender
.leapForward(1000);
24 eventSender
.mouseMoveTo(x
, dstY
);
25 eventSender
.mouseUp();