PageSourceSearch

https://htaglossary.net/public/generated/js/vendor_dist/@popperjs/core/dist/esm/dom-utils/getParentNode.js

js htaglossary.net collected 2026-10-02 14:38:22 UTC 759 bytes, 19 lines download raw bytes

vendor: 759 bytes, lines 1-19
1import getNodeName from "./getNodeName.js";
2import getDocumentElement from "./getDocumentElement.js";
3import { isShadowRoot } from "./instanceOf.js";
4export default function getParentNode(element) {
5  if (getNodeName(element) === 'html') {
6    return element;
7  }
8
9  return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
10    // $FlowFixMe[incompatible-return]
11    // $FlowFixMe[prop-missing]
12    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
13    element.parentNode || ( // DOM Element detected
14    isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
15    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
16    getDocumentElement(element) // fallback
17
18  );
19}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.