Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / contains-boundaries.html
blobe033157859920057e47b191e3aad3a37a70fcaa8
1 <p>
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>.
4 </p>
5 <p>
6 Drag the selected letter W into the yellow rectangle.
7 </p>
8 <div id="source" style="font-size: 72px">W</div>
9 <div contenteditable="true" id="destination" style="font-size: 72px; background: #ffc;"></div>
10 <script>
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();
27 </script>