Use optimal DOM selection functions
Reverts part of 7046d48cf9d574
This commit is contained in:
parent
8dc2115347
commit
487bb53145
|
@ -14,7 +14,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection])
|
|||
{
|
||||
// display a full text tooltip on buttons with ellipsis overflow and no inherent title
|
||||
const addTooltipsToEllipsized = () => {
|
||||
for (const btn of $$('button')) {
|
||||
for (const btn of document.getElementsByTagName('button')) {
|
||||
if (btn.title && !btn.titleIsForEllipsis ||
|
||||
btn.clientWidth === btn.preresizeClientWidth) {
|
||||
continue;
|
||||
|
|
|
@ -30,7 +30,7 @@ function tHTML(html, tag) {
|
|||
}
|
||||
const body = t.DOMParser.parseFromString(html, 'text/html').body;
|
||||
if (html.includes('i18n-')) {
|
||||
tNodeList($$('*', body));
|
||||
tNodeList(body.getElementsByTagName('*'));
|
||||
}
|
||||
// the html string may contain more than one top-level node
|
||||
if (!body.childNodes[1]) {
|
||||
|
@ -115,7 +115,7 @@ function tDocLoader() {
|
|||
const cacheLength = Object.keys(t.cache).length;
|
||||
|
||||
// localize HEAD
|
||||
tNodeList($$('*'));
|
||||
tNodeList(document.getElementsByTagName('*'));
|
||||
|
||||
// localize BODY
|
||||
const process = mutations => {
|
||||
|
|
|
@ -301,7 +301,7 @@ function showFiltersStats({immediately} = {}) {
|
|||
}
|
||||
$('#filters').classList.toggle('active', filtersSelector.hide !== '');
|
||||
const numTotal = BG.cachedStyles.list.length;
|
||||
const numHidden = $$('.entry.hidden', installed).length;
|
||||
const numHidden = installed.getElementsByClassName('entry hidden').length;
|
||||
const numShown = Math.min(numTotal - numHidden, installed.children.length);
|
||||
if (filtersSelector.numShown !== numShown ||
|
||||
filtersSelector.numTotal !== numTotal) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user