mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/DOM: Copy "allow declarative shadow roots" to template document
This flag defaults to false for new Documents, such as the one created here for use by template elements' contents. Without setting it to true, nothing inside a template can have a declarative shadow dom. As noted, this appears to be a spec issue. I am not convinced that this is the correct fix, but it is simple and does solve the issue without any apparent regressions.
This commit is contained in:
parent
8ca4833885
commit
aac387bcc6
Notes:
github-actions[bot]
2025-11-26 08:53:57 +00:00
Author: https://github.com/AtkinsSJ
Commit: aac387bcc6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6931
Reviewed-by: https://github.com/gmta ✅
3 changed files with 12 additions and 9 deletions
|
|
@ -4511,6 +4511,11 @@ GC::Ref<DOM::Document> Document::appropriate_template_contents_owner_document()
|
|||
if (document_type() == Type::HTML)
|
||||
new_document->set_document_type(Type::HTML);
|
||||
|
||||
// AD-HOC: Copy over the "allow declarative shadow roots" flag, otherwise no elements inside templates will
|
||||
// be able to have declarative shadow roots.
|
||||
// Spec issue: https://github.com/whatwg/html/issues/11955
|
||||
new_document->set_allow_declarative_shadow_roots(allow_declarative_shadow_roots());
|
||||
|
||||
// 3. Set doc's associated inert template document to new doc.
|
||||
m_associated_inert_template_document = new_document;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue