Re: Redo selectors instead of parent-selectors

Jesper Hermansen wrote:
> Example:
> Say you've got the following selector:
> 
> #foo>#bar :root #foobar { /* Previously #foo>#bar / #foobar */
>  background-color: red;
> }
> 
> In this example if #bar is in #foo, #foobar will have a red background.

I don't like this syntax. It would logically match only if #bar is 
ancestor of :root which clearly isn't the case. I'd prefer

#foobar:root-matches(#foo>#bar)
{ /* Previously #foo>#bar / #foobar */
 background-color: red;
}

This pseudo-element would be defined as

:root-matches(SELECTOR) - matches elements if the SELECTOR would 
match any element (the SELECTOR is matched against the whole document).

I've no idea how this could be implemented with high performance.

-- 
Mikko

Received on Wednesday, 21 December 2005 14:05:57 UTC