W3C home > Mailing lists > Public > public-html@w3.org > December 2009

DOCTYPE versioning change proposal (ISSUE-4)

From: Larry Masinter <masinter@adobe.com>
Date: Tue, 1 Dec 2009 00:00:52 -0800
To: "public-html@w3.org" <public-html@w3.org>
Message-ID: <8B62A039C620904E92F1233570534C9B0118DC9EC752@nambx04.corp.adobe.com>
Here is a concrete change proposal for ISSUE-4.  This text replaces section 9.1.1 ("The DOCTYPE") in the current Editor's draft.
This issue has been discussed at length over several years.   I've reviewed all the discussion I can find, and it seems like allowing a evolving string would have some advantages for those that want one without requiring a version string and disallowing any behavior changes based on it.


9.1.1 The DOCTYPE

 A DOCTYPE is a header element with limited utility.  It was inherited from the time when HTML was thought of as an application of SGML. Previous versions of HTML mandated a DOCTYPE header with an explicit reference to the version of the specification; for example, see [HTML 4.01].
Some widely-deployed web browsers will use a different rendering mode if the DOCTYPE header is omitted and the document is being served as "text/html" (and not as an XML media type.) For this reason, DOCTYPE is still included in HTML, and (for content served as text/html) is mandatory,  even when no specific version identifier is supplied. Because this specification is intended to be compatible with all previously deployed HTML content, and because many hope that no incompatible changes will be ever be necessary in any future edition or version of HTML, the DOCTYPE, while required, is not used. Specifically:

 *   Except for explicitly defined previous versions of DOCTYPE strings used to trigger "quirks mode" (see [#quirks-mode] and [hsvonin]), implementations which consume HTML SHOULD NOT use the DOCTYPE to trigger alternative behavior, as authors tend to use DOCTYPE versions inconsistent with expected behavior.
 *   Implementations which validate HTML content SHOULD use the latest version of this specification to validate against; validating only against older specifications, or only against the indicated version, is likely to be much less useful.
 *   Documents served as an XML media type MAY include a DOCTYPE header to support enhanced workflow. Other documents (not served as an XML media type) SHOULD include a DOCTYPE header, since many browsers, in the absence of a DOCTYPE header, will trigger a "quirks" mode of rendering.

The form of the doctype header is

     <!DOCTYPE html>
or <!DOCTYPE html PUBLIC "html version string">
or <!DOCTYPE html SYSTEM "about:legacy-compat">

"html", "PUBLIC" and "SYSTEM" are case insensitive, may have additional spaces around them, and the html version string or the "about:legacy-compat" string is wrapped  either with double or single (apostrophe) quote marks. Note that XML allows many more forms of DOCTYPE declarations which are not allowed. (The html version string is defined below.)

In most instances, the simple <!DOCTYPE html> form is all that is required or recommended. The form with the "SYSTEM about:legacy-compat" is provided to allow for those who oppose providing version identifiers to still support processors that require a PUBLIC or SYSTEM identifier.

The form with a "html version string" SHOULD NOT be used unless the content is served in a controlled environment where the intended version is known.  The html version string is allowed primarily because it may be useful for content management systems and other development workflows  as a kind of metadata to indicate which specification was being consulted when the HTML content was being prepared.

Using a html version string:

 Until this specification is approved as a W3C recommendation, documents MAY contain a DOCTYPE with an html version string that identifying the specification referenced and its date.  The pattern for the html version string is simple, and should be clear from the following examples:

   <!DOCTYPE html PUBLIC "-//WHATWG//HTML 20100401">

for the 2010 April 1 version of the WhatWG edition of the specification.

   <!DOCTYPE html PUBLIC "-//W3C HTMLWG//HTML 20100401">

for the HTML working group editor's draft of the same date.

 If multiple alternative specifications are available in a committee, the author's nickname or handle may be used to distinguish which draft is being referenced, e.g.,

   <!DOCTYPE html PUBLIC "-//W3C HTMLWG hixie//HTML 20100401">
   <!DOCTYPE html PUBLIC "-//W3C HTMLWG manu//HTML 20100401">

When this specification becomes a W3C Recommendation, a  DOCTYPE with a correct html version string will be:

   <!DOCTYPE html PUBLIC "-//W3C//HTML 5.0//EN">

However, HTML documents MUST NOT use the  "-//W3C//HTML 5.0//EN" html version string until the edition of this specification referenced is actually approved and published as a W3C Recommendation.
Received on Tuesday, 1 December 2009 08:03:41 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:04 UTC