From e4bb670114d10347a856608e6e71f1b93548b163 Mon Sep 17 00:00:00 2001 From: edave64 Date: Thu, 18 Jul 2024 14:36:34 +0200 Subject: [PATCH] Handle contained by checks in documents other than the primary document --- src/blot/abstract/parent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blot/abstract/parent.ts b/src/blot/abstract/parent.ts index 2b1c5fd..c8ea687 100644 --- a/src/blot/abstract/parent.ts +++ b/src/blot/abstract/parent.ts @@ -351,7 +351,7 @@ class ParentBlot extends ShadowBlot implements Parent { node.parentNode != null && // @ts-expect-error Fix me later node.tagName !== 'IFRAME' && - document.body.compareDocumentPosition(node) & + (node.ownerDocument ?? document).body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY ) { return;