blob: 019f347b37cfc96a3378e2a8d54bcfd4e9c4f05e [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<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>
<p>To manually test, select "hello" and rapidly drag. You should see "hello world" on Mac and "worldhello" on all other platforms.</p>
<div id="log"></div>
<input id="text" type="text" value="hello world" />
<script>
if (window.testRunner) {
testRunner.dumpAsText();
var text = document.getElementById("text");
text.setSelectionRange(0, 5);
var start_x = text.offsetLeft + 5;
var start_y = text.offsetTop + text.offsetHeight / 2;
eventSender.mouseMoveTo(start_x, start_y);
eventSender.mouseDown();
var end_x = text.offsetLeft + text.offsetWidth - 5;
var end_y = start_y;
eventSender.mouseMoveTo(end_x, end_y);
eventSender.mouseUp();
document.getElementById('log').innerText = text.value;
}
</script>
</body>
</html>