From dddd9d1b22c9585c27c57b3fc1dadb23ec56afde Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Fri, 21 Jun 2013 21:41:55 -0400 Subject: [PATCH] proper subclass on cloned --- dom.d | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dom.d b/dom.d index 4322183..b0278e6 100644 --- a/dom.d +++ b/dom.d @@ -1866,7 +1866,10 @@ class Element { body { +/ { - auto e = new Element(parentDocument, tagName, attributes.dup, selfClosed); + auto e = Element.make(this.tagName); + e.parentDocument = this.parentDocument; + e.attributes = this.attributes.dup; + e.selfClosed = this.selfClosed; foreach(child; children) { e.appendChild(child.cloned); } @@ -1880,7 +1883,10 @@ class Element { return this.cloned; // shallow clone - auto e = new Element(parentDocument, tagName, attributes.dup, selfClosed); + auto e = Element.make(this.tagName); + e.parentDocument = this.parentDocument; + e.attributes = this.attributes.dup; + e.selfClosed = this.selfClosed; return e; }