Skip to content

Conversation

@foolip
Copy link
Member

@foolip foolip commented Nov 27, 2025

  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/document-lifecycle.html ( diff )
/document-sequences.html ( diff )
/dynamic-markup-insertion.html ( diff )
/infrastructure.html ( diff )
/parsing.html ( diff )

@foolip
Copy link
Member Author

foolip commented Nov 27, 2025

This doesn't work yet, but uploading just to confirm the desired behavior.

From my reading of Blink, this flag is disabled for innerHTML, outerHTML, insertAdjacentHTML(), and createContextualFragment() unless trusted types is used, and otherwise enabled.

@noamr please correct me if I'm wrong.

@annevk does that match WebKit as well?

@foolip
Copy link
Member Author

foolip commented Nov 27, 2025

As an editorial matter, I think I'd like the "Each HTML parser has a something flag" style, but I didn't make that change yet.

@annevk
Copy link
Member

annevk commented Nov 27, 2025

It being conditional on Trusted Types in any way seems like a bug. cc @lukewarlow

@lukewarlow
Copy link
Member

Yeah it shouldn't change based on TT and reading the blink code I don't think it does.

Range::createContextualFragment does the trusted types dance then later on calls into blink::createContextualFragment which has ParseDeclarativeShadowRoots::kDontParse.

@foolip
Copy link
Member Author

foolip commented Nov 27, 2025

If it doesn't depend on TT it's even simpler, basically the "legacy" HTML setting methods don't get declarative shadow roots and in every other context they're enabled. Tests are needed to confirm the TT behavior though.

@lukewarlow
Copy link
Member

From my reading of Blink, this flag is disabled for innerHTML, outerHTML, insertAdjacentHTML(), and createContextualFragment()

Fwiw it's also disabled for execCommand("insertHTML", html) but that's... Well that's execCommand...

@lukewarlow
Copy link
Member

basically the "legacy" HTML setting methods

Being pedantic but just to be clear, iframe.srcdoc does support declarative shadow roots, but admittedly that's a rather odd case. I think your point is correct though, the legacy methods/setters don't support it, and the newer ones and all going forwards probably will.

@annevk
Copy link
Member

annevk commented Nov 27, 2025

Also editorial: we don't want "flags" for new things, just associated fields that are booleans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants