Re: CSS Variables Draft Proposal

On Feb 16, 2011, at 3:38 , Christoph Päper wrote:

> 
> FWIW I’d have no problem retracting the second, exception part of that statement and therefore say: I am against making variables available across the three types of sources (i.e. user agent, author and user), no exceptions possible.

I am with you.  I think we are asking for grief making variables cross over boundaries between style-sheets that do not certainly know about each other.  That means either (a) restrict to the document in which they occur or (b) to that document and documents imported by that document.

Even in the (b) case, we would have to do the usual lexical scoping.  For example:

A stylesheet Q exists that defines variable X, and imports stylesheet R that does not use X (the author of Q can check that at the time of writing).  But the author of R is not aware of the fact that he is being used in this way. He later does a revision of R that introduces a variable X with a completely different meaning.  Within R everything is fine still; the variable there is defined and used consistently. But now the system has to remember when interpreting Q that its use of X is as defined in X, and the variable X in R is, in fact, different.

Is it harmful to have variables textually local to the document in which they occur?

David Singer
Multimedia and Software Standards, Apple Inc.

Received on Wednesday, 16 February 2011 07:27:15 UTC