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

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