Re: xkcd: LTR

From: Philippe Verdy <>
Date: Tue, 27 Nov 2012 21:07:31 +0100

Ahhhh ! I see now the problem: the XHTML file is being served as HTML
instead of XHTML (but this is not invalid for XHTML 1).

But anyway you're also right that the XML prolog found is NOT valid for
HTML5 when the file is served as HTML instead of XHTML. This should
immediately trigger the fact that HTML5 should not be used to render the
page in the HTML profile. So these browsers must find something else: given
the XML prolog they should then use HTML5 in its XHTML profile, not in its
HTML profile ; in this profile, they MUST honor the XML prolog and notably
its XML encoding declaration (given that the encoding is not specified in
the HTTP Content-type.

Now given the XML prolog and the DTD declaration, the file is clearly not
even HTML5 in XML/XHTML (i.e. XHTML 5), but is XHTML 1 (based on a stable
subset of HTML4, but working in strict mode without the quirks modes). Once
again, this excludes using the HTML5 rules again.

I'm still convinced that these are bugs in Firefox and IE, which support
only HTML5 in its basic HTML profile, but not HTML5 in its XML/XHTML
profile (which is also part of the HTML5 standard and where processing the
XML prolog is NOT an option but a requirement).

2012/11/27 Leif Halvard Silli <>

> Philippe Verdy, Tue, 27 Nov 2012 15:39:43 +0100:
> > I've never said that user agents had to "'write" the prolog. It's the
> > reverse: yes authors have to write a prolog (but the prolog is perfect
> here
> > so this is not the fault of the author).
> XML has (or more correctly: can have) a prolog. HTML does not have a
> prolog. Now to the million dollar question: is your page in question
> XML or HTML? Answer: Per the Content-Type, then it is HTML (that is:
> "text/html"). Next question: Does the XML prolog have any effect when
> the XML file (more specifically: the XHTML file) is served as HTML
> (that is: "text/html")?
> The answer is that, per HTML5, it does not have effect. And of course,
> per HTML4, it does not have effect. As for XHTML 1, then it cannot
> really regulate what is supposed to happen in text/html. The
> problem/challenge, hover is that some Web browsers - such as W3m (a
> text browser), Chrome, Opera and Safari - *do* look at the prolog for
> encoding info *also* when served as HTML. But Firefox and Internet
> Explorer do not. Which is according the HTML5 specification.
> My guess is that it will *never* become conforming to use the XML
> prologue in HTML files. However, that does not necessarily prevent
> Firefox from looking at the prologue for encoding info, when *that* is
> the only source of encoding info. In fact, I think the HTML5 encoding
> sniffing algorithm already permits this (since it it has a step which
> roughly says "if the user agent have other sources of information".)
> So, for what it is worth - and with reference to your pages, I filed a
> bug against Firefox, to make it start to use the encoding declartion of
> the XML prologue, when nothing else is available:
> --
> leif halvard silli
Received on Tue Nov 27 2012 - 14:09:22 CST

This archive was generated by hypermail 2.2.0 : Tue Nov 27 2012 - 14:09:22 CST