mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +02:00
Before calling update_style() for a getComputedStyle property access, we now check whether the target element actually needs a style update by walking the flat tree ancestor chain. If neither the element nor any of its ancestors have dirty style bits, and there are no document-level reasons to recalculate style, we skip the update_style() call entirely. We walk the flat tree (not the DOM tree) because style inheritance follows slot assignment -- slotted elements inherit from their assigned slot, not their DOM parent. This avoids unnecessary work when scripts access computed style properties on elements whose styles are already up-to-date, which is a common pattern on the web.
76 KiB
76 KiB