Integrate media query evaluation into HTML5 event loop
[WebKit-https.git] / LayoutTests / fast / events / shift-drag-selection-on-link-triggers-drag-n-drop.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>This test ensures drag-n-drop does start when extending an existing selecting with shift + mouse drag, starting over a link.</p>
5 <span style='font-size: 30px; padding: 10px;'>Some text with a <a href=#>link in the end of sentence</a>.</span>
6 <pre>
7 <script>
8
9 var span = document.getElementsByTagName('span')[0];
10 span.focus();
11
12 var dragStartCount = 0;
13 document.addEventListener('dragstart', function (event) { dragStartCount++; });
14
15 if (!window.testRunner || !window.eventSender)
16     document.write('This test requires eventSender');
17 else {
18     testRunner.dumpAsText();
19
20     var y = span.offsetTop + span.offsetHeight / 2;
21     eventSender.mouseMoveTo(span.offsetLeft + 5, y);
22     eventSender.mouseDown();
23     eventSender.leapForward(200);
24     eventSender.mouseUp();
25
26     eventSender.mouseMoveTo(span.offsetLeft + span.offsetWidth / 4, y);
27     eventSender.mouseDown(0, ['shiftKey']);
28     eventSender.leapForward(200);
29     eventSender.mouseUp();
30
31     eventSender.mouseMoveTo(span.offsetLeft + span.offsetWidth * .75 , y);
32     eventSender.mouseDown(0, ['shiftKey']);
33     eventSender.leapForward(200);
34     eventSender.mouseMoveTo(span.offsetLeft + span.offsetWidth * .75, y + 120);
35     eventSender.leapForward(200);
36     eventSender.mouseUp();
37
38     document.writeln("Drag count: " + dragStartCount);
39     span.parentNode.removeChild(span);
40 }
41 </script></pre>
42 </body>
43 </html>