templates: compress inter-tag whitespace
to reduce number of DOM nodes by 25%
This commit is contained in:
parent
fcb149ae21
commit
a889ac6413
|
@ -100,7 +100,7 @@
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
.svg-icon:not(.applies-to-help):not(.dismiss) {
|
.svg-icon:not(.dismiss) {
|
||||||
margin-left: 0.2rem;
|
margin-left: 0.2rem;
|
||||||
}
|
}
|
||||||
h2 .svg-icon, label .svg-icon {
|
h2 .svg-icon, label .svg-icon {
|
||||||
|
|
|
@ -41,8 +41,8 @@ function tNodeList(nodes) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (node.localName == 'template') {
|
if (node.localName == 'template') {
|
||||||
tNodeList(node.content.querySelectorAll('*'));
|
// compress inter-tag whitespace to reduce number of DOM nodes by 25%
|
||||||
template[node.dataset.id] = node.content.firstElementChild;
|
template[node.dataset.id] = tHTML(node.innerHTML);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (const attr of [...node.attributes]) {
|
for (const attr of [...node.attributes]) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user