W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] doctype parsing

From: Olav Junker Kjr <olav@olav.dk>
Date: Sun, 01 Aug 2004 20:56:28 +0200
Message-ID: <WorldClient-F200408012056.AA56280427@jirty.dk>
This is not really a WF2-specific question, but since the spec also
clarifies some undefined parts of HTML, I thing it might be relevant anyway.

Is comments allowed before the doctype in HTML? In MSIE, a strict doctype
preceded by a comment will not trigger standards mode, but in Mozilla it
will. From the HTML 4 spec, its not clear whether comments is allowed
before the doctype. (Of course this must be defined somewhere in SGML, but
is seems that with XHTML appendix C, HTML has officially cut its ties to
SGML?)

If comments is allowed before the doctype, it enables an ugly but useful
hack in IE: with the WHATWG doctype, a document is rendered in standard
mode, however if a comment precedes the doctype, the document is rendered
in quirks mode. This might be useful if legacy pages is upgraded to WF2.

Olav Junker Kj?r
Received on Sunday, 1 August 2004 11:56:28 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:36 UTC