W3C home > Mailing lists > Public > www-style@w3.org > June 2008

Re: WebKit now supports CSS Variables

From: Francois Remy <fremycompany_pub@yahoo.fr>
Date: Mon, 30 Jun 2008 21:26:13 +0200
Message-ID: <20F14273C4874AE1AC07141BBE72B0DA@FremyCompany1>
To: "Andrew Fedoniouk" <news@terrainformatica.com>, "CSS 3 W3C Group" <www-style@w3.org>

>> In any language, if you try to write something like "const x = 1" in 
>> file1 and
>> "const x = 2" in file2 (assuming that both file a defining the variable 
>> on the
>> same scope), you will get a compilation error and nothing of your code 
>> will
>> be compiled.
>
> Depends on many factors, cases and languages. In most languages you can 
> define constants with the same name but e.g. in different namespaces and 
> probably files.

If you are "assuming that both file a defining the variable on the same 
scope",
then it's not possible.

> CSS uses "silent recovery" method of parsing. So if you have
> two entities with the same name you have only two options in CSS:
>
> 1) first seen - first used. That is @const.
> 2) last seen - last used. That is @var.

Yes, but what's "first" seen ?

1. The first style that's sucessfully parsed ?
>  Then it's not possible for the developers to be sure which @const wil be 
> used.

2. The first sytle in the DOM ?
> Then, it can change during the application. So you can't use that for a 
> variable.

But you'll see it yourself, when you will need to make a true W3C Spec, 
defining exactly
all process that define how you compute a value of a constant.

Fremy

PS : Last seen is easy. It's the last in the document DOM. It can change and 
it's not a problem
if we decide to use variables. And it's the only way CSS have been parsed at 
any time. I see
no spec that say "first seen is first used". Because it's not possible to 
have "a first seen" that
you can assume as immutable for all the time the page will be running. 
Keywords are so.
But keywords are true constant... because it's not possible to override and 
disable them. 
Received on Monday, 30 June 2008 19:26:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:07 GMT