Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / drag-text-delay.html
blob019f347b37cfc96a3378e2a8d54bcfd4e9c4f05e
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>On most platforms, if you click and move the mouse on selected text, it will always initiate a drag. On Mac, there must be a delay between the click and the mouse move before a drag starts. Otherwise, it will just change the selection.</p>
5 <p>To manually test, select "hello" and rapidly drag. You should see "hello world" on Mac and "worldhello" on all other platforms.</p>
6 <div id="log"></div>
7 <input id="text" type="text" value="hello world" />
8 <script>
9 if (window.testRunner) {
10 testRunner.dumpAsText();
12 var text = document.getElementById("text");
13 text.setSelectionRange(0, 5);
15 var start_x = text.offsetLeft + 5;
16 var start_y = text.offsetTop + text.offsetHeight / 2;
17 eventSender.mouseMoveTo(start_x, start_y);
18 eventSender.mouseDown();
20 var end_x = text.offsetLeft + text.offsetWidth - 5;
21 var end_y = start_y;
22 eventSender.mouseMoveTo(end_x, end_y);
23 eventSender.mouseUp();
25 document.getElementById('log').innerText = text.value;
27 </script>
28 </body>
29 </html>