attachShadow() and <slot>
Shadow trees and slot-based distribution of light-DOM children. Specification: dom.spec.whatwg.org/.
Results
Probed on 2026-10-19 with Node.js v22.23.3.
warpdom 0.1.6
Supported5 of 5 checks work.
Web IDL existence (coverage):
- ShadowRoot: interface present; 11 of 23 members present, missing:
styleSheets,adoptedStyleSheets,customElementRegistry,fullscreenElement,setHTML,appendHTML,prependHTML,appendHTMLUnsafe,prependHTMLUnsafe,pictureInPictureElement,pointerLockElement,getAnimations. - HTMLSlotElement: interface present; 3 of 4 members present, missing:
assign.
happy-dom 21.0.3
Partial3 of 5 checks work.
Web IDL existence (coverage):
-
ShadowRoot: interface present; 15 of 23 members present, missing:
styleSheets,customElementRegistry,setHTML,appendHTML,prependHTML,appendHTMLUnsafe,prependHTMLUnsafe,getHTML. -
HTMLSlotElement: interface present; 4 of 4 members present.
-
Named and default slots: assignedNodes() returns the matching light-DOM children and assignedSlot points back.
- Result:
p.assignedSlot is not the default slot
- Result:
-
document.querySelector does not see into the shadow tree, and an event from inside is retargeted to the host.
- Result:
event.target seen by body is not the host
- Result:
jsdom 30.1.3
Supported5 of 5 checks work.
Web IDL existence (coverage):
- ShadowRoot: interface present; 4 of 23 members present, missing:
styleSheets,adoptedStyleSheets,delegatesFocus,serializable,slotAssignment,clonable,onslotchange,customElementRegistry,fullscreenElement,setHTML,appendHTML,prependHTMLand 7 more. - HTMLSlotElement: interface present; 3 of 4 members present, missing:
assign.
linkedom 0.18.13
Partial1 of 5 checks work.
Web IDL existence (coverage):
-
ShadowRoot: interface present; 1 of 23 members present, missing:
styleSheets,adoptedStyleSheets,mode,delegatesFocus,serializable,slotAssignment,clonable,host,onslotchange,customElementRegistry,fullscreenElement,setHTMLand 10 more. -
HTMLSlotElement: interface present; 4 of 4 members present.
-
The root's mode reflects the option: "open" for an open root; for mode "closed", element.shadowRoot is null.
- Result:
root.mode: expected "open", got undefined
- Result:
-
Named and default slots: assignedNodes() returns the matching light-DOM children and assignedSlot points back.
- Result:
p.assignedSlot is not the default slot
- Result:
-
document.querySelector does not see into the shadow tree, and an event from inside is retargeted to the host.
- Result:
event.target seen by body is not the host
- Result:
-
Adding a child that gets assigned to a slot fires "slotchange" on the slot.
- Result:
"slotchange" did not fire (waited 500 ms)
- Result:
Checks
Exists when: typeof element.attachShadow === "function".
attach-open: attachShadow({ mode: "open" }) returns a shadow root whose host is the element, and element.shadowRoot returns it. (spec)mode-closed: The root's mode reflects the option: "open" for an open root; for mode "closed", element.shadowRoot is null. (spec)slot-assignment: Named and default slots: assignedNodes() returns the matching light-DOM children and assignedSlot points back. (spec)encapsulation-and-retarget: document.querySelector does not see into the shadow tree, and an event from inside is retargeted to the host. (spec)slotchange: Adding a child that gets assigned to a slot fires "slotchange" on the slot. (spec)