refactor(core): remove testing-only childNodes() and firstChild() fns from DomAdapters (#32291)
PR Close #32291
This commit is contained in:

committed by
Miško Hevery

parent
30dabdf8fc
commit
c0680602f9
@ -95,7 +95,7 @@ export function dispatchEvent(element: any, eventType: any): void {
|
||||
}
|
||||
|
||||
export function el(html: string): HTMLElement {
|
||||
return <HTMLElement>getDOM().firstChild(getContent(createTemplate(html)));
|
||||
return <HTMLElement>getContent(createTemplate(html)).firstChild;
|
||||
}
|
||||
|
||||
export function normalizeCSS(css: string): string {
|
||||
@ -148,7 +148,7 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
|
||||
|
||||
// Children
|
||||
const childrenRoot = templateAwareRoot(el);
|
||||
const children = childrenRoot ? getDOM().childNodes(childrenRoot) : [];
|
||||
const children = childrenRoot ? childrenRoot.childNodes : [];
|
||||
for (let j = 0; j < children.length; j++) {
|
||||
result += stringifyElement(children[j]);
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ _global.beforeEach(function() {
|
||||
|
||||
function elementText(n: any): string {
|
||||
const hasNodes = (n: any) => {
|
||||
const children = getDOM().childNodes(n);
|
||||
const children = n.childNodes;
|
||||
return children && children.length > 0;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user