Re: [selectors] Previous-sibling combinator?

> 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