Re: Backwards compatibility and DOCTYPE

Disclaimer: Not a WG response.

On Mar 5, 2008, at 16:33, Bert Bos wrote:

> 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.
[...]
> 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).

First, I agree that there's no *technical* reason why HTML 4.01 could  
not be rescinded and *some* HTML 4.01-looking doctypes be made  
conforming as HTML5.

> 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.

I've argued previously that in order for the current HTML5 to HTML6  
forward-compatibility story to be believable, the same story should  
apply to the HTML4 to HTML5 transition:
http://lists.whatwg.org/pipermail/help-whatwg.org/2008-February/000126.html

Here are some complicating points in no particular order:

  * Making doctypes that say "HTML 4.01" conforming as HTML5 will  
confuse some people who have not yet internalized the notion that Web  
formats shouldn't have versions with which the language grows and  
shrinks but only levels that grow the language monotonically.

  * We shouldn't make quirks mode doctypes conforming, which means  
that some doctypes that were conforming under HTML 4.01 have to be non- 
conforming.

  * We probably shouldn't make the almost standard mode doctypes  
conforming, either, as long as the distinction between almost  
standards and standards modes is maintained in Gecko/Opera/WebKit.  
However, the almost standards mode is the common case among pragmatic  
standards-aware developers today. Therefore, it seems to me that in  
order to reap a notable practical benefit from making some legacy  
doctypes conforming, the CSS WG would need to fix the CSS defaults to  
match the almost standards mode so that the need for distinguishing  
the almost standards mode and the standards mode would go away.
http://lists.w3.org/Archives/Public/www-style/2008Jan/0598.html

  * Valid HTML 4.01 formally includes various weird SGML stuff  
(minimizations in particular) that have never been supported by  
mainstream browsers. We shouldn't make that stuff conforming. Hence,  
we can't categorically make valid HTML 4.01 documents valid HTML5  
documents.

  * HTML 4.01 has some above-SGML-layer bits that are so bad and  
rarely used that we should take the opportunity to ban them: The way  
isindex is implemented in browsers is fundamentally incompatible with  
the generally understood relationship of markup and the DOM. basefont  
is obsolete in practice. This is another reason why we shouldn't  
categorically make valid HTML 4.01 documents valid HTML5 documents.

  * On a number of other points mainly pertaining to presentational or  
redundant attributes (in particular border=0, target=_blank,  
language=JavaScript and presentational attributes on tables that were  
allowed in 4.01 Strict) I think we indeed should make more HTML 4.01  
usage patterns conforming even if the patterns are no-ops or would  
have more elegant CSS alternatives.
http://lists.w3.org/Archives/Public/public-html/2008Jan/0305.html
http://hsivonen.iki.fi/test/moz/happycog-portfolio-results.txt

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Thursday, 6 March 2008 09:33:12 UTC