Skip to content

Commit 27a70fb

Browse files
committed
chore(e2e): add domCount() perf tool
1 parent 59dd853 commit 27a70fb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/e2e/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@
2626
document.dir = 'ltr';
2727
}
2828

29+
window.domCount = function domCount(ele) {
30+
if(!ele) {
31+
return 0;
32+
}
33+
var count = 1;
34+
for(var i = 0; i < ele.children.length; i++) {
35+
count += domCount(ele.children[i]);
36+
}
37+
return count;
38+
}
39+
2940
if (location.href.indexOf('theme=dark') > -1) {
3041
var link = document.getElementById('ionicLink');
3142
link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));

0 commit comments

Comments
 (0)