4 <script src=
"../editing.js"></script>
8 var items
= event
.clipboardData
.items
;
9 for (var i
= 0; i
< items
.length
; ++i
) {
10 if (items
[i
].kind
== 'file' && items
[i
].type
== 'image/png') {
11 var blob
= items
[i
].getAsFile();
12 var url
= window
.URL
.createObjectURL(blob
);
13 document
.getElementById('dest').src
= url
;
16 window
.setTimeout(function () {
17 if (window
.testRunner
)
18 testRunner
.notifyDone();
24 if (!window
.testRunner
)
26 testRunner
.waitUntilDone();
27 var srcElement
= document
.getElementById('src');
28 srcElement
.contentWindow
.document
.execCommand('copy');
29 eventSender
.mouseMoveTo(1, 1);
30 eventSender
.mouseDown();
31 eventSender
.mouseUp();
32 document
.execCommand('paste');
36 <body onload=
"runTest()" onpaste=
"paste(event)">
37 <div>This file tests the image pasting functionality of DataTransferItems.
38 To try the test manually, right-click on the image
> Copy Image, click
39 anywhere in the background of the main page and paste.
</div>
40 <iframe id=
"src" src=
"resources/mozilla.gif"></iframe><br>