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

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

From: Ian Hickson <ianh@netscape.com>
Date: Wed, 11 Oct 2000 17:12:08 -0700 (Pacific Daylight Time)
To: www-style@w3.org
Message-ID: <Pine.WNT.4.21.0010111710080.496-100000@HIXIE.netscape.com>

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 GMT

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