Re: [whatwg/fetch] Add chunk type checking of requestForServiceWorker's body's stream (#1199)

@yutakahirano commented on this pull request.

Please see https://github.com/whatwg/fetch#formatting for the formatting rules (and add missing rules if there are).

> @@ -4156,6 +4156,34 @@ these steps:
    <li><p>Let <var>requestForServiceWorker</var> be a <a for=request>clone</a> of
    <var>request</var>.
 
+   <li>
+    <p> If <var>requestForServiceWorker</var>'s <a for=/>body</a> is non-null, then:
+
+    <ol>
+     <li><p> Let <var>transformAlgorithm</var> given <var>chunk</var> be these steps:

Let's break this line between \<li> and \<p>.

> @@ -4156,6 +4156,34 @@ these steps:
    <li><p>Let <var>requestForServiceWorker</var> be a <a for=request>clone</a> of
    <var>request</var>.
 
+   <li>
+    <p> If <var>requestForServiceWorker</var>'s <a for=/>body</a> is non-null, then:
+
+    <ol>
+     <li><p> Let <var>transformAlgorithm</var> given <var>chunk</var> be these steps:

No space before "Let".

> @@ -4156,6 +4156,34 @@ these steps:
    <li><p>Let <var>requestForServiceWorker</var> be a <a for=request>clone</a> of
    <var>request</var>.
 
+   <li>
+    <p> If <var>requestForServiceWorker</var>'s <a for=/>body</a> is non-null, then:
+
+    <ol>
+     <li><p> Let <var>transformAlgorithm</var> given <var>chunk</var> be these steps:
+      <ol>
+       <li><p>If the ongoing fetch is <a for=fetch>terminated</a>, then abort these steps.
+
+       <li><p>If <var>chunk</var> is not a {{Uint8Array}} object, then
+        <a lt=terminated for=fetch>terminate</a> the ongoing fetch.

-1 indent

ditto below

> +    <ol>
+     <li><p> Let <var>transformAlgorithm</var> given <var>chunk</var> be these steps:
+      <ol>
+       <li><p>If the ongoing fetch is <a for=fetch>terminated</a>, then abort these steps.
+
+       <li><p>If <var>chunk</var> is not a {{Uint8Array}} object, then
+        <a lt=terminated for=fetch>terminate</a> the ongoing fetch.
+
+       <li>Otherwise, <a for=ReadableStream>enqueue</a> <var>chunk</var>. The user agent may split
+        the chunk into <a>implementation-defined</a> practical sizes and
+        <a for=ReadableStream>enqueue</a> each of them. The user agent also may concatenate the
+        chunks into an <a>implementation-defined</a> practical size and
+        <a for=ReadableStream>enqueue</a> it.
+      </ol>
+
+     <li><p> Let <var>transformStream</var> be result of <a for=TransformStream>setting up</a> a

s/result/the result/

> +       <li><p>If the ongoing fetch is <a for=fetch>terminated</a>, then abort these steps.
+
+       <li><p>If <var>chunk</var> is not a {{Uint8Array}} object, then
+        <a lt=terminated for=fetch>terminate</a> the ongoing fetch.
+
+       <li>Otherwise, <a for=ReadableStream>enqueue</a> <var>chunk</var>. The user agent may split
+        the chunk into <a>implementation-defined</a> practical sizes and
+        <a for=ReadableStream>enqueue</a> each of them. The user agent also may concatenate the
+        chunks into an <a>implementation-defined</a> practical size and
+        <a for=ReadableStream>enqueue</a> it.
+      </ol>
+
+     <li><p> Let <var>transformStream</var> be result of <a for=TransformStream>setting up</a> a
+      {{TransformStream}} with <var>transformAlgorithm</var>.
+
+     <li><p> Let <var>transformedStream</var> be result of <var>requestForServiceWorker</var>'s

s/result/the result/

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1199#pullrequestreview-628572907

Received on Tuesday, 6 April 2021 05:07:54 UTC