Re: [css3-selectors] minor question about :not()

Eric A. Meyer wrote:
> At 8:40 PM +0300 3/12/09, Andrey Mikhalev wrote:
>> in 6.6.7:
>> "The negation pseudo-class, :not(X), is a functional notation taking a 
>> simple selector (excluding the negation pseudo-class itself and 
>> pseudo-elements) as an argument."
>>
>> so, :not(:pseudo-element) - allowed by formal grammar -
>> is invalid selector or "useless" selector, as foo:not(bar) ?
> 
>    Yes.  The limited scope of ':not()' has long bugged me.  It would be 
> really useful to be able to say something along the lines of 
> ':not(input, textarea, select, option) {margin: 0; padding: 0;}' -- thus 
> allowing us to style all elements that are not form controls. Yes, this 
> most often comes up in resets, which some people don't like, but there 
> are other use cases besides just resets.
>    I sort of get excluding pseudo-elements, but being limited to a 
> simple selector is annoying and I don't quite see the point.

I expect us to release that limitation in Selectors Level 4,
along with introducing a corresponding :matches() pseudo-class
(same as :not(), except it doesn't negate).

~fantasai

Received on Wednesday, 18 March 2009 14:24:42 UTC