Re: [whatwg/dom] Should there be a declarative version of adoptedStyleSheets? (#910)

I ran into a performance issue today where I have 100 cards in a grid, and each card mounts a webcomponent with shadow containing a `<link>` tag. I discovered that while the browser is smart enough to coalesce the network calls, it seems to have to construct 100 distinct CSSStyleSheets which created a 300ms parseStylesheet/computeLayout/GC when the resource came back from the network. IMO the browser should be able to create 1 CSSStyleSheet and attach it to all 100 of the shadowTrees instead.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/910#issuecomment-2403393227
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/910/2403393227@github.com>

Received on Wednesday, 9 October 2024 20:43:30 UTC