Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow speculative fetches in Declarative Shadow DOM template elements #7069

Closed
zcorpan opened this issue Sep 14, 2021 · 0 comments · Fixed by #5465
Closed

Allow speculative fetches in Declarative Shadow DOM template elements #7069

zcorpan opened this issue Sep 14, 2021 · 0 comments · Fixed by #5465
Labels
topic: parser topic: shadow Relates to shadow trees (as defined in DOM)

Comments

@zcorpan
Copy link
Member

zcorpan commented Sep 14, 2021

#5959 says to not speculatively fetch URLs found in <template> elements, but this should be allowed for <template shadowroot=open> and <template shadowroot=closed>. @whatwg/html-parser

While the declarative Shadow DOM spec isn't landed, I'm concerned that this will be incompatible. <template> elements that are declarative shadow roots should likely get speculatively parsed, since they will be added to the live DOM tree upon the closing </template> tag.

That seems fine. There's an attribute to denote declarative shadow DOM (shadowroot), correct? Would it be OK to speculatively fetch in those cases, but not for regular template elements?

Right, the attribute is shadowroot, and the legal values are <template shadowroot=open> or <template shadowroot=closed>. Anything other than those two values should look like a regular <template> and speculative parsers should skip.

Originally posted by @mfreed7 in #5959 (comment)

@zcorpan zcorpan added topic: parser topic: shadow Relates to shadow trees (as defined in DOM) labels Sep 14, 2021
annevk pushed a commit that referenced this issue Oct 29, 2023
A longer explanation of this feature can be found at https://github.com/mfreed7/declarative-shadow-dom/blob/master/README.md. It was originally discussed in whatwg/dom#831.

Corresponding DOM PR: whatwg/dom#892.

Tests: shadow-dom/declarative in WPT with web-platform-tests/wpt#42833 being the latest PR as of this commit.

Closes #7069.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parser topic: shadow Relates to shadow trees (as defined in DOM)
Development

Successfully merging a pull request may close this issue.

1 participant