W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] DOCTYPE declaration

From: Francis Boumphrey <boumphreyfr@gmail.com>
Date: Sun, 16 Oct 2011 14:15:37 -0400
Message-ID: <CAN1jwS5M7Musr_n3QyJeFN3HU4BtwKCAxrtv+GnRbHaR1U00rg@mail.gmail.com>
Thanks Tab,
I guess I could have stated myself a little clearer.
The spec says:

"DOCTYPEs are required for legacy reasons. When omitted, browsers tend to
use a different rendering mode that is incompatible with some
specifications. Including the DOCTYPE in a document ensures that the browser
makes a best-effort attempt at following the relevant specifications."

My point is, as the only possible use for a DOCTYPE declaration in HTML (any
version) is for including <!ENTITY >declarations, and no browser to my
knowledge does, not even the niche browsers, why bother with an DOCTYPE
declaration at all. As you point out

<tab>Doctypes in HTML have never, in practice, actually done anything
useful. </tab>

Surely the Living HTML Spec could be cutting out some dead-wood here.
(Perhaps it's here just as some 'sacred cow' talisman and to prevent some
'hurt feelings' :>)

Frank


On Sun, Oct 16, 2011 at 1:34 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:

> On Sun, Oct 16, 2011 at 10:30 AM, Francis Boumphrey
> <boumphreyfr at gmail.com> wrote:
> > I'm not sure if this is the right place to ask this.
> > What, if any DOCTYPE declaration should be used on HTML5 documents. As
> these
> > usually refer to a DTD, and living HTML does not have a DTD is it even
> > appropriate to use one?
>
> You use the "<!DOCTYPE HTML>" doctype, as explained in the spec.
>
> Doctypes in HTML have never, in practice, actually done anything
> useful.  The DTD reference hasn't been followed by any major browser
> (the W3C website has had to go to great lengths to protect itself from
> being DDOSed by the few editors and niche browsers that *do* follow
> DTD references), and essentially acts solely as a talisman that
> switches between Quirks Mode and Standards Mode.  "<!DOCTYPE HTML>" is
> the minimal string that still triggers Standards Mode in every major
> browser.
>
> ~TJ
>
Received on Sunday, 16 October 2011 11:15:37 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:37 UTC