mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 09:27:00 +02:00
We now track when a parent has a child affected by a backward structural pseudo-class. These are selectors whose match result for an element can depend on siblings after that element, such as `:last-child`, `:only-child`, `:last-of-type`, `:only-of-type`, `:nth-last-child`, and `:nth-last-of-type`. When inserting or removing a node, previous siblings only need style invalidation if one of them was matched against such a selector. Use the parent-level flag to skip the previous-sibling walk when no child under that parent can be affected. This saves a lot of invalidation work on sites that insert a lot of nodes into the DOM via JS.
229 KiB
229 KiB