Intent to prototype and ship: :nth-child(An+B of <selector list>)

Skip to first unread message

Zach Hoffman

Mar 16, 2023, 4:15:23 PM3/16/23
As of today, I intend to turn :nth-child(An+B of <selector list>) and :nth-last-child(An+B of <selector list>) on by default on all platforms. It has been developed behind the layout.css.nth-child-of.enabled preference. Status in other browsers is shipped.

Summary: Implement the selector list of :nth-child(An+B of <selector list>) and :nth-last-child(An+B of <selector list>) from the CSS Selectors 4 spec, which can be used like :nth-of-type(An+B) and :nth-last-of-type(An+B), except <selector list> can be any selector list, not only a type selector.

It's been enabled in Nightly for 2 weeks, see <>.

Bug to turn on by default:


Standards Body: CSSWG (W3C)

Platform coverage: All

Preference: layout.css.nth-child-of.enabled

DevTools bug: N/A, existing DevTools support works fine. Adding autocompletion for selectors is tracked in <>, please speak up if you think something additional is needed.

Other browsers:
* Chromium: Shipped <> in M111

* Safari: Shipped in Safari 9 (2015!)

* Matching tests in
* Invalidation tests in
* Some supports() negative tests in
* Bug for reftests in SVG:

Reply all
Reply to author
0 new messages