mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
Share the style cache for shadow roots whose only active author sheet is the same constructed stylesheet. Matching already carries the effective shadow root separately, so the cache can be reused while selectors such as :host and ::slotted() still evaluate against each consuming shadow root. Keep the optimization conservative by falling back to the existing per-scope cache whenever the shadow root has multiple active sheets, a non-constructed sheet, or a page user stylesheet. Drop the shared cache when the stylesheet rules or media query match state change. Add coverage for two shadow roots adopting the same constructed sheet, including :host, ::slotted(), and replaceSync() invalidation.
6.7 KiB
6.7 KiB