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

 | > 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