W3C home > Mailing lists > Public > www-style@w3.org > August 2012

Re: Comment syntax

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Tue, 28 Aug 2012 15:08:08 +0800
Message-ID: <503C6E58.1000908@oupeng.com>
To: Liam R E Quin <liam@w3.org>
CC: "Zachary “Gamer_Z.” Yaro" <zmyaro@gmail.com>, WWW Style <www-style@w3.org>, "Jens O. Meiert" <jens@meiert.com>
(12/08/28 12:47), Liam R E Quin wrote:
> On Mon, 2012-08-27 at 19:44 +0800, Kang-Hao (Kenny) Lu wrote:
> [...]
>> (12/08/25 13:01), Liam R E Quin wrote:
>>> <span style="color: red;// background-color: yellow; font-size:
>>> 36pt;"> Is "font-size" commented out in (1) the mind of the author,
>>> (2) the mind of the parser?
>>
>> Can you elaborate? Are you suggesting "font-size" should not be
>> commented out? That would be another proposal D.
> 
> It's the status quo, as Tab pointed out.

I know the status quo, but I don't know what you are trying to say here.
Why do the mind of the author and that of the parser have to differ in
this case? It seems that the //-style comment proposal (A.) is pretty
unambiguous in this case: "font-size" is commented out.

>>> In
>>> <span style="color: red;
>>>             // background-color: yellow;
>>>             font-size: 36pt;">
>>>
>>> how does attribute value normalization interact with the comment?
>>
>> What is attribute value normalization?
> 
> In XML and SGML attributes, newlines are converted to spaces by the
> parser. E.g. see
> http://www.w3.org/TR/REC-xml/#AVNormalize

Thanks for the link. So, it's (surprisingly) true that you can't use
//-style comments in XHTML. Test cases:

  data:application/xhtml+xml,<body xmlns="http://www.w3.org/1999/xhtml"
onload="//... %0A alert('hello world')" />

. Back to the original question:

>>> how does attribute value normalization interact with the comment?

I guess the answer is: attribute value normalization still happens, and
processors that outputs XHTML should strip away the //-style comments in
CSS or turn those into /*-style, in the same way as how //-style
comments in JS on* attributes should be handled.

In any case, I agree this is a point, but is has a precedent and I don't
think it's a big deal, as I don't think there are many people who write
XHTML by hand.



Cheers,
Kenny
-- 
Web Specialist, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/
Received on Tuesday, 28 August 2012 07:08:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:59 GMT