W3C home > Mailing lists > Public > www-style@w3.org > January 2015

Re: [selectors] Are really arbitrary selectors allowed in :not()?

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Tue, 20 Jan 2015 14:24:29 -0500
Message-ID: <54BEAB6D.4020900@mit.edu>
To: www-style@w3.org
On 1/20/15 11:36 AM, Sebastian Zartner wrote:
>> span:not(div > .someclass) matches any span that does not have a class "someclass" and is not under a div.
>
> So an equivalent to :not(div) > span:not(.someclass).

Not quite.  For example, consider this document:

   data:application/xhtml+xml,<span xmlns="http://www.w3.org/1999/xhtml"/>

That element matches "span:not(div > .someClass)" but does not match 
":not(div) > span:not(.someClass)".

But yes, for non-root elements it's equivalent.

-Boris
Received on Tuesday, 20 January 2015 19:25:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:56 UTC