[Bug 12072] Comments before <!DOCTYPE html> should be forbidden

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12072

--- Comment #14 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> 2011-02-17 00:15:25 UTC ---
(In reply to comment #13)
> (In reply to comment #12)

> > It will anyhow affect legacy browsers, including IE9.
> 
> Let's face it: [...] forbidding every feature that has a buggy implementation in
> the wild.

* I'm familiar with "in the wild" about documents, but not about UAs…
* It is core to HTML5's design to not trigger quirks mode.
* What do you mean by "feature" in this case? 
  "<!---><!DOCTYPE html>" is not a feature!

     Feature: It is not "<!---><!DOCTYPE html>" in particular, but HTML
comments in general, that has a buggy (read: proprietary) implementation in
Internet Explorer. But HTML5 does still not forbid the comments feature ... !

    IE's buggy/proprietary comments feature implementation is otherwise well
documented and explaned - including by Microsoft themselves: "Everyone" knows
about conditional comments, and the implementation is quite logical and simple
to understand.

    But, in case of "<!---><!DOCTYPE html>" as well as "<!--[if
ie]><![endif]--><!DOCTYPE html>", then IE's comments implementation has the
unexpected and *undocumented* (undocumented by Microsoft) sideeffect [*] that
it triggers quirks mode. 

    That it can be avoided via "<!--[if !ie]><![endif]--><!DOCTYPE html>" as
well as "<!--[if ie]><meta http-equiv="X-UA-Compatible"
content="IE=Edge"><![endif]--><!DOCTYPE html>", only makes it even more
confusing. But worse: it forces authors to use proprietary syntax in order to
achive what HTML5 should be providing out of the box! And even worse: unless it
is made non-conforming, it is also impossible to catch these parsing mode
affecting sideffects in conformance checkers.

It is not theoretical spec purity that favours forbidding comments before
DOCTYPE. It is predictabilitiy for authors. That said: to forbid comments
before the DOCTYPE, in many ways looks very natural: it means that conforming
HTML gets a more "streamlined" look. 

Are there not any other arguments in favour of comments before DOCTYPE than
spec purity?

[*] sideffect: It has been pointed out that comments are partly stylable in IE.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 17 February 2011 00:15:27 UTC