diff --git a/xhr.bs b/xhr.bs index dc6d6db..2fed42e 100644 --- a/xhr.bs +++ b/xhr.bs @@ -756,8 +756,6 @@ return this's cross-origin credentials.
cors
".
send()
flag is unset, then return.
Fetch req. - Handle the tasks - queued on the - networking task source per below. - -
Run these steps in parallel: +
Let processRequestBody, given a request, be these steps:
Wait until either req's done flag is set or this's - timeout is not 0 and this's timeout milliseconds have passed since these - steps started. - -
If req's done flag is unset, then set this's - timed out flag and terminate fetching. -
To process request body for request, run 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
@@ -825,12 +806,13 @@ return this's cross-origin credentials.
These steps are only invoked when new bytes are transmitted. -
To process request end-of-body for request, run these steps: +
Let processRequestEndOfBody, given a request, be these steps:
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 @@ -851,12 +833,14 @@ return this's cross-origin credentials.
To process response for response, run these steps: +
Let processResponse, given a response, be these steps:
Handle errors fo this and response. +
Handle errors for this and this's + response.
If this's response is a network error, then return. @@ -876,7 +860,7 @@ return this's cross-origin credentials. this's response's body's stream. -
This operation will not throw an exception. +
This operation will not throw an exception.
Let readRequest be the following read request: @@ -887,8 +871,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. @@ -920,6 +903,26 @@ return this's cross-origin credentials.
Read a chunk from reader given readRequest.
Fetch req with processRequestBody set to + processRequestBody, processRequestEndOfBody set to + processRequestEndOfBody, and processResponse set to + processResponse. + +
Let now be the present time. + + +
Run these steps in parallel: + +
sync-xhr
" feature, then run
handle response end-of-body for this and a network error, and then return.
+ Let response be a network error. + +
Let processedResponse be false. +
Let response be the result of - fetching req. +
Let processResponse, given a fetchResponse, be these steps: + +
Set response to fetchResponse. + +
Set processedResponse to true. +
Fetch req with processResponse + set to processResponse and useParallelQueue set to true. + +
Let now be the present time. + + +
Pause until either processedResponse is true or this's + timeout is not 0 and this's timeout milliseconds have passed since + now. -
If this's timeout is not 0, then set this's timed out flag and - terminate fetching if it has not returned within this's - timeout milliseconds. +
If processedResponse is false, then set this's timed out flag and + terminate fetching.
If response's body is null, then run handle response end-of-body for this and response, and then return. @@ -945,12 +966,12 @@ return this's cross-origin credentials.
Let reader be the result of getting a reader for response's body's stream. -
This operation will not throw an exception. +
This operation will not throw an exception.
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.