W3C home > Mailing lists > Public > www-style@w3.org > February 2013

Re: [css-syntax] value grammar, <value> type and browser implementations

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Tue, 05 Feb 2013 12:37:49 -0700
Message-ID: <51115F8D.7040605@kozea.fr>
To: François REMY <francois.remy.dev@outlook.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Le 05/02/2013 08:17, François REMY a écrit :
>> The use of the value production from 2.1 isn't desirable in any case.
>> What we actually want to do is simply say that it has no grammar -
>> that every possible property value is valid for a custom property.
>> That way, the only limitation is what is automatically imposed by the
>> parser itself.
> My issue is that browsers do not seem to follow any spec for their
> property value syntax (because the CSS Syntax is more permissive than
> any non-custom property need, and inexplicably complex).
>
> The 'value' grammar doesn't make any sense to me: it seem to accept
> {a:a} but not {'a':'a'} or {a}. It should accept [;;] but not {;;}. I
> would like the value tokenization to be redefined to be more
> understandable and independant of other productions like 'block',
> 'declaration' and 'property'.

Hi François,

As discussed in another thread and F2F yesterday, the <value> production 
of CSS 2.1 is more restrictive than it needs to be. Before we had 
variables (custom properties) it didn’t matter because any selector or 
property value had a more specific grammar anyway.

css3-syntax now has a more precise definition of how to turn text into 
tokens, and tokens into "component values" (which were known as 
"primitives" in the draft until recently.) A property value is a list of 
primitives, except that ; or ! can not appear top-level because they 
would end the declaration.

The normative definition of all this is the state machine, but I started 
making informative railroad diagrams of the various items in the output 
tree of css3-syntax parsing:

http://dev.w3.org/csswg/css3-syntax/Diagrams.src.html#parsing


Does this help?

-- 
Simon Sapin
Received on Tuesday, 5 February 2013 19:38:16 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT