From 5f5fce9d80220e86d0c4fc20914a82ee97d74f43 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Thu, 5 Jan 2017 21:11:47 +0900 Subject: [PATCH 1/5] initial --- fetch.bs | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/fetch.bs b/fetch.bs index 17e833703..0a6d43814 100644 --- a/fetch.bs +++ b/fetch.bs @@ -215,16 +215,6 @@ for request.
-

To read a request, if request's -body is non-null, whenever -request's body is read from (i.e. -is transmitted or read by script), increase request's -body's -transmitted bytes with the amount of payload body -bytes transmitted and then queue a fetch task on request to -process request body for request. - -

HTTP

@@ -1121,6 +1111,46 @@ or "worker".
  • Return newRequest. +

    To upload body of a +request request, run these steps: + +

      +
    1. Let body be request's body. + +
    2. If body is null, then queue a fetch task on request to + process request end-of-body for request and abort these steps. + +

    3. +

      Let read be the result of reading a + chunk from body's stream. + +

        +
      • +

        When read is fulfilled with an object whose done + property is false and whose value property is a + Uint8Array object, run these substeps: + +

          +
        1. Let bytes be the bytes represented by the Uint8Array object. + +

        2. Upload bytes. + +

        3. Increase body's transmitted bytes with bytes' + length. + +

        4. Run the above step again. +

        + +
      • When read is fulfilled with an object whose done + property is true, queue a fetch task on request to + process request end-of-body for request. + +

      • When read is fulfilled with a value that matches with neither of the + above patterns, or read is rejected, terminate the + ongoing fetch with reason fatal. +

      +
    +

    Responses

    @@ -2791,7 +2821,7 @@ optional CORS flag and CORS-preflight flag, run these steps:

    If response is not null, then run these substeps:

      -
    1. Read request. +

    2. Upload body of request.

    3. Set actualResponse to response, if response is not a filtered response, and to response's @@ -3457,7 +3487,7 @@ steps: "deprecated" state value ought to be a temporary and last resort kind of option. -

      Read request. +

      Upload body of request.

    4. Let strategy be an object. The user agent may choose any object. From 53ee0785a40a40b59acc6e1e1145881bde72b7c7 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Thu, 5 Jan 2017 21:49:16 +0900 Subject: [PATCH 2/5] fix --- fetch.bs | 2 -- 1 file changed, 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 0a6d43814..e99be2576 100644 --- a/fetch.bs +++ b/fetch.bs @@ -213,8 +213,6 @@ of: queue a fetch task on request to process request end-of-body for request. -


      -

      HTTP

      From f83170a6d8602553cc52d6251778ea14c919bc1f Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Fri, 6 Jan 2017 18:51:16 +0900 Subject: [PATCH 3/5] fix --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index e99be2576..34372e082 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1109,7 +1109,7 @@ or "worker".
    5. Return newRequest.

    -

    To upload body of a +

    To transmit body for a request request, run these steps:

      @@ -1131,7 +1131,7 @@ or "worker".
      1. Let bytes be the bytes represented by the Uint8Array object. -

      2. Upload bytes. +

      3. Transmit bytes.

      4. Increase body's transmitted bytes with bytes' length. @@ -2819,7 +2819,7 @@ optional CORS flag and CORS-preflight flag, run these steps:

        If response is not null, then run these substeps:

          -
        1. Upload body of request. +

        2. Transmit body for request.

        3. Set actualResponse to response, if response is not a filtered response, and to response's @@ -3485,7 +3485,7 @@ steps: "deprecated" state value ought to be a temporary and last resort kind of option. -

          Upload body of request. +

          Transmit body for request.

        4. Let strategy be an object. The user agent may choose any object. From 23e2d2ecac980e1911a39d351ffe61091276cdd0 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 6 Jan 2017 14:58:48 +0100 Subject: [PATCH 4/5] add some breathing room --- fetch.bs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fetch.bs b/fetch.bs index 34372e082..3791275c0 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1094,6 +1094,8 @@ or "worker".

          See handle fetch for usage of these terms. [[!SW]] +


          +

          To clone a request request, run these steps: @@ -1109,6 +1111,8 @@ or "worker".

        5. Return newRequest.

        +
        +

        To transmit body for a request request, run these steps: From 8e193fd4fa7cbbc26419fc46c62d3cef853effe3 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Fri, 6 Jan 2017 11:11:58 -0500 Subject: [PATCH 5/5] Minor style issues --- fetch.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 3791275c0..36a272150 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1133,11 +1133,12 @@ or "worker". Uint8Array object, run these substeps:

          -
        1. Let bytes be the bytes represented by the Uint8Array object. +

        2. Let bytes be the byte sequence represented by the + Uint8Array object.

        3. Transmit bytes. -

        4. Increase body's transmitted bytes with bytes' +

        5. Increase body's transmitted bytes by bytes's length.

        6. Run the above step again.