Skip to content
Prev Previous commit
Next Next commit
refactor(core): add Shadow DOM APIs to RNode and RElement
This exposes [`Node.prototype.getRootNode`](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode) and [`Element.prototype.shadowRoot`](https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot) to the framework.
  • Loading branch information
dgp1130 committed Jan 20, 2026
commit 6253eac3d4d0defdb1818d181f54c12445df0117
11 changes: 11 additions & 0 deletions packages/core/src/render3/interfaces/renderer_dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ export interface RNode {
* Used exclusively for building up DOM which are static (ie not View roots)
*/
appendChild(newChild: RNode): RNode;

/**
* Get the root node of the DOM tree containing the node.
*
* This is typically either the `document` object (when the Node exists in light
* DOM) or a `ShadowRoot` (when the Node exists in shadow DOM).
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode
*/
getRootNode(options?: GetRootNodeOptions): Node;
}

/**
Expand All @@ -78,6 +88,7 @@ export interface RElement extends RNode {
removeEventListener(type: string, listener?: EventListener, options?: boolean): void;
remove(): void;
setProperty?(name: string, value: any): void;
shadowRoot: ShadowRoot | null;
}

export interface RCssStyleDeclaration {
Expand Down