Bug 1634779 - pt 2. Partially revert Bug 1603006 r=kmag
[gecko.git] / dom / webidl / FileReader.webidl
blobe1f7dc8c6a7f67eec4e20bf598219feb19bc8fc0
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://w3c.github.io/FileAPI/#APIASynch
8  *
9  * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 [Exposed=(Window,Worker)]
14 interface FileReader : EventTarget {
15   constructor();
17   // async read methods
18   [Throws]
19   void readAsArrayBuffer(Blob blob);
20   [Throws]
21   void readAsBinaryString(Blob filedata);
22   [Throws]
23   void readAsText(Blob blob, optional DOMString label);
24   [Throws]
25   void readAsDataURL(Blob blob);
27   void abort();
29   // states
30   const unsigned short EMPTY = 0;
31   const unsigned short LOADING = 1;
32   const unsigned short DONE = 2;
35   readonly attribute unsigned short readyState;
37   readonly attribute (DOMString or ArrayBuffer)? result;
39   readonly attribute DOMException? error;
41   // event handler attributes
42   attribute EventHandler onloadstart;
43   attribute EventHandler onprogress;
44   attribute EventHandler onload;
45   attribute EventHandler onabort;
46   attribute EventHandler onerror;
47   attribute EventHandler onloadend;