Skip to main content

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​

Supported

5 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.
Report a wrong result for warpdom

happy-dom 21.0.3​

Partial

3 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
  • 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
Report a wrong result for happy-dom

jsdom 30.1.3​

Supported

5 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, prependHTML and 7 more.
  • HTMLSlotElement: interface present; 3 of 4 members present, missing: assign.
Report a wrong result for jsdom

linkedom 0.18.13​

Partial

1 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, setHTML and 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
  • Named and default slots: assignedNodes() returns the matching light-DOM children and assignedSlot points back.

    • Result: p.assignedSlot is not the default slot
  • 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
  • Adding a child that gets assigned to a slot fires "slotchange" on the slot.

    • Result: "slotchange" did not fire (waited 500 ms)
Report a wrong result for linkedom

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)