chore: Completly migrated to firefox 138, b=(no-bug), c=tabs, common, folders, glance

This commit is contained in:
Mr. M
2025-04-19 16:03:15 +02:00
parent 2e6e71e3b6
commit 2fcf6c80e9
6 changed files with 139 additions and 78 deletions

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9f61ca14c 100644 index bfba253af3253a8cf547a5d69a1695651fc5c203..24cedfa868878d1619c9d9d04a060a0b930f411c 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js --- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -415,11 +415,67 @@ @@ -415,11 +415,71 @@
return this.tabContainer.visibleTabs; return this.tabContainer.visibleTabs;
} }
@@ -19,6 +19,10 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
+ return i; + return i;
+ } + }
+ +
+ zenInsertTabAtIndex(...args) {
+ return this.#insertTabAtElementIndex(...args);
+ }
+
+ get _numVisiblePinTabsWithoutCollapsed() { + get _numVisiblePinTabsWithoutCollapsed() {
+ let i = 0; + let i = 0;
+ for (let item of this.tabContainer.ariaFocusableItems) { + for (let item of this.tabContainer.ariaFocusableItems) {
@@ -72,7 +76,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} }
return i; return i;
} }
@@ -549,6 +605,7 @@ @@ -549,6 +609,7 @@
this.tabpanels.appendChild(panel); this.tabpanels.appendChild(panel);
let tab = this.tabs[0]; let tab = this.tabs[0];
@@ -80,7 +84,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
tab.linkedPanel = uniqueId; tab.linkedPanel = uniqueId;
this._selectedTab = tab; this._selectedTab = tab;
this._selectedBrowser = browser; this._selectedBrowser = browser;
@@ -814,11 +871,13 @@ @@ -814,11 +875,13 @@
} }
this.showTab(aTab); this.showTab(aTab);
@@ -97,7 +101,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
this.moveTabTo(aTab, { this.moveTabTo(aTab, {
tabIndex: this.pinnedTabCount, tabIndex: this.pinnedTabCount,
forceUngrouped: true, forceUngrouped: true,
@@ -835,12 +894,15 @@ @@ -835,12 +898,15 @@
} }
if (this.tabContainer.verticalMode) { if (this.tabContainer.verticalMode) {
@@ -114,7 +118,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
}); });
} else { } else {
this.moveTabTo(aTab, { this.moveTabTo(aTab, {
@@ -1024,6 +1086,8 @@ @@ -1024,6 +1090,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"]; let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@@ -123,7 +127,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if ( if (
aIconURL && aIconURL &&
!aLoadingPrincipal && !aLoadingPrincipal &&
@@ -1034,6 +1098,9 @@ @@ -1034,6 +1102,9 @@
); );
return; return;
} }
@@ -133,7 +137,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
let browser = this.getBrowserForTab(aTab); let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL; browser.mIconURL = aIconURL;
@@ -1283,6 +1350,7 @@ @@ -1283,6 +1354,7 @@
if (!this._previewMode) { if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload(); newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed(); newTab.updateLastAccessed();
@@ -141,7 +145,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
oldTab.updateLastAccessed(); oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps. // if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) { if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1435,6 +1503,9 @@ @@ -1435,6 +1507,9 @@
} }
let activeEl = document.activeElement; let activeEl = document.activeElement;
@@ -151,7 +155,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// If focus is on the old tab, move it to the new tab. // If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) { if (activeEl == oldTab) {
newTab.focus(); newTab.focus();
@@ -1758,7 +1829,8 @@ @@ -1758,7 +1833,8 @@
} }
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) { _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@@ -161,7 +165,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
return false; return false;
} }
@@ -1866,7 +1938,7 @@ @@ -1866,7 +1942,7 @@
newIndex = this.selectedTab._tPos + 1; newIndex = this.selectedTab._tPos + 1;
} }
@@ -170,7 +174,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (this.isTabGroupLabel(targetTab)) { if (this.isTabGroupLabel(targetTab)) {
throw new Error( throw new Error(
"Replacing a tab group label with a tab is not supported" "Replacing a tab group label with a tab is not supported"
@@ -2130,6 +2202,7 @@ @@ -2130,6 +2206,7 @@
uriIsAboutBlank, uriIsAboutBlank,
userContextId, userContextId,
skipLoad, skipLoad,
@@ -178,7 +182,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} = {}) { } = {}) {
let b = document.createXULElement("browser"); let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the // Use the JSM global to create the permanentKey, so that if the
@@ -2203,8 +2276,7 @@ @@ -2203,8 +2280,7 @@
// we use a different attribute name for this? // we use a different attribute name for this?
b.setAttribute("name", name); b.setAttribute("name", name);
} }
@@ -188,7 +192,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
b.setAttribute("transparent", "true"); b.setAttribute("transparent", "true");
} }
@@ -2369,7 +2441,7 @@ @@ -2369,7 +2445,7 @@
let panel = this.getPanel(browser); let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID(); let uniqueId = this._generateUniquePanelID();
@@ -197,7 +201,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
aTab.linkedPanel = uniqueId; aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary. // Inject the <browser> into the DOM if necessary.
@@ -2428,8 +2500,8 @@ @@ -2428,8 +2504,8 @@
// If we transitioned from one browser to two browsers, we need to set // If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser. // hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) { if (this.tabs.length == 2) {
@@ -208,7 +212,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} else { } else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
} }
@@ -2657,6 +2729,7 @@ @@ -2657,6 +2733,7 @@
schemelessInput, schemelessInput,
hasValidUserGestureActivation = false, hasValidUserGestureActivation = false,
textDirectiveUserActivation = false, textDirectiveUserActivation = false,
@@ -216,7 +220,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} = {} } = {}
) { ) {
// all callers of addTab that pass a params object need to pass // all callers of addTab that pass a params object need to pass
@@ -2667,6 +2740,12 @@ @@ -2667,6 +2744,12 @@
); );
} }
@@ -229,7 +233,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (!UserInteraction.running("browser.tabs.opening", window)) { if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window); UserInteraction.start("browser.tabs.opening", "initting", window);
} }
@@ -2730,6 +2809,16 @@ @@ -2730,6 +2813,16 @@
noInitialLabel, noInitialLabel,
skipBackgroundNotify, skipBackgroundNotify,
}); });
@@ -246,7 +250,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (insertTab) { if (insertTab) {
if (typeof index == "number") { if (typeof index == "number") {
elementIndex = this.#tabIndexToElementIndex(index); elementIndex = this.#tabIndexToElementIndex(index);
@@ -2756,6 +2845,7 @@ @@ -2756,6 +2849,7 @@
initialBrowsingContextGroupId, initialBrowsingContextGroupId,
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
@@ -254,7 +258,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
})); }));
if (focusUrlBar) { if (focusUrlBar) {
@@ -2875,6 +2965,9 @@ @@ -2875,6 +2969,9 @@
} }
} }
@@ -264,7 +268,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// Additionally send pinned tab events // Additionally send pinned tab events
if (pinned) { if (pinned) {
this._notifyPinnedStatus(t); this._notifyPinnedStatus(t);
@@ -2922,12 +3015,15 @@ @@ -2922,12 +3019,15 @@
* @param {string} [label=] * @param {string} [label=]
* @returns {MozTabbrowserTabGroup} * @returns {MozTabbrowserTabGroup}
*/ */
@@ -281,7 +285,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
return group; return group;
} }
@@ -2970,6 +3066,7 @@ @@ -2970,6 +3070,7 @@
insertBefore = null, insertBefore = null,
isUserTriggered = false, isUserTriggered = false,
telemetryUserCreateSource = "unknown", telemetryUserCreateSource = "unknown",
@@ -289,7 +293,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} = {} } = {}
) { ) {
if (!tabs?.length) { if (!tabs?.length) {
@@ -2988,7 +3085,12 @@ @@ -2988,7 +3089,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`; id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
} }
let group = this._createTabGroup(id, color, false, label); let group = this._createTabGroup(id, color, false, label);
@@ -303,7 +307,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
group, group,
insertBefore?.group ?? insertBefore insertBefore?.group ?? insertBefore
); );
@@ -3318,6 +3420,7 @@ @@ -3318,6 +3424,7 @@
initialBrowsingContextGroupId, initialBrowsingContextGroupId,
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
@@ -311,7 +315,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} }
) { ) {
// If we don't have a preferred remote type, and we have a remote // If we don't have a preferred remote type, and we have a remote
@@ -3381,6 +3484,7 @@ @@ -3381,6 +3488,7 @@
openWindowInfo, openWindowInfo,
name, name,
skipLoad, skipLoad,
@@ -319,7 +323,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
}); });
} }
@@ -3559,6 +3663,27 @@ @@ -3559,6 +3667,27 @@
) { ) {
tabWasReused = true; tabWasReused = true;
tab = this.selectedTab; tab = this.selectedTab;
@@ -347,7 +351,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (!tabData.pinned) { if (!tabData.pinned) {
this.unpinTab(tab); this.unpinTab(tab);
} else { } else {
@@ -3607,8 +3732,28 @@ @@ -3607,8 +3736,28 @@
skipLoad: true, skipLoad: true,
preferredRemoteType, preferredRemoteType,
}); });
@@ -378,7 +382,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
tabToSelect = tab; tabToSelect = tab;
} }
} }
@@ -3620,8 +3765,8 @@ @@ -3620,8 +3769,8 @@
// inserted in the DOM. If the tab is not yet in the DOM, // inserted in the DOM. If the tab is not yet in the DOM,
// just insert it in the right place from the start. // just insert it in the right place from the start.
if (!tab.parentNode) { if (!tab.parentNode) {
@@ -389,7 +393,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
tab.toggleAttribute("pinned", true); tab.toggleAttribute("pinned", true);
this.tabContainer._invalidateCachedTabs(); this.tabContainer._invalidateCachedTabs();
// Then ensure all the tab open/pinning information is sent. // Then ensure all the tab open/pinning information is sent.
@@ -3631,7 +3776,8 @@ @@ -3631,7 +3780,8 @@
// needs calling: // needs calling:
shouldUpdateForPinnedTabs = true; shouldUpdateForPinnedTabs = true;
} }
@@ -399,7 +403,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
let { groupId } = tabData; let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId); const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group // if a tab refers to a tab group we don't know, skip any group
@@ -3645,7 +3791,10 @@ @@ -3645,7 +3795,10 @@
tabGroup.stateData.id, tabGroup.stateData.id,
tabGroup.stateData.color, tabGroup.stateData.color,
tabGroup.stateData.collapsed, tabGroup.stateData.collapsed,
@@ -411,7 +415,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
); );
tabsFragment.appendChild(tabGroup.node); tabsFragment.appendChild(tabGroup.node);
} }
@@ -3696,6 +3845,9 @@ @@ -3696,6 +3849,9 @@
this.selectedTab = tabToSelect; this.selectedTab = tabToSelect;
this.removeTab(leftoverTab); this.removeTab(leftoverTab);
} }
@@ -421,7 +425,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (tabs.length > 1 || !tabs[0].selected) { if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert(); this._updateTabsAfterInsert();
@@ -3882,7 +4034,7 @@ @@ -3882,7 +4038,7 @@
// Ensure we have an index if one was not provided. // Ensure we have an index if one was not provided.
if (typeof index != "number") { if (typeof index != "number") {
// Move the new tab after another tab if needed, to the end otherwise. // Move the new tab after another tab if needed, to the end otherwise.
@@ -430,7 +434,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if ( if (
!bulkOrderedOpen && !bulkOrderedOpen &&
((openerTab && ((openerTab &&
@@ -3928,18 +4080,18 @@ @@ -3928,18 +4084,18 @@
// Ensure index is within bounds. // Ensure index is within bounds.
if (tab.pinned) { if (tab.pinned) {
@@ -453,7 +457,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) { if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group // Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, itemAfter); this.tabContainer.insertBefore(tab, itemAfter);
@@ -4260,6 +4412,9 @@ @@ -4260,6 +4416,9 @@
return; return;
} }
@@ -463,7 +467,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
this.removeTabs(selectedTabs, { telemetrySource }); this.removeTabs(selectedTabs, { telemetrySource });
} }
@@ -4512,6 +4667,7 @@ @@ -4512,6 +4671,7 @@
telemetrySource, telemetrySource,
} = {} } = {}
) { ) {
@@ -471,7 +475,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs // When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window. // can be considered equivalent to closing the window.
if ( if (
@@ -4596,6 +4752,7 @@ @@ -4596,6 +4756,7 @@
if (lastToClose) { if (lastToClose) {
this.removeTab(lastToClose, aParams); this.removeTab(lastToClose, aParams);
} }
@@ -479,7 +483,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
@@ -4620,6 +4777,7 @@ @@ -4620,6 +4781,7 @@
telemetrySource, telemetrySource,
} = {} } = {}
) { ) {
@@ -487,7 +491,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (UserInteraction.running("browser.tabs.opening", window)) { if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window); UserInteraction.finish("browser.tabs.opening", window);
} }
@@ -4633,6 +4791,12 @@ @@ -4633,6 +4795,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start(); aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
} }
@@ -500,7 +504,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// Handle requests for synchronously removing an already // Handle requests for synchronously removing an already
// asynchronously closing tab. // asynchronously closing tab.
if (!animate && aTab.closing) { if (!animate && aTab.closing) {
@@ -4647,7 +4811,9 @@ @@ -4647,7 +4815,9 @@
// frame created for it (for example, by updating the visually selected // frame created for it (for example, by updating the visually selected
// state). // state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@@ -511,7 +515,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if ( if (
!this._beginRemoveTab(aTab, { !this._beginRemoveTab(aTab, {
closeWindowFastpath: true, closeWindowFastpath: true,
@@ -4810,7 +4976,7 @@ @@ -4810,7 +4980,7 @@
closeWindowWithLastTab != null closeWindowWithLastTab != null
? closeWindowWithLastTab ? closeWindowWithLastTab
: !window.toolbar.visible || : !window.toolbar.visible ||
@@ -520,7 +524,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (closeWindow) { if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here, // We've already called beforeunload on all the relevant tabs if we get here,
@@ -4834,6 +5000,7 @@ @@ -4834,6 +5004,7 @@
newTab = true; newTab = true;
} }
@@ -528,7 +532,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
aTab._endRemoveArgs = [closeWindow, newTab]; aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation. // swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4873,9 +5040,7 @@ @@ -4873,9 +5044,7 @@
aTab._mouseleave(); aTab._mouseleave();
if (newTab) { if (newTab) {
@@ -539,7 +543,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} else { } else {
TabBarVisibility.update(); TabBarVisibility.update();
} }
@@ -5004,6 +5169,8 @@ @@ -5004,6 +5173,8 @@
this.tabs[i]._tPos = i; this.tabs[i]._tPos = i;
} }
@@ -548,7 +552,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (!this._windowIsClosing) { if (!this._windowIsClosing) {
if (wasPinned) { if (wasPinned) {
this.tabContainer._positionPinnedTabs(); this.tabContainer._positionPinnedTabs();
@@ -5129,8 +5296,8 @@ @@ -5129,8 +5300,8 @@
return closedCount; return closedCount;
} }
@@ -559,7 +563,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (unloadBlocked) { if (unloadBlocked) {
return; return;
} }
@@ -5230,13 +5397,13 @@ @@ -5230,13 +5401,13 @@
!excludeTabs.has(aTab.owner) && !excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) { ) {
@@ -575,7 +579,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
); );
let tab = this.tabContainer.findNextTab(aTab, { let tab = this.tabContainer.findNextTab(aTab, {
@@ -5252,7 +5419,7 @@ @@ -5252,7 +5423,7 @@
} }
if (tab) { if (tab) {
@@ -584,7 +588,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} }
// If no qualifying visible tab was found, see if there is a tab in // If no qualifying visible tab was found, see if there is a tab in
@@ -5273,7 +5440,7 @@ @@ -5273,7 +5444,7 @@
}); });
} }
@@ -593,7 +597,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} }
_blurTab(aTab) { _blurTab(aTab) {
@@ -5674,10 +5841,10 @@ @@ -5674,10 +5845,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
} }
@@ -606,7 +610,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
aTab.selected || aTab.selected ||
aTab.closing || aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden. // Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -5971,7 +6138,7 @@ @@ -5971,7 +6142,7 @@
// Don't allow mixing pinned and unpinned tabs. // Don't allow mixing pinned and unpinned tabs.
if (this.isTab(element) && element.pinned) { if (this.isTab(element) && element.pinned) {
@@ -615,7 +619,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
} else { } else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount); tabIndex = Math.max(tabIndex, this.pinnedTabCount);
} }
@@ -5998,9 +6165,16 @@ @@ -5998,9 +6169,16 @@
element, element,
() => { () => {
let neighbor = this.tabs[tabIndex]; let neighbor = this.tabs[tabIndex];
@@ -633,7 +637,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (neighbor && this.isTab(element) && tabIndex > element._tPos) { if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element); neighbor.after(element);
} else { } else {
@@ -6069,7 +6243,9 @@ @@ -6069,7 +6247,9 @@
targetElement = targetElement.group; targetElement = targetElement.group;
} }
} }
@@ -644,7 +648,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// Don't allow mixing pinned and unpinned tabs. // Don't allow mixing pinned and unpinned tabs.
if (element.pinned && !targetElement?.pinned) { if (element.pinned && !targetElement?.pinned) {
targetElement = this.tabs[this.pinnedTabCount - 1]; targetElement = this.tabs[this.pinnedTabCount - 1];
@@ -6079,7 +6255,13 @@ @@ -6079,7 +6259,13 @@
moveBefore = true; moveBefore = true;
} }
@@ -658,7 +662,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if (element.pinned && this.tabContainer.verticalMode) { if (element.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer; return this.tabContainer.verticalPinnedTabsContainer;
} }
@@ -6139,7 +6321,7 @@ @@ -6139,7 +6325,7 @@
if (!this.isTab(aTab)) { if (!this.isTab(aTab)) {
throw new Error("Can only move a tab into a tab group"); throw new Error("Can only move a tab into a tab group");
} }
@@ -667,7 +671,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
return; return;
} }
if (aTab.group && aTab.group.id === aGroup.id) { if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6233,6 +6415,10 @@ @@ -6233,6 +6419,10 @@
moveActionCallback(); moveActionCallback();
@@ -678,7 +682,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// Clear tabs cache after moving nodes because the order of tabs may have // Clear tabs cache after moving nodes because the order of tabs may have
// changed. // changed.
this.tabContainer._invalidateCachedTabs(); this.tabContainer._invalidateCachedTabs();
@@ -6290,7 +6476,7 @@ @@ -6290,7 +6480,7 @@
createLazyBrowser, createLazyBrowser,
}; };
@@ -687,7 +691,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
if ( if (
elementIndex < numPinned || elementIndex < numPinned ||
(aTab.pinned && elementIndex == numPinned) (aTab.pinned && elementIndex == numPinned)
@@ -7050,7 +7236,7 @@ @@ -7050,7 +7240,7 @@
// preventDefault(). It will still raise the window if appropriate. // preventDefault(). It will still raise the window if appropriate.
break; break;
} }
@@ -696,7 +700,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
window.focus(); window.focus();
aEvent.preventDefault(); aEvent.preventDefault();
break; break;
@@ -7951,6 +8137,7 @@ @@ -7951,6 +8141,7 @@
aWebProgress.isTopLevel aWebProgress.isTopLevel
) { ) {
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
@@ -704,7 +708,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
gBrowser._tabAttrModified(this.mTab, ["busy"]); gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected; this.mTab._notselectedsinceload = !this.mTab.selected;
} }
@@ -8924,7 +9111,7 @@ var TabContextMenu = { @@ -8924,7 +9115,7 @@ var TabContextMenu = {
); );
contextUnpinSelectedTabs.hidden = contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected; !this.contextTab.pinned || !this.multiselected;
@@ -713,7 +717,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
// Move Tab items // Move Tab items
let contextMoveTabOptions = document.getElementById( let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions" "context_moveTabOptions"
@@ -8958,7 +9145,7 @@ var TabContextMenu = { @@ -8958,7 +9149,7 @@ var TabContextMenu = {
let isFirstTab = let isFirstTab =
!this.contextTabs[0].group && !this.contextTabs[0].group &&
(this.contextTabs[0] == visibleTabs[0] || (this.contextTabs[0] == visibleTabs[0] ||
@@ -722,7 +726,7 @@ index bfba253af3253a8cf547a5d69a1695651fc5c203..1ba8b8c51f27d92222f1e682681cf9c9
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent; contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled = document.getElementById("context_openTabInWindow").disabled =
@@ -9193,6 +9380,7 @@ var TabContextMenu = { @@ -9193,6 +9384,7 @@ var TabContextMenu = {
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP, telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
}); });
} else { } else {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1a977b7b1 100644 index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..eee9613b4405a8a301cef3db1ae6a3f9d21d56ac 100644
--- a/browser/components/tabbrowser/content/tabs.js --- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
@@ -37,6 +37,15 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let tabsPerRow = 0; let tabsPerRow = 0;
let position = 0; let position = 0;
for (let pinnedTab of pinnedTabs) { for (let pinnedTab of pinnedTabs) {
@@ -764,7 +765,7 @@
} else if (isTabGroupLabel(tab) && !tab.group.collapsed) {
this._lockTabSizing();
this.#keepTabSizeLocked = true;
- tab.group.collapsed = true;
+ tab.group.collapsed = !tab.group.hasAttribute("split-view-group");
expandGroupOnDrop = true;
}
}
@@ -913,6 +914,10 @@ @@ -913,6 +914,10 @@
} }
@@ -356,14 +365,16 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let shiftSizeX = tabWidth * movingTabs.length; let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight; let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth; dragData.tabWidth = tabWidth;
@@ -2375,11 +2408,15 @@ @@ -2374,12 +2407,16 @@
this.#clearDragOverCreateGroupTimer(); this.#clearDragOverCreateGroupTimer();
let isPinned = draggedTab.pinned; - let isPinned = draggedTab.pinned;
- let numPinned = gBrowser.pinnedTabCount; - let numPinned = gBrowser.pinnedTabCount;
- let tabs = this.ariaFocusableItems.slice( - let tabs = this.ariaFocusableItems.slice(
- isPinned ? 0 : numPinned, - isPinned ? 0 : numPinned,
- isPinned ? numPinned : undefined - isPinned ? numPinned : undefined
+ let isPinned = draggedTab?.group.pinned || draggedTab.pinned;
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed; + let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential"); + let essential = draggedTab.hasAttribute("zen-essential");
+ let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice( + let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(
@@ -385,7 +396,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let translateX = event.screenX - dragData.screenX; let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY; let translateY = event.screenY - dragData.screenY;
@@ -2407,6 +2444,12 @@ @@ -2407,10 +2444,19 @@
let lastTab = tabs.at(-1); let lastTab = tabs.at(-1);
let lastMovingTab = movingTabs.at(-1); let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0]; let firstMovingTab = movingTabs[0];
@@ -398,7 +409,24 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let endEdge = ele => ele[screenAxis] + bounds(ele)[size]; let endEdge = ele => ele[screenAxis] + bounds(ele)[size];
let lastMovingTabScreen = endEdge(lastMovingTab); let lastMovingTabScreen = endEdge(lastMovingTab);
let firstMovingTabScreen = firstMovingTab[screenAxis]; let firstMovingTabScreen = firstMovingTab[screenAxis];
@@ -2568,6 +2611,9 @@ let shiftSize = lastMovingTabScreen - firstMovingTabScreen;
+ if (firstMovingTab.hasAttribute("split-view-group")) {
+ shiftSize += 5; // A hack to allow more space for the group
+ }
let translate = screen - dragData[screenAxis];
if (!isPinned) {
translate +=
@@ -2431,6 +2477,9 @@
// Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement;
}
+ if (item.parentElement?.hasAttribute("split-view-group")) {
+ item = item.parentElement;
+ }
item.style.transform = `${translateAxis}(${translate}px)`;
}
@@ -2568,6 +2617,9 @@
break; break;
} }
let element = tabs[mid]; let element = tabs[mid];
@@ -408,7 +436,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let elementForSize = isTabGroupLabel(element) let elementForSize = isTabGroupLabel(element)
? element.parentElement ? element.parentElement
: element; : element;
@@ -2590,6 +2636,10 @@ @@ -2590,6 +2642,10 @@
if (!dropElement) { if (!dropElement) {
dropElement = this.ariaFocusableItems[oldDropElementIndex]; dropElement = this.ariaFocusableItems[oldDropElementIndex];
} }
@@ -419,7 +447,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
let newDropElementIndex = dropElement let newDropElementIndex = dropElement
? dropElement.elementIndex ? dropElement.elementIndex
: oldDropElementIndex; : oldDropElementIndex;
@@ -2598,7 +2648,7 @@ @@ -2598,7 +2654,7 @@
let shouldCreateGroupOnDrop; let shouldCreateGroupOnDrop;
let dropBefore; let dropBefore;
if (dropElement) { if (dropElement) {
@@ -428,7 +456,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
? dropElement.parentElement ? dropElement.parentElement
: dropElement; : dropElement;
@@ -2660,12 +2710,12 @@ @@ -2660,12 +2716,12 @@
} }
} }
@@ -443,7 +471,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
dropElement != draggedTab && dropElement != draggedTab &&
isTab(dropElement) && isTab(dropElement) &&
!dropElement?.group && !dropElement?.group &&
@@ -2735,7 +2785,7 @@ @@ -2735,7 +2791,7 @@
// Shift background tabs to leave a gap where the dragged tab // Shift background tabs to leave a gap where the dragged tab
// would currently be dropped. // would currently be dropped.
for (let item of tabs) { for (let item of tabs) {
@@ -452,7 +480,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
continue; continue;
} }
@@ -2744,6 +2794,9 @@ @@ -2744,6 +2800,9 @@
if (isTabGroupLabel(item)) { if (isTabGroupLabel(item)) {
// Shift the `.tab-group-label-container` to shift the label element. // Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement; item = item.parentElement;
@@ -462,7 +490,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
} }
item.style.transform = transform; item.style.transform = transform;
} }
@@ -2796,8 +2849,9 @@ @@ -2796,8 +2855,9 @@
); );
} }
@@ -474,7 +502,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
return; return;
} }
@@ -2809,6 +2863,12 @@ @@ -2809,6 +2869,12 @@
item = item.parentElement; item = item.parentElement;
} }
item.style.transform = ""; item.style.transform = "";
@@ -487,7 +515,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
item.removeAttribute("dragover-createGroup"); item.removeAttribute("dragover-createGroup");
} }
this.removeAttribute("movingtab-createGroup"); this.removeAttribute("movingtab-createGroup");
@@ -2855,7 +2915,7 @@ @@ -2855,7 +2921,7 @@
let postTransitionCleanup = () => { let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false; movingTab._moveTogetherSelectedTabsData.animate = false;
}; };
@@ -496,7 +524,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
postTransitionCleanup(); postTransitionCleanup();
} else { } else {
let onTransitionEnd = transitionendEvent => { let onTransitionEnd = transitionendEvent => {
@@ -3028,7 +3088,7 @@ @@ -3028,7 +3094,7 @@
} }
_notifyBackgroundTab(aTab) { _notifyBackgroundTab(aTab) {
@@ -505,3 +533,13 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..5ba36f48da0d85cf9be1abcd8d5446e1
return; return;
} }
@@ -3154,6 +3220,9 @@
return null;
}
}
+ if (target?.group?.hasAttribute("split-view-group")) {
+ target = target.group.labelElement;
+ }
return target;
}

View File

@@ -163,7 +163,7 @@
@media (-moz-windows-mica) or (-moz-platform: macos) { @media (-moz-windows-mica) or (-moz-platform: macos) {
background: transparent; background: transparent;
--zen-themed-toolbar-bg-transparent: transparent; --zen-themed-toolbar-bg-transparent: transparent;
@media -moz-pref("widget.windows.mica.toplevel-backdrop", 2) { @media -moz-pref('widget.windows.mica.toplevel-backdrop', 2) {
--zen-themed-toolbar-bg-transparent: color-mix(in srgb, var(--zen-themed-toolbar-bg) 35%, transparent 65%); --zen-themed-toolbar-bg-transparent: color-mix(in srgb, var(--zen-themed-toolbar-bg) 35%, transparent 65%);
} }
} }

View File

@@ -4,6 +4,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
tab-group {
& .tabbrowser-tab {
margin-inline-start: 0 !important;
}
}
tab-group[split-view-group] { tab-group[split-view-group] {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;

View File

@@ -271,7 +271,7 @@
this.closingGlance = true; this.closingGlance = true;
this._animating = true; this._animating = true;
gBrowser._insertTabAtIndex(this.#currentTab, { gBrowser.zenInsertTabAtIndex(this.#currentTab, {
index: this.getTabPosition(this.#currentParentTab), index: this.getTabPosition(this.#currentParentTab),
}); });
@@ -564,7 +564,7 @@
this.animatingFullOpen = true; this.animatingFullOpen = true;
this.#currentTab.setAttribute('zen-dont-split-glance', true); this.#currentTab.setAttribute('zen-dont-split-glance', true);
gBrowser._insertTabAtIndex(this.#currentTab, { gBrowser.zenInsertTabAtIndex(this.#currentTab, {
index: this.getTabPosition(this.#currentTab), index: this.getTabPosition(this.#currentTab),
}); });

View File

@@ -332,7 +332,7 @@
} }
async _onTabMove(tab) { async _onTabMove(tab) {
if (!tab.pinned) { if (!tab.pinned || !this._pinsCache) {
return; return;
} }
@@ -731,6 +731,18 @@
event.target.closest('#vertical-pinned-tabs-container') || event.target.closest('.zen-current-workspace-indicator'); event.target.closest('#vertical-pinned-tabs-container') || event.target.closest('.zen-current-workspace-indicator');
const essentialTabsTarget = event.target.closest('#zen-essentials-container'); const essentialTabsTarget = event.target.closest('#zen-essentials-container');
const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox'); const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox');
// Remove group labels from the moving tabs and replace it
// with the sub tabs
for (let i = 0; i < movingTabs.length; i++) {
const draggedTab = movingTabs[i];
if (draggedTab.classList.contains('tab-group-label')) {
const group = draggedTab.group;
// remove label and add sub tabs to moving tabs
if (group) {
movingTabs.splice(i, 1, ...group.tabs);
}
}
}
let isVertical = this.expandedSidebarMode; let isVertical = this.expandedSidebarMode;
let moved = false; let moved = false;
@@ -905,6 +917,7 @@
const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox'); const tabsTarget = event.target.closest('#tabbrowser-arrowscrollbox');
let targetTab = event.target.closest('.tabbrowser-tab'); let targetTab = event.target.closest('.tabbrowser-tab');
targetTab = targetTab?.group || targetTab; targetTab = targetTab?.group || targetTab;
draggedTab = draggedTab?.group?.hasAttribute('split-view-group') ? draggedTab.group : draggedTab;
if (event.target.closest('.zen-current-workspace-indicator')) { if (event.target.closest('.zen-current-workspace-indicator')) {
this.removeTabContainersDragoverClass(); this.removeTabContainersDragoverClass();
ZenWorkspaces.activeWorkspaceIndicator?.setAttribute('open', true); ZenWorkspaces.activeWorkspaceIndicator?.setAttribute('open', true);