[webkit-dev] XHTML, XML and WebKit editing

Maciej Stachowiak mjs at apple.com
Fri Aug 25 00:13:52 PDT 2006

On Aug 24, 2006, at 11:40 PM, Rob Burns wrote:

> Todd and Maciej,
> Thank you both for your help. I was not loading this as an  
> application/xhtml+xml but instead as html. This has taken care of  
> many issues that i though i was going to have to work around and  
> makes me quite happy. The content is no longer being rearranged,  
> and its looks like well-formed and valid xhtml.

Glad to hear it.

> I'm curious why the DOM would rearrange the HTML content in that  
> way. Any ideas?

Rearranging HTML content that is technically invalid is something  
that browsers have done for a long time. The current generation of  
browsers has to do it to process invalid HTML in a compatible way.

> BTW Maciej, why would getElementsByName not work? I haven't tried,  
> but the other HTML specific methods seem to be working. From what I  
> can tell the XHTML content still seems to be instantiated with the  
> DOMHTML element subclasses of the DOMCore classes. I think that's  
> how it should be. if the DOM is to treat HTML elements as  
> subclasses then it makes sense to treat the XHTML elements as HTML  
> subclasses too (at least for XHTML 1.0 and probably 1.1).

Elements in an HTML document will generate the specific subclasses.  
However, the document object will not be an HTMLDocument (at least  
not currently - we may reconsider this in the future; there are  
complications with things like document.write).


More information about the webkit-dev mailing list