diff --git a/xhr.bs b/xhr.bs index 1326182..230004b 100644 --- a/xhr.bs +++ b/xhr.bs @@ -495,6 +495,7 @@ methods, when invoked, must run these steps: network error.
Set received bytes to the empty byte sequence.
Set response object to null. +
Set override MIME type to null.
Return mimeType. -
The override MIME type is initially null and can get a value if -{{overrideMimeType()}} is invoked. Final MIME type is the +
The override MIME type is initially null and can get a value +when {{overrideMimeType()}} is invoked. Final MIME type is the override MIME type unless that is null in which case it is the response MIME type. -
The response charset is the value of
-the charset
parameter of the `Content-Type
` header
-or null if there was no `charset
` parameter or the header could
-not be parsed or was omitted. The
-override charset is initially null and
-can get a value if overrideMimeType()
is invoked.
-Final charset is the
-override charset unless
-that is null in which case it is the response charset.
+
Final charset is the return value of these steps: + +
If override MIME type's parameters["charset
"] is
+ not nothing, then return it.
+
+
If response MIME type's parameters["charset
"] is
+ not nothing, then return it.
+
+
Return null. +
The above steps intentionally do not use final MIME type as it would yield the +wrong result.
client . overrideMimeType(mime)
Acts as if the `Content-Type
` header for response is mime.
+
Acts as if the `Content-Type
` header value for response is mime.
+ (It does not actually change the header though.)
Throws an "{{InvalidStateError!!exception}}" {{DOMException}} if state is loading or done.
The
-overrideMimeType(mime)
-method must run these steps:
+
The overrideMimeType(mime)
method,
+when invoked, must run these steps:
If state is loading or done, then throw an "{{InvalidStateError!!exception}}" {{DOMException}}. -
Set override MIME type to `application/octet-stream
`.
-
-
If mime is a parsable MIME type, then set override MIME type to its - MIME type portion. - +
Set override MIME type to the result of parsing + mime. -
If override MIME type has a `charset
` parameter, then set
- override charset to its value.
+
If override MIME type is failure, then set mimeTypeRecord to a new
+ MIME type whose type is "application
" and
+ subtype is "octet-stream
".