PageSourceSearch

https://www.astrobetter.com/wiki/public/generated/js/vendor_dist/@…/core/dist/esm/dom-utils/getScrollParent.js

js astrobetter.com collected 2026-10-02 03:39:25 UTC 546 bytes, 16 lines download raw bytes

vendor: 546 bytes, lines 1-16
1import getParentNode from "./getParentNode.js";
2import isScrollParent from "./isScrollParent.js";
3import getNodeName from "./getNodeName.js";
4import { isHTMLElement } from "./instanceOf.js";
5export default function getScrollParent(node) {
6  if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
7    // $FlowFixMe[incompatible-return]: assume body is always available
8    return node.ownerDocument.body;
9  }
10
11  if (isHTMLElement(node) && isScrollParent(node)) {
12    return node;
13  }
14
15  return getScrollParent(getParentNode(node));
16}

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.