tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 23707808ff317b6c29bc91c823239c3f6003c363
parent e5115019b7b0ea6a58d90a2f46ef76524e46fda8
Author: Simon Wülker <simon.wuelker@arcor.de>
Date:   Fri, 31 Oct 2025 09:05:07 +0000

Bug 1997242 [wpt PR 55758] - script: Don't unregister slots from their shadow root when the whole shadow tree is being unbound, a=testonly

Automatic update from web-platform-tests
Add web platform test

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

--

wpt-commits: 91014a25d4903e6193b27844d79babfcf8e204fc
wpt-pr: 55758

Diffstat:
Atesting/web-platform/tests/shadow-dom/assign-slottables-after-removing-shadow-tree-from-document.html | 34++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/shadow-dom/assign-slottables-after-removing-shadow-tree-from-document.html b/testing/web-platform/tests/shadow-dom/assign-slottables-after-removing-shadow-tree-from-document.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<head> + <title>Slottables should match slots when the shadow host is removed from the document</title> + <meta name="author" title="Simon Wülker" href="mailto:simon.wuelker@arcor.de"> + <meta name="assert" content="Slottables should be assigned to slots even after the shadow host has been removed from the document"> + <link rel="help" href="https://github.com/servo/servo/issues/40242"> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> + +<body> + <script defer> + test((t) => { + // Attach a shadow root with a slot named "foo" inside it + let host = document.createElement("div"); + document.body.appendChild(host); + let root = host.attachShadow({mode: "closed"}); + let slot = document.createElement("slot"); + slot.name = "foo"; + root.appendChild(slot); + + // Remove the host from the document tree + host.remove(); + assert_array_equals(slot.assignedNodes(), []); + + // Create a slottable that should be slotted into "foo" + let slottable = document.createElement("div"); + slottable.slot = "foo" + host.appendChild(slottable); + assert_array_equals(slot.assignedNodes(), [slottable]); + }, "Slottables should be assigned to slots even after the shadow host has been removed from the document"); + </script> +</body>