Matthew Gertner wrote:
> In a fit of pique I ranted about this on my blog
> (
http://www.allpeers.com/blog/?p=136). I was trying to be funny, but
> the issue is serious. I'm probably missing something, but can someone
> explain to me why the appropriate interfaces are not exposed to
> scripters using XPCOM?
Because HTML content model construction is so tied to having a window. As one
simple example, it assumes the existence of a window it can reload to handle
charset autodetection and <meta> charset declarations that are not in the first
chunk of data we get from the document. For XML this is not an issue, of
course, since the problem simply cannot arise.
There are other issues; for example the HTML parser needs the window to find out
whether scripts and frames are enabled (for parsing <noscript> and <noframes>
tags). This is not an issue in XML, again, because the _parsing_ doesn't depend
on anything. In HTML it does. And since frames and scripts can be
enabled/disabled on a per-window basis, this is a bit of a problem.
Some work has been done to make the parsing not require a window, but a lot more
needs to be done, especially if people want it to work like it would with a
window around.
-Boris