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

Re: [selectors] Previous-sibling combinator?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 12 Feb 2015 08:24:03 +1100
Message-ID: <CAAWBYDANVunz5jQRqQcaU9zGN4HNnNOw486hgQpkhE-VAsfh7g@mail.gmail.com>
To: Marat Tanalin <mtanalin@yandex.ru>
Cc: Clive Chan <doobahead@gmail.com>, Brad Kemper <brad.kemper@gmail.com>, Henrik Andersson <henke@henke37.cjb.net>, www-style list <www-style@w3.org>
On Thu, Feb 12, 2015 at 7:18 AM, Marat Tanalin <mtanalin@yandex.ru> wrote:
> 11.02.2015, 22:54, "Clive Chan" <doobahead@gmail.com>:
>> I like the idea of requiring spaces around the dash - it'll actually force people to write nicely spaced out CSS combinators, haha - but it does break typical naming conventions. Hm. I'm still for it, though.
>
> A possible nice option for previous-sibling combinator syntax is `!+`:
>
>     P !+ UL {
>         /* UL is previous sibling of P. */
>     }
>
> It's short (like other combinators).
> it's intuitive (`!` for negation of the next-sibling combinator `+`).
> it doesn't have the whitespace-around-combinator "issue".
>
> What's important is that a responsible CSSWG member should finally (after at least 3 years after my first proposal [1]) take a _real_ action by adding a previous-sibling combinator (be it ` - `, or `!+`, or `::prev`, or anything else at first) to a real draft to prevent the proposal and the discussion results from being lost and forgotten (which is unfortunately typical here).

Chill out, bro.  This hasn't been added to a draft not because it's
been forgotten, and you're far from the first person to have suggested
this; this topic comes up at least once a year from various people
(including me, several years back).  It hasn't yet been added because
it's technically difficult to make it work in a performant manner.

That said, I did bring this up at the CSSWG face-to-face that just
concluded, and the WG was generally supportive of allowing :has() in
the fast profile with some restrictions; a few members are going to
investigate what level of restriction would be reasonable and will
report back.  It is likely, though, that `el:has(>child)` and
`el:has(+sibling)` will end up in the fast profile.  Believe, the list
will be notified when we decide on this.

~TJ
Received on Wednesday, 11 February 2015 21:24:51 UTC

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