Skip to content

Commit

Permalink
address part of the review
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Feb 11, 2021
1 parent f338510 commit 565bc63
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions xhr.bs
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,7 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<p>Let <var>processRequestBody</var>, given a <var>request</var>, be these steps:

<ol>
<li><p>If not roughly 50ms have passed since these steps were last invoked,
terminate these steps.
<li><p>If not roughly 50ms have passed since these steps were last invoked, then return.

<li><p>If <a>this</a>'s <a>upload listener flag</a> is set, then <a>fire a progress event</a>
named <a event><code>progress</code></a> at <a>this</a>'s <a>upload object</a> with
Expand All @@ -815,7 +814,7 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<ol>
<li><p>Set <a>this</a>'s <a>upload complete flag</a>.

<li><p>If <a>this</a>'s <a>upload listener flag</a> is unset, then terminate these steps.
<li><p>If <a>this</a>'s <a>upload listener flag</a> is unset, then return.

<li><p>Let <var>transmitted</var> be <var>request</var>'s
<a for=request>body</a>'s
Expand All @@ -842,7 +841,8 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<ol>
<li><p>Set <a>this</a>'s <a for=XMLHttpRequest>response</a> to <var>response</var>.

<li><p><a>Handle errors</a> fo <a>this</a> and <var>response</var>.
<li><p><a>Handle errors</a> for <a>this</a> and <a>this</a>'s
<a for=XMLHttpRequest>response</a>.

<li><p>If <a>this</a>'s <a for=XMLHttpRequest>response</a> is a <a>network error</a>, then
return.
Expand Down Expand Up @@ -873,8 +873,7 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<ol>
<li><p>Append <var>chunk</var> to <a>this</a>'s <a>received bytes</a>.

<li><p>If not roughly 50ms have passed since these steps were last invoked, then abort
these steps.
<li><p>If not roughly 50ms have passed since these steps were last invoked, then return.

<li><p>If <a>this</a>'s <a>state</a> is <i>headers received</i>, then set <a>this</a>'s
<a>state</a> to <i>loading</i>.
Expand Down Expand Up @@ -935,24 +934,28 @@ return <a>this</a>'s <a>cross-origin credentials</a>.

<li><p>Let <var>response</var> be a <a for=/>network error</a>.

<li><p>Let <var>doesNotBlockTask</var> be false.
<li><p>Let <var>processedResponse</var> be false.

<li>
<p>Let <var>processResponse</var>, given a <var>fetchResponse</var>, be these steps:

<ol>
<li><p>Set <var>response</var> to <var>fetchResponse</var>.

<li><p>Set <var>doesNotBlockTask</var> to true.
<li><p>Set <var>processedResponse</var> to true.
</ol>

<li><p><a for=/>Fetch</a> <var>req</var> with <a for=fetch><i>processResponse</i></a>
set to <var>processResponse</var> and <a for=fetch><i>useParallelQueue</i></a> set to true.

<li><p>Wait until either <var>doesNotBlockTask</var> is true or <a>this</a>'s <a>timeout</a> is
not 0 and <a>this</a>'s <a>timeout</a> milliseconds have passed since now.
<li><p>Let <var>now</var> be the present time.
<!-- Eventually this should use some kind of time standard. -->

<li><p>If <var>doesNotBlockTask</var> is false, then set <a>this</a>'s <a>timed out flag</a> and
<li><p><a>Pause</a> until either <var>processedResponse</var> is true or <a>this</a>'s
<a>timeout</a> is not 0 and <a>this</a>'s <a>timeout</a> milliseconds have passed since
<var>now</var>.

<li><p>If <var>processedResponse</var> is false, then set <a>this</a>'s <a>timed out flag</a> and
<a for=fetch>terminate</a> <a for=/>fetching</a>.

<li><p>If <var>response</var>'s <a for=response>body</a> is null, then run
Expand All @@ -967,7 +970,7 @@ return <a>this</a>'s <a>cross-origin credentials</a>.
<li><p>Let <var>promise</var> be the result of
<a for=ReadableStreamDefaultReader>reading all bytes</a> from <var>reader</var>.

<li><p>Wait for <var>promise</var> to be fulfilled or rejected.
<li><p><a>Pause</a> until <var>promise</var> is fulfilled or rejected.

<li><p>If <var>promise</var> is fulfilled with <var>bytes</var>, then append <var>bytes</var>
to <a>this</a>'s <a>received bytes</a>.
Expand Down

0 comments on commit 565bc63

Please sign in to comment.