[whatwg/dom] Should attachShadow throw or override when an existing declarative shadow root doesn't match (Issue #1235)

### What is the issue with the DOM Standard?

See also https://github.com/whatwg/dom/issues/1234 which involves the same code-paths.

I find it really weird / confusing that calling `.attachShadow({ mode: "closed" })` on an element that has an open declarative shadow DOM just silently returns the open shadow DOM.

It might be even more problematic the other way around. `.attachShadow({ mode: "open" })` on a closed declarative shadow host will just happily return a reference to an otherwise closed shadow root.

Same for the `delegatesFocus` flags and so on, probably the imperative flag should override these, at least, or maybe we should throw if the `ShadowRootInit` members don't match the declarative shadow DOM attributes...

Is that intentional? If it is it might at least be worth a note.



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

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

Received on Sunday, 26 November 2023 21:58:55 UTC