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

On Mon, 16 Oct 2000, fantasai wrote:
> 
> From your proposal 
> (http://lists.w3.org/Archives/Public/www-style/1999Nov/0241.html):
>  >    Proposed syntax:  x:matches(y)
>  >    WD syntax:        x:subject y
>  >    matches:          <x MATCHED> <z> <y/> </z> </x>
> 
> In the syntax I've described, x:matches(y) wouldn't match anything.
> 
> I wrote:
>> Redefining X:matches(Y) to mean any X that matches the Y pattern where
>> Y is given as a CSS selector.
> 
> Thus, to use :matches for the above situation, you would have to put
>   x:matches($ y)

Ooooooh. I like this. This is much better than :subject and :matches()!


> :matches() in this context takes the intersection of the set defined in the
> parentheses and the set defined by the simple selector it's modifying.
> 
> In 'x:matches(y)', the intersection of 'x' & 'y' is the empty set - 
>   'x' matches any element <x>.
>   'y' matches any element <y>.
>   You cannot find an element that matches both conditions.
> 
> For 'x:matches($ y)' - 
>   'x' matches any element <x>
>   '$ y' matches any element with a descendant of <y>.
>   An element in the pattern <x> <z> <y/> </z> </x> will satisfy both
>   conditions.

Yes! This is great. A better syntax for :subject, along with future
extensibility for complex selectors. I like it.

-- 
Ian Hickson                                     )\     _. - ._.)       fL
Netscape, Standards Compliance QA              /. `- '  (  `--'
+1 650 937 6593                                `- , ) -  > ) \
irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________

Received on Monday, 16 October 2000 16:57:06 UTC