blob: dbfe83c6bc0550d79cb3d43d18242f5db1153fbc [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function log(msg) {
var msgNode = document.createTextNode(msg);
var li = document.createElement("li");
li.appendChild(msgNode);
document.getElementById("logElem").appendChild(li);
}
function dragStarted() {
log("Drag Started");
}
window.onmouseup = function() {
log("Root frame received mouse up");
}
window.onload = function() {
try {
if (!frames[0] || !frames[0].document || !frames[0].document.getElementById("dragSource")) {
log("Window.onload fired before subframe completed load.");
}
if (!window.testRunner) {
log("This test needs to be run in DRT. To test manually drag from the text 'Drag Me!' out into the parent frame.");
return;
}
var dragSource = frames[0].document.getElementById("dragSource");
var sourceFrame = document.getElementById("sourceFrame");
var targetFrame = document.getElementById("targetFrame");
var x = dragSource.offsetLeft + sourceFrame.offsetLeft + 10;
var y = dragSource.offsetTop + sourceFrame.offsetTop + dragSource.offsetHeight / 2;
var x1 = targetFrame.offsetLeft + 10;
var y1 = targetFrame.offsetTop + 10;
eventSender.mouseMoveTo(x,y);
eventSender.mouseDown();
eventSender.mouseMoveTo(x1, y1);
eventSender.mouseUp();
} finally {
if (window.testRunner)
testRunner.notifyDone();
}
}
</script>
</head>
<body>
<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, and allows the mouse move to get to other subframes.</div>
<iframe id="sourceFrame" style="width: 100px; height: 50px;" src="resources/mouse-drag-from-frame-subframe.html"></iframe>
<iframe id="targetFrame" style="width: 100px; height: 50px;" src="resources/mouse-drag-from-frame-target-subframe.html"></iframe>
<ul id="logElem">
</ul>
</body>
</html>