Re: The future of XML related technologies in Mozilla

Ian Hickson <[email protected]> Wed, 1 Nov 2006 02:10:51 +0000 (UTC)
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
On Tue, 31 Oct 2006, Boris Zbarsky wrote:
>
> Ian Hickson wrote:
> > HTML5 has document.innerHTML
> 
> Only for HTMLDocument.

In DOM5 HTML, every Document supports HTMLDocument.


> >    var d = document.implementation.createDocument(null, null, null);
> 
> createDocument doesn't create an HTMLDocument, last I checked.

DOM5 HTML changes this.


> In addition to which, for serialization purposes this is all patently 
> insufficient without jumping through a _lot_ of hoops (one of the hoops 
> being that innerHTML doesn't serialize the node in question, so the only 
> way to do the equivalent of outerHTML is to import the subtree into a 
> brand-new HTMLDocument, etc).  Especially if, God forbid, you were to 
> want to serialize SVG or MathML or some such.

Could you elaborate on this? I don't follow.


> I also fully expect people to demand configurable serialization at some 
> point.

The answer "no" is probably good enough for now, though. Eventually, we 
can add configuration attributes for the really desired options, but 
frankly I don't see the point -- once an author has an XML string, he can 
fix it to whatever he wants himself, e.g. on the server side.


> One other note.  For purposes of parsing HTML, it's not even clear what 
> the right behavior for random fragments is (which is why the innerHTML 
> does some whack things and one reason why DOMParser doesn't handle 
> HTML).  It'd be good to figure this out.

HTML5 has this all documented now. Let me know if you spot any errors. I 
know of a few that have been reported to the WHATWG list, and that I'll be 
fixing in due course, but please report any you see.

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