W3C home > Mailing lists > Public > public-html-comments@w3.org > March 2008

Re: Backwards compatibility and DOCTYPE

From: Bert Bos <bert@w3.org>
Date: Wed, 5 Mar 2008 15:33:07 +0100
To: Ian Hickson <ian@hixie.ch>
Cc: public-html-comments@w3.org
Message-Id: <200803051533.07962.bert@w3.org>

On Wednesday 05 March 2008 05:28, Ian Hickson wrote:
> On Wed, 5 Mar 2008, Bert Bos wrote:
> > The HTML5 WD states (section 1.1.1[1]) that the format is meant to
> > be as much backwards-compatible as possible. With a little change
> > to section 8.1.1[2], HTML5 could, in fact, be fully backwards
> > compatible.
> What do you mean by backwards compatible in this context? HTML5
> doesn't claim that all legacy documents are conforming HTML5
> documents (in fact no legacy documents are conforming HTML5
> documents);

Yes, and I wonder why. HTML5 can easily say that (most? all?) valid 
HTML4 document are also valid HTML5 documents.

> it only claims that HTML5 user agents will process legacy 
> documents in a manner compatible with legacy user agents.

That's not clear. The HTML5 draft says an incorrect DOCTYPE is an error 
and while some UAs may silently ignore the error, others may (or even 
must) report it.

> > The current version (4.01) of HTML requires[3] documents to start
> > with this DOCTYPE line:
> >
> >     <!doctype html public "-//W3C//DTD HTML 4.01//EN"
> >     "http://www.w3.org/TR/html4/strict.dtd">
> >
> > But that line is not allowed in the latest draft of version 5. Why
> > not?
> Because that line is HTML 4.01, not HTML5. If you want to write HTML
> 4.01, the HTML5 spec is not relevant.

Yes, it is. Once HTML5 is a REC, *it* defines HTML (see, e.g., sections 
1.3 and 1.4.1) and HTML 4.01 is no longer relevant. It would be a pity 
if old documents suddenly stopped being HTML, when they only differ in 
a line that is "mostly useless" (as the draft says).

It's nice that HTML5 takes forward compatibility into account (by not 
including a version number in document instances), but I don't see why 
it has to break with the past. I know previous versions of HTML had the 
same problem, but that is not a reason to repeat the mistake.

> HTML5's UA requirements are compatible with that DOCTYPE, though, so
> a user agent written to HTML5 will process that document in a manner
> compatible with legacy user agents.

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 5 March 2008 14:33:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:24 UTC