(node: RNode, doc: () => Document)
| 500 | } |
| 501 | |
| 502 | function getStyleHost(node: RNode, doc: () => Document): Node { |
| 503 | const rootNode = node.getRootNode?.(); |
| 504 | |
| 505 | if (documentSupported && rootNode instanceof Document) { |
| 506 | return rootNode.head; // Connected to document. |
| 507 | } else if (!rootNode) { |
| 508 | return doc().head; // `getRootNode` not supported, Node.js use case. |
| 509 | } else if (shadowRootSupported && rootNode instanceof ShadowRoot) { |
| 510 | return rootNode; // Shadow root |
| 511 | } else { |
| 512 | return doc().head; // Disconnected element, use fallback document. |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | function getRootTViewTemplate( |
| 517 | creationBindings: Binding[] | null, |
no test coverage detected
searching dependent graphs…