Re: [css3-variables] review comments on latest draft

Tab Atkins Jr. wrote:

> >>> The valid possible values of a variable property are almost
> >>> completely unrestricted.
> >
> > Arron loves to write testcases for anything 'almost completely
> > unrestricted' :)
> >
> > More seriously this sentence seems both confusing and unnecessary
> > given what follows, which is the clear normative part. John, any
> > example(s) of your concern?
> 
> Yeah, there's a better definition for it, I just haven't had time to
> write it yet.  It's basically "whatever is allowed by the 'term'
> production in the Grammar", but it's also pretty simple to state it
> in normal type terms, like "<number> | <dimension> | ...".  Things
> like "var-foo: );" shouldn't be allowed.

The question I had reading the spec was whether *any* validation
occurs with variable property declarations.  If validation does occur,
then it needs to be spelled out explicitly.

Given that a lot of parsing in CSS is tied to the specifics associated
with individual properties I'm not sure it makes much sense to do any
validation within the variable property declaration.

Variable declarations are basically defining a set of tokens to be
substituted elsewhere and the validity will ultimately be determined
by the use context.  I don't think the definition of what is and isn't
valid is going to be "pretty simple". Plus you'll effectively make the
exact nature of this property be dependent on the syntax used by all
other properties implemented by a given user agent, which basically
reduces the chances of consistency across user agents.

So while 'var-foo: );' shouldn't be allowed, I think what's needed
here is the simplest possible set of syntax rules that handles cases
like the one below without causing anyone's head to explode:

  var-foo: "() blah @bongo /* dumb" { de dumb */*/ -moz-tra-la {});";

This feels like a good topic for a dbaron comment (or maybe Luke since
he's been working on the Webkit implementation?).

Regards,

John Daggett

Received on Wednesday, 23 May 2012 01:51:59 UTC