aboutsummaryrefslogtreecommitdiffstats
path: root/src/elements/Element.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements/Element.js')
-rw-r--r--src/elements/Element.js7
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
}