Closed
Bug 1300732
Opened 8 years ago
Closed 8 years ago
Use multiple querySelectorAll calls, one for each Localization
Categories
(L20n :: JS Library, defect)
L20n
JS Library
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: stas, Assigned: stas)
Details
(Whiteboard: [gecko-l20n])
In XUL documents only the first querySelectorAll call is expensive (in the browser.xul case it's about 4ms if called after DOMContentLoaded). We also seem to be paying around 3ms to then group NodeList from the qSA by Localization so that we can call l10n.formatEntities. And we need to pass l10ns further down to applyTranslations because of l10n.overlayElement which is Localiztion-specific. If additional qSA's are cheap we could make more calls -- one per each Localization: `[data-l10n-bundle=${bundleName}]` and for the main Localization object: `[data-l10n-bundle="main"], [data-l10n-id]:not([data-l10n-bundle])`
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → stas
Assignee | ||
Comment 1•8 years ago
|
||
https://hg.mozilla.org/projects/larch/rev/99d8ce46f4dc12cf735388b6d69df008fa135f09 Bug 1300732 - Use multiple querySelectorAll calls, one for each Localization
Assignee | ||
Comment 2•8 years ago
|
||
https://github.com/l20n/l20n.js/commit/dd9a5bb1ffc9fd63f126c0b6ab9c4b8c89beceb4
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•