Re: User constant declarations in style sheets

Werner Donné wrote:
> David Woolley wrote:
>>The key design rule for CSS grammars is backwards compatibility.  All new
>>syntax must result in the new construct being ignored by browsers that 
>>don't support the new features.
> 
> If the "lh" in the example would be interpreted as a unit by a browser that
> doesn't support the constants feature, the browser would have to conclude a
> wrong length was specified and should therefore ignore the rule. What is so
> special about it then?

The problem is that *you* get to define what "lh" means. For 
example, in your example you defined that
const lh: 1.2em;
which means that 2lh is equivalent to 2.4em if I've understood 
correctly. The point is that *if* this is allowed there's no way to 
ever define any new unit without requiring UA to support this 
"const" feature too. For example, W3C couldn't define a new unit 
"lh" because your already example uses it. If W3C defined lh as 
anything else but "1.2em", your stylesheet would get broken - that 
is, unless the UA also supported "const" so it could decipher what 
your stylesheet really means. UA shouldn't be required to support 
"const" feature to support all the units defined in the spec.

The problems that need to be solved:

1) How to express contants so that old UA correctly ignore those?
2) Does this feature prevent other features in the future?
3) How does the cascade work with the user style sheet?
4) If user style sheet already defines similarly named constant, 
what should happen?

In the end, the question remains: is it really worth the trouble 
considering that real world UAs would support this feature only 
after a really long time?

-- 
Mikko

Received on Wednesday, 27 April 2005 08:43:32 UTC