Re: Comment syntax

(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 UTC