diff options
author | Daniel Kern <dkern4159@yahoo.com> | 2021-09-20 13:56:49 -0500 |
---|---|---|
committer | Daniel Kern <dkern4159@yahoo.com> | 2021-09-20 13:56:49 -0500 |
commit | e5f02c66db9307d87da476c17dcbaec19e4dafc6 (patch) | |
tree | eb893e614bfea3a539ed6010fe10d80466f2297b /src/utils/adopter.js | |
parent | 34de092742e19b84c74e775482cb08c234f2c75d (diff) | |
download | svg.js-e5f02c66db9307d87da476c17dcbaec19e4dafc6.tar.gz svg.js-e5f02c66db9307d87da476c17dcbaec19e4dafc6.zip |
check 'ownerDocument' in node in nodeOrNew
Diffstat (limited to 'src/utils/adopter.js')
-rw-r--r-- | src/utils/adopter.js | 3 |
1 files changed, 2 insertions, 1 deletions
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 |