script: Set host for template content (#42276)

A template element should set the host of a DocumentFragment. However,
it didn't have a host yet. That's because ShadowRoot declares a host
attribute which returns Element, but its property is declared on
DocumentFragment.

Therefore, define the host on DocumentFragment instead and use it in all
relevant points for shadow roots. Then, update the pre-insert validity
check to use the correct host-including variant of inclusive ancestors.
Lastly, set the host of the template to wire it all up.

---------

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-02-02 09:25:54 +01:00
committed by GitHub
parent 17f7c87088
commit e8aa7d51ba
7 changed files with 92 additions and 40 deletions

View File

@@ -781886,7 +781886,7 @@
]
],
"template-content-hierarcy.html": [
"823c0c830fc08c466e5043e63e1a9fdf3a942095",
"7cf2ed84258c22d1ea28476e4800e429e2534f6e",
[
null,
{}