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 21 matching lines...) Expand all Loading... | |
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 "stream" | 39 "stream" |
40 }; | 40 }; |
41 | 41 |
42 // TODO(philipj): Most DOMString types in the XMLHttpRequest interface should be | |
43 // either ByteString or USVString. | |
42 [ | 44 [ |
43 WillBeGarbageCollected, | 45 WillBeGarbageCollected, |
44 ActiveDOMObject, | 46 ActiveDOMObject, |
45 Constructor, | 47 Constructor, |
46 ConstructorCallWith=ScriptState, | 48 ConstructorCallWith=ScriptState, |
49 // TODO(philipj): The spec has Exposed=(Window,Worker) | |
50 // https://github.com/whatwg/xhr/issues/19 | |
47 Exposed=(Window,DedicatedWorker,SharedWorker) | 51 Exposed=(Window,DedicatedWorker,SharedWorker) |
48 ] interface XMLHttpRequest : XMLHttpRequestEventTarget { | 52 ] interface XMLHttpRequest : XMLHttpRequestEventTarget { |
49 // event handler | 53 // event handler |
50 attribute EventHandler onreadystatechange; | 54 attribute EventHandler onreadystatechange; |
51 | 55 |
52 // states | 56 // states |
53 const unsigned short UNSENT = 0; | 57 const unsigned short UNSENT = 0; |
54 const unsigned short OPENED = 1; | 58 const unsigned short OPENED = 1; |
55 const unsigned short HEADERS_RECEIVED = 2; | 59 const unsigned short HEADERS_RECEIVED = 2; |
56 const unsigned short LOADING = 3; | 60 const unsigned short LOADING = 3; |
57 const unsigned short DONE = 4; | 61 const unsigned short DONE = 4; |
58 readonly attribute unsigned short readyState; | 62 readonly attribute unsigned short readyState; |
59 | 63 |
60 // request | 64 // request |
61 [RaisesException] void open(DOMString method, DOMString url, optional boolea n async, [TreatUndefinedAs=NullString] optional DOMString? user, [TreatUndefined As=NullString] optional DOMString? password); | 65 [RaisesException] void open(DOMString method, DOMString url); |
62 [RaisesException] void setRequestHeader(DOMString header, DOMString value); | 66 [RaisesException] void open(DOMString method, DOMString url, boolean async, optional DOMString? username = null, optional DOMString? password = null); |
67 [RaisesException] void setRequestHeader(DOMString name, DOMString value); | |
63 [RaisesException=Setter] attribute unsigned long timeout; | 68 [RaisesException=Setter] attribute unsigned long timeout; |
64 [RaisesException=Setter] attribute boolean withCredentials; | 69 [RaisesException=Setter] attribute boolean withCredentials; |
65 readonly attribute XMLHttpRequestUpload upload; | 70 readonly attribute XMLHttpRequestUpload upload; |
66 [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob or Document or DOMString or FormData)? data); | 71 // TODO(philipj): The data argument should be of type (Document or BodyInit) ? |
yhirano
2015/06/01 01:25:12
Please wrap the comment in 80 columns.
philipj_slow
2015/06/01 11:59:54
Done.
| |
72 [RaisesException] void send(optional (ArrayBuffer or ArrayBufferView or Blob or Document or DOMString or FormData)? data = null); | |
yhirano
2015/06/01 01:25:12
The parameter name should be |body| instead of |da
philipj_slow
2015/06/01 11:59:54
Done.
| |
67 void abort(); | 73 void abort(); |
68 | 74 |
69 // response | 75 // response |
70 readonly attribute DOMString responseURL; | 76 readonly attribute DOMString responseURL; |
71 readonly attribute unsigned short status; | 77 readonly attribute unsigned short status; |
72 readonly attribute DOMString statusText; | 78 readonly attribute DOMString statusText; |
73 DOMString? getResponseHeader(DOMString header); | 79 DOMString? getResponseHeader(DOMString name); |
74 [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders(); | 80 DOMString getAllResponseHeaders(); |
75 [RaisesException] void overrideMimeType(DOMString override); | 81 [RaisesException] void overrideMimeType(DOMString mime); |
76 [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType; | 82 [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType; |
77 [Custom=Getter, RaisesException=Getter] readonly attribute object response; | 83 [Custom=Getter, RaisesException=Getter] readonly attribute any response; |
78 [Custom=Getter, RaisesException=Getter] readonly attribute DOMString? respon seText; | 84 [Custom=Getter, RaisesException=Getter] readonly attribute DOMString respons eText; |
79 [RaisesException=Getter] readonly attribute Document responseXML; | 85 // TODO(philipj): responseXML should be [Exposed=Window]. |
86 [RaisesException=Getter] readonly attribute Document? responseXML; | |
80 }; | 87 }; |
OLD | NEW |