Re: @version rule

Ian Hickson wrote:
> 
> On Mon, 30 Jul 2001, Stuart Ballard wrote:
> 
> > George Lund wrote:
> > >
> > > What is needed is a mechanism for grouping CSS rules, such that either
> > > they are all rules in the group are applied or none are. This would
> > > allow user and author stylesheets to interact without the risk that a
> > > setting in one, while not overriding the setting in another, render the
> > > page unreadable. The present situation leaves a serious risk of this
> > > happening especially when fixed positioning is used.
> >
> > @combine {
> >   selector1 { attr1: val1 };
> >   selector2 { attr2: val2 };
> > }

> I think if it means "only apply the contents of this rule if you
> understand every single selector, @rule and property" then it would be a
> worthy addition. However, 'understand' is not the same as 'support'.
> Mozilla understands (parses) a few CSS2 properties and keywords that it
> then promptly ignores when rendering (e.g. all the aural properties).

The original proposal was even more strict (and possibly harder to
specify fully): Only apply these rules if (a) all the rules in the
@combine section are "understood" by the UA, AND (b) neither rule will
be overridden by a user stylesheet. Of course, since being overridden by
a user stylesheet is not an all-or-nothing thing, this is very hard to
specify.

If the @combine were done on a per-selector basis, it could be specified
like this:

@combine selector { property1: value1; property2: value2 }

This would mean:

Apply these properties ONLY if you understand both properties and both
values, and ONLY to elements that:
a) are matched by the selector, AND
b) are not matched by any rule with a higher precedence in the cascade
that would set a value for either property1 or property2.

How does that sound?

Stuart.

Received on Monday, 30 July 2001 16:38:01 UTC