refactor(core): remove misc dom utils from DomAdapters (#32278)

PR Close #32278
This commit is contained in:
Kara Erickson
2019-08-22 19:48:08 -07:00
committed by atscott
parent 28c8b03797
commit cf4b944865
17 changed files with 59 additions and 56 deletions

View File

@ -20,7 +20,7 @@ export class DOMTestComponentRenderer extends TestComponentRenderer {
insertRootElement(rootElId: string) {
const rootEl = <HTMLElement>getDOM().firstChild(
getDOM().content(getDOM().createTemplate(`<div id="${rootElId}"></div>`)));
getContent(getDOM().createTemplate(`<div id="${rootElId}"></div>`)));
// TODO(juliemr): can/should this be optional?
const oldRoots = getDOM().querySelectorAll(this._doc, '[id^=root]');
@ -30,3 +30,11 @@ export class DOMTestComponentRenderer extends TestComponentRenderer {
getDOM().appendChild(this._doc.body, rootEl);
}
}
function getContent(node: Node): Node {
if ('content' in node) {
return (<any>node).content;
} else {
return node;
}
}