-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Move the allow declarative shadow roots flag to the parser #11965
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
base: main
Are you sure you want to change the base?
Conversation
|
This doesn't work yet, but uploading just to confirm the desired behavior. From my reading of Blink, this flag is disabled for @noamr please correct me if I'm wrong. @annevk does that match WebKit as well? |
|
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. |
|
It being conditional on Trusted Types in any way seems like a bug. cc @lukewarlow |
|
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. |
|
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. |
Fwiw it's also disabled for execCommand("insertHTML", html) but that's... Well that's execCommand... |
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. |
|
Also editorial: we don't want "flags" for new things, just associated fields that are booleans. |
(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 )