Intent to Ship: CSS Selectors 4 Pseudo-Class :nth-child(an + b of S)

198 views
Skip to first unread message

Steinar H. Gunderson

unread,
Jan 12, 2023, 11:22:35 AM1/12/23
to blin...@chromium.org
Contact emails: se...@chromium.org
Explainer: None
Specification: https://www.w3.org/TR/selectors-4

Summary:
Extend :nth-child(an + b) to take a selector, and the same with
:nth-last-child. So e.g. :nth-child(3 .c) is the third .c under a given
parent. (This is not the same as .c:nth-child(3), which is a .c that must
also be the third element under a given parent.)

Blink component: Blink>CSS
TAG review status: Not applicable

Risks, Interoperability and Compatibility: None known. Part of Interop 2023.

Gecko: In development
WebKit: Shipped/Shipping

WebView application risks: None.
Debuggability: N/A

Will this feature be supported on all six Blink platforms (Windows, Mac,
Linux, Chrome OS, Android, and Android WebView)?
Yes

Is this feature fully tested by web-platform-tests?
Yes. (We added more WPT tests as part of implementing it.)

Flag name: CSSSelectorNthChildComplexSelectorEnabled

Requires code in //chrome? No

Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=304163

Estimated milestones
Shipping on desktop: 111
Shipping on Android: 111

Anticipated spec changes: None.

Link to entry on the Chrome Platform Status:
https://chromestatus.com/feature/5144225077788672

/* Steinar */
--
Software Engineer, Google Norway

Mike Taylor

unread,
Jan 12, 2023, 1:09:51 PM1/12/23
to Steinar H. Gunderson, blink-dev
Hi Steinar,

On 1/12/23 5:32 AM, Steinar H. Gunderson wrote:
> Contact emails: se...@chromium.org
> Explainer: None
> Specification: https://www.w3.org/TR/selectors-4
>
> Summary:
> Extend :nth-child(an + b) to take a selector, and the same with
> :nth-last-child. So e.g. :nth-child(3 .c) is the third .c under a given
> parent. (This is not the same as .c:nth-child(3), which is a .c that must
> also be the third element under a given parent.)
>
> Blink component: Blink>CSS
> TAG review status: Not applicable
>
> Risks, Interoperability and Compatibility: None known. Part of Interop 2023.
>
> Gecko: In development
Do you have a link?
> WebKit: Shipped/Shipping
>
> WebView application risks: None.
> Debuggability: N/A
>
> Will this feature be supported on all six Blink platforms (Windows, Mac,
> Linux, Chrome OS, Android, and Android WebView)?
> Yes
>
> Is this feature fully tested by web-platform-tests?
> Yes. (We added more WPT tests as part of implementing it.)
How do we do with the feature enabled, compared to Safari?

Steinar H. Gunderson

unread,
Jan 12, 2023, 1:47:10 PM1/12/23
to Mike Taylor, blink-dev
On Thu, Jan 12, 2023 at 01:09:41PM -0500, Mike Taylor wrote:
>> Gecko: In development
> Do you have a link?

https://bugzilla.mozilla.org/show_bug.cgi?id=1808227

>> Is this feature fully tested by web-platform-tests?
>> Yes. (We added more WPT tests as part of implementing it.)
> How do we do with the feature enabled, compared to Safari?

We pass all the tests (32 base tests + 8 invalidation tests),
Safari TP fails two of the base tests and four of the invalidation
tests (at least according to wpt.fyi).

/* Steinar */
--
Homepage: https://www.sesse.net/

Mike Taylor

unread,
Jan 12, 2023, 2:04:35 PM1/12/23
to Steinar H. Gunderson, blink-dev
On 1/12/23 1:24 PM, Steinar H. Gunderson wrote:
> On Thu, Jan 12, 2023 at 01:09:41PM -0500, Mike Taylor wrote:
>>> Gecko: In development
>> Do you have a link?
> https://bugzilla.mozilla.org/show_bug.cgi?id=1808227
Thank you - it looks to be implemented in Nightly, by behind the
layout.css.nth-child-of.enabled pref for now.

Rick Byers

unread,
Jan 13, 2023, 12:05:13 PM1/13/23
to Mike Taylor, Steinar H. Gunderson, blink-dev
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/b8b15031-b35d-56a1-70b6-d5c76d662155%40chromium.org.

Mike Taylor

unread,
Jan 13, 2023, 12:29:05 PM1/13/23
to Rick Byers, Steinar H. Gunderson, blink-dev
LGTM2

Yoav Weiss

unread,
Jan 16, 2023, 5:57:41 AM1/16/23
to Mike Taylor, Rick Byers, Steinar H. Gunderson, blink-dev
Reply all
Reply to author
Forward
0 new messages