Make DataTransferItemList work with plain text entries
[WebKit-https.git] / LayoutTests / editing / pasteboard / datatransfer-idl.html
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../../resources/WebIDLParser.js"></script>
7 <script src="../../resources/idlharness.js"></script>
8 </head>
9 <body>
10 <script id="datatransfer-idl" type="text/plain">
11 [Constructor, Exposed=(Window)]
12 interface DataTransfer {
13     attribute DOMString dropEffect;
14     attribute DOMString effectAllowed;
15
16     [SameObject] readonly attribute DataTransferItemList items;
17
18     void setDragImage(Element image, long x, long y);
19
20     /* old interface */
21     readonly attribute FrozenArray<DOMString> types;
22     DOMString getData(DOMString format);
23     void setData(DOMString format, DOMString data);
24     void clearData(optional DOMString format);
25     [SameObject] readonly attribute FileList files;
26 };
27 </script>
28 <script id="datatransferitemlist-idl" type="text/plain">
29 interface DataTransferItemList {
30     readonly attribute unsigned long length;
31     getter DataTransferItem (unsigned long index);
32     DataTransferItem? add(DOMString data, DOMString type);
33     DataTransferItem? add(File data);
34     void remove(unsigned long index);
35     void clear();
36 };
37 </script>
38 <script id="datatransferitem-idl" type="text/plain">
39 interface DataTransferItem {
40     readonly attribute DOMString kind;
41     readonly attribute DOMString type;
42     void getAsString(FunctionStringCallback? callback);
43     File? getAsFile();
44 };
45
46 callback FunctionStringCallback = void (DOMString data);
47 </script>
48 <script>
49 var idlsArray = new IdlArray();
50 var idl = document.getElementById("datatransfer-idl").textContent
51     + document.getElementById("datatransferitemlist-idl").textContent
52     + document.getElementById("datatransferitem-idl").textContent;
53
54 idlsArray.add_idls(idl);
55 idlsArray.add_untested_idls("interface Element {};");
56 idlsArray.test();
57 </script>
58 </body>
59 </html>