6 document
.body
.innerHTML
= 'PASS';
7 if (!evt
.dataTransfer
.types
) return;
8 for (var i
= 0, type
; type
= evt
.dataTransfer
.types
[i
]; i
++) {
9 clip
= evt
.dataTransfer
.getData(type
);
10 if (typeof clip
== 'string' && clip
.indexOf('FAIL') != -1)
11 document
.body
.innerHTML
= 'FAIL';
14 window
.testRunner
.notifyDone();
18 window
.testRunner
.dumpAsText();
19 window
.testRunner
.waitUntilDone();
20 var d
= document
.getElementById('drag');
21 var o
= document
.getElementById('drop');
22 eventSender
.mouseMoveTo(d
.offsetLeft
+ d
.offsetWidth
/ 2, d
.offsetTop
+ d
.offsetHeight
/ 2);
23 eventSender
.mouseDown();
24 eventSender
.leapForward(100);
25 eventSender
.mouseMoveTo(o
.offsetLeft
+ o
.offsetWidth
/ 2, o
.offsetTop
+ o
.offsetHeight
/ 2);
26 eventSender
.mouseUp();
29 window
.onload = function() {
30 var d
= document
.getElementById('drag');
31 var r
= document
.createRange();
33 getSelection().removeAllRanges();
34 getSelection().addRange(r
);
35 document
.getElementById('drop').addEventListener('drop', onDrop
, true);
36 window
.addEventListener('dragover', function(x
) { x
.preventDefault() }, true);
37 window
.addEventListener('dragstart', function(x
) { window
.focus() }, true);
39 if (window
.testRunner
)
45 Dragging this iframe onto a drop target should not expose its contents.
46 <div id=
"drag" style=
"-webkit-user-drag: element ">
48 <iframe src=
"resources/file-for-drag-and-drop-subframe-dataTransfer.html"></iframe>