From 1c3a9ee872ccddca49efd8a24b4f419c24da199b Mon Sep 17 00:00:00 2001 From: Oliver Caldwell Date: Sun, 28 May 2017 15:58:16 +0100 Subject: [PATCH] Only set the parentNode on faux DOM nodes --- lib/Element.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Element.js b/lib/Element.js index 7c19a22..27e8242 100644 --- a/lib/Element.js +++ b/lib/Element.js @@ -157,7 +157,10 @@ Element.prototype.removeEventListener = function (name, fn) { } Element.prototype.appendChild = function (el) { - el.parentNode = this + if (el instanceof Element) { + el.parentNode = this + } + this.childNodes.push(el) return el }