HTML DOM for XHTML docs as XML?

Bug 111514, including comments up to 80
There’s been a long and sharp debate on how Mozilla should treat an XHTML document’s DOM as the mime-type indicates it. I’ve made a static copy of the first 80 comments on the bug, so as to cut down on Bugzilla server load, and invite the discussion over here.
There are four mime-types for XHTML documents. The first, text/html, is irrelevant as that automatically triggers HTMLDocument. The best, application/xhtml+xml, currently is XMLDocument. (jst has a patch to make that HTMLDocument as well.)
The other two, application/xml and text/xml, are gray areas. My thinking now is these two mime-types we should continue to treat as XMLDocument for DOM purposes.
Extended debate welcome.

4 thoughts on “HTML DOM for XHTML docs as XML?”

  1. I just hope that application/xhtml+xml gets fixed soon. The debate about other MIME-types could drag on forever, as this sounds like a tough nut to crack, and no one seems to have any good ideas as to how to approach it.
    In the meantime, I want my HTMLDocument methods!

  2. /**
    * returns a document that implements the most
    * specific interface for the doctype if
    * floatVersion is null. otherwise returns
    * a document that implements the interface
    * of the specified floatVersion.
    *
    * Throws a DOMException whose code is
    * DOMException.NOT_SUPPORTED_ERR.
    */
    document.getDocumentInstance(Doctype doctype, string interfaceName,
    string floatVersion);

  3. But now I’m reading this:
    http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#DOMImplementation3-getFeature
    getFeature introduced in DOM Level 3
    This method returns a specialized object which implements the specialized APIs of the specified feature and version. The specialized object may also be obtained by using binding-specific casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations. This method also allow the implementation to provide specialized objects which do not support the DOMImplementation interface.
    Parameters
    feature of type DOMString
    The name of the feature requested (case-insensitive).
    version of type DOMString
    This is the version number of the feature to test. If the version is null or the empty string, supporting any version of the feature will cause the method to return an object that supports at least one version of the feature.
    Return Value
    Node
    Returns an object which implements the specialized APIs of the specified feature and version, if any, or null if there is no object which implements interfaces associated with that feature. If the DOMObject returned by this method implements the DOMImplementation interface, it must delegate to the primary core Node and not return results inconsistent with the primary core Node such as attributes, childNodes, etc.

Comments are closed.