Re: XHTML document not implementing HTMLDocument when served as application/xml
Stanimir Stamenkov <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
Sat, 24 May 2008 23:01:39 -0500, /Boris Zbarsky/: > Stanimir Stamenkov wrote: > >> Is there a reason XHTML documents served as 'Content-Type: >> application/xml' not to implement the HTMLDocument interface? > > Yes: the document is created based on MIME type before parsing begins, > so there's no way to know that you XML has an XHTML doctype at that point. I thought it could be the reason but I though it could be made somewhat smarter by determining the type after a DOCTYPE or the root document element has been read. >> Safari and Opera seem to create an HTMLDocument instance when served >> an XHTML document that way. > > Do they also do that if the doctype is not XHTML? Or if the > documentElement is not in the XHTML namespace? Opera creates HTMLDocument in the absence of a DOCTYPE but only if the root element is "html" in the XHTML namespace. I don't know if my test is sufficient but seems Safari always provides the 'document.forms' collection regardless of the DOCTYPE or the root document element. -- Stanimir _______________________________________________ dev-tech-dom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-dom