W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [selectors4] :not(a, b) vs. :not(a):not(b)

From: Peter Moulder <peter.moulder@monash.edu>
Date: Wed, 20 Mar 2013 00:14:46 +1100
To: www-style@w3.org
Message-id: <20130319131445.GA8122@bowman.infotech.monash.edu.au>
On Tue, Mar 19, 2013 at 10:27:32AM +0100, Simon Sapin wrote:

> Selectors 4 extends :not() so its argument is a selector list. As I
> read it, it’s just syntaxic sugar for multiple :not()
> pseudo-classes. In other words, :not(a, b) is equivalent to
> :not(a):not(b), just like not(a or b) is not(a) and not(b) in
> boolean logic. Is this correct?

They differ in specificity: :not(a):not(b) has the sum of the specificities of
a and b, while that of :not(a, b) is currently defined as the max of the two.

There's an issue open as to whether the specificity of :matches should change
from max specificity to something else, though that issue was raised before
:not was changed to take a selector list, so there isn't yet a corresponding
proposal as to how or whether the specificity of :not(a, b) might change if
that proposal for :matches(a, b) were to be adopted.

> If so, it might be worth pointing out in the spec. Maybe in the
> html|*:not(:link):not(:visited) example, by saying that it can also
> be written html|*:not(:link, :visited)

Nevertheless, that might still be a good idea, while noting the difference in

Received on Tuesday, 19 March 2013 13:15:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:27 UTC