From a889ac641317eedaf3977cd8f0d23d768c6f9f4d Mon Sep 17 00:00:00 2001 From: tophf Date: Fri, 7 Apr 2017 15:24:55 +0300 Subject: [PATCH] templates: compress inter-tag whitespace to reduce number of DOM nodes by 25% --- edit.html | 2 +- localization.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/edit.html b/edit.html index 376c110c..f6ef45a1 100644 --- a/edit.html +++ b/edit.html @@ -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 { diff --git a/localization.js b/localization.js index 70489c02..ca423777 100644 --- a/localization.js +++ b/localization.js @@ -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]) {