Bug 1694728 - pause the fluent observer while updating the about:processes or about:performance page, r=Gijs.

Differential Revision: https://phabricator.services.mozilla.com/D106299
This commit is contained in:
Florian Quèze 2021-02-24 22:04:30 +00:00
Родитель 8fbec92c35
Коммит 2376f91e05
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -504,10 +504,15 @@ var View = {
// to avoid flicker when resizing. // to avoid flicker when resizing.
await document.l10n.translateFragment(this._fragment); await document.l10n.translateFragment(this._fragment);
// Pause the DOMLocalization mutation observer, or the already translated
// content will be translated a second time at the next tick.
document.l10n.pauseObserving();
while (tbody.firstChild) { while (tbody.firstChild) {
tbody.firstChild.remove(); tbody.firstChild.remove();
} }
tbody.appendChild(this._fragment); tbody.appendChild(this._fragment);
document.l10n.resumeObserving();
this._fragment = document.createDocumentFragment(); this._fragment = document.createDocumentFragment();
}, },
insertAfterRow(row) { insertAfterRow(row) {

Просмотреть файл

@ -410,10 +410,15 @@ var View = {
// to avoid flicker when resizing. // to avoid flicker when resizing.
await document.l10n.translateFragment(this._fragment); await document.l10n.translateFragment(this._fragment);
// Pause the DOMLocalization mutation observer, or the already translated
// content will be translated a second time at the next tick.
document.l10n.pauseObserving();
while (tbody.firstChild) { while (tbody.firstChild) {
tbody.firstChild.remove(); tbody.firstChild.remove();
} }
tbody.appendChild(this._fragment); tbody.appendChild(this._fragment);
document.l10n.resumeObserving();
this._fragment = document.createDocumentFragment(); this._fragment = document.createDocumentFragment();
}, },
insertAfterRow(row) { insertAfterRow(row) {