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.

  • @@ -1282,19 +1283,24 @@ transfer-encoding: chunked
  • 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: + +

      +
    1. If override MIME type's parameters["charset"] is + not nothing, then return it. + +

    2. If response MIME type's parameters["charset"] is + not nothing, then return it. + +

    3. Return null. +

    + +

    The above steps intentionally do not use final MIME type as it would yield the +wrong result.


    @@ -1457,28 +1463,26 @@ resources using utf-8.
    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:

    1. If state is loading or done, then throw an "{{InvalidStateError!!exception}}" {{DOMException}}. -

    2. Set override MIME type to `application/octet-stream`. - -

    3. If mime is a parsable MIME type, then set override MIME type to its - MIME type portion. - +

    4. Set override MIME type to the result of parsing + mime. -

    5. If override MIME type has a `charset` parameter, then set - override charset to its value. +

    6. If override MIME type is failure, then set mimeTypeRecord to a new + MIME type whose type is "application" and + subtype is "octet-stream".