mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
integrate readablestream with fetch and blob
This commit is contained in:
parent
0281acea95
commit
bd5796c90b
74 changed files with 2219 additions and 899 deletions
|
@ -17,6 +17,7 @@ interface Blob {
|
|||
optional [Clamp] long long end,
|
||||
optional DOMString contentType);
|
||||
|
||||
[NewObject] object stream();
|
||||
[NewObject] Promise<DOMString> text();
|
||||
[NewObject] Promise<ArrayBuffer> arrayBuffer();
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
[Exposed=(Window,Worker)]
|
||||
interface mixin Body {
|
||||
readonly attribute boolean bodyUsed;
|
||||
readonly attribute object? body;
|
||||
|
||||
[NewObject] Promise<ArrayBuffer> arrayBuffer();
|
||||
[NewObject] Promise<Blob> blob();
|
||||
|
|
11
components/script/dom/webidls/ReadableStream.webidl
Normal file
11
components/script/dom/webidls/ReadableStream.webidl
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// This interface is entirely internal to Servo, and should not be accessible to
|
||||
// web pages.
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
// Need to escape "ReadableStream" so it's treated as an identifier.
|
||||
interface _ReadableStream {
|
||||
};
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
// https://fetch.spec.whatwg.org/#bodyinit
|
||||
typedef (Blob or BufferSource or FormData or DOMString or URLSearchParams) BodyInit;
|
||||
typedef (Blob or BufferSource or FormData or DOMString or URLSearchParams or ReadableStream) BodyInit;
|
||||
|
||||
enum XMLHttpRequestResponseType {
|
||||
"",
|
||||
|
@ -21,7 +21,7 @@ enum XMLHttpRequestResponseType {
|
|||
"blob",
|
||||
"document",
|
||||
"json",
|
||||
"text"
|
||||
"text",
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue