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

@annevk and @smaug---- thanks for the input here!

> @rniwa @mfreed7 waiting for the `template` end tag before updating the shadow tree is not a problem for Firefox. I don't think any of us is really convinced about the cost-benefit tradeoff however. Especially ending up with so many parser modes seems rather bad: script/noscript, fragment/no-fragment, shadow/no-shadow.

I'm glad the "non-streaming" solution works for Firefox.

As for the cost-benefit tradeoff, I suppose that's a decision you'll have to make. Having implemented the new opt-in code in Chromium (twice now), in addition to the actual DSD implementation, I can say it doesn't **seem** to complicate things much at all. The nice thing about this proposal is that it re-uses the vast majority of the `<template>` implementation, and just tacks a few things on when the closing tag is parsed. Of course, I have yet to update the spec PR with the opt-in changes, so the difficulty there remains to be seen. But if it mirrors the implementation, I'm hoping it won't be bad. I'd love your help and input getting that part right.

> Before adding declarative shadow DOM, it would be good to think about if/how it will work with probable future proposals, say declarative custom elements. It would be very unfortunate to add first declarative shadow DOM and then realize it doesn't work well with other proposals and we'd end up having yet another mode for those new features.

I definitely agree that we should make sure this is at least nominally compatible with future proposals. Having said that, it's impossible to make anything future proof, since we don't know what the future proposals will look like. But for declarative custom elements, the [main proposal we already have](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Declarative-Custom-Elements-Strawman.md) turns out to already use pretty much exactly the syntax we've landed on here, `<template shadowmode="closed">`. There will end up being the same backwards-compatibility problem there that was encountered for DSD - before all browsers understand `<definition>`, the scripts will be live. But at least the declarative shadow DOM will not be attached, since `HTMLUnknownElement` doesn't support shadow DOM.

Given the above, I feel pretty good about declarative custom elements. But if you have specific concerns, let's try to resolve them!

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

Received on Wednesday, 11 November 2020 17:55:41 UTC