5 if (window
.testRunner
) {
6 testRunner
.waitUntilDone();
7 testRunner
.dumpAsText();
11 var msgNode
= document
.createTextNode(msg
);
12 var li
= document
.createElement("li");
13 li
.appendChild(msgNode
);
14 document
.getElementById("log").appendChild(li
);
17 var waitingForUp
= false;
18 function dragStarted() {
19 if (dragging
|| waitingForUp
) {
20 log("Unexpected drag start");
27 window
.onmousedown = function() {
28 log("Unexpected mousedown");
31 window
.onmousemove = function() {
32 if (!dragging
|| waitingForUp
)
34 log("Received mouse move");
38 window
.onmouseup = function() {
40 log("Unexpected mouseup");
43 log("Received mouseup event")
47 window
.onload = function() {
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.");
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();
66 if (window
.testRunner
)
67 testRunner
.notifyDone();
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>