Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / drag-select-rapidly.html
blob7ff4daf28f42098e19ef5d953bc73d21976b80e1
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test verifies that selection begins at the mouse-down position. Select rapidly inside the box blow. The first letter should be selected.</p>
5 <div id='text' style="border: solid 1px; padding: 10px;">The first part of this text should be selected.</div>
6 <script>
7 if (window.testRunner)
8 testRunner.dumpAsText();
10 if (window.eventSender) {
11 var div = document.getElementById('text');
12 var x = div.offsetLeft + 1;
13 var y = div.offsetTop + div.offsetHeight / 2;
15 eventSender.mouseMoveTo(x, y);
16 eventSender.mouseDown();
18 eventSender.mouseMoveTo(x + div.offsetWidth - 5, y);
19 eventSender.mouseUp();
21 var sel = window.getSelection();
22 document.write(sel.anchorNode == sel.focusNode && sel.anchorOffset < sel.focusOffset ? 'PASS' : 'FAIL');
24 </script>
25 </body>
26 </html>