Re: [whatwg/xhr] Fix overrideMimeType() again (#174)

domenic requested changes on this pull request.



> @@ -1282,19 +1283,32 @@ transfer-encoding: chunked</code></pre>
  <li><p>Return <var>mimeType</var>.
 </ol>
 
-<p>The <dfn id=override-mime-type>override MIME type</dfn> is initially null and can get a value if
-{{overrideMimeType()}} is invoked. <dfn id=final-mime-type>Final MIME type</dfn> is the
+<p>The <dfn id=override-mime-type>override MIME type</dfn> is initially null and can get a value
+when {{overrideMimeType()}} is invoked. <dfn id=final-mime-type>Final MIME type</dfn> is the

Nit: You used "the" for override MIME type but left it out for "final MIME type" and "final charset". (I prefer including it.)

>  <a>override MIME type</a> unless that is null in which case it is the <a>response MIME type</a>.
 
-<p>The <dfn id=response-charset>response charset</dfn> is the value of
-the <code>charset</code> parameter of the `<code>Content-Type</code>` header
-or null if there was no `<code>charset</code>` parameter or the header could
-not be parsed or was omitted. The
-<dfn id=override-charset>override charset</dfn> is initially null and
-can get a value if <a><code>overrideMimeType()</code></a> is invoked.
-<dfn id=final-charset>Final charset</dfn> is the
-<a>override charset</a> unless
-that is null in which case it is the <a>response charset</a>.
+<p><dfn id=final-charset>Final charset</dfn> is the return value of these steps:
+
+<ol>
+ <li><p>Let <var>label<var> be null.

Missing `/` in `</var>`

>  
- <li><p>If <a>override MIME type</a> has a `<code>charset</code>` parameter, then set
- <a>override charset</a> to its value.
+ <li><p>If <a>override MIME type</a> is failure, then set <a>override MIME type</a> to a new
+ <a>MIME type</a> whose <a for="MIME type">type</a> is "<code>application</code>" and
+ <a for="MIME type">subtype</a> is "<code>octet-stream</code>".

You could probably also use the literal syntax here (even though it doesn't really exist).

>  
 <ol>
  <li><p>If <a>state</a> is <i>loading</i> or <i>done</i>, then <a>throw</a> an
  "{{InvalidStateError!!exception}}" {{DOMException}}.
 
- <li><p>Set <a>override MIME type</a> to `<code>application/octet-stream</code>`.
-
- <li><p>If <var>mime</var> is a <a>parsable MIME type</a>, then set <a>override MIME type</a> to its
- <a>MIME type portion</a>.
- <!-- XXX Ignore string to byte sequence conversion issues until some point in the future -->
+ <li><p>Set <a>override MIME type</a> to the result of <a lt="parse a MIME type">parsing</a>
+ <var>mime</var>.

This no longer throws out all the parameters. I think that is observable using e.g. a Blob response's `type`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/pull/174#pullrequestreview-110958972

Received on Tuesday, 10 April 2018 18:36:18 UTC