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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ Harness status: OK
|
|||
|
||||
Found 2 tests
|
||||
|
||||
1 Pass
|
||||
1 Fail
|
||||
2 Pass
|
||||
Pass can use ShadowRoot as options for attachShadow
|
||||
Fail can use ShadowRoot in document fragment as options for attachShadow
|
||||
Pass can use ShadowRoot in document fragment as options for attachShadow
|
||||
|
|
@ -2,8 +2,7 @@ Harness status: OK
|
|||
|
||||
Found 22 tests
|
||||
|
||||
18 Pass
|
||||
4 Fail
|
||||
22 Pass
|
||||
Pass Declarative Shadow DOM: Basic test
|
||||
Pass Declarative Shadow DOM: Feature detection
|
||||
Pass Shadowrootmode reflection
|
||||
|
|
@ -19,10 +18,10 @@ Pass Declarative Shadow DOM: Missing closing tag
|
|||
Pass Declarative Shadow DOM: delegates focus attribute
|
||||
Pass Declarative Shadow DOM: clonable attribute
|
||||
Pass Declarative Shadow DOM: Multiple roots
|
||||
Fail Declarative Shadow DOM: template containing declarative shadow root (with shadowrootclonable)
|
||||
Fail Declarative Shadow DOM: template containing (deeply nested) declarative shadow root
|
||||
Fail Declarative Shadow DOM: template containing a template containing declarative shadow root
|
||||
Fail Declarative Shadow DOM: template containing declarative shadow root and UA shadow root
|
||||
Pass Declarative Shadow DOM: template containing declarative shadow root (with shadowrootclonable)
|
||||
Pass Declarative Shadow DOM: template containing (deeply nested) declarative shadow root
|
||||
Pass Declarative Shadow DOM: template containing a template containing declarative shadow root
|
||||
Pass Declarative Shadow DOM: template containing declarative shadow root and UA shadow root
|
||||
Pass Declarative Shadow DOM: template containing closed declarative shadow root and UA shadow root
|
||||
Pass Declarative Shadow DOM: declarative shadow roots are not supported by the template element
|
||||
Pass Declarative Shadow DOM: explicit test that exceptions are not thrown
|
||||
Loading…
Add table
Add a link
Reference in a new issue