summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-07-21 14:08:27 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-07-21 14:08:27 +0200
commite046447f00c954b234ffb2ac21bb326336364584 (patch)
tree5f3bf0d42422f88d8dde2f53c20aa77eb00eb7f6 /src
parentc9b762e3e36e0ec14a3d5934af8e6512192018c4 (diff)
downloadsvg.js-e046447f00c954b234ffb2ac21bb326336364584.tar.gz
svg.js-e046447f00c954b234ffb2ac21bb326336364584.zip
fixing node error in parent method when hitting document node (#720)
Diffstat (limited to 'src')
-rw-r--r--src/element.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/element.js b/src/element.js
index 1c35b42..8f412ad 100644
--- a/src/element.js
+++ b/src/element.js
@@ -178,6 +178,7 @@ SVG.Element = SVG.invent({
// loop trough ancestors if type is given
while(parent && parent.node instanceof window.SVGElement){
if(typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent
+ if(parent.node.parentNode.nodeName == '#document') return null // #720
parent = SVG.adopt(parent.node.parentNode)
}
}