Files
ladybird/Tests/LibWeb/Text/expected/css/stylesheet-add-targeted-invalidation.txt
Andreas Kling 5f434a442a LibWeb: Use targeted style invalidation when adding a new stylesheet
Instead of doing a full document style invalidation when a stylesheet is
dynamically added, we now analyze the new sheet's selectors to determine
which elements could potentially be affected, and only invalidate those.

This works by building an InvalidationSet from the rightmost compound
selector (the "subject") of each rule in the new stylesheet, extracting
class, ID, tag name, attribute, and pseudo-class features. We then walk
the DOM tree and only mark elements matching those features as needing a
style update.

If any selector has a rightmost compound that is purely universal (no
identifying features), or uses a pseudo-class not supported by the
invalidation set matching logic, we fall back to full invalidation.
2026-02-02 21:08:30 +01:00

14 lines
298 B
Plaintext

PASS: class selector
PASS: id selector
PASS: tag selector
PASS: attr selector
PASS: compound selector
PASS: descendant selector
PASS: multi selector
PASS: link pseudo-class
PASS: multi-rule sheet
PASS: :has() as sole feature
PASS: :has() with class
PASS: :has() with direct child
PASS: empty sheet