W3C home > Mailing lists > Public > www-style@w3.org > December 2005

Re: Redo selectors instead of parent-selectors

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Wed, 21 Dec 2005 16:05:46 +0200
Message-ID: <43A9613A.8040301@peda.net>
To: www-style@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:42 GMT