W3C home > Mailing lists > Public > www-style@w3.org > May 2012

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 22 May 2012 14:45:35 -0700
Message-ID: <CAAWBYDAgPpEMKjORni5xsJx6B+E15z-BZD_zP6Ajq_MHR6v-3Q@mail.gmail.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: John Daggett <jdaggett@mozilla.com>, www-style list <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT