Bug 1850721 - Correctly check boolean attributes when deciding whether to set indicator-replaces-favicon, and correctly carry over boolean attributes when moving a tab to another window. r=mak,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D187183
This commit is contained in:
Dão Gottwald
2023-09-05 09:57:27 +00:00
parent fc3aa9fba8
commit 6876424fca
4 changed files with 30 additions and 26 deletions

View File

@@ -4494,7 +4494,7 @@
let modifiedAttrs = [];
if (aOtherTab.hasAttribute("muted")) {
aOurTab.setAttribute("muted", "true");
aOurTab.toggleAttribute("muted", true);
aOurTab.muteReason = aOtherTab.muteReason;
// For non-lazy tabs, mute() must be called.
if (aOurTab.linkedPanel) {
@@ -4503,11 +4503,11 @@
modifiedAttrs.push("muted");
}
if (aOtherTab.hasAttribute("undiscardable")) {
aOurTab.setAttribute("undiscardable", "true");
aOurTab.toggleAttribute("undiscardable", true);
modifiedAttrs.push("undiscardable");
}
if (aOtherTab.hasAttribute("soundplaying")) {
aOurTab.setAttribute("soundplaying", "true");
aOurTab.toggleAttribute("soundplaying", true);
modifiedAttrs.push("soundplaying");
}
if (aOtherTab.hasAttribute("usercontextid")) {
@@ -4521,7 +4521,7 @@
webrtcUI.swapBrowserForNotification(otherBrowser, ourBrowser);
}
if (aOtherTab.hasAttribute("pictureinpicture")) {
aOurTab.setAttribute("pictureinpicture", true);
aOurTab.toggleAttribute("pictureinpicture", true);
modifiedAttrs.push("pictureinpicture");
let event = new CustomEvent("TabSwapPictureInPicture", {
@@ -6122,7 +6122,7 @@
}
if (!tab.hasAttribute("soundplaying")) {
tab.setAttribute("soundplaying", true);
tab.toggleAttribute("soundplaying", true);
modifiedAttrs.push("soundplaying");
}
@@ -6150,7 +6150,7 @@
"--soundplaying-removal-delay",
`${removalDelay - 300}ms`
);
tab.setAttribute("soundplaying-scheduledremoval", "true");
tab.toggleAttribute("soundplaying-scheduledremoval", true);
this._tabAttrModified(tab, ["soundplaying-scheduledremoval"]);
tab._soundPlayingAttrRemovalTimer = setTimeout(() => {