<!DOCTYPE html>
<html>
<body>
<div id="editor" contenteditable>
<canvas width="100" height="100" style="border: 1px solid black" onmousedown="mouseDown=true;" onmouseup="mouseUp=true;"></canvas>
</div>
<script src="../../resources/js-test-pre.js"></script>
<script>

description("This tests initiating a mouse drag on a canvas element doesn't start selection."
    + " To manually test, drag mouse on the canvas below. WebKit shouldn't select the canvas.")

if (window.eventSender) {
    var canvas = document.querySelector('canvas');

    evalAndLog('getSelection().removeAllRanges(); mouseDown = false; mouseUp = false');
    shouldBeTrue("eventSender.mouseMoveTo(canvas.offsetLeft + 10, canvas.offsetTop + 10); eventSender.mouseDown(); mouseDown");
    eventSender.leapForward(200);
    shouldBeTrue("eventSender.mouseMoveTo(canvas.offsetLeft + 100, canvas.offsetTop + 100); eventSender.mouseUp(); mouseUp");
    shouldBeTrue("getSelection().isCollapsed");
}

</script>
</body>
</html>
