Files
ladybird/Libraries/LibWeb/CSS/Invalidation/StructuralMutationInvalidator.cpp
Andreas Kling de7ed9a498 LibWeb: Target :first/:last/:only-child sibling invalidation precisely
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.
2026-05-06 21:22:02 +02:00

9.0 KiB