W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2012

[whatwg] Comments before the DOCTYPE (warning message in validator.nu)

From: Charles Pritchard <chuck@jumis.com>
Date: Fri, 3 Feb 2012 17:47:34 -0800
Message-ID: <2BC4201C-46CF-4A24-8C23-D1D773E8C9FA@jumis.com>
On Feb 3, 2012, at 5:20 PM, Leif Halvard Silli <xn--mlform-iua at xn--mlform-iua.no> wrote:

> If one tries to validate
> 
> <!----><!DOCTYPE html><title></title>
> 
> then validator.nu gives this warning:
> 
> ]]
> Warning: Comments seen before doctype. 
> Internet Explorer will go into the quirks mode.
> From line 1, column 1; to line 1, column 7
> <!----><!DOCT
> [[
> 
> While I take some responsibility for this warning, the text ought to be 
> more precise. Firstly, because IE10 will not go into quirks mode by 
> comments before the DOCTYPE anymore. And, secondly, because IE8 and IE9 
> *could*, via the X-UA-Compatible directive, be directed to not go into 
> quirks mode - or even simply ignore the entire comment if it belongs to 
> Microsoft's proprietary Conditional Comments subset ? see 
> http://xn--mlform-iua.no/blog/no-condition-comments.
> 
> Hence, I would suggest that e.g. "some versions of Internet Explorer 
> risk entering quirks-mode" would be a more truthful message to send.
> -- 
> Leif Halvard Silli


In one of my projects, I've taken the uncivil position of including a text node before the HTML declaration. It lets me use an HTML file as a web workers source.

So far, it seems to work out just fine. +1 to loosening the warning language.
Received on Friday, 3 February 2012 17:47:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:39 UTC