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

Re: WebKit now supports CSS Variables

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 30 Jun 2008 12:06:28 -0700
Message-ID: <48692EB4.2070809@terrainformatica.com>
To: Francois Remy <fremycompany_pub@yahoo.fr>
CC: Brad Kemper <brkemper@comcast.net>, Christoph Päper <christoph.paeper@crissov.de>, www-style@w3.org

Francois Remy wrote:
> 
> In CSS, we have no compiler. So, the "validity" of the constants cannot
> be checked before the program became compiled, because the constant
> can be created at any moment.

And what is the name the thing that gets CSS source (text) and builds
correspondent data structures as a result?

> 
> 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.

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.

@const does not require any major changes in CSS parsing and handling.
@var requires change of CSS paradigm - @vars require at least
some additional interpreting layer.

> 
> In CSS, this is not possible, because you can't check all stylesheets 
> before
> loading thems, because the JS can add some new stylesheet later... or 
> because
> a stylesheet can change when the media change !
> 
> Well, I see no solution...
> 

You see no solution to what?

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Monday, 30 June 2008 19:07:15 GMT

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