3 <script src="../../resources/dump-as-markup.js" type="text/javascript"></script>
5 Markup.description("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.");
7 function focusHandler() {
8 var input = document.getElementById("input");
9 input.parentNode.removeChild(input);
13 if (!window.layoutTestController)
16 layoutTestController.dumpEditingCallbacks();
19 var span = document.getElementById("span");
20 x = span.offsetParent.offsetLeft + span.offsetLeft + span.offsetWidth / 2;
21 y = span.offsetParent.offsetTop + span.offsetTop + span.offsetHeight / 2;
23 eventSender.mouseMoveTo(x, y);
24 eventSender.mouseDown();
25 eventSender.mouseUp();
26 eventSender.mouseDown();
27 eventSender.mouseUp();
29 eventSender.leapForward(1000);
31 eventSender.mouseDown();
33 eventSender.leapForward(500);
35 var input = document.getElementById("input");
36 x = input.offsetParent.offsetLeft + input.offsetLeft + input.offsetWidth / 2;
37 y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight / 2;
39 eventSender.mouseMoveTo(x, y);
40 eventSender.leapForward(500);
41 eventSender.mouseUp();
43 Markup.dump(document.body);
48 <span id="span">Dragme</span><input type="text" id="input" onfocus="focusHandler()">
49 <script>runTest();</script>