diff --git a/Overview.html b/Overview.html index c37708884..040e6b6d2 100644 --- a/Overview.html +++ b/Overview.html @@ -7,7 +7,7 @@

Fetch

-

Living Standard — Last Updated 10 September 2015

+

Living Standard — Last Updated 15 September 2015

Participate: @@ -55,7 +55,10 @@

Table of Contents

  • 3.1.6 Responses
  • 3.2 Authentication entries
  • 3.3 Fetch groups
  • -
  • 3.4 Referrer policies
  • +
  • 3.4 Referrer policies
  • +
  • 3.5 Streams +
      +
    1. 3.5.1 ReadableStream
  • 4 HTTP extensions
    1. 4.1 `Origin` header
    2. @@ -162,11 +165,14 @@

      2 Conformance

      3 Infrastructure

      -

      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 0x7F, inclusive, is represented as a utf-8-encoded string with code points in the range U+0000 to @@ -1115,6 +1121,170 @@

      3.4 Referrer policies

      [REFERRER] +

      3.5 Streams

      + +

      This section might be integrated into other standards, such as IDL. + +

      3.5.1 ReadableStream

      + +

      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: + +

        +
      1. Call EnqueueInReadableStream(stream, + chunk). Rethrow any exceptions. +

      + +

      To close a +ReadableStream stream, run these steps: +

        +
      1. 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: + +

        +
      1. Let init be a new object. + +

      2. Set init["pull"] to a function that runs pull if + pull is given. + +

      3. Set init["cancel"] to a function that runs cancel if + cancel is given. + +

      4. Set init["strategy"] to strategy if + strategy is given. + +

      5. Set init be the result of calling the initial value of + ReadableStream as constructor with + init as an argument. Rethrow any exceptions. + +

      6. Return stream. +

      + +

      To construct a fixed +ReadableStream with given chunks, +run these steps: + +

        +
      1. Let stream be the result of + constructing a + ReadableStream. Rethrow any exceptions. + +

      2. For each chunk in chunks, + enqueue chunk into + stream. Rethrow any exceptions. + +

      3. Close stream. Rethrow any + exceptions. + +

      4. Return stream. +
      + +

      To get a reader from a +ReadableStream stream, run these steps: +

        +
      1. Let reader be the result of calling + AcquireReadableStreamReader(stream). + Rethrow any exceptions. + +

      2. Return reader. +

      + +

      To read all bytes from a +ReadableStream with reader, run these +steps: + +

        +
      1. Let promise be a new promise. + +

      2. Let bytes be an empty byte sequence. + +

      3. +

        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. +

        + +
      4. 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: + +

        +
      1. 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: + +

      + +

      A ReadableStream stream is said to be +disturbed if the result of calling +IsReadableStreamDisturbed(stream) is true. + +

      4 HTTP extensions

      @@ -4224,6 +4394,9 @@

      References

      [SRI]
      Subresource Integrity, Devdatta Akhawe, Francois Marier, Frederik Braun et al.. W3C. +
      [STREAMS] +
      Streams, Domenic Denicola and Takeshi Yoshino. WHATWG. +
      [SW]
      Service Workers, Alex Russell and Jungkee Song. W3C. @@ -4236,6 +4409,9 @@

      References

      [URL]
      URL, Anne van Kesteren. WHATWG. +
      [WEBIDL] +
      Web IDL, Cameron McCormack. W3C. +
      [XHR]
      (Non-normative) XMLHttpRequest, Anne van Kesteren. WHATWG. diff --git a/Overview.src.html b/Overview.src.html index 5db175c50..f291ce365 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -106,9 +106,11 @@

      Conformance

      Infrastructure

      -

      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 @@

      Referrer policies

      REFERRER +

      Streams

      + +

      This section might be integrated into other standards, such as IDL. + +

      ReadableStream

      + +

      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: + +

        +
      1. Call EnqueueInReadableStream(stream, + chunk). Rethrow any exceptions. +

      + +

      To close a +ReadableStream stream, run these steps: +

        +
      1. 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: + +

        +
      1. Let init be a new object. + +

      2. Set init["pull"] to a function that runs pull if + pull is given. + +

      3. Set init["cancel"] to a function that runs cancel if + cancel is given. + +

      4. Set init["strategy"] to strategy if + strategy is given. + +

      5. Set init be the result of calling the initial value of + ReadableStream as constructor with + init as an argument. Rethrow any exceptions. + +

      6. Return stream. +

      + +

      To construct a fixed +ReadableStream with given chunks, +run these steps: + +

        +
      1. Let stream be the result of + constructing a + ReadableStream. Rethrow any exceptions. + +

      2. For each chunk in chunks, + enqueue chunk into + stream. Rethrow any exceptions. + +

      3. Close stream. Rethrow any + exceptions. + +

      4. Return stream. +
      + +

      To get a reader from a +ReadableStream stream, run these steps: +

        +
      1. Let reader be the result of calling + AcquireReadableStreamReader(stream). + Rethrow any exceptions. + +

      2. Return reader. +

      + +

      To read all bytes from a +ReadableStream with reader, run these +steps: + +

        +
      1. Let promise be a new promise. + +

      2. Let bytes be an empty byte sequence. + +

      3. +

        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. +

        + +
      4. 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: + +

        +
      1. 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. + +

      HTTP extensions