* Numien <num...@deathwyrm.com> [2010-01-06 22:40]:
> Well, the XHTML 1.0 spec says you can serve XHTML as
> "text/html"

Yes. <http://www.w3.org/TR/xhtml-media-types/>:

    The 'text/html' media type [RFC2854] is primarily for HTML,
    not for XHTML. In general, this media type is NOT suitable
    for XHTML except when the XHTML conforms to the guidelines in
    Appendix A. In particular, 'text/html' is NOT suitable for
    XHTML Family document types that add elements and attributes
    from foreign namespaces, such as XHTML+MathML [XHTML+MathML].

> with the appropriate DOCTYPE

What the DOCTYPE says is utterly irrelevant. The *only* thing
browsers do with the DOCTYPE is switch CSS interpretation and
a few Javascript edge cases from Quirks Mode (AKA IE5 compat) to
Standards Mode if *a* DOCTYPE is declared. However, they care
*not one whit* about *what* the DOCTYPE is.

> and browsers are supposed to interpret it using XHTML rules...

No. <http://www.w3.org/TR/xhtml-media-types/>:

    XHTML documents served as 'text/html' will not be processed
    as XML [XML10], e.g., well-formedness errors may not be
    detected by user agents. Also be aware that HTML rules will
    be applied for DOM and style sheets (see guidelines 11 and
    13).

> which it looks like Firefox isn't doing completely,

Not completely, nor AT ALL -- and entirely correctly so.

If the MIME type is `text/html`, then the document is parsed and
is *supposed* to be parsed as tag soup. End of story.

If you serve XHTML 1.0 documents with `text/html`, you are not
serving valid XHTML, you are serving malformed HTML 4.

The W3C validator, ironically, respects the DOCTYPE over the MIME
type and suggests that you really *are* serving valid XHTML even
though this contradicts the spec and even though every browser in
the world follows the spec on this point.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to