diff --git a/xhr.bs b/xhr.bs index 4f7cdd7..b5c3cb4 100644 --- a/xhr.bs +++ b/xhr.bs @@ -839,8 +839,7 @@ return this's cross-origin credentials.
Handle errors for this and this's - response. +
Handle errors for this.
If this's response is a network error, then return. @@ -852,8 +851,7 @@ return this's cross-origin credentials.
If this's response's body is null, - then run handle response end-of-body for this and this's - response, and then return. + then run handle response end-of-body for this and return.
Let processBodyChunk given bytes be these steps: @@ -879,10 +877,16 @@ return this's cross-origin credentials.
Let processEndOfBody be this step: run handle response end-of-body for - this and this's response. + this. -
Let processBodyError be this step: run handle errors for this - and this's response. +
Let processBodyError be these steps: + +
Set this's response to a network error. + +
Run handle errors for this. +
Incrementally read this's response's body, given processBodyChunk, processEndOfBody, @@ -916,18 +920,17 @@ return this's cross-origin credentials.
If this's relevant settings object has a responsible document which
is not allowed to use the "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. + handle response end-of-body for this and return.
Let processedResponse be false.
Let processResponseEndOfBody, given a fetchResponse and +
Let processResponseEndOfBody, given a response and nullOrFailureOrBytes, be these steps:
Set response to fetchResponse. +
If nullOrFailureOrBytes is not failure, then set this's + response to response.
If nullOrFailureOrBytes is a byte sequence, then append nullOrFailureOrBytes to this's received bytes. @@ -949,31 +952,24 @@ return this's cross-origin credentials.
If processedResponse is false, then set this's timed out flag and terminate fetching. -
Run handle response end-of-body for this and response. +
Run handle response end-of-body for this.
To handle response end-of-body for an -{{XMLHttpRequest}} object xhr and a response response, run these -steps: +{{XMLHttpRequest}} object xhr, run these steps:
If xhr's synchronous flag is set, then set xhr's - response to response. - -
Handle errors for xhr and response. +
Handle errors for xhr.
If xhr's response is a network error, then return. -
If xhr's synchronous flag is unset, then update xhr's - response's body using response. -
Let transmitted be xhr's received bytes's length. -
Let length be response's body's - total bytes. +
Let length be xhr's response's + body's total bytes.
If xhr's synchronous flag is unset, then fire a progress event
named progress
at xhr with transmitted and
@@ -992,8 +988,7 @@ steps:
transmitted and length.
To handle errors for an {{XMLHttpRequest}} object xhr and a -response response, run these steps: +
To handle errors for an {{XMLHttpRequest}} object xhr, run these steps:
If xhr's send()
flag is unset, then return.
@@ -1002,25 +997,13 @@ steps:
for xhr, timeout
, and "{{TimeoutError!!exception}}"
{{DOMException}}.
-
If response is a network error, then run the request error steps
- for xhr, error
, and "{{NetworkError!!exception}}"
- {{DOMException}}.
-
-
Otherwise, if response's body's stream is - errored, then: - -
Set xhr's state to done. - -
Unset xhr's send()
flag.
-
-
Set xhr's response to a network error. -
Otherwise, if xhr's response's
+ aborted flag is set, run the request error steps for xhr,
+ abort
, and "{{AbortError!!exception}}" {{DOMException}}.
-
Otherwise, if xhr's response's aborted flag is
- set, then run the request error steps for xhr, abort
,
- and "{{AbortError!!exception}}" {{DOMException}}.
+
Otherwise, if xhr's response's is a
+ network error, run the request error steps for xhr,
+ error
, and "{{NetworkError!!exception}}" {{DOMException}}.
The request error steps for an {{XMLHttpRequest}} object xhr,