brave/adblock-rust

Support for CSS Selectors 4 Pseudo-Class :nth-child(an + b of S)

Emi-TheDhamphirInLoveUnderTheFrozenStar opened this issue · 1 comments

Shipped in Chromium 111 https://chromestatus.com/feature/5144225077788672 it extends :nth-child() and :nth-last-child() pseudo classes to take a selector.

Examples:
:nth-child(-n+3 of li.important)
tr:nth-child(even of :not([hidden]))

@Emi-TheDhamphirInLoveUnderTheFrozenStar thanks for reporting! This is actually handled just fine by adblock-rust. Instead it looks like there's just some issue in Brave where the selectors aren't working at all (even in a normal stylesheet). I suspect it's been enabled in Chrome 111 via an origin trial. I'll move this issue to brave-browser and see if we can investigate further there.

Nope, I misunderstood how it's supposed to work and on closer inspection, it is definitely not supported in adblock-rust with the css-validation feature enabled. Looks like the selectors library would have to be updated to support it.