I did a very quick inspection of some relatively recent code,
Webapps.jsm, to find out why even recent code isn't using the encoding
conversion facilities that the Web offers and is instead using XPCOM
facilities.

The quick answer seems to be that the reason for not using Web APIs
for encoding conversion is that I/O is done using XPCOM facilities, so
then encoding conversion needs to be done using XPCOM facilities as
well.

The Web API for doing I/O is XHR, which would also take care of
encoding conversion. What prevents .jsm code from using XHR? That XHR
doesn't take an nsIFile in open()? That XHR with file: URLs is a bit
weird because our file channels pump their content in a way that
differs from the way HTTP channels work? That XHR itself is old and
crufty as an API design? Something else?

-- 
Henri Sivonen
hsivo...@hsivonen.fi
https://hsivonen.fi/
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to