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

Re: [selectors4] :not and :matches specificity (was :not(a, b) vs. :not(a):not(b)

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 17 Apr 2013 12:43:42 -0700
Message-ID: <516EFB6E.9090906@inkedblade.net>
To: www-style@w3.org
On 03/19/2013 05:43 PM, Peter Moulder wrote:
> On Tue, Mar 19, 2013 at 02:34:39PM +0100, Simon Sapin wrote:
>> Le 19/03/2013 14:14, Peter Moulder a écrit :
>
>>> ...
>
>>> 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.
>
> Possibilities include:
>
>    1. Keeping as max (which would then become the only selector to use max).
>
>    2. Same specificity as a pseudo-class.
>
>    3. change to sum, so that :not(a, b) would in fact have the same specificity
>       as :not(a):not(b).
>
>    4. Drop the list argument feature of :not.

Tab and I think the best thing to do here is go with the max. IMO this is
actually the most natural interpretation. It also solves the problem of a
chain of :not()s awkward increasing the specificity to some absurdly high
amount, e.g.

   :not(address):not(blockquote):not(center):not(div):not(figure):not(figcaption
   ):not(footer):not(form):not(header):not(hr):not(legend):not(listing):not(main
   ):not(p):not(plaintext):not(pre):not(summary):not(xmp):not(article):not(aside
   ):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(hgroup):not(nav
   ):not(section):not(table):not(caption):not(colgroup):not(col):not(thead
   ):not(tbody):not(tfoot):not(tr):not(td):not(th):not(dir):not(dd):not(dl):not(dt
   ):not(menu):not(ol):not(ul):not(li)

This is taken directly from the HTML5 spec. Note also the awkward wrapping,
which is required here.

We can't do #2 because it already introspects in Level 3. Options #3 and #4
don't provide any added utility.

~fantasai
Received on Wednesday, 17 April 2013 19:44:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 17 April 2013 19:44:13 UTC