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

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

--- Comment #19 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> 2011-02-18 03:38:06 UTC ---
(In reply to comment #18)
> (In reply to comment #14)

> This bug is there, but it probably won't be there forever.

Above you said: "It's marked Won't Fix for IE9." 

> > [*] sideffect: It has been pointed out that comments are partly stylable in IE.
> 
> In quirks mode and standards mode up to IE7, but not IE8 nor IE9.
> 
> This issue is not related to comments only, but to other "invisible" elements
> as well, e.g. noscript if scrits are enabled, input@type=hidden

If IE looks at comments the same way it looks at <noscript>, then it is easy to
see why <!----><!DOCTYPE html> brings even IE8/9 into quirks mode. (That
<!----> is unstylable in IE8/9, might simply be due to a CSS implementation
change rather than to a parsing change.)

> Other browsers also have bugs in their quirks mode that are partially
> undocumented.

Other browsers are actually pretty complete in their quirks mode *trigger*
documentation. Whereas the IE meta switch documentation is incomplete when it
states that: [*] "Emulate IE[789] mode tells Internet Explorer to use the
<!DOCTYPE> directive to determine how to render content". It should have added:
"as long as there is no comment before the DOCTYPE". 
[*] http://msdn.microsoft.com/library/cc288325(v=vs.85).aspx#DCModes 

> Besides, even if this case was forbidden, there'd still be an
> issue in IE that had to be fixed.

Indeed: Forbidding <!---><!DOCTYPE wouldn't bless IE's behaviour.

> Assume IE didn't have this bug. Would you still want to forbid Comments before
> the doctype because the meta switch could be used there?

Hypothetical! With many if's. Such as: if <!----><!DOCTYPE html> didn't trigger
quirks mode, would the meta switch still have existed/been relevant?

A more realistic question: would I have filed this bug even if IE8 and IE9 did
not support the X-UA-COMPATIBLE switch? Of course I would.

A question for you: Does the X-UA-COMPATIBLE meta switch mean that there is
less reason to consider whether <!----><!DOCTYPE html> should be forbidden? 

> > 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.
> 
> I'm afraid that there will be more and more cases where things like comments
> may look "out of place" and get forbidden to ensure a streamlined look.

Through the concept "restrictions on the content model", HTML5 is able to
discern between things that are forbidden for practical reasons and other kinds
of forbiddance. Thus, if the practical reason for forbidding <!----><!DOCTYPE
html> would disappear, then e.g. HTML6, could lift the ban.

-- 
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 Friday, 18 February 2011 03:38:09 UTC