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

On Tue, May 22, 2012 at 8:07 AM, Sylvain Galineau
<sylvaing@microsoft.com> wrote:
> [John Daggett:]
>> > 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.


>> > A declaration that is invalid at computed-value time results from
>> > either using an invalid variable in a property value, or using a valid
>> > variable that produces an invalid declaration when it is substituted
>> > in. When this happens, the declaration must compute to the property's
>> > initial value.
>>
>> This ends up changing CSS semantics in some fairly subtle ways which I
>> think you should explicitly note.  Specifically, invalid declarations with
>> variables behave differently from invalid declarations without:
>>
>> /* without variables */
>>
>> p        { color: blue; }
>> p > span { color: 3px;  }  /* invalid ==> color == blue */
>>
>> /* with variables */
>>
>> :root    { var-span-color: 3px; }
>> p        { color: blue; }
>> p > span { color: var(span-color); }  /* invalid ==> color == black */
>>
>
> This is both subtle and surprising. Why shouldn't/can't it be blue?

I actually didn't even think about that.  It shouldn't be problematic
to instead make invalid declarations become the inherited value on
inherited properties.

(John - I'll get to the rest of your feedback later - it's all valid.)

~TJ

Received on Tuesday, 22 May 2012 21:46:45 UTC