blob: 493031581f32b35f165935d89dd1837a38ed7a64 [file] [log] [blame]
<html>
<head>
<script>
function focusHandler() {
var input = document.getElementById("input");
input.parentNode.removeChild(input);
}
function runTest() {
if (!window.layoutTestController)
return;
window.layoutTestController.dumpEditingCallbacks();
var x, y;
var span = document.getElementById("span");
x = span.offsetParent.offsetLeft + span.offsetLeft + span.offsetWidth / 2;
y = span.offsetParent.offsetTop + span.offsetTop + span.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
eventSender.mouseDown();
eventSender.mouseUp();
eventSender.leapForward(1000);
eventSender.mouseDown();
eventSender.leapForward(500);
var input = document.getElementById("input");
x = input.offsetParent.offsetLeft + input.offsetLeft + input.offsetWidth / 2;
y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.leapForward(500);
eventSender.mouseUp();
}
</script>
</head>
<body>
<p>This tests drag and drop into a form element that is removed in its onfocus handler. Safari shouldn't crash and the dropped content shouldn't appear anywhere because there's no editable region left over underneath the mouse when the input element is removed on drop.</p>
<hr>
<span id="span">Dragme</span><input type="text" id="input" onfocus="focusHandler()">
<script>runTest();</script>
</body>