Skip to content

Allow speculative fetches in Declarative Shadow DOM template elements #7069

@zcorpan

Description

@zcorpan

#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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions