diff --git a/xhr.bs b/xhr.bs index 7b197c0..674734f 100644 --- a/xhr.bs +++ b/xhr.bs @@ -797,8 +797,7 @@ return this's cross-origin credentials.
Let processRequestBody, given a request, be these steps:
If not roughly 50ms have passed since these steps were last invoked, - terminate these steps. +
If not roughly 50ms have passed since these steps were last invoked, then return.
If this's upload listener flag is set, then fire a progress event
named progress
at this's upload object with
@@ -815,7 +814,7 @@ return this's cross-origin credentials.
Set this's upload complete flag. -
If this's upload listener flag is unset, then terminate these steps. +
If this's upload listener flag is unset, then return.
Let transmitted be request's body's @@ -842,7 +841,8 @@ return this's cross-origin credentials.
Handle errors fo this and response. +
Handle errors for this and this's + response.
If this's response is a network error, then return. @@ -873,8 +873,7 @@ return this's cross-origin credentials.
Append chunk to this's received bytes. -
If not roughly 50ms have passed since these steps were last invoked, then abort - these steps. +
If not roughly 50ms have passed since these steps were last invoked, then return.
If this's state is headers received, then set this's state to loading. @@ -935,7 +934,7 @@ return this's cross-origin credentials.
Let response be a network error. -
Let doesNotBlockTask be false. +
Let processedResponse be false.
Let processResponse, given a fetchResponse, be these steps: @@ -943,16 +942,20 @@ return this's cross-origin credentials.
Set response to fetchResponse. -
Set doesNotBlockTask to true. +
Set processedResponse to true.
Fetch req with processResponse set to processResponse and useParallelQueue set to true. -
Wait until either doesNotBlockTask is true or this's timeout is - not 0 and this's timeout milliseconds have passed since now. +
Let now be the present time. + -
If doesNotBlockTask is false, then set this's timed out flag and +
Pause until either processedResponse is true or this's + timeout is not 0 and this's timeout milliseconds have passed since + now. + +
If processedResponse is false, then set this's timed out flag and terminate fetching.
If response's body is null, then run @@ -967,7 +970,7 @@ return this's cross-origin credentials.
Let promise be the result of reading all bytes from reader. -
Wait for promise to be fulfilled or rejected. +
Pause until promise is fulfilled or rejected.
If promise is fulfilled with bytes, then append bytes to this's received bytes.