diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-03 18:42:19 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-03 18:42:19 +1000 |
commit | 7547a6a45818bcfefd545da4697196b81bd8da5b (patch) | |
tree | 0f62eb9f98b81c6fe20536d5437c9acf39e08b01 /src/elements/Element.js | |
parent | 28e74482b8cc7b7f2e4aca099ceea9f7d7a888d5 (diff) | |
download | svg.js-7547a6a45818bcfefd545da4697196b81bd8da5b.tar.gz svg.js-7547a6a45818bcfefd545da4697196b81bd8da5b.zip |
- fixed `put()` which correctly creates an svgjs object from the passed element now before returning
- fixed `parent()` which correctly returns null if direct parent is the document or a document-fragment
- fixed `add()` which correctly removes namespaces of non-root svg elements now when added to another svg element (#1086)
- fixed `isRoot()` which correctly returns false, if the element is in a document-fragment
Diffstat (limited to 'src/elements/Element.js')
-rw-r--r-- | src/elements/Element.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/elements/Element.js b/src/elements/Element.js index 56dbcf3..d75db17 100644 --- a/src/elements/Element.js +++ b/src/elements/Element.js @@ -106,8 +106,13 @@ export default class Element extends Dom { const parents = new List() let parent = this - while ((parent = parent.parent()) && parent.node !== globals.document) { + while ( + (parent = parent.parent()) + && parent.node !== globals.document + && parent.nodeName !== '#document-fragment') { + parents.push(parent) + if (parent.node === until.node) { break } |