Skip to content

script: Set host for template content#57472

Merged
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_42276
Feb 2, 2026
Merged

script: Set host for template content#57472
servo-wpt-sync merged 1 commit intoweb-platform-tests:masterfrom
servo:servo_export_42276

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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.

Reviewed in servo/servo#42276

Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

Now it passes in all browsers. It was asserting on the wrong
document after being adopted.

Signed-off-by: Tim van der Lippe <[email protected]>
@servo-wpt-sync servo-wpt-sync merged commit bed65a4 into web-platform-tests:master Feb 2, 2026
26 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_42276 branch February 2, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants