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

Re: [css-variables] Should var properties respect !important?

From: Florian Rivoal <florianr@opera.com>
Date: Sat, 07 Apr 2012 01:37:39 +0200
To: www-style@w3.org
Message-ID: <op.wcdak1xl4p7avi@eeeflorian>
On Sat, 07 Apr 2012 01:06:51 +0200, Kang-Hao (Kenny) Lu  
<kennyluck@csail.mit.edu> wrote:

> (12/04/07 6:33), Florian Rivoal wrote:
>> On Thu, 05 Apr 2012 04:07:36 +0200, Tab Atkins Jr.
>> I still prefer 2d (same thing, except the syntax error is cause at the
>> expansion of
>> the variable rather than its definition) for two reasons:
>>
>> 1) It deals with this:
>> ul{ data-foo:!;data-bar:important;}
>> li{ width: 0 data(foo) data(bar);}
>
> Do we seriously want this to work? This is different from what I
> imagine, but no strong opinion, provided that it is more or equivalently
> implementable.

No we don't, and my so-called "2d" proposal makes it simple to see why it
doesn't work, while 2a leaves it undefined, as far as I can tell.

>> 2) you will have to parse the result of the expansion anyway, so it is a
>> good time to detect syntax error. At the data-property definition stage,
>> only lexing is needed, not parsing (except for the 2 last tokens, to see
>> if they are "!" and "important"), which makes it at less natural place
>> to do syntax checks.
>
> This seems like a valid argument only if the implementation has clear
> boundary between the lexing and parsing.

At data- property definition time, the only thing you're supposed to do
is to turn the value into a string of tokens, and that's essentially  
lexing.

Exactly how implementations deal with that is a separate question, but  
conceptually
lexing is all you need here.
Received on Friday, 6 April 2012 23:33:19 GMT

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