- From: Keith Cirkel via GitHub <noreply@w3.org>
- Date: Wed, 13 Aug 2025 16:35:10 +0000
- To: public-css-archive@w3.org
As we're sharing impls, [here's the Firefox code for parsing](https://github.com/mozilla-firefox/firefox/commit/8ea4e6ec087a38d0356f6d5f15a1f9b00fc8fb5c#diff-bf1bb3f382568e3837f864f5a9ae0fa6f28ff2efdb5b3ea43a739090cff62f4eR513-R521) which incurs, what I would describe, as trivial additional complexity (`parser.parse_comma_separated(parse_nth)` vs just `parse_nth`) and [the matching code](https://github.com/mozilla-firefox/firefox/commit/8ea4e6ec087a38d0356f6d5f15a1f9b00fc8fb5c#diff-bf1bb3f382568e3837f864f5a9ae0fa6f28ff2efdb5b3ea43a739090cff62f4eR71) (`0.iter().any(|anb| anb.matches_index(level))` vs `0.matches_index(level)`). The majority of work went into decoupling our `An+B` [parsing code from the existing `nth-*` selectors](https://github.com/mozilla-firefox/firefox/commit/9b183fdb05029f6a65bfcc68b47cefecacc6ad48). Also in response to this thread I thought I'd [implement it in csskit](https://github.com/csskit/csskit/pull/285/files) (a parser I'm working on) and while it's obviously not representative of a real engine, the complexity between `Nth` and `CommaSeparated<Nth>` is about as trivial as it gets, IMO. I don't spend enough time in WebKit code but I would imagine it would use `CommaSeparatedVector<NthChildOfSelectorInfo>`, or am I off base? Or are you speaking to a different type of added complexity? (I hope this is not read as hostile, emotions can be difficult to convey in prose but I am being sincere). -- GitHub Notification of comment by keithamus Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12599#issuecomment-3184628491 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 13 August 2025 16:35:11 UTC