OLD | NEW |
1 [Constructor, | 1 // https://w3c.github.io/FileAPI/#idl-index |
2 Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blo
bParts, optional BlobPropertyBag options), Exposed=Window,Worker] | 2 |
| 3 [Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag opt
ions), |
| 4 Exposed=(Window,Worker)] |
3 interface Blob { | 5 interface Blob { |
4 | 6 |
5 readonly attribute unsigned long long size; | 7 readonly attribute unsigned long long size; |
6 readonly attribute DOMString type; | 8 readonly attribute DOMString type; |
7 readonly attribute boolean isClosed; | 9 readonly attribute boolean isClosed; |
8 | 10 |
9 //slice Blob into byte-ranged chunks | 11 //slice Blob into byte-ranged chunks |
10 | 12 |
11 Blob slice([Clamp] optional long long start, | 13 Blob slice([Clamp] optional long long start, |
12 [Clamp] optional long long end, | 14 [Clamp] optional long long end, |
13 optional DOMString contentType); | 15 optional DOMString contentType); |
14 void close(); | 16 void close(); |
15 | 17 |
16 }; | 18 }; |
17 | 19 |
18 dictionary BlobPropertyBag { | 20 dictionary BlobPropertyBag { |
19 DOMString type = ""; | 21 DOMString type = ""; |
20 }; | 22 }; |
21 | 23 |
22 [Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fil
eBits, | 24 typedef (BufferSource or Blob or USVString) BlobPart; |
23 [EnsureUTF16] DOMString fileName, optional FilePropertyBag options), Exposed=Win
dow,Worker] | 25 |
| 26 [Constructor(sequence<BlobPart> fileBits, |
| 27 [EnsureUTF16] DOMString fileName, |
| 28 optional FilePropertyBag options), |
| 29 Exposed=(Window,Worker)] |
24 interface File : Blob { | 30 interface File : Blob { |
25 | |
26 readonly attribute DOMString name; | 31 readonly attribute DOMString name; |
27 readonly attribute long long lastModified; | 32 readonly attribute long long lastModified; |
28 | |
29 }; | 33 }; |
30 | 34 |
31 dictionary FilePropertyBag { | 35 dictionary FilePropertyBag : BlobPropertyBag { |
32 | |
33 DOMString type = ""; | |
34 long long lastModified; | 36 long long lastModified; |
35 | |
36 }; | 37 }; |
37 | 38 |
38 [Exposed=Window,Worker] interface FileList { | 39 [Exposed=(Window,Worker)] |
| 40 interface FileList { |
39 getter File? item(unsigned long index); | 41 getter File? item(unsigned long index); |
40 readonly attribute unsigned long length; | 42 readonly attribute unsigned long length; |
41 }; | 43 }; |
42 | 44 |
43 [Constructor, Exposed=Window,Worker] | 45 [Constructor, Exposed=(Window,Worker)] |
44 interface FileReader: EventTarget { | 46 interface FileReader: EventTarget { |
45 | 47 |
46 // async read methods | 48 // async read methods |
47 void readAsArrayBuffer(Blob blob); | 49 void readAsArrayBuffer(Blob blob); |
| 50 void readAsBinaryString(Blob blob); |
48 void readAsText(Blob blob, optional DOMString label); | 51 void readAsText(Blob blob, optional DOMString label); |
49 void readAsDataURL(Blob blob); | 52 void readAsDataURL(Blob blob); |
50 | 53 |
51 void abort(); | 54 void abort(); |
52 | 55 |
53 // states | 56 // states |
54 const unsigned short EMPTY = 0; | 57 const unsigned short EMPTY = 0; |
55 const unsigned short LOADING = 1; | 58 const unsigned short LOADING = 1; |
56 const unsigned short DONE = 2; | 59 const unsigned short DONE = 2; |
57 | 60 |
| 61 |
58 readonly attribute unsigned short readyState; | 62 readonly attribute unsigned short readyState; |
59 | 63 |
60 // File or Blob data | 64 // File or Blob data |
61 readonly attribute (DOMString or ArrayBuffer)? result; | 65 readonly attribute (DOMString or ArrayBuffer)? result; |
62 | 66 |
63 readonly attribute DOMError? error; | 67 readonly attribute DOMError? error; |
64 | 68 |
65 // event handler attributes | 69 // event handler content attributes |
66 attribute EventHandler onloadstart; | 70 attribute EventHandler onloadstart; |
67 attribute EventHandler onprogress; | 71 attribute EventHandler onprogress; |
68 attribute EventHandler onload; | 72 attribute EventHandler onload; |
69 attribute EventHandler onabort; | 73 attribute EventHandler onabort; |
70 attribute EventHandler onerror; | 74 attribute EventHandler onerror; |
71 attribute EventHandler onloadend; | 75 attribute EventHandler onloadend; |
72 | 76 |
73 }; | 77 }; |
74 | 78 |
75 partial interface URL { | |
76 | |
77 static DOMString createObjectURL(Blob blob); | |
78 static DOMString createFor(Blob blob); | |
79 static void revokeObjectURL(DOMString url); | |
80 | |
81 }; | |
82 | |
83 [Constructor, Exposed=Worker] | 79 [Constructor, Exposed=Worker] |
84 interface FileReaderSync { | 80 interface FileReaderSync { |
85 | |
86 // Synchronously return strings | 81 // Synchronously return strings |
87 | 82 |
88 ArrayBuffer readAsArrayBuffer(Blob blob); | 83 ArrayBuffer readAsArrayBuffer(Blob blob); |
| 84 DOMString readAsBinaryString(Blob blob); |
89 DOMString readAsText(Blob blob, optional DOMString label); | 85 DOMString readAsText(Blob blob, optional DOMString label); |
90 DOMString readAsDataURL(Blob blob); | 86 DOMString readAsDataURL(Blob blob); |
91 }; | 87 }; |
| 88 |
| 89 [Exposed=(Window,DedicatedWorker,SharedWorker)] |
| 90 partial interface URL { |
| 91 static DOMString createObjectURL(Blob blob); |
| 92 static DOMString createFor(Blob blob); |
| 93 static void revokeObjectURL(DOMString url); |
| 94 }; |
OLD | NEW |