Bug 1882876 - Port bug 1878629: Consider removing nsIEventListenerService.addSystemEventListener/removeSystemEventListener. r=vineet

Differential Revision: https://phabricator.services.mozilla.com/D203267

--HG--
extra : rebase_source : cb9f7ef31e6885d51ca8dbd5eceb374420a498dc
extra : amend_source : 1a59ef86c043b70be9635e87ea8ab2dabb87dca4
This commit is contained in:
Magnus Melin 2024-03-02 12:48:13 +02:00
Родитель 0a0f89e42c
Коммит 59bb7cce6a
2 изменённых файлов: 7 добавлений и 10 удалений

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

@ -299,12 +299,9 @@ function InitMsgWindow() {
}
},
};
Services.els.addSystemEventListener(
document,
"keypress",
keypressListener,
false
);
document.addEventListener("keypress", keypressListener, {
mozSystemGroup: true,
});
}
// We're going to implement our status feedback for the mail window in JS now.

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

@ -20,8 +20,8 @@ var gPanelsForWindow = new WeakMap();
var CustomizableUIInternal = {
addPanelCloseListeners(aPanel) {
Services.els.addSystemEventListener(aPanel, "click", this, false);
Services.els.addSystemEventListener(aPanel, "keypress", this, false);
aPanel.addEventListener("click", this, { mozSystemGroup: true });
aPanel.addEventListener("keypress", this, { mozSystemGroup: true });
const win = aPanel.ownerGlobal;
if (!gPanelsForWindow.has(win)) {
gPanelsForWindow.set(win, new Set());
@ -30,8 +30,8 @@ var CustomizableUIInternal = {
},
removePanelCloseListeners(aPanel) {
Services.els.removeSystemEventListener(aPanel, "click", this, false);
Services.els.removeSystemEventListener(aPanel, "keypress", this, false);
aPanel.removeEventListener("click", this, { mozSystemGroup: true });
aPanel.removeEventListener("keypress", this, { mozSystemGroup: true });
const win = aPanel.ownerGlobal;
const panels = gPanelsForWindow.get(win);
if (panels) {