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

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

--- Comment #23 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> 2011-03-01 16:06:11 UTC ---
Any conditional comment before the DOCTYPE (regardless of its content) and (at
least in IE8) any regular comment as well, will cause IE8 and (E9 to report
"wrong" user agent. 

In other words, if you browse the following document with IE8:

   <!--[if ie]><![endif]-->
   <!DOCTYPE html>
   <meta http-equiv="x-ua-compatible" content="IE=7">
   <!--[if ie 8>IE8<![endif]--><!--[if ie 7>IE7<![endif]-->

Then IE8 - as well as IE9 - will report itself as IE8 and IE9 and not as IE7 -
as the author intended. (The parser will still immitate IE7, but it will not
report itself as being IE7.)

In IE8's case, then even a normal coment seem to have the same effect:

   <!---->
   <!DOCTYPE html>
   <meta http-equiv="x-ua-compatible" content="IE=7">
   <!--[if ie 8>IE8<![endif]--><!--[if ie 7>IE7<![endif]-->

-- 
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 Tuesday, 1 March 2011 16:06:13 UTC