Re: [whatwg/dom] Declarative Shadow DOM (#831)

>> I agree that problem b) is a problem that needs a solution. Perhaps the parser could detect exactly-duplicate <style> elements and condense them into a single CSSStyleSheet that gets added to adoptedStylesheets? That might be crazy. I do agree that styles need a solution. I don't think it needs to be solved for this declarative Shadow DOM solution to be useful as-is.

> Can you elaborate? All browsers already avoid parsing duplicate inline stylesheets in Shadow DOM, as far as I'm aware.

Hmm - can you elaborate? I do know that duplicate `<link rel=stylesheet>` links will use a shared stylesheet. But I was not aware that exactly-duplicated inline `<style>` elements would end up with a single backing `CSSStyleSheet` object in memory. If that's true, then I would say the inline `<style>` element solution might be a good one here. Gzip will reduce the network overhead, and this stylesheet de-duplication will eliminate the memory overhead.

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

Received on Thursday, 13 February 2020 00:22:11 UTC