mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
When a sheet's rightmost compound carries :first-child, :last-child, or :only-child but no other class/tag/id/attr feature, the sheet add/remove path can target the boundary children directly instead of falling back to a whole-subtree invalidation. The narrowing in extend_style_sheet_invalidation_set_with_style_rule deliberately only kicks in when the structural pseudo is the only feature in the rightmost compound. A selector like `.foo:first-child` keeps targeting `.foo` rather than every first-child in the document. Adds matchers for :first-child / :last-child / :only-child in InvalidationSetMatcher so the targeted walk can recognize them on each candidate element.
5.4 KiB
5.4 KiB