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

@rniwa, you are correct that a MutationObserver could be used to grab references to the contents of the `<template shadowroot>` before the closing tag is encountered, and therefore before the shadow root is attached. That would break encapsulation if the eventual shadowroot is closed. This is independent of whether the element is being created or upgraded, I think. Perhaps we could just disallow the `.content` accessor on the `<template>` element if it is a *closed* declarative shadow root?

On the sync parsing question for non-upgrading custom elements, I'm not sure how big of an issue this is in practice. For the SSR use case, none of the custom elements would be likely defined prior to the declarative content, so all custom elements would be upgraded later, after scripts are loaded. I don't know what the use case is that would load custom element definitions **prior** to sending declarative content, as that would seem to defeat the (No-JS) purpose. Perhaps I'm missing something, though.

-- 
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-606324684

Received on Tuesday, 31 March 2020 00:32:11 UTC