[whatwg] DOCTYPE declaration

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