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

Re: [selectors] Previous-sibling combinator?

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sat, 7 Feb 2015 18:45:25 -0800
Message-Id: <4B4F18E6-0DDA-499A-8446-DAA2F2A698CA@gmail.com>
Cc: Henrik Andersson <henke@henke37.cjb.net>, Clive Chan <doobahead@gmail.com>, www-style list <www-style@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

> On Feb 3, 2015, at 8:17 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> That said, I'm not certain this should be a combinator at all.  We can
> instead put :has() in the fast profile if we limit it to only
> containing + (and > ?) combinators.

I'm for that, but I'd add the "following sibling" combinator (~) also, to get everything that has subsequent siblings. That should be no worse that +. 

Then to get something that has any P siblings, you would do this:

:matches(:has(*~P), P~*)

And these two would be equivalent:

:matches(:has(*~), ~*)
:not(:only-child)
Received on Sunday, 8 February 2015 02:45:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC