Re: [css-style-attr] SVG WG comments on CSS Styling Attributes Level 1

On Feb 22, 2010, at 6:29 PM, fantasai wrote:

> On 02/09/2010 03:26 PM, Chris Lilley wrote:
>> Hello www-style,
>> 
>> These comments relate to CSS Styling Attributes Level 1, W3C Working
>> Draft 21 January 2010 from the perspective of SVG.
>> 
> 
>> 3) In section 3. Syntax and Parsing, the actual grammar for a style
>> attribute, following CSS2.1 chapter 4, appears to be
>> 
>> declaration-list
>>   : C* S* C* declaration? C* [ ';' C* S* C* declaration? C*]* C*
>>   ;
>> 
>> where C is the comment production. Is that correct? (Specifically, are
>> leading and trailing comments allowed, as well as ones between tokens?)
> 
> I'll leave this question to Bert, who's our resident grammar expert.

Per CSS 2.1 ( http://www.w3.org/TR/CSS21/syndata.html#comments ) comments can appear "anywhere between tokens". We don't put the comment tokens anywhere in grammar specifications to keep things simple (they do appear in the tokenizer spec however where they're allowed inside other tokens). Having comments as the first and last tokens should also be allowed, although on re-reading the spec, that isn't really covered by "between tokens"... I don't think that distinction was made intentionally.

So yes, your grammar is correct.

Received on Tuesday, 23 February 2010 06:31:31 UTC