@@ -1872,22 +1872,33 @@ we define common operations for {{ReadableStream}} objects. [[!STREAMS]]
1872
1872
1873
1873
<p> To
1874
1874
<dfn export for=ReadableStream id=concept-construct-readablestream>construct a <code>ReadableStream</code> object</dfn>
1875
- with given <var> strategy</var> , <var> pull</var> action and <var> cancel</var> action, all of which
1876
- are optional, run these steps:
1875
+ optionally with a <var> highWaterMark</var> , <var> sizeAlgorithm</var> algorithm, <var> pull</var>
1876
+ action, and <var> cancel</var> action, run these steps:
1877
+
1878
+ <p class=note> This algorithm used to take a <var ignore> strategy</var> parameter, whose
1879
+ <code> highWaterMark</code> and <code> sizeAlgorithm</code> members were extracted to provide what are
1880
+ now separate parameters. If another specification still passes that <var ignore> strategy</var>
1881
+ parameter, please update it.
1877
1882
1878
1883
<ol>
1879
- <li><p> Let <var> init</var> be a new object.
1884
+ <li><p> Let <var> startAlgorithm</var> be an algorithm that returns undefined.
1885
+
1886
+ <li><p> If <var> pull</var> is absent, then set it to an action that returns undefined.
1887
+
1888
+ <li><p> Let <var> pullAlgorithm</var> be an algorithm that returns the result of [=promise-calling=]
1889
+ <var> pull</var> ().
1880
1890
1881
- <li><p> Set <var> init</var> ["pull"] to a function that runs <var> pull</var> if <var> pull</var> is
1882
- given.
1891
+ <li><p> If <var> cancel</var> is absent, then set it to an action that returns undefined.
1883
1892
1884
- <li><p> Set <var> init </var> ["cancel"] to a function that runs <var> cancel </var> if
1885
- <var> cancel</var> is given .
1893
+ <li><p> Let <var> cancelAlgorithm </var> be an algorithm that takes a <var> reason </var> and returns
1894
+ the result of [=promise-calling=] <var> cancel</var> ( <var> reason </var> ) .
1886
1895
1887
- <li><p> Let <var> stream</var> be the result of calling the initial value of {{ReadableStream}} as
1888
- constructor with <var> init</var> and <var> strategy</var> if given.
1896
+ <li><p> If <var> highWaterMark</var> is absent, then set it to 1.
1889
1897
1890
- <li><p> Return <var> stream</var> .
1898
+ <li><p> If <var> sizeAlgorithm</var> is absent, then set it to an algorithm that returns 1.
1899
+
1900
+ <li><p> Return [$CreateReadableStream$] (<var> startAlgorithm</var> , <var> pullAlgorithm</var> ,
1901
+ <var> cancelAlgorithm</var> , <var> highWaterMark</var> , <var> sizeAlgorithm</var> ).
1891
1902
</ol>
1892
1903
1893
1904
<p> To
@@ -4123,11 +4134,10 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
4123
4134
<li><p> Return a <a>network error</a> .
4124
4135
</ol>
4125
4136
4126
- <li>
4127
- <p> Let <var> strategy</var> be an object. The user agent may choose any object.
4137
+ <li><p> Let <var> highWaterMark</var> be a non-negative, non-NaN number, chosen by the user agent.
4128
4138
4129
- <p class="note no-backref"> <var>strategy </var> is used to control the queuing strategy of
4130
- <var> stream </var> constructed below .
4139
+ <li><p> Let <var> sizeAlgorithm </var> be an algorithm that accepts a <a>chunk</a> object and returns
4140
+ a non-negative, non-NaN, non-infinite number, chosen by the user agent .
4131
4141
4132
4142
<li><p> Let <var> pull</var> be an action that <a lt=resumed for=fetch>resumes</a> the ongoing fetch
4133
4143
if it is <a lt=suspend for=fetch>suspended</a> .
@@ -4137,9 +4147,10 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
4137
4147
4138
4148
<li>
4139
4149
<p> Let <var> stream</var> be the result of
4140
- <a lt="construct a ReadableStream object" for=ReadableStream>constructing</a> a
4141
- {{ReadableStream}} object with <var> strategy</var> ,
4142
- <var> pull</var> and <var> cancel</var> .
4150
+ <a lt="construct a ReadableStream object" for=ReadableStream>constructing</a> a {{ReadableStream}}
4151
+ object with <var> highWaterMark</var> , <var> sizeAlgorithm</var> , <var> pull</var> , and
4152
+ <var> cancel</var> .
4153
+
4143
4154
<p class="note no-backref"> This construction operation will not throw an exception.
4144
4155
4145
4156
<li>
0 commit comments