mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
invalidate_structurally_affected_siblings used to mark every previous or next sibling that had ever observed :first-child, :last-child, or :only-child. Their match result can flip for at most one element per single mutation, so compute that transition target once and only mark it. The :nth-child and :nth-last-child paths still re-evaluate every affected sibling since their indices shift on every mutation. Drops elementStyleNoopRecomputations from ~22000 to ~15000 on the github.com/LadybirdBrowser/ladybird page (60s settle, three-run median). Rebaselines the structural-pseudo-class-precision test, with the :nth-child / :nth-last-child counters intentionally unchanged.
9.0 KiB
9.0 KiB