templates: compress inter-tag whitespace

to reduce number of DOM nodes by 25%
This commit is contained in:
tophf 2017-04-07 15:24:55 +03:00
parent fcb149ae21
commit a889ac6413
2 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@
width: 16px;
height: 16px;
}
.svg-icon:not(.applies-to-help):not(.dismiss) {
.svg-icon:not(.dismiss) {
margin-left: 0.2rem;
}
h2 .svg-icon, label .svg-icon {

View File

@ -41,8 +41,8 @@ function tNodeList(nodes) {
continue;
}
if (node.localName == 'template') {
tNodeList(node.content.querySelectorAll('*'));
template[node.dataset.id] = node.content.firstElementChild;
// compress inter-tag whitespace to reduce number of DOM nodes by 25%
template[node.dataset.id] = tHTML(node.innerHTML);
continue;
}
for (const attr of [...node.attributes]) {