REGRESSION(r145788): mouse drag on canvas shouldn't start selection
[WebKit-https.git] / LayoutTests / fast / events / mosuedrag-on-canvas-should-not-start-selection.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div id="editor" contenteditable>
5 <canvas width="100" height="100" style="border: 1px solid black" onmousedown="mouseDown=true;" onmouseup="mouseUp=true;"></canvas>
6 </div>
7 <script src="../js/resources/js-test-pre.js"></script>
8 <script>
9
10 description("This tests initiating a mouse drag on a canvas element doesn't start selection."
11     + " To manually test, drag mouse on the canvas below. WebKit shouldn't select the canvas.")
12
13 if (window.eventSender) {
14     var canvas = document.querySelector('canvas');
15
16     evalAndLog('getSelection().removeAllRanges(); mouseDown = false; mouseUp = false');
17     shouldBeTrue("eventSender.mouseMoveTo(canvas.offsetLeft + 10, canvas.offsetTop + 10); eventSender.mouseDown(); mouseDown");
18     eventSender.leapForward(200);
19     shouldBeTrue("eventSender.mouseMoveTo(canvas.offsetLeft + 100, canvas.offsetTop + 100); eventSender.mouseUp(); mouseUp");
20     shouldBeTrue("getSelection().isCollapsed");
21 }
22
23 </script>
24 </body>
25 </html>