W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: selector negation (was Re: New version of the Selectors moduleof CSS3)

From: fantasai <fantasai@escape.com>
Date: Mon, 16 Oct 2000 12:45:08 -0400
Message-ID: <39EB3094.796229EC@escape.com>
To: www-style@w3.org
 | > The syntax scares me.
 | I'm open to better syntaxes! :-)

Okay. Here's a suggestion, then:

Defining $ as equivalent to :subject. It must come before the simple
selector, thus:

$A > B

$ by itself means $*

The default $ subject is the last simple selector in a complex pattern,
as before: A > $B = A > B

(You can pick a different symbol later.)

Redefining X:matches(Y) to mean any X that matches the Y pattern where
Y is given as a CSS selector.

Examples - 

:matches(A B) matches any element B that is a descendant of A.

:matches($A B) matches any element A that is an ancestor of B.

A:matches($ B) means the same thing as :matches($A B).

This way you only have to learn how to match against one set of rules;
standard CSS selectors.
Received on Monday, 16 October 2000 12:44:45 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:55 UTC