From: Daniel Kern Date: Mon, 20 Sep 2021 18:56:49 +0000 (-0500) Subject: check 'ownerDocument' in node in nodeOrNew X-Git-Tag: 3.1.2~7^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e5f02c66db9307d87da476c17dcbaec19e4dafc6;p=svg.js.git check 'ownerDocument' in node in nodeOrNew --- diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 88db17c..6d055ed 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -45,7 +45,8 @@ export function makeInstance (element, isHTML = false) { // return node instanceof globals.window.Node ? node : create(name) // } export function nodeOrNew (name, node) { - return (node && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) + //console.log(node) + return (node && 'ownerDocument' in node && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) } // Adopt existing svg elements