| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 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> | 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 worl
d" on Mac and "worldhello" on all other platforms.</p> | 5 <p>To manually test, select "hello" and rapidly drag. You should see "hello worl
d" on Mac and "worldhello" on all other platforms.</p> |
| 6 <div id="log"></div> | 6 <div id="log"></div> |
| 7 <input id="text" type="text" value="hello world" /> | 7 <input id="text" type="text" value="hello world" /> |
| 8 <script> | 8 <script> |
| 9 if (window.testRunner) { | 9 if (window.testRunner) { |
| 10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 11 | 11 |
| 12 var text = document.getElementById("text"); | 12 var text = document.getElementById("text"); |
| 13 text.focus(); |
| 13 text.setSelectionRange(0, 5); | 14 text.setSelectionRange(0, 5); |
| 14 | 15 |
| 15 var start_x = text.offsetLeft + 5; | 16 var start_x = text.offsetLeft + 5; |
| 16 var start_y = text.offsetTop + text.offsetHeight / 2; | 17 var start_y = text.offsetTop + text.offsetHeight / 2; |
| 17 eventSender.mouseMoveTo(start_x, start_y); | 18 eventSender.mouseMoveTo(start_x, start_y); |
| 18 eventSender.mouseDown(); | 19 eventSender.mouseDown(); |
| 19 | 20 |
| 20 var end_x = text.offsetLeft + text.offsetWidth - 5; | 21 var end_x = text.offsetLeft + text.offsetWidth - 5; |
| 21 var end_y = start_y; | 22 var end_y = start_y; |
| 22 eventSender.mouseMoveTo(end_x, end_y); | 23 eventSender.mouseMoveTo(end_x, end_y); |
| 23 eventSender.mouseUp(); | 24 eventSender.mouseUp(); |
| 24 | 25 |
| 25 document.getElementById('log').innerText = text.value; | 26 document.getElementById('log').innerText = text.value; |
| 26 } | 27 } |
| 27 </script> | 28 </script> |
| 28 </body> | 29 </body> |
| 29 </html> | 30 </html> |
| OLD | NEW |