From dc7e039ef2cbd3005c53652334f42d12f1f25691 Mon Sep 17 00:00:00 2001 From: Daniel Kern Date: Mon, 20 Sep 2021 13:21:24 -0500 Subject: nodeornew --- src/utils/adopter.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 048eb9c..824da57 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -44,6 +44,9 @@ export function makeInstance (element, isHTML = false) { export function nodeOrNew (name, node) { 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) +// } // Adopt existing svg elements export function adopt (node) { -- cgit v1.2.3 From 34de092742e19b84c74e775482cb08c234f2c75d Mon Sep 17 00:00:00 2001 From: Daniel Kern Date: Mon, 20 Sep 2021 13:26:55 -0500 Subject: new --- src/utils/adopter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 824da57..88db17c 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -41,12 +41,12 @@ export function makeInstance (element, isHTML = false) { return element } -export function nodeOrNew (name, node) { - 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) +// 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) +} // Adopt existing svg elements export function adopt (node) { -- cgit v1.2.3 From e5f02c66db9307d87da476c17dcbaec19e4dafc6 Mon Sep 17 00:00:00 2001 From: Daniel Kern Date: Mon, 20 Sep 2021 13:56:49 -0500 Subject: check 'ownerDocument' in node in nodeOrNew --- src/utils/adopter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3 From aeea23be44bb6dc1653837c61c82a404d4701c8b Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 22 Sep 2021 09:29:09 -0500 Subject: remove old code --- src/utils/adopter.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 6d055ed..300c133 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -41,11 +41,7 @@ export function makeInstance (element, isHTML = false) { return element } -// export function nodeOrNew (name, node) { -// return node instanceof globals.window.Node ? node : create(name) -// } export function nodeOrNew (name, node) { - //console.log(node) return (node && 'ownerDocument' in node && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) } -- cgit v1.2.3 From 8e7c12b42cd91f21ff18fb3786f2782003743ed3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 22 Sep 2021 17:41:46 -0500 Subject: reverted package lock and edit nodeOrNew --- src/utils/adopter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 300c133..487115c 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -42,7 +42,7 @@ export function makeInstance (element, isHTML = false) { } export function nodeOrNew (name, node) { - return (node && 'ownerDocument' in node && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) + return (node && node.ownerDocument && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) } // Adopt existing svg elements -- cgit v1.2.3 From a91e29f4d035fb541a2f9a21fcc1cca1fe9d381f Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 22 Sep 2021 17:44:50 -0500 Subject: Revert "remove old code" This reverts commit aeea23be44bb6dc1653837c61c82a404d4701c8b. --- src/utils/adopter.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 487115c..b5e326c 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -41,6 +41,9 @@ export function makeInstance (element, isHTML = false) { return element } +// export function nodeOrNew (name, node) { +// return node instanceof globals.window.Node ? node : create(name) +// } export function nodeOrNew (name, node) { return (node && node.ownerDocument && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) } -- cgit v1.2.3 From 35c127256dbcd65452cf6ecd9ed63ac9daec724a Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 22 Sep 2021 17:45:12 -0500 Subject: Revert "remove old code" This reverts commit aeea23be44bb6dc1653837c61c82a404d4701c8b. --- src/utils/adopter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index b5e326c..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.ownerDocument && 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 -- cgit v1.2.3 From 4c415a20af17c55c6d8848c50f719aa7a80d4e4e Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 22 Sep 2021 17:46:41 -0500 Subject: this time for real revert package lock --- src/utils/adopter.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 6d055ed..487115c 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -41,12 +41,8 @@ export function makeInstance (element, isHTML = false) { return element } -// export function nodeOrNew (name, node) { -// return node instanceof globals.window.Node ? node : create(name) -// } export function nodeOrNew (name, node) { - //console.log(node) - return (node && 'ownerDocument' in node && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) + return (node && node.ownerDocument && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name) } // Adopt existing svg elements -- cgit v1.2.3