Bug 1741521 - Revert changes to TabAttrModified event from bug 1683865. r=mkmelin

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

--HG--
extra : rebase_source : b05cfed0fdc43837a205a4e295a1926f98024eaf
This commit is contained in:
Geoff Lankow 2021-11-17 12:07:40 +13:00
Родитель 515d64b29f
Коммит 8a988fc3e7
2 изменённых файлов: 11 добавлений и 13 удалений

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

@ -1756,7 +1756,7 @@
let evt = new CustomEvent("TabAttrModified", {
bubbles: true,
cancelable: false,
detail: { change: "title", tabInfo: tab },
detail: { changed: ["label"], tabInfo: tab },
});
tabNode.dispatchEvent(evt);
}
@ -1789,7 +1789,7 @@
let evt = new CustomEvent("TabAttrModified", {
bubbles: true,
cancelable: false,
detail: { change: "favIconUrl", tabInfo },
detail: { changed: ["favIconUrl"], tabInfo },
});
tabInfo.tabNode.dispatchEvent(evt);
}

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

@ -168,17 +168,15 @@ class TabsUpdateFilterEventManager extends EventManager {
let listener = event => {
let changeInfo = {};
let tab = tabManager.getWrapper(event.detail.tabInfo);
switch (event.detail.change) {
case "favIconUrl":
if (filter.properties.has("favIconUrl")) {
changeInfo.favIconUrl = tab.favIconUrl;
}
break;
case "title":
if (filter.properties.has("title")) {
changeInfo.title = tab.title;
}
break;
let changed = event.detail.changed;
if (
changed.includes("favIconUrl") &&
filter.properties.has("favIconUrl")
) {
changeInfo.favIconUrl = tab.favIconUrl;
}
if (changed.includes("label") && filter.properties.has("title")) {
changeInfo.title = tab.title;
}
fireForTab(tab, changeInfo);