W3C home > Mailing lists > Public > www-style@w3.org > September 2007

Re: handling of HTML Comments in HTML style element

From: Allan Sandfeld Jensen <kde@carewolf.com>
Date: Tue, 4 Sep 2007 07:59:58 +0200
To: www-style@w3.org
Message-Id: <200709040759.58201.kde@carewolf.com>

On Sunday 02 September 2007 08:11, fantasai wrote:
> 4.1.9 basically says "refer to the grammar".
>
> The grammar defines the tokens
>
>    CDO  <!--
>    CDC  -->
>
> then it defines a style sheet as
>
>    stylesheet  : [ CDO | CDC | S | statement ]*;
>
> where a statement is either a style rule or an @rule.
>
> This means '<!--' and '-->' are allowed anywhere between style rules
> and @rules, so your style sheet should result in the following style
> rules:
>
As I understand those rules CDO and CDC are on statement level, and therefore 
can not _not_ be part of the next statement, because they are fully 
terminated statements in themselves.

<style>
<!--
  body { color: green }
-->
</style>
as well as
<style>
  body { color: red }
  <!-- body { color: green } -->
</style>
should result in green text.

In this respect both '<!--' and '-->' are essentially ignored, and firefox is 
wrong.

Though we could clarify the spec so that '<!--' is only allowed in beginning 
and '-->' only in the end.


Regards
`Allan
Received on Tuesday, 4 September 2007 06:00:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:52 GMT