Re: [css3-cascade] Proposed property: rule( sSelector );

Boris Zbarsky [bzbarsky@MIT.EDU] wrote:
> So let me see if I understand.  The cascade with the proposed change now looks
> like:
> user !important
> user !important indirect
> author !important
> author !important indirect
> author
> author indirect
> user
> user indirect
> UA
> UA indirect
> where "indirect" refers to rules that are pulled in by the new construct, with
> ordering by specificity within each level above?

I think I see where you're going with this - that an indirection at for example,
the user level, could end up referring to one at the author !important level -
and what wins then?

Perhaps a limitation to simplify things, then, would be to allow @rule() to only
work at the Cascade level it is applied at; that is, @rule() on the author level
does not import from UA or user styles. This would make my earlier example where
the !important rules won invalid.

> Or does specificity take precedence over indirection when determining cascade
> order?
> Also, is the specificity for indirect rules that of the "importing" rule, or
> "imported rule"?

If there is no limitation and @rule( "div.section" ); applies the styles of a
div selector, then the Specificity flag could be expaned to account for
indirection; least indirection gets a 5 (5 max levels of indirection) and most
indirection gets a 0.

So, to be concrete:

li { color: red; }
dt { @rule( "li.error" ); color: orange; }
div.error { @rule( "dt.error" ); color: yellow; }

And the Element in question is a div with class "error".

yellow has specificity 5011.
orange has specificity 4001.
red has specificity 3001.

-Chris "SoopahMan" Moschini

Received on Wednesday, 22 October 2003 17:40:20 UTC