Re: [whatwg/dom] Add declarative Shadow DOM features (#892)

I don't really understand the objection to making it bi-state. Just modifying https://html.spec.whatwg.org/#initialise-the-document-object should be fine? That is only used iff the document is created by navigations, so it includes exactly this list:

- HTML parser documents
- XML parser documents
- text documents
- media documents

Note that text and media documents don't run scripts from the inside, so unless you add a JS parser entrypoint that makes use of the "allow declarative shadow roots" flag, it doesn't matter what the value is set to for those. If you do add such a JS entrypoint, it seems to me it should be allowed to do `iframeContainingATextFile.contentDocument.body.setHTMLWithDeclarativeShadowRootSupport("...")` just like `iframeContainingATextFile.contentDocument.body.innerHTML = "..."` is allowed today.

(Also user agent pages / PDF viewer pages, technically, but not really since those are opaque-origin and don't run author-controlled script, so nobody can ever insert declarative shadow roots into them even if such a parser entrypoint exists.)

It does *not* include initial about:blank `Document`s, i.e. the initial page of `<iframe src="about:blank"></iframe>`. So if you want to allow `iframeContainingATextFile.contentDocument.body.setHTMLWithDeclarativeShadowRootSupport("...")` on those you'd also need to modify https://html.spec.whatwg.org/#creating-a-new-browsing-context .

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

Message ID: <whatwg/dom/pull/892/c1396618174@github.com>

Received on Thursday, 19 January 2023 08:38:59 UTC