W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Overriding the MIME type in XHR2 after the request has started

From: Henri Sivonen <hsivonen@iki.fi>
Date: Tue, 19 Apr 2011 12:04:34 +0300
To: public-webapps@w3.org
Message-ID: <1303203874.12278.26.camel@shuttle>
In reference to
http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-overridemimetype

It seems to me that XHR2 allows overrideMimeType() to be called at any
time so that it affects the calls to the responseXML getter the
overrideMimeType() call. And the subsequent overrideMimeType() calls can
make the responseXML getter return different things later.

This is bad, because it requires synchronous parsing when the
responseXML getter is called. OTOH, if overrideMimeType() calls were
honored only before the send() method has been called, parsing to DOM
could be implemented progressively (potentially off-the-main-thread) as
the resource representation downloads and the responseXML getter could
return this eagerly-parsed Document and always return the same document
on subsequent calls.

Are there compelling use cases for allowing overrideMimeType() after
send() has been called? I assume that typically one would use
overrideMimeType() when knowing ahead of time that the config of the
server responding to XHR is bogus.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Tuesday, 19 April 2011 09:05:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:44 GMT