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: Jonas Sicking <sicking@bigfoot.com>
Date: Mon, 9 Oct 2000 23:43:11 +0200
Message-ID: <003a01c03239$ec138200$3110f7d4@ericsson.se>
To: "Bjoern Hoehrmann" <derhoermi@gmx.net>, <www-style@w3.org>
Bjoern Hoehrmann wrote
> * "Jonas Sicking" <sicking@bigfoot.com> wrote:
> | I'd guess that the WG has recogniced the need for class inversion since
> | CSS3 drafts has contained inversion of some of the classes. What I'm
> | for is to make inversion generic on *all* pseudo classes by saying "any
> | pseudoclass can be inverted by putting not- infront of it" rather then
> | adding some specific classes that are inverted. That way it could also
> | possible to have the CSS parser handle the inversion and thus making css
> | renderers a bit slimmer.
> I really don't like a 'not-' prefix as a generic modifier.
> What about a suffix pseudo-class?
>   p:contains("foo"):not
>   "selects element p not containing 'foo'"
>   a[href^='http://www.w3.org']:not
>   "selects element a with href not starting with 'http://www.w3.org'"
>   p:subject > a:not
>   "selects element p with no child 'a'"
>   h1:subject + p:not
>   "selects element h1 with no adjacent sibling p"
>   a:hover:not

> I think it makes small sense to say for negating attribute selectors you
> this syntax for negating pseudo-classes use that syntax, for negating type
> selectors use again another syntax.

I completly agree that the "not-" syntax is not perfect. However the :not
pseudoclass looks even stranger to me. Think of a selector like


that gives really messy syntax.
The coder in me wants to use ! for all inversions


but the designer-friendly-guy in me likes the not- syntax better.

I think it will be hard to find a good common syntax for attributes,
pseudoclasses and elements because they have different syntax in CSS. If
they don't share a "match syntax" why should they share a "don't match"

/ Jonas Sicking
Received on Monday, 9 October 2000 17:42:17 UTC

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