diff --git a/Overview.html b/Overview.html index c37708884..040e6b6d2 100644 --- a/Overview.html +++ b/Overview.html @@ -7,7 +7,7 @@
Origin
` headerThis specification uses terminology from the Encoding, HTML, and URL Standards. +
This specification uses terminology from the Encoding, HTML, IDL, Streams, and URL Standards. [ENCODING] [HTML] +[WEBIDL] +[STREAMS] [URL] +
A byte sequence with bytes in the range 0x00 to 0x7F, inclusive, is represented as a utf-8-encoded string with code points in the range U+0000 to @@ -1115,6 +1121,170 @@
This section might be integrated into other standards, such as IDL. + +
A ReadableStream represents a +stream of data. In this section, we +define common operations for ReadableStream. [STREAMS] + +
To enqueue a byte sequence +(chunk) into a ReadableStream +stream, run the these steps: + +
Call EnqueueInReadableStream
(stream,
+ chunk). Rethrow any exceptions.
+
To close a +ReadableStream stream, run these steps: +
Call CloseReadableStream
(stream).
+ Rethrow any exceptions.
+
To construct a +ReadableStream with given strategy, +pull action and cancel action, all of which are optional, run +these steps: + +
Let init be a new object. + +
Set init["pull"] to a function that runs pull if + pull is given. + +
Set init["cancel"] to a function that runs cancel if + cancel is given. + +
Set init["strategy"] to strategy if + strategy is given. + +
Set init be the result of calling the initial value of + ReadableStream as constructor with + init as an argument. Rethrow any exceptions. + +
Return stream. +
To construct a fixed +ReadableStream with given chunks, +run these steps: + +
Let stream be the result of + constructing a + ReadableStream. Rethrow any exceptions. + +
For each chunk in chunks, + enqueue chunk into + stream. Rethrow any exceptions. + +
Close stream. Rethrow any + exceptions. + +
To get a reader from a +ReadableStream stream, run these steps: +
Let reader be the result of calling
+ AcquireReadableStreamReader
(stream).
+ Rethrow any exceptions.
+
+
Return reader. +
To read all bytes from a +ReadableStream with reader, run these +steps: + +
Let promise be a new promise. + +
Let bytes be an empty byte sequence. + +
Let read be the result of calling
+ ReadFromReadableStreamReader
(reader).
+
+
When read is fulfilled with an object whose done
+ property is false and whose value
property is a
+ Uint8Array
, append the value
property to
+ bytes and run the above step again.
+
+
When read is fulfilled with an object whose done
+ property is true, resolve promise with bytes.
+
+
When read is fulfilled with a value that matches with neither of the
+ above patterns, reject promise with a TypeError
.
+
+
When read is rejected with an error, reject promise + with that error. +
Return promise. +
Because the reader grants exclusive access, the actual mechanism of how +to read cannot be observed. Implementations could use more direct mechanism if convenient. + +
To tee a +ReadableStream stream, run these steps: + +
Return the result of calling
+ TeeReadableStream
(stream, true).
+ Rethrow any exception.
+
An empty +ReadableStream is the result of +constructing a fixed +ReadableStream with an empty array. + +
Constructing an empty +ReadableStream will not throw an exception. + +
A ReadableStream stream is said to be +readable if stream@[[state]] is +"readable". + +
A ReadableStream stream is said to be +closed if stream@[[state]] is +"closed". + +
A ReadableStream stream is said to be +errored if stream@[[state]] is +"errored". + +
A ReadableStream stream is said to be
+locked if the result of calling
+IsReadableStreamLocked
(stream) is true.
+
+
A ReadableStream stream is said to +need more data if the following conditions +hold: + +
stream is readable. + +
The result of calling
+ GetReadableStreamDesiredSize
(stream) is
+ positive.
+
A ReadableStream stream is said to be
+disturbed if the result of calling
+IsReadableStreamDisturbed
(stream) is true.
+
+
This specification uses terminology from the Encoding, HTML, and URL Standards. +
This specification uses terminology from the Encoding, HTML, IDL, Streams, and URL Standards. ENCODING HTML +WEBIDL +STREAMS URL
A byte sequence with bytes in the range 0x00 to @@ -1059,6 +1061,170 @@
This section might be integrated into other standards, such as IDL. + +
A ReadableStream represents a +stream of data. In this section, we +define common operations for ReadableStream. STREAMS + +
To enqueue a byte sequence +(chunk) into a ReadableStream +stream, run the these steps: + +
Call EnqueueInReadableStream
(stream,
+ chunk). Rethrow any exceptions.
+
To close a +ReadableStream stream, run these steps: +
Call CloseReadableStream
(stream).
+ Rethrow any exceptions.
+
To construct a +ReadableStream with given strategy, +pull action and cancel action, all of which are optional, run +these steps: + +
Let init be a new object. + +
Set init["pull"] to a function that runs pull if + pull is given. + +
Set init["cancel"] to a function that runs cancel if + cancel is given. + +
Set init["strategy"] to strategy if + strategy is given. + +
Set init be the result of calling the initial value of + ReadableStream as constructor with + init as an argument. Rethrow any exceptions. + +
Return stream. +
To construct a fixed +ReadableStream with given chunks, +run these steps: + +
Let stream be the result of + constructing a + ReadableStream. Rethrow any exceptions. + +
For each chunk in chunks, + enqueue chunk into + stream. Rethrow any exceptions. + +
Close stream. Rethrow any + exceptions. + +
To get a reader from a +ReadableStream stream, run these steps: +
Let reader be the result of calling
+ AcquireReadableStreamReader
(stream).
+ Rethrow any exceptions.
+
+
Return reader. +
To read all bytes from a +ReadableStream with reader, run these +steps: + +
Let promise be a new promise. + +
Let bytes be an empty byte sequence. + +
Let read be the result of calling
+ ReadFromReadableStreamReader
(reader).
+
+
When read is fulfilled with an object whose done
+ property is false and whose value
property is a
+ Uint8Array
, append the value
property to
+ bytes and run the above step again.
+
+
When read is fulfilled with an object whose done
+ property is true, resolve promise with bytes.
+
+
When read is fulfilled with a value that matches with neither of the
+ above patterns, reject promise with a TypeError
.
+
+
When read is rejected with an error, reject promise + with that error. +
Return promise. +
Because the reader grants exclusive access, the actual mechanism of how +to read cannot be observed. Implementations could use more direct mechanism if convenient. + +
To tee a +ReadableStream stream, run these steps: + +
Return the result of calling
+ TeeReadableStream
(stream, true).
+ Rethrow any exception.
+
An empty +ReadableStream is the result of +constructing a fixed +ReadableStream with an empty array. + +
Constructing an empty +ReadableStream will not throw an exception. + +
A ReadableStream stream is said to be +readable if stream@[[state]] is +"readable". + +
A ReadableStream stream is said to be +closed if stream@[[state]] is +"closed". + +
A ReadableStream stream is said to be +errored if stream@[[state]] is +"errored". + +
A ReadableStream stream is said to be
+locked if the result of calling
+IsReadableStreamLocked
(stream) is true.
+
+
A ReadableStream stream is said to +need more data if the following conditions +hold: + +
stream is readable. + +
The result of calling
+ GetReadableStreamDesiredSize
(stream) is
+ positive.
+
A ReadableStream stream is said to be
+disturbed if the result of calling
+IsReadableStreamDisturbed
(stream) is true.
+
+