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

Re: [selectors] Previous-sibling combinator

From: Benjamin Poulain <benjamin@webkit.org>
Date: Wed, 28 Jan 2015 17:03:50 -0800
Message-ID: <54C986F6.4050805@webkit.org>
To: www-style@w3.org
I agree. It would be a good idea to add something explicit.

Developers can do ugly things to get to the siblings:
     #target:nth-last-child(2 of #target, #target ~ foo + bar)
(e.g. on WebKit Nightly: http://codepen.io/anon/pen/GgvMqP)

Benjamin

On 1/28/15 4:34 PM, Marat Tanalin wrote:
> We should probably reconsider adding the previous-sibling combinator [1] to CSS since:
>
>      * the subject indicator is dropped [2];
>
>      * the `:has()` function will not be available in fast profile (and therefore in CSS) [3].
>
> Thanks.
>
> [1] https://lists.w3.org/Archives/Public/www-style/2012Jan/1245.html
> [2] https://lists.w3.org/Archives/Public/www-style/2014Feb/0617.html
> [3] http://dev.w3.org/csswg/selectors/#fast-profile
>
>
>
> 28.01.2012, 03:34, "Tab Atkins Jr." <jackalmage@gmail.com>:
>> 2012/1/27 Marat Tanalin <mtanalin@yandex.ru>:
>>>   And how would you write following selector using subject indicator?
>>>
>>>      P - UL > LI {...}
>>
>> Using the future extension to :matches() to allow complex selectors:
>>
>> :matches(!ul + p) > li {...}
>>
>> Or, if I get my way, with :has():
>>
>> ul:has(+p) > li {...}
>
Received on Thursday, 29 January 2015 01:08:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:50 UTC