OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 21 matching lines...) Expand all Loading... |
32 // https://w3c.github.io/FileAPI/#APIASynch | 32 // https://w3c.github.io/FileAPI/#APIASynch |
33 | 33 |
34 [ | 34 [ |
35 ActiveScriptWrappable, | 35 ActiveScriptWrappable, |
36 DependentLifetime, | 36 DependentLifetime, |
37 Constructor, | 37 Constructor, |
38 ConstructorCallWith=ExecutionContext, | 38 ConstructorCallWith=ExecutionContext, |
39 Exposed=(Window,Worker), | 39 Exposed=(Window,Worker), |
40 ] interface FileReader : EventTarget { | 40 ] interface FileReader : EventTarget { |
41 // async read methods | 41 // async read methods |
42 [RaisesException] void readAsArrayBuffer(Blob blob); | 42 [RaisesException, Measure] void readAsArrayBuffer(Blob blob); |
43 [RaisesException] void readAsBinaryString(Blob blob); | 43 [RaisesException, Measure] void readAsBinaryString(Blob blob); |
44 [RaisesException] void readAsText(Blob blob, optional DOMString label); | 44 [RaisesException] void readAsText(Blob blob, optional DOMString label); |
45 [RaisesException] void readAsDataURL(Blob blob); | 45 [RaisesException] void readAsDataURL(Blob blob); |
46 | 46 |
47 void abort(); | 47 void abort(); |
48 | 48 |
49 // states | 49 // states |
50 const unsigned short EMPTY = 0; | 50 const unsigned short EMPTY = 0; |
51 const unsigned short LOADING = 1; | 51 const unsigned short LOADING = 1; |
52 const unsigned short DONE = 2; | 52 const unsigned short DONE = 2; |
53 | 53 |
54 [ImplementedAs=getReadyState] readonly attribute unsigned short readyState; | 54 [ImplementedAs=getReadyState] readonly attribute unsigned short readyState; |
55 | 55 |
56 // File or Blob data | 56 // File or Blob data |
57 readonly attribute (DOMString or ArrayBuffer)? result; | 57 readonly attribute (DOMString or ArrayBuffer)? result; |
58 | 58 |
59 // TODO(jsbell): Spec has DOMError, which is being deprecated. | 59 // TODO(jsbell): Spec has DOMError, which is being deprecated. |
60 readonly attribute DOMException? error; | 60 readonly attribute DOMException? error; |
61 | 61 |
62 // event handler attributes | 62 // event handler attributes |
63 attribute EventHandler onloadstart; | 63 attribute EventHandler onloadstart; |
64 attribute EventHandler onprogress; | 64 attribute EventHandler onprogress; |
65 attribute EventHandler onload; | 65 attribute EventHandler onload; |
66 attribute EventHandler onabort; | 66 attribute EventHandler onabort; |
67 attribute EventHandler onerror; | 67 attribute EventHandler onerror; |
68 attribute EventHandler onloadend; | 68 attribute EventHandler onloadend; |
69 }; | 69 }; |
OLD | NEW |