W3C home > Mailing lists > Public > public-html-comments@w3.org > March 2010

Starting a script block with <!--

From: Herman Venter <hermanv@microsoft.com>
Date: Sat, 20 Mar 2010 21:17:23 +0000
To: "public-html-comments@w3.org" <public-html-comments@w3.org>
Message-ID: <BAB781858DF25C488FD24AF239E418E016523A6F@TK5EX14MBXC115.redmond.corp.microsoft.com>
Hi

I'm working on a prototype HTML5 parser for research purposes and recently bumped into this little bit of markup:

<SCRIPT type=text/javascript><!-- site js --></SCRIPT>

Trawling around the Web it seems that the expectation is that the script engine will ignore a (first?) line starting with <!--.

The EcmaScript standard does not provide for this (at least not the last time I've read through it), so I thought perhaps the issue will be addressed in the new HTML5 standard.

However, looking at the latter, I find myself hopelessly confused about the meaning of the "Script data escape start state" that is entered when <! is encountered inside a script tag body.

As best as I can make things out, the end result is that the HTML comment in the above example is just passed through to the script engine, which leaves the question of what the script engine should do with the non compliant syntax dangling in the air.

I'm also left bemused by the purpose of the "Script data escape start state". Some non normative text the explains the rationale behind this state, amplified by some concrete examples, would be a great improvement to the standard.

Sincerely

Herman Venter
Received on Sunday, 21 March 2010 20:22:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:01 GMT