mirror of https://github.com/adamdruppe/arsd.git
some contracts
This commit is contained in:
parent
5e2c7d9f57
commit
1c9dc91f00
10
dom.d
10
dom.d
|
@ -496,7 +496,15 @@ class Element {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element addChild(string tagName, Html innerHtml) {
|
Element addChild(string tagName, Html innerHtml)
|
||||||
|
in {
|
||||||
|
assert(parentDocument !is null);
|
||||||
|
}
|
||||||
|
out(ret) {
|
||||||
|
assert(ret !is null);
|
||||||
|
assert(ret.parentNode is this);
|
||||||
|
}
|
||||||
|
body {
|
||||||
auto e = parentDocument.createElement(tagName);
|
auto e = parentDocument.createElement(tagName);
|
||||||
this.appendChild(e);
|
this.appendChild(e);
|
||||||
e.innerHTML = innerHtml.source;
|
e.innerHTML = innerHtml.source;
|
||||||
|
|
Loading…
Reference in New Issue