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

Re: handling of HTML Comments in HTML style element

From: Nikodem <nikn1@gazeta.pl>
Date: Mon, 03 Sep 2007 20:18:11 +0200
Message-ID: <46DC4FE3.1010301@gazeta.pl>
To: Christof Höke <csad7@t-online.de>
CC: www-style@w3.org

Christof Höke wrote:
> 
> hi,
> hope this is the right play to ask, well for the question:
> 
> How should the following excerpt from a simple HTML page be working:
> 
>       <style type="text/css">
>               body { color: red }
>               <!-- comment -->
>               body { color: blue }
>               body { color: pink }
>               <!-- comment -->
>               body { color: green }
>           </style>
> 
> (see http://cthedot.de/xbrowsertest/css.html for the complete page)
> 
> At least one browser (Firefox) does seem to interpret the spec
> differently than most other browsers (at least IE, Opera, have not
> testet Safari).
> 
> It seems Firefox invalidates the first CSS statement following a HTML
> comment so the resulting text is pinc which is defined in the 2nd
> following statement.
> 
> As far as I understand the spec <!-- and --> in CSS Stylesheets should
> be ignored so it would lead to the following sheet:
> 
>               body { color: red }
>               comment
>               body { color: blue }
>               body { color: pink }
>               comment
>               body { color: green }
> 
> which definitely has errors in it. But how should the following
> statement be handled now? Ignored as Firefox does it or acknowledged as
> others do it?
> 
> thanks
> Chris
> 

In my opinion, HTML comments should be handled if page is sent as 
text/html (then it is needed for old UAs). If the document is a 100% 
valid XHTML (MIME type application/xhtml+xml), comments are comments and 
nothing else.

-- 
Nikodem
JID: nikn@jabber.org

= Probably below will be added a stupid ad =

--
Opole - Miasto Bez Granic.
http://www.opole.pl - tu znajdziesz nowe miejsca, nowe mozliwosci, nowe inspiracje...
Received on Monday, 3 September 2007 18:15:23 GMT

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