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

> Our prior objection was more based on rendering & exposing half-baked shadow DOM to scripts. There was also a concern that exposing half-baked shadow tree can lead to new security bugs in the parser. However, a lot of people seem to want streaming for this feature so maybe we should do it despite of the risk of complications.

Great! I'm definitely happy to take the risk, given the demand for this part of the feature.

> @mfreed7 : in terms of the implementation complexity of streaming, you can take a look at the PR: [WebKit/WebKit#4822](https://github.com/WebKit/WebKit/pull/4822)

Looks pretty clean, and very close to what I imagined. Just replace `.content` with `.fragmentForInsertion` everywhere, and hope you didn't miss any corner cases.

> @mfreed7 : We also really need to come up with a solution for [WICG/webcomponents#972](https://github.com/WICG/webcomponents/issues/972).

Agree - I just commented there.

> How does streaming version compare to light DOM, if light DOM is such that it ends up having as many DOM nodes as the light+shadow DOM? But thanks for testing. And even when not thinking performance, I think we just need to go with streaming approach so that nested shadow dom, or fullpage shadow DOMs can be supported in a reasonable way
> 
> (note about polyfill, when I was testing this a bit more, was it last year, I tweaked MutationObserver so that it had a childElementName filter and that way Gecko with polyfill had almost the same speed as native implementation in Chrome. So - unrelated to declarative shadow DOM - perhaps we should add some more tweaks to MutationObserver. )

I think these are great concerns that we should think/work more about. However, I do think they're orthogonal to declarative vs. imperative shadow dom. These are more about shadow DOM as a whole, no matter how you attach it. Right?

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

Message ID: <whatwg/dom/issues/831/1267691310@github.com>

Received on Tuesday, 4 October 2022 22:54:51 UTC