diff --git a/Overview.html b/Overview.html index 76431f9..f5f93da 100644 --- a/Overview.html +++ b/Overview.html @@ -7,7 +7,7 @@

XMLHttpRequest

-

Living Standard — Last Updated 21 January 2016

+

Living Standard — Last Updated 22 March 2016

Participate: @@ -607,6 +607,7 @@

4.5.1 The o
  • Empty author request headers.

  • Set response to a network error. +

  • Set received bytes to the empty byte sequence.

  • Set response ArrayBuffer object to null.

  • Set response Blob object to null.

  • Set response Document object to null. @@ -974,7 +975,7 @@

    4.5.6 The s loadstart on the XMLHttpRequestUpload object with 0 and req's body's - length. + total bytes.
  • Fetch req. @@ -1014,10 +1015,10 @@

    4.5.6 The s progress on the XMLHttpRequestUpload object with request's body's - transmitted and + transmitted bytes and request's body's - length. + total bytes. @@ -1029,11 +1030,11 @@

    4.5.6 The s
  • Let transmitted be request's body's - transmitted. + transmitted bytes.

  • Let length be request's body's - length. + total bytes.

  • Fire a progress event named progress on the @@ -1070,38 +1071,58 @@

    4.5.6 The s
  • Set state to headers received. -

  • Fire an event named readystatechange. - +

  • Fire an event named + readystatechange. -

    To process response body for - response, run these subsubsteps: +

  • If state is not + headers received, then return. -

      -
    1. If not roughly 50ms have passed since these subsubsteps were last invoked, - terminate these subsubsteps. +

    2. If response's + body is null, + then run handle response end-of-file and return. -

    3. Handle errors for response. +

    4. +

      Let reader be the result of + getting a reader from + response's body's + stream. -

    5. If response is a - network error, - return. +

      This operation will not throw an exception. -

    6. If state is - headers received, set - state to loading and - fire an event named readystatechange. - -

    7. Fire a progress event named progress with response's - body's - transmitted and - response's - body's - length. -

    +
  • +

    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 object, run these + subsubsubsteps and then run the above subsubstep again: + +

      +
    1. Append the value property to received bytes. + +

    2. If not roughly 50ms have passed since these subsubsubsteps were last invoked, + then terminate these subsubsubsteps. + +

    3. If state is + headers received, then set + state to loading and + fire an event named + readystatechange. + +

    4. Fire a progress event named + progress with response's + body's + transmitted bytes and + response's body's + total bytes. +

    -

    To process response end-of-file for - response, run handle response end-of-file for - response. +

    When read is fulfilled with an object whose done property is true, + run handle response end-of-file for response. + +

    When read is rejected with an exception, run handle errors for + response. +

  • @@ -1119,6 +1140,29 @@

    4.5.6 The s timeout attribute value with reason timeout. +
  • If response's + body is null, + then run handle response end-of-file and return. + +

  • +

    Let reader be the result of + getting a reader from + response's body's + stream. + +

    This operation will not throw an exception. + +

  • Let promise be the result of + reading all + bytes from response's + body's + stream with reader. + +

  • Wait for promise to be fulfilled or rejected. + +

  • If promise is fulfilled with bytes, then append bytes + to received bytes. +

  • Run handle response end-of-file for response. @@ -1147,11 +1191,11 @@

    4.5.6 The s
  • Let transmitted be response's body's - transmitted. + transmitted bytes.

  • Let length be response's body's - length. + total bytes.

  • Fire a progress event named progress with transmitted and length. @@ -1284,6 +1328,8 @@

    4.6 Response

    otherwise it is a network error. +

    An XMLHttpRequest also has an associated received bytes (a byte +sequence). Unless stated otherwise it is the empty byte sequence.

    4.6.1 The responseURL attribute

    @@ -1436,16 +1482,11 @@

    4.6.6 Response body

    1. If response ArrayBuffer object is non-null, return it. -

    2. Let bytes be the empty byte sequence, if response's - body is null, and - response's - body otherwise. -

    3. Set response ArrayBuffer object to a new ArrayBuffer - object representing bytes. If this throws an exception, set - response ArrayBuffer object and response's - body to null. + object representing received bytes. If this throws an exception, then set + response ArrayBuffer object to null and set received bytes + to the empty byte sequence.

      Allocating an ArrayBuffer buffer is not guaranteed to succeed. [ECMASCRIPT] @@ -1462,13 +1503,8 @@

      4.6.6 Response body

    4. Let type be the empty string, if final MIME type is null, and final MIME type otherwise. -

    5. Let bytes be the empty byte sequence, if response's - body is null, and - response's - body otherwise. -

    6. Set response Blob object to a new - Blob object representing bytes with + Blob object representing received bytes with type type and return it.

    @@ -1479,10 +1515,8 @@

    4.6.6 Response body

    1. If response Document object is non-null, return it. -

    2. Let bytes be response's - body. - -

    3. If bytes is null, return null. +

    4. If response's + body is null, then return null.

    5. If final MIME type is not null, text/html, text/xml, @@ -1508,7 +1542,7 @@

      4.6.6 Response body

    6. If charset is null, prescan - the first 1024 bytes of bytes and if + the first 1024 bytes of received bytes and if that does not terminate unsuccessfully then let charset be the return value. @@ -1517,7 +1551,7 @@

      4.6.6 Response body

    7. Let document be a document that - represents the result parsing bytes following the rules set + represents the result parsing received bytes following the rules set forth in the HTML Standard for an HTML parser with scripting disabled and a known definite encoding charset. [HTML] @@ -1531,8 +1565,8 @@

      4.6.6 Response body

      document that represents the result of running the XML parser with XML scripting support disabled on - bytes. If that fails (unsupported character encoding, - namespace well-formedness error, etc.), return null. + received bytes. If that fails (unsupported character encoding, + namespace well-formedness error, etc.), then return null. [HTML]

      Resources referenced will not be loaded and no associated XSLT will be @@ -1569,13 +1603,11 @@

      4.6.6 Response body

      1. If response JSON object is non-null, return it. -

      2. Let bytes be response's - body. - -

      3. If bytes is null, return null. +

      4. If response's + body is null, then return null.

      5. Let JSON text be the result of running - utf-8 decode on byte stream bytes. + utf-8 decode on received bytes.

      6. Let JSON object be the result of invoking the initial value of the parse property of the JSON object, with @@ -1589,10 +1621,9 @@

        4.6.6 Response body

        A text response is the return value of these steps:

          -
        1. Let bytes be response's - body. - -

        2. If bytes is null, return the empty string. +

        3. If response's + body is null, then return the + empty string.

        4. Let charset be the final charset. @@ -1615,9 +1646,8 @@

          4.6.6 Response body

          utf-8.
        5. Return the result of running - decode on byte stream - bytes using fallback encoding - charset. + decode on received bytes using fallback + encoding charset.

        Authors are strongly encouraged to always encode their @@ -2223,6 +2253,8 @@

        References

        Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content, Roy Fielding and Julian Reschke. IETF. +
        Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests, Roy Fielding and Julian Reschke. IETF. +
        Hypertext Transfer Protocol (HTTP/1.1): Caching, Roy Fielding and Julian Reschke. IETF.
        Hypertext Transfer Protocol (HTTP/1.1): Authentication, Roy Fielding and Julian Reschke. IETF. @@ -2237,10 +2269,10 @@

        References

        Web IDL, Cameron McCormack. W3C.
        [XML] -
        Extensible Markup Language, Tim Bray, Jean Paoli, C. M. Sperberg-McQueen et al.. W3C. +
        Extensible Markup Language, Tim Bray, Jean Paoli, C. M. Sperberg-McQueen et al.. W3C.
        [XMLNS] -
        Namespaces in XML, Tim Bray, Dave Hollander, Andrew Layman et al.. W3C. +
        Namespaces in XML, Tim Bray, Dave Hollander, Andrew Layman et al.. W3C.
  • diff --git a/Overview.src.html b/Overview.src.html index 39d799a..7fc0ab7 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -559,6 +559,7 @@

    The open() method

  • Empty author request headers.

  • Set response to a network error. +

  • Set received bytes to the empty byte sequence.

  • Set response ArrayBuffer object to null.

  • Set response Blob object to null.

  • Set response Document object to null. @@ -926,7 +927,7 @@

    The send() method

    loadstart on the XMLHttpRequestUpload object with 0 and req's body's - length. + total bytes.
  • Fetch req. @@ -966,10 +967,10 @@

    The send() method

    progress on the XMLHttpRequestUpload object with request's body's - transmitted and + transmitted bytes and request's body's - length. + total bytes. @@ -981,11 +982,11 @@

    The send() method

  • Let transmitted be request's body's - transmitted. + transmitted bytes.

  • Let length be request's body's - length. + total bytes.

  • Fire a progress event named progress on the @@ -1022,38 +1023,58 @@

    The send() method

  • Set state to headers received. -

  • Fire an event named readystatechange. - +

  • Fire an event named + readystatechange. -

    To process response body for - response, run these subsubsteps: +

  • If state is not + headers received, then return. -

      -
    1. If not roughly 50ms have passed since these subsubsteps were last invoked, - terminate these subsubsteps. +

    2. If response's + body is null, + then run handle response end-of-file and return. -

    3. Handle errors for response. +

    4. +

      Let reader be the result of + getting a reader from + response's body's + stream. -

    5. If response is a - network error, - return. +

      This operation will not throw an exception. -

    6. If state is - headers received, set - state to loading and - fire an event named readystatechange. - -

    7. Fire a progress event named progress with response's - body's - transmitted and - response's - body's - length. -

    +
  • +

    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 object, run these + subsubsubsteps and then run the above subsubstep again: + +

      +
    1. Append the value property to received bytes. + +

    2. If not roughly 50ms have passed since these subsubsubsteps were last invoked, + then terminate these subsubsubsteps. + +

    3. If state is + headers received, then set + state to loading and + fire an event named + readystatechange. + +

    4. Fire a progress event named + progress with response's + body's + transmitted bytes and + response's body's + total bytes. +

    -

    To process response end-of-file for - response, run handle response end-of-file for - response. +

    When read is fulfilled with an object whose done property is true, + run handle response end-of-file for response. + +

    When read is rejected with an exception, run handle errors for + response. +

  • @@ -1071,6 +1092,29 @@

    The send() method

    timeout attribute value with reason timeout. +
  • If response's + body is null, + then run handle response end-of-file and return. + +

  • +

    Let reader be the result of + getting a reader from + response's body's + stream. + +

    This operation will not throw an exception. + +

  • Let promise be the result of + reading all + bytes from response's + body's + stream with reader. + +

  • Wait for promise to be fulfilled or rejected. + +

  • If promise is fulfilled with bytes, then append bytes + to received bytes. +

  • Run handle response end-of-file for response. @@ -1099,11 +1143,11 @@

    The send() method

  • Let transmitted be response's body's - transmitted. + transmitted bytes.

  • Let length be response's body's - length. + total bytes.

  • Fire a progress event named progress with transmitted and length. @@ -1236,6 +1280,8 @@

    Response

    otherwise it is a network error. +

    An XMLHttpRequest also has an associated received bytes (a byte +sequence). Unless stated otherwise it is the empty byte sequence.

    The responseURL attribute

    @@ -1388,16 +1434,11 @@

    Response body

    1. If response ArrayBuffer object is non-null, return it. -

    2. Let bytes be the empty byte sequence, if response's - body is null, and - response's - body otherwise. -

    3. Set response ArrayBuffer object to a new ArrayBuffer - object representing bytes. If this throws an exception, set - response ArrayBuffer object and response's - body to null. + object representing received bytes. If this throws an exception, then set + response ArrayBuffer object to null and set received bytes + to the empty byte sequence.

      Allocating an ArrayBuffer buffer is not guaranteed to succeed. ECMASCRIPT @@ -1414,13 +1455,8 @@

      Response body

    4. Let type be the empty string, if final MIME type is null, and final MIME type otherwise. -

    5. Let bytes be the empty byte sequence, if response's - body is null, and - response's - body otherwise. -

    6. Set response Blob object to a new - Blob object representing bytes with + Blob object representing received bytes with type type and return it.

    @@ -1431,10 +1467,8 @@

    Response body

    1. If response Document object is non-null, return it. -

    2. Let bytes be response's - body. - -

    3. If bytes is null, return null. +

    4. If response's + body is null, then return null.

    5. If final MIME type is not null, text/html, text/xml, @@ -1460,7 +1494,7 @@

      Response body

    6. If charset is null, prescan - the first 1024 bytes of bytes and if + the first 1024 bytes of received bytes and if that does not terminate unsuccessfully then let charset be the return value. @@ -1469,7 +1503,7 @@

      Response body

    7. Let document be a document that - represents the result parsing bytes following the rules set + represents the result parsing received bytes following the rules set forth in the HTML Standard for an HTML parser with scripting disabled and a known definite encoding charset. HTML @@ -1483,8 +1517,8 @@

      Response body

      document that represents the result of running the XML parser with XML scripting support disabled on - bytes. If that fails (unsupported character encoding, - namespace well-formedness error, etc.), return null. + received bytes. If that fails (unsupported character encoding, + namespace well-formedness error, etc.), then return null. HTML

      Resources referenced will not be loaded and no associated XSLT will be @@ -1521,13 +1555,11 @@

      Response body

      1. If response JSON object is non-null, return it. -

      2. Let bytes be response's - body. - -

      3. If bytes is null, return null. +

      4. If response's + body is null, then return null.

      5. Let JSON text be the result of running - utf-8 decode on byte stream bytes. + utf-8 decode on received bytes.

      6. Let JSON object be the result of invoking the initial value of the parse property of the JSON object, with @@ -1541,10 +1573,9 @@

        Response body

        A text response is the return value of these steps:

          -
        1. Let bytes be response's - body. - -

        2. If bytes is null, return the empty string. +

        3. If response's + body is null, then return the + empty string.

        4. Let charset be the final charset. @@ -1567,9 +1598,8 @@

          Response body

          utf-8.
        5. Return the result of running - decode on byte stream - bytes using fallback encoding - charset. + decode on received bytes using fallback + encoding charset.

        Authors are strongly encouraged to always encode their