Re: [XHR2] responseText for text/html before the encoding has stabilized

On Fri, 30 Sep 2011, Anne van Kesteren wrote:
>
> FWIW, I am waiting for 
> http://www.w3.org/Bugs/Public/show_bug.cgi?id=14284 to be fixed in HTML 
> before making changes to XMLHttpRequest.

So... the prescanning is generally considered optional (the only benefit 
really is that it avoids reloads in bad cases), and indeed implementations 
are somewhat encouraged to abort it early if the server only sent a few 
bytes (because that will shorten the time until something is displayed). 
Also, it has a number of false-positives, e.g. it doesn't ignore the 
contents of <script> elements.

Do we really want to put it into the critical path in this way?

I agree that the reloading alternative is even worse. What about just 
relying on the Content-Type charset="" and defaulting to UTF-8 if it isn't 
there, and not doing any in-page stuff?

How is the encoding determined for, e.g., text/plain or text/css files 
brought down through XHR and viewed through responseText?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 30 September 2011 18:09:22 UTC