diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-12-01 18:39:37 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-12-01 18:39:37 +0100 |
commit | 1edcc976b8db981ba2398036b3a39c4de4791a86 (patch) | |
tree | a8f01fda0b67624aea0e63d788a5410f88f4c7cc /src/elements | |
parent | 622ec7b326a6cd24d7c7cba99aa9ca873713ca4e (diff) | |
download | svg.js-1edcc976b8db981ba2398036b3a39c4de4791a86.tar.gz svg.js-1edcc976b8db981ba2398036b3a39c4de4791a86.zip |
applied fixes from 2.x branch
Diffstat (limited to 'src/elements')
-rw-r--r-- | src/elements/Dom.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/elements/Dom.js b/src/elements/Dom.js index ff33d46..45a41ca 100644 --- a/src/elements/Dom.js +++ b/src/elements/Dom.js @@ -156,8 +156,9 @@ export default class Dom extends EventTarget { if (!type) return parent // loop trough ancestors if type is given - while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary + while (parent) { // FIXME: That shouldnt be neccessary if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent + if (!parent.node.parentNode || parent.node.parentNode.nodeName === '#document' || parent.node.parentNode.nodeName === '#document-fragment') return null // #759, #720 parent = adopt(parent.node.parentNode) } } |