Henri Sivonen wrote:

On Wed, Jan 8, 2014 at 9:22 PM, Neil <n...@parkwaycc.co.uk> wrote:
Ah, but it makes a subtle difference to the way XHR works; from a server, it 
will parse according to the MIME type, which was HTML in my case, but from a 
file:// URL, it always parses in XML, even if the document would normally load 
as HTML (i.e. you XHR for a .html document). I certainly found this behaviour 
unexpected, even if it isn't a bug.
There's a method called overrideMimeType() on XHR.
Sure, but I wasn't expecting to have to override the MIME type to the type that gets used when you load the file in the browser.

This then triggered another unexpected behaviour, which is that XHR's XML 
parsing blocks onload but its HTML parsing does not.
A more likely explanation is that some of our channel types, including file:, 
can file OnStartRequest, OnDataAvailable and OnStopRequest without spinning the 
event loop in between.

Indeed, the XML parsing didn't "block" when I switched to serving the reftest from the HTTP server, and I had to add a dummy progress listener to restore blocking behaviour. (Android and b2g reftests detected this for me because they always serve from HTTP.) I can't remember whether I tried HTML parsing over HTTP with a progress listener.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to