2 <script src=
"../../resources/js-test.js"></script>
4 var dragEndExpected
= true;
6 window
.onload = function()
8 var dragger
= document
.getElementById('dragMe');
9 dragger
.addEventListener('dragstart', dragStart
);
10 dragger
.addEventListener('drag', dragging
);
11 dragger
.addEventListener('dragend', dragEnd
);
12 if (!window
.testRunner
)
15 var x
= dragger
.offsetLeft
+ dragger
.offsetWidth
/ 2;
16 var y
= dragger
.offsetTop
+ dragger
.offsetHeight
/ 2;
18 eventSender
.mouseMoveTo(x
, y
);
19 eventSender
.mouseDown();
20 eventSender
.leapForward(100);
21 eventSender
.mouseMoveTo(x
+ 100, y
+ 100);
22 eventSender
.mouseUp();
27 if (window
.testRunner
)
28 dragEndExpected
= false;
29 debug('Started drag.');
30 var emptyDiv
= document
.createElement('div');
31 e
.dataTransfer
.setDragImage(emptyDiv
, 0, 0);
36 dragEndExpected
= true;
42 testFailed('Not expecting drag end!');
44 testPassed('Ended drag.');
54 border:
1px solid black;
58 <p>Test that calling setDragImage() with a detached node doesn't immediately abort the drag. This test can be manually run by dragging the 'Drag Me' div around and then ending the drag.
59 <div id=
"dragMe" draggable=
"true">Drag Me
</div>
60 <div id=
"console"></div>