OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 20 matching lines...) Expand all Loading... |
31 enum XMLHttpRequestResponseType { | 31 enum XMLHttpRequestResponseType { |
32 "", | 32 "", |
33 "arraybuffer", | 33 "arraybuffer", |
34 "blob", | 34 "blob", |
35 "document", | 35 "document", |
36 "json", | 36 "json", |
37 "text", | 37 "text", |
38 "legacystream", | 38 "legacystream", |
39 }; | 39 }; |
40 | 40 |
41 // TODO(philipj): Most DOMString types in the XMLHttpRequest interface should be | 41 // TODO(foolip): Most DOMString types in the XMLHttpRequest interface should be |
42 // either ByteString or USVString. | 42 // either ByteString or USVString. |
43 [ | 43 [ |
44 ActiveScriptWrappable, | 44 ActiveScriptWrappable, |
45 Constructor, | 45 Constructor, |
46 ConstructorCallWith=ScriptState, | 46 ConstructorCallWith=ScriptState, |
47 DependentLifetime, | 47 DependentLifetime, |
48 Exposed=(Window,DedicatedWorker,SharedWorker), | 48 Exposed=(Window,DedicatedWorker,SharedWorker), |
49 ] interface XMLHttpRequest : XMLHttpRequestEventTarget { | 49 ] interface XMLHttpRequest : XMLHttpRequestEventTarget { |
50 // event handler | 50 // event handler |
51 attribute EventHandler onreadystatechange; | 51 attribute EventHandler onreadystatechange; |
52 | 52 |
53 // states | 53 // states |
54 const unsigned short UNSENT = 0; | 54 const unsigned short UNSENT = 0; |
55 const unsigned short OPENED = 1; | 55 const unsigned short OPENED = 1; |
56 const unsigned short HEADERS_RECEIVED = 2; | 56 const unsigned short HEADERS_RECEIVED = 2; |
57 const unsigned short LOADING = 3; | 57 const unsigned short LOADING = 3; |
58 const unsigned short DONE = 4; | 58 const unsigned short DONE = 4; |
59 readonly attribute unsigned short readyState; | 59 readonly attribute unsigned short readyState; |
60 | 60 |
61 // request | 61 // request |
62 [RaisesException] void open(DOMString method, DOMString url); | 62 [RaisesException] void open(DOMString method, DOMString url); |
63 [RaisesException] void open(DOMString method, DOMString url, boolean async,
optional DOMString? username = null, optional DOMString? password = null); | 63 [RaisesException] void open(DOMString method, DOMString url, boolean async,
optional DOMString? username = null, optional DOMString? password = null); |
64 [RaisesException] void setRequestHeader(DOMString name, DOMString value); | 64 [RaisesException] void setRequestHeader(DOMString name, DOMString value); |
65 [RaisesException=Setter] attribute unsigned long timeout; | 65 [RaisesException=Setter] attribute unsigned long timeout; |
66 [RaisesException=Setter] attribute boolean withCredentials; | 66 [RaisesException=Setter] attribute boolean withCredentials; |
67 readonly attribute XMLHttpRequestUpload upload; | 67 readonly attribute XMLHttpRequestUpload upload; |
68 // TODO(philipj): The data argument should be of type | 68 // TODO(foolip): The data argument should be of type |
69 // (Document or BodyInit)? | 69 // (Document or BodyInit)? |
70 [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob
or Document or DOMString or FormData)? body = null); | 70 [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob
or Document or DOMString or FormData)? body = null); |
71 void abort(); | 71 void abort(); |
72 | 72 |
73 // response | 73 // response |
74 readonly attribute DOMString responseURL; | 74 readonly attribute DOMString responseURL; |
75 readonly attribute unsigned short status; | 75 readonly attribute unsigned short status; |
76 readonly attribute DOMString statusText; | 76 readonly attribute DOMString statusText; |
77 DOMString? getResponseHeader(DOMString name); | 77 DOMString? getResponseHeader(DOMString name); |
78 DOMString getAllResponseHeaders(); | 78 DOMString getAllResponseHeaders(); |
79 [RaisesException] void overrideMimeType(DOMString mime); | 79 [RaisesException] void overrideMimeType(DOMString mime); |
80 [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType; | 80 [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType; |
81 [Custom=Getter, RaisesException=Getter] readonly attribute any response; | 81 [Custom=Getter, RaisesException=Getter] readonly attribute any response; |
82 [Custom=Getter, RaisesException=Getter] readonly attribute DOMString respons
eText; | 82 [Custom=Getter, RaisesException=Getter] readonly attribute DOMString respons
eText; |
83 // TODO(philipj): responseXML should be [Exposed=Window]. | 83 // TODO(foolip): responseXML should be [Exposed=Window]. |
84 [RaisesException=Getter] readonly attribute Document? responseXML; | 84 [RaisesException=Getter] readonly attribute Document? responseXML; |
85 }; | 85 }; |
OLD | NEW |