Re: [css2] tokenization, blocks as property values.

Le 26/02/2013 05:31, Peter Moulder a écrit :
> On Mon, Feb 25, 2013 at 07:34:32PM -0800, Andrew Fedoniouk wrote:
>> Reading this part: http://www.w3.org/TR/CSS2/syndata.html#tokenization
>>
>> Seem like this:
>>
>> div {
>>     some-prop: { /* prop value may contain blocks, so: */
>>       start: 0%;
>>       end: 100%;
>>       color-stops: white/0% red/100%
>>     };
>> }
>>
>> is a valid *syntax* construction from CSS 2.1 point of view.
>>
>> Am I right?

Yes, this is valid for the generic syntax of declarations in both 
css3-syntax (the new Editor’s Draft being worked on) and CSS 2.1. The 
error recovery rules ensure that UAs that don’t know this property will 
still correctly find the end of the declaration.

However, no existing descriptor or property accepts a syntax like this. 
It is not a style we have favored until now, but we could add such 
properties in the future. css3-variables will also accept such syntax; 
the cascaded value could be used from JavaScript.

http://dev.w3.org/csswg/css3-syntax/
http://dev.w3.org/csswg/css-variables/


> More precisely, it conforms to CSS 2.1's description of the core grammar.
> It does not conform to the grammar of valid CSS 2.1 that's described
> (non-normatively) at http://www.w3.org/TR/CSS21/grammar.html .

I don’t find this grammar very useful. It’s not even CSS 2.1, but a 
superset of 2.1. As soon as you add Level 3 support for some modules, it 
becomes neither a superset nor a subset.

I find more useful to define separately the core grammar/syntax, then 
selectors, then individual property values, etc.

-- 
Simon Sapin

Received on Tuesday, 26 February 2013 05:15:43 UTC