mirror of https://github.com/adamdruppe/arsd.git
proper subclass on cloned
This commit is contained in:
parent
7f6c62458e
commit
dddd9d1b22
10
dom.d
10
dom.d
|
@ -1866,7 +1866,10 @@ class Element {
|
||||||
body {
|
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) {
|
foreach(child; children) {
|
||||||
e.appendChild(child.cloned);
|
e.appendChild(child.cloned);
|
||||||
}
|
}
|
||||||
|
@ -1880,7 +1883,10 @@ class Element {
|
||||||
return this.cloned;
|
return this.cloned;
|
||||||
|
|
||||||
// shallow clone
|
// 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;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue