Move the allow declarative shadow roots flag to the parser#11965
Move the allow declarative shadow roots flag to the parser#11965
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 )