Re: [css3-selectors] "recursive" selectors

Boris Zbarsky wrote:

> Andy wrote:
>> Ok point taken, maybe selecting based on all CSS properties isn't 
>> perfect idea. But surely you can't disagree that selecting based on 
>> display type or the like is a bad?
> Why is display special?  Note that if such a selector is introduced it 
> could only be used for _one_ property; otherwise the problems I 
> mentioned arise.  Even then, what happens with:
> *:display(block) { display: inline } ?
> Or for that matter with:
> *:display(inline) { float: right } ? 

Ok, I can see the point you're trying to make but is this any different 
than the :hover pseudo-class in that you just have to be careful in 
which order you place it? In my view, your first example would make all 
block elements inline (not all elements since we have table cells, rows 
etc) and if the second rule followed it, would float all inline objects 
to the right. Seems pretty simple to me.

> One of the basic principles of CSS at the moment is that determining 
> which rules apply to an element and computing the style of an element 
> are separate processes; the former does not depend on the latter in 
> any way.  This allows some rather significan optimization on the UA 
> end (for example, you don't have to recompute all style for every rule 
> that applies to the element; you can just take all rules that apply 
> and compute the style once, bailing out of looking at 
> lower-precendence rules if the style is fully specified by the 
> higher-precedence ones).
> Changing this property of CSS would probably require pretty complete 
> rewrites of all existing CSS engines (nothing wrong with that per se, 
> but that means that it should be considered very carefully).

Received on Tuesday, 29 April 2003 13:43:48 UTC