chore: Update patches to ff 145, b=no-bug, c=no-component

This commit is contained in:
Mr. M
2025-11-13 13:56:31 +01:00
parent bf1b0dcd48
commit c4dd470864
3 changed files with 96 additions and 96 deletions

View File

@@ -1,17 +1,17 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03cda47b6f 100644
index 1cdbc0f41bf5b55dfbbd850cb618c6d870f7a261..2a7d429e2ed2f2be5bb554a5fb5fd2be523e4feb 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -126,6 +126,8 @@ const TAB_EVENTS = [
"TabUngrouped",
@@ -127,6 +127,8 @@ const TAB_EVENTS = [
"TabGroupCollapse",
"TabGroupExpand",
"TabSplitViewActivate",
+ "TabAddedToEssentials",
+ "TabRemovedFromEssentials",
];
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -195,6 +197,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
@@ -196,6 +198,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs",
TabStateFlusher: "resource:///modules/sessionstore/TabStateFlusher.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
@@ -19,7 +19,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
});
ChromeUtils.defineLazyGetter(lazy, "blankURI", () => {
@@ -1904,6 +1907,8 @@ var SessionStoreInternal = {
@@ -1911,6 +1914,8 @@ var SessionStoreInternal = {
case "TabPinned":
case "TabUnpinned":
case "SwapDocShells":
@@ -28,7 +28,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
this.saveStateDelayed(win);
break;
case "TabGroupCreate":
@@ -2139,7 +2144,6 @@ var SessionStoreInternal = {
@@ -2151,7 +2156,6 @@ var SessionStoreInternal = {
if (closedWindowState) {
let newWindowState;
if (
@@ -36,7 +36,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
!lazy.SessionStartup.willRestore()
) {
// We want to split the window up into pinned tabs and unpinned tabs.
@@ -2203,6 +2207,10 @@ var SessionStoreInternal = {
@@ -2215,6 +2219,10 @@ var SessionStoreInternal = {
});
this._shouldRestoreLastSession = false;
}
@@ -47,7 +47,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
if (this._restoreLastWindow && aWindow.toolbar.visible) {
// always reset (if not a popup window)
@@ -2372,11 +2380,9 @@ var SessionStoreInternal = {
@@ -2384,11 +2392,9 @@ var SessionStoreInternal = {
tabbrowser.selectedTab.label;
}
@@ -59,7 +59,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
// Store the window's close date to figure out when each individual tab
// was closed. This timestamp should allow re-arranging data based on how
@@ -3361,7 +3367,7 @@ var SessionStoreInternal = {
@@ -3373,7 +3379,7 @@ var SessionStoreInternal = {
if (!isPrivateWindow && tabState.isPrivate) {
return;
}
@@ -68,7 +68,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
return;
}
@@ -4073,6 +4079,11 @@ var SessionStoreInternal = {
@@ -4089,6 +4095,11 @@ var SessionStoreInternal = {
Math.min(tabState.index, tabState.entries.length)
);
tabState.pinned = false;
@@ -80,7 +80,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab;
@@ -4509,6 +4520,7 @@ var SessionStoreInternal = {
@@ -4525,6 +4536,7 @@ var SessionStoreInternal = {
// Append the tab if we're opening into a different window,
tabIndex: aSource == aTargetWindow ? pos : Infinity,
pinned: state.pinned,
@@ -88,7 +88,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
userContextId: state.userContextId,
skipLoad: true,
preferredRemoteType,
@@ -5358,7 +5370,7 @@ var SessionStoreInternal = {
@@ -5374,7 +5386,7 @@ var SessionStoreInternal = {
for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) {
let tab = tabbrowser.tabs[i];
@@ -97,7 +97,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
removableTabs.push(tab);
}
}
@@ -5418,7 +5430,7 @@ var SessionStoreInternal = {
@@ -5434,7 +5446,7 @@ var SessionStoreInternal = {
}
let workspaceID = aWindow.getWorkspaceID();
@@ -106,7 +106,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
winData.workspaceID = workspaceID;
}
},
@@ -5609,11 +5621,12 @@ var SessionStoreInternal = {
@@ -5625,11 +5637,12 @@ var SessionStoreInternal = {
}
let tabbrowser = aWindow.gBrowser;
@@ -120,7 +120,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
// update the internal state data for this window
for (let tab of tabs) {
if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -5624,6 +5637,7 @@ var SessionStoreInternal = {
@@ -5640,6 +5653,7 @@ var SessionStoreInternal = {
tabsData.push(tabData);
}
@@ -128,7 +128,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
// update tab group state for this window
winData.groups = [];
for (let tabGroup of aWindow.gBrowser.tabGroups) {
@@ -5636,7 +5650,7 @@ var SessionStoreInternal = {
@@ -5652,7 +5666,7 @@ var SessionStoreInternal = {
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected).
if (aWindow.FirefoxViewHandler.tab?.selected) {
@@ -137,7 +137,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
winData.title = tabbrowser.tabs[0].label;
}
winData.selected = selectedIndex;
@@ -5748,8 +5762,8 @@ var SessionStoreInternal = {
@@ -5764,8 +5778,8 @@ var SessionStoreInternal = {
// selectTab represents.
let selectTab = 0;
if (overwriteTabs) {
@@ -148,7 +148,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
selectTab = Math.min(selectTab, winData.tabs.length);
}
@@ -5792,6 +5806,8 @@ var SessionStoreInternal = {
@@ -5808,6 +5822,8 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
@@ -157,7 +157,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -6348,6 +6364,25 @@ var SessionStoreInternal = {
@@ -6371,6 +6387,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.
@@ -183,7 +183,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..6a73ee56c067cba2347a552b4152cd03
if (tabData.pinned) {
tabbrowser.pinTab(tab);
@@ -7263,7 +7298,7 @@ var SessionStoreInternal = {
@@ -7289,7 +7324,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362efc001afdd 100644
index 4c1a48424316b29d27ae2bc8b64004df41c87bb6..f1ff9bf0947127a8e9115357cedac577b5fad08c 100644
--- a/browser/components/tabbrowser/content/tab.js
+++ b/browser/components/tabbrowser/content/tab.js
@@ -21,6 +21,7 @@
@@ -42,7 +42,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
".tab-label-container":
"pinned,selected=visuallyselected,labeldirection",
".tab-label":
@@ -184,7 +187,7 @@
@@ -186,7 +189,7 @@
}
set _visuallySelected(val) {
@@ -51,7 +51,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
return;
}
@@ -220,11 +223,21 @@
@@ -222,11 +225,21 @@
}
get visible() {
@@ -78,7 +78,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
}
get hidden() {
@@ -295,7 +308,7 @@
@@ -297,7 +310,7 @@
return false;
}
@@ -87,7 +87,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
}
get lastAccessed() {
@@ -372,8 +385,11 @@
@@ -374,8 +387,11 @@
}
get group() {
@@ -101,7 +101,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
}
return null;
}
@@ -468,6 +484,8 @@
@@ -470,6 +486,8 @@
this.style.MozUserFocus = "ignore";
} else if (
event.target.classList.contains("tab-close-button") ||
@@ -110,7 +110,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
event.target.classList.contains("tab-icon-overlay") ||
event.target.classList.contains("tab-audio-button")
) {
@@ -522,6 +540,10 @@
@@ -524,6 +542,10 @@
this.style.MozUserFocus = "";
}
@@ -121,7 +121,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
on_click(event) {
if (event.button != 0) {
return;
@@ -582,6 +605,14 @@
@@ -584,6 +607,14 @@
// (see tabbrowser-tabs 'click' handler).
gBrowser.tabContainer._blockDblClick = true;
}
@@ -136,7 +136,7 @@ index 425aaf8c8e4adf1507eb0d8ded671f8295544b04..12988986c4cf00990c1d1b2e4be362ef
}
on_dblclick(event) {
@@ -605,6 +636,8 @@
@@ -607,6 +638,8 @@
animate: true,
triggeringEvent: event,
});

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394b7dbc6a7 100644
index c0eafd4faf8d57b8486c5bf8917375850ec8147e..326bf96d9346aba7096d518fbf63cc349868d0d0 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -432,15 +432,64 @@
@@ -450,15 +450,64 @@
return this.tabContainer.visibleTabs;
}
@@ -69,7 +69,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
set selectedTab(val) {
if (
gSharedTabWarning.willShowSharedTabWarning(val) ||
@@ -588,6 +637,7 @@
@@ -613,6 +662,7 @@
this.tabpanels.appendChild(panel);
let tab = this.tabs[0];
@@ -77,7 +77,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tab.linkedPanel = uniqueId;
this._selectedTab = tab;
this._selectedBrowser = browser;
@@ -873,13 +923,17 @@
@@ -898,13 +948,17 @@
}
this.showTab(aTab);
@@ -96,7 +96,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.setAttribute("pinned", "true");
this._updateTabBarForPinnedTabs();
@@ -892,11 +946,15 @@
@@ -917,11 +971,15 @@
}
this.#handleTabMove(aTab, () => {
@@ -113,7 +113,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
aTab.style.marginInlineStart = "";
@@ -1073,6 +1131,8 @@
@@ -1098,6 +1156,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@@ -122,7 +122,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
aIconURL &&
!LOCAL_PROTOCOLS.some(protocol => aIconURL.startsWith(protocol))
@@ -1082,6 +1142,9 @@
@@ -1107,6 +1167,9 @@
);
return;
}
@@ -132,7 +132,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL;
@@ -1445,6 +1508,7 @@
@@ -1470,6 +1533,7 @@
if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed();
@@ -140,7 +140,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1597,6 +1661,9 @@
@@ -1622,6 +1686,9 @@
}
let activeEl = document.activeElement;
@@ -150,7 +150,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1920,7 +1987,8 @@
@@ -1945,7 +2012,8 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@@ -160,7 +160,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return false;
}
@@ -2028,7 +2096,7 @@
@@ -2053,7 +2121,7 @@
newIndex = this.selectedTab._tPos + 1;
}
@@ -169,7 +169,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.isTabGroupLabel(targetTab)) {
throw new Error(
"Replacing a tab group label with a tab is not supported"
@@ -2303,6 +2371,7 @@
@@ -2328,6 +2396,7 @@
uriIsAboutBlank,
userContextId,
skipLoad,
@@ -177,7 +177,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2376,8 +2445,7 @@
@@ -2401,8 +2470,7 @@
// we use a different attribute name for this?
b.setAttribute("name", name);
}
@@ -187,7 +187,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
b.setAttribute("transparent", "true");
}
@@ -2542,7 +2610,7 @@
@@ -2567,7 +2635,7 @@
let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID();
@@ -196,7 +196,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary.
@@ -2601,8 +2669,8 @@
@@ -2626,8 +2694,8 @@
// If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) {
@@ -207,7 +207,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
}
@@ -2779,7 +2847,6 @@
@@ -2814,7 +2882,6 @@
this.selectedTab = this.addTrustedTab(BROWSER_NEW_TAB_URL, {
tabIndex: tab._tPos + 1,
userContextId: tab.userContextId,
@@ -215,7 +215,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
focusUrlBar: true,
});
resolve(this.selectedBrowser);
@@ -2859,6 +2926,8 @@
@@ -2923,6 +2990,8 @@
schemelessInput,
hasValidUserGestureActivation = false,
textDirectiveUserActivation = false,
@@ -224,7 +224,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2869,6 +2938,12 @@
@@ -2933,6 +3002,12 @@
);
}
@@ -237,7 +237,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -2932,6 +3007,19 @@
@@ -2996,6 +3071,19 @@
noInitialLabel,
skipBackgroundNotify,
});
@@ -257,7 +257,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (insertTab) {
// Insert the tab into the tab container in the correct position.
this.#insertTabAtIndex(t, {
@@ -2940,6 +3028,7 @@
@@ -3004,6 +3092,7 @@
ownerTab,
openerTab,
pinned,
@@ -265,7 +265,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
bulkOrderedOpen,
tabGroup: tabGroup ?? openerTab?.group,
});
@@ -2958,6 +3047,7 @@
@@ -3022,6 +3111,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -273,7 +273,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}));
if (focusUrlBar) {
@@ -3078,6 +3168,12 @@
@@ -3146,6 +3236,12 @@
}
}
@@ -286,7 +286,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Additionally send pinned tab events
if (pinned) {
this.#notifyPinnedStatus(t);
@@ -3248,10 +3344,10 @@
@@ -3330,10 +3426,10 @@
isAdoptingGroup = false,
isUserTriggered = false,
telemetryUserCreateSource = "unknown",
@@ -298,7 +298,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
if (!color) {
@@ -3272,9 +3368,14 @@
@@ -3354,9 +3450,14 @@
label,
isAdoptingGroup
);
@@ -315,7 +315,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
group.addTabs(tabs);
@@ -3395,7 +3496,7 @@
@@ -3477,7 +3578,7 @@
}
this.#handleTabMove(tab, () =>
@@ -324,7 +324,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
}
@@ -3597,6 +3698,7 @@
@@ -3679,6 +3780,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -332,7 +332,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
) {
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
@@ -3666,6 +3768,7 @@
@@ -3748,6 +3850,7 @@
openWindowInfo,
name,
skipLoad,
@@ -340,7 +340,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
}
@@ -3853,7 +3956,7 @@
@@ -3935,7 +4038,7 @@
// Add a new tab if needed.
if (!tab) {
let createLazyBrowser =
@@ -349,7 +349,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let url = "about:blank";
if (tabData.entries?.length) {
@@ -3890,8 +3993,10 @@
@@ -3972,8 +4075,10 @@
insertTab: false,
skipLoad: true,
preferredRemoteType,
@@ -361,7 +361,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (select) {
tabToSelect = tab;
}
@@ -3903,7 +4008,8 @@
@@ -3985,7 +4090,8 @@
this.pinTab(tab);
// Then ensure all the tab open/pinning information is sent.
this._fireTabOpen(tab, {});
@@ -371,7 +371,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group
@@ -3917,7 +4023,10 @@
@@ -3999,7 +4105,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
@@ -383,7 +383,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3962,9 +4071,23 @@
@@ -4044,9 +4153,23 @@
// to remove the old selected tab.
if (tabToSelect) {
let leftoverTab = this.selectedTab;
@@ -407,7 +407,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -4155,11 +4278,14 @@
@@ -4237,11 +4360,14 @@
if (ownerTab) {
tab.owner = ownerTab;
}
@@ -423,7 +423,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -4171,7 +4297,7 @@
@@ -4253,7 +4379,7 @@
let lastRelatedTab =
openerTab && this._lastRelatedTabMap.get(openerTab);
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
@@ -432,7 +432,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tabGroup = previousTab.group;
}
if (
@@ -4182,7 +4308,7 @@
@@ -4264,7 +4390,7 @@
) {
elementIndex = Infinity;
} else if (previousTab.visible) {
@@ -441,7 +441,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (previousTab == FirefoxViewHandler.tab) {
elementIndex = 0;
}
@@ -4210,14 +4336,14 @@
@@ -4292,14 +4418,14 @@
}
// Ensure index is within bounds.
if (tab.pinned) {
@@ -460,7 +460,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (pinned && !itemAfter?.pinned) {
itemAfter = null;
@@ -4228,7 +4354,7 @@
@@ -4310,7 +4436,7 @@
this.tabContainer._invalidateCachedTabs();
@@ -469,7 +469,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, itemAfter);
@@ -4264,6 +4390,7 @@
@@ -4346,6 +4472,7 @@
if (pinned) {
this._updateTabBarForPinnedTabs();
}
@@ -477,7 +477,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
TabBarVisibility.update();
}
@@ -4814,6 +4944,7 @@
@@ -4896,6 +5026,7 @@
telemetrySource,
} = {}
) {
@@ -485,7 +485,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
@@ -4903,6 +5034,7 @@
@@ -4985,6 +5116,7 @@
if (lastToClose) {
this.removeTab(lastToClose, aParams);
}
@@ -493,7 +493,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} catch (e) {
console.error(e);
}
@@ -4941,6 +5073,12 @@
@@ -5023,6 +5155,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
}
@@ -506,7 +506,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4955,6 +5093,9 @@
@@ -5037,6 +5175,9 @@
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
let isLastTab = this.#isLastTabInWindow(aTab);
@@ -516,7 +516,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -5003,7 +5144,13 @@
@@ -5085,7 +5226,13 @@
// We're not animating, so we can cancel the animation stopwatch.
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
aTab._closeTimeAnimTimerId = null;
@@ -531,7 +531,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return;
}
@@ -5137,7 +5284,7 @@
@@ -5219,7 +5366,7 @@
closeWindowWithLastTab != null
? closeWindowWithLastTab
: !window.toolbar.visible ||
@@ -540,7 +540,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -5161,6 +5308,7 @@
@@ -5243,6 +5390,7 @@
newTab = true;
}
@@ -548,7 +548,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -5201,13 +5349,7 @@
@@ -5283,13 +5431,7 @@
aTab._mouseleave();
if (newTab) {
@@ -563,7 +563,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
TabBarVisibility.update();
}
@@ -5340,6 +5482,7 @@
@@ -5422,6 +5564,7 @@
this.tabs[i]._tPos = i;
}
@@ -571,7 +571,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (!this._windowIsClosing) {
// update tab close buttons state
this.tabContainer._updateCloseButtons();
@@ -5552,6 +5695,7 @@
@@ -5643,6 +5786,7 @@
}
let excludeTabs = new Set(aExcludeTabs);
@@ -579,7 +579,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// If this tab has a successor, it should be selectable, since
// hiding or closing a tab removes that tab as a successor.
@@ -5564,13 +5708,13 @@
@@ -5655,13 +5799,13 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -595,7 +595,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
let tab = this.tabContainer.findNextTab(aTab, {
@@ -5586,7 +5730,7 @@
@@ -5677,7 +5821,7 @@
}
if (tab) {
@@ -604,7 +604,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5607,7 +5751,7 @@
@@ -5698,7 +5842,7 @@
});
}
@@ -613,7 +613,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
_blurTab(aTab) {
@@ -6013,10 +6157,10 @@
@@ -6104,10 +6248,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -626,7 +626,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -6075,6 +6219,7 @@
@@ -6166,6 +6310,7 @@
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
*/
replaceTabWithWindow(aTab, aOptions) {
@@ -634,7 +634,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.tabs.length == 1) {
return null;
}
@@ -6208,7 +6353,7 @@
@@ -6299,7 +6444,7 @@
* `true` if element is a `<tab-group>`
*/
isTabGroup(element) {
@@ -643,7 +643,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
/**
@@ -6284,8 +6429,8 @@
@@ -6375,8 +6520,8 @@
}
// Don't allow mixing pinned and unpinned tabs.
@@ -654,7 +654,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
}
@@ -6311,10 +6456,16 @@
@@ -6402,10 +6547,16 @@
this.#handleTabMove(
element,
() => {
@@ -673,7 +673,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
@@ -6372,23 +6523,28 @@
@@ -6463,23 +6614,28 @@
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
if (this.isTabGroupLabel(targetElement)) {
targetElement = targetElement.group;
@@ -708,7 +708,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (!element.pinned && targetElement && targetElement.pinned) {
// If the caller asks to move an unpinned element next to a pinned
// tab, move the unpinned element to be the first unpinned element
@@ -6401,14 +6557,34 @@
@@ -6492,14 +6648,34 @@
// move the tab group right before the first unpinned tab.
// 4. Moving a tab group and the first unpinned tab is grouped:
// move the tab group right before the first unpinned tab's tab group.
@@ -744,7 +744,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
element.pinned
? this.tabContainer.pinnedTabsContainer
: this.tabContainer;
@@ -6417,7 +6593,7 @@
@@ -6508,7 +6684,7 @@
element,
() => {
if (moveBefore) {
@@ -753,7 +753,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (targetElement) {
targetElement.after(element);
} else {
@@ -6489,10 +6665,10 @@
@@ -6580,10 +6756,10 @@
* @param {TabMetricsContext} [metricsContext]
*/
moveTabToGroup(aTab, aGroup, metricsContext) {
@@ -766,7 +766,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6522,6 +6698,7 @@
@@ -6613,6 +6789,7 @@
let state = {
tabIndex: tab._tPos,
@@ -774,7 +774,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
};
if (tab.visible) {
state.elementIndex = tab.elementIndex;
@@ -6548,7 +6725,7 @@
@@ -6639,7 +6816,7 @@
let changedTabGroup =
previousTabState.tabGroupId != currentTabState.tabGroupId;
@@ -783,7 +783,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tab.dispatchEvent(
new CustomEvent("TabMove", {
bubbles: true,
@@ -6585,6 +6762,10 @@
@@ -6676,6 +6853,10 @@
moveActionCallback();
@@ -794,7 +794,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -7486,7 +7667,7 @@
@@ -7576,7 +7757,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -803,7 +803,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
window.focus();
aEvent.preventDefault();
break;
@@ -7501,7 +7682,6 @@
@@ -7593,7 +7774,6 @@
}
case "TabGroupCollapse":
aEvent.target.tabs.forEach(tab => {
@@ -811,7 +811,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
break;
case "TabGroupCreateByUser":
@@ -8442,6 +8622,7 @@
@@ -8542,6 +8722,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -819,7 +819,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -9443,7 +9624,7 @@ var TabContextMenu = {
@@ -9543,7 +9724,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;