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

On Wed, 11 Oct 2000, fantasai wrote:

> Ian Hickson wrote:
>  | fantasai wrote:
>  | > !(DIV.navbar > P) > A
>  | 
>  | What does this mean? An <A> that is a child of an element that is not a P-
>  | that-is-a-child-of-a-DIV-with-class-"navbar" ?
>  | 
>  | As in,
>  | 
>  |    A:not-matches(DIV.navbar > P > #) 
>  | 
>  | ...?
> 
> I suppose so. That matches every non-root element <A> but one in this sequence:
> <DIV class="navbar">
>   <P>
>     <A></A>
>   </P>
> </DIV>
> 
> ...Right?

Yours does (I guess). Mine would also match a root <A>.

So a more accurate translation of your syntax into mine would be:

   :not-matches(DIV.navbar > P#) > A

Of course, as with my argument against :subject pseudo-thing, the :matches
pseudo-class is inherently more powerful than the !() syntax.

For example:

   :not-matches(DIV.navbar > P# SPAN) > A

..._would_ match the <A> in the fragment above, except if the <P> had a
SPAN descendant (which could be a sibling, child, or (nth level) niece of
the <A>.) This cannot, as far as I can tell, be described using !().

HOWEVER: At this point I should reiterate that in case this power scares
you, for CSS3 I am merely proposing that we allow the very simple
case: only at the end of a selector, and no '#' extended syntax. i.e.,
make :matches be exactly equivalent to :subject but with a clear extension
path (since :subject cannot easily be extended).

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

Received on Wednesday, 11 October 2000 20:14:54 UTC