aux window - avoid more global window (#195869)

* aux window - avoid more global `window`

* aux window - avoid more global `document`
This commit is contained in:
Benjamin Pasero
2023-10-18 09:33:39 +02:00
committed by GitHub
parent d18bce4980
commit 198bbdf35e
17 changed files with 49 additions and 46 deletions

View File

@@ -602,14 +602,7 @@ export function getLargestChildWidth(parent: HTMLElement, children: HTMLElement[
// ----------------------------------------------------------------------------------------
export function isAncestor(testChild: Node | null, testAncestor: Node | null): boolean {
while (testChild) {
if (testChild === testAncestor) {
return true;
}
testChild = testChild.parentNode;
}
return false;
return Boolean(testAncestor?.contains(testChild));
}
const parentFlowToDataKey = 'parentFlowToElementId';