Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / mouse-drag-from-frame.html
blobb59f3de88ef06ebd15900cb4ced75019bb951f0a
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner) {
6 testRunner.waitUntilDone();
7 testRunner.dumpAsText();
10 function log(msg) {
11 var msgNode = document.createTextNode(msg);
12 var li = document.createElement("li");
13 li.appendChild(msgNode);
14 document.getElementById("log").appendChild(li);
16 var dragging = false;
17 var waitingForUp = false;
18 function dragStarted() {
19 if (dragging || waitingForUp) {
20 log("Unexpected drag start");
21 return;
23 log("Drag started");
24 dragging = true;
27 window.onmousedown = function() {
28 log("Unexpected mousedown");
31 window.onmousemove = function() {
32 if (!dragging || waitingForUp)
33 return;
34 log("Received mouse move");
35 waitingForUp = true;
38 window.onmouseup = function() {
39 if (!waitingForUp) {
40 log("Unexpected mouseup");
41 return;
43 log("Received mouseup event")
44 log("PASS!");
47 window.onload = function() {
48 try {
49 if (!frames[0] || !frames[0].document || !frames[0].document.getElementById("dragSource")) {
50 log("Window.onload fired before subframe completed load.");
53 if (!window.testRunner) {
54 log("This test needs to be run in DRT. To test manually drag from the text 'Drag Me!' out into the parent frame.");
55 return;
57 var dragSource = frames[0].document.getElementById("dragSource");
58 var sourceFrame = document.getElementById("sourceFrame");
59 var x = dragSource.offsetLeft + sourceFrame.offsetLeft + 10;
60 var y = dragSource.offsetTop + sourceFrame.offsetTop + dragSource.offsetHeight / 2;
61 eventSender.mouseMoveTo(x,y);
62 eventSender.mouseDown();
63 eventSender.mouseMoveTo(120, 120);
64 eventSender.mouseUp();
65 } finally {
66 if (window.testRunner)
67 testRunner.notifyDone();
70 </script>
71 </head>
72 <body>
73 <div>This tests that dragging from an element that returns <emph>false</emph> from its mousedown handler will not let the subsequent mousemove events be captured by the containing frame.</div>
74 <iframe id="sourceFrame" style="width: 100px; height: 50px;" src="resources/mouse-drag-from-frame-subframe.html"></iframe>
75 <ul id="log">
76 </ul>
77 </body>
78 </html>