mirror of
https://github.com/zen-browser/desktop.git
synced 2025-11-23 10:36:16 +00:00
test: Added more tests for glance, b=(no-bug), c=tests, scripts, tabs, glance, workspaces
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247ecdebcfc 100644
|
||||
index d5aa64842a35c6697263c63fd3a0571b64b01344..bcae8a44593d7b3e5efdd999b4c2f5bcac221632 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -413,11 +413,45 @@
|
||||
@@ -413,11 +413,41 @@
|
||||
return this.tabContainer.visibleTabs;
|
||||
}
|
||||
|
||||
+ zenInsertTabAtIndex(...args) {
|
||||
+ return this.#insertTabAtIndex(...args);
|
||||
+ }
|
||||
+
|
||||
+ get _numVisiblePinTabsWithoutCollapsed() {
|
||||
+ let i = 0;
|
||||
+ for (let item of this.tabContainer.ariaFocusableItems) {
|
||||
@@ -50,7 +46,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
return i;
|
||||
}
|
||||
@@ -569,6 +603,7 @@
|
||||
@@ -569,6 +599,7 @@
|
||||
this.tabpanels.appendChild(panel);
|
||||
|
||||
let tab = this.tabs[0];
|
||||
@@ -58,7 +54,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
tab.linkedPanel = uniqueId;
|
||||
this._selectedTab = tab;
|
||||
this._selectedBrowser = browser;
|
||||
@@ -834,11 +869,13 @@
|
||||
@@ -834,11 +865,13 @@
|
||||
}
|
||||
|
||||
this.showTab(aTab);
|
||||
@@ -75,7 +71,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
this.moveTabTo(aTab, {
|
||||
tabIndex: this.pinnedTabCount,
|
||||
forceUngrouped: true,
|
||||
@@ -855,12 +892,15 @@
|
||||
@@ -855,12 +888,15 @@
|
||||
}
|
||||
|
||||
if (this.tabContainer.verticalMode) {
|
||||
@@ -92,7 +88,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
});
|
||||
} else {
|
||||
this.moveTabTo(aTab, {
|
||||
@@ -1044,6 +1084,8 @@
|
||||
@@ -1044,6 +1080,8 @@
|
||||
|
||||
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
|
||||
|
||||
@@ -101,7 +97,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (
|
||||
aIconURL &&
|
||||
!aLoadingPrincipal &&
|
||||
@@ -1054,6 +1096,9 @@
|
||||
@@ -1054,6 +1092,9 @@
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -111,7 +107,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
|
||||
let browser = this.getBrowserForTab(aTab);
|
||||
browser.mIconURL = aIconURL;
|
||||
@@ -1303,6 +1348,7 @@
|
||||
@@ -1303,6 +1344,7 @@
|
||||
if (!this._previewMode) {
|
||||
newTab.recordTimeFromUnloadToReload();
|
||||
newTab.updateLastAccessed();
|
||||
@@ -119,7 +115,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
oldTab.updateLastAccessed();
|
||||
// if this is the foreground window, update the last-seen timestamps.
|
||||
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
|
||||
@@ -1455,6 +1501,9 @@
|
||||
@@ -1455,6 +1497,9 @@
|
||||
}
|
||||
|
||||
let activeEl = document.activeElement;
|
||||
@@ -129,7 +125,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// If focus is on the old tab, move it to the new tab.
|
||||
if (activeEl == oldTab) {
|
||||
newTab.focus();
|
||||
@@ -1778,7 +1827,8 @@
|
||||
@@ -1778,7 +1823,8 @@
|
||||
}
|
||||
|
||||
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
|
||||
@@ -139,7 +135,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1886,7 +1936,7 @@
|
||||
@@ -1886,7 +1932,7 @@
|
||||
newIndex = this.selectedTab._tPos + 1;
|
||||
}
|
||||
|
||||
@@ -148,7 +144,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (this.isTabGroupLabel(targetTab)) {
|
||||
throw new Error(
|
||||
"Replacing a tab group label with a tab is not supported"
|
||||
@@ -2150,6 +2200,7 @@
|
||||
@@ -2150,6 +2196,7 @@
|
||||
uriIsAboutBlank,
|
||||
userContextId,
|
||||
skipLoad,
|
||||
@@ -156,7 +152,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} = {}) {
|
||||
let b = document.createXULElement("browser");
|
||||
// Use the JSM global to create the permanentKey, so that if the
|
||||
@@ -2223,8 +2274,7 @@
|
||||
@@ -2223,8 +2270,7 @@
|
||||
// we use a different attribute name for this?
|
||||
b.setAttribute("name", name);
|
||||
}
|
||||
@@ -166,7 +162,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
b.setAttribute("transparent", "true");
|
||||
}
|
||||
|
||||
@@ -2389,7 +2439,7 @@
|
||||
@@ -2389,7 +2435,7 @@
|
||||
|
||||
let panel = this.getPanel(browser);
|
||||
let uniqueId = this._generateUniquePanelID();
|
||||
@@ -175,7 +171,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
aTab.linkedPanel = uniqueId;
|
||||
|
||||
// Inject the <browser> into the DOM if necessary.
|
||||
@@ -2448,8 +2498,8 @@
|
||||
@@ -2448,8 +2494,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) {
|
||||
@@ -186,7 +182,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} else {
|
||||
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
|
||||
}
|
||||
@@ -2680,6 +2730,7 @@
|
||||
@@ -2680,6 +2726,7 @@
|
||||
schemelessInput,
|
||||
hasValidUserGestureActivation = false,
|
||||
textDirectiveUserActivation = false,
|
||||
@@ -194,7 +190,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} = {}
|
||||
) {
|
||||
// all callers of addTab that pass a params object need to pass
|
||||
@@ -2690,6 +2741,12 @@
|
||||
@@ -2690,6 +2737,12 @@
|
||||
);
|
||||
}
|
||||
|
||||
@@ -207,7 +203,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (!UserInteraction.running("browser.tabs.opening", window)) {
|
||||
UserInteraction.start("browser.tabs.opening", "initting", window);
|
||||
}
|
||||
@@ -2753,6 +2810,16 @@
|
||||
@@ -2753,6 +2806,16 @@
|
||||
noInitialLabel,
|
||||
skipBackgroundNotify,
|
||||
});
|
||||
@@ -224,7 +220,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (insertTab) {
|
||||
// Insert the tab into the tab container in the correct position.
|
||||
// For now, we support `index` as an alias for `tabIndex`.
|
||||
@@ -2783,6 +2850,7 @@
|
||||
@@ -2783,6 +2846,7 @@
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
triggeringRemoteType,
|
||||
@@ -232,7 +228,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}));
|
||||
|
||||
if (focusUrlBar) {
|
||||
@@ -2902,6 +2970,12 @@
|
||||
@@ -2902,6 +2966,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,7 +241,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// Additionally send pinned tab events
|
||||
if (pinned) {
|
||||
this._notifyPinnedStatus(t);
|
||||
@@ -2990,10 +3064,10 @@
|
||||
@@ -2990,10 +3060,10 @@
|
||||
isAdoptingGroup = false,
|
||||
isUserTriggered = false,
|
||||
telemetryUserCreateSource = "unknown",
|
||||
@@ -257,7 +253,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
|
||||
if (!color) {
|
||||
@@ -3014,7 +3088,12 @@
|
||||
@@ -3014,7 +3084,12 @@
|
||||
label,
|
||||
isAdoptingGroup
|
||||
);
|
||||
@@ -271,7 +267,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
group,
|
||||
insertBefore?.group ?? insertBefore
|
||||
);
|
||||
@@ -3303,6 +3382,7 @@
|
||||
@@ -3303,6 +3378,7 @@
|
||||
openWindowInfo,
|
||||
skipLoad,
|
||||
triggeringRemoteType,
|
||||
@@ -279,7 +275,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
) {
|
||||
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
|
||||
@@ -3372,6 +3452,7 @@
|
||||
@@ -3372,6 +3448,7 @@
|
||||
openWindowInfo,
|
||||
name,
|
||||
skipLoad,
|
||||
@@ -287,7 +283,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3560,7 +3641,7 @@
|
||||
@@ -3560,7 +3637,7 @@
|
||||
// Add a new tab if needed.
|
||||
if (!tab) {
|
||||
let createLazyBrowser =
|
||||
@@ -296,7 +292,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
|
||||
let url = "about:blank";
|
||||
if (tabData.entries?.length) {
|
||||
@@ -3598,7 +3679,29 @@
|
||||
@@ -3598,7 +3675,29 @@
|
||||
skipLoad: true,
|
||||
preferredRemoteType,
|
||||
});
|
||||
@@ -326,7 +322,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (select) {
|
||||
tabToSelect = tab;
|
||||
}
|
||||
@@ -3622,7 +3725,8 @@
|
||||
@@ -3622,7 +3721,8 @@
|
||||
// needs calling:
|
||||
shouldUpdateForPinnedTabs = true;
|
||||
}
|
||||
@@ -336,7 +332,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
let { groupId } = tabData;
|
||||
const tabGroup = tabGroupWorkingData.get(groupId);
|
||||
// if a tab refers to a tab group we don't know, skip any group
|
||||
@@ -3636,7 +3740,10 @@
|
||||
@@ -3636,7 +3736,10 @@
|
||||
tabGroup.stateData.id,
|
||||
tabGroup.stateData.color,
|
||||
tabGroup.stateData.collapsed,
|
||||
@@ -348,7 +344,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
);
|
||||
tabsFragment.appendChild(tabGroup.node);
|
||||
}
|
||||
@@ -3684,8 +3791,16 @@
|
||||
@@ -3684,8 +3787,16 @@
|
||||
// to remove the old selected tab.
|
||||
if (tabToSelect) {
|
||||
let leftoverTab = this.selectedTab;
|
||||
@@ -367,7 +363,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
@@ -3881,7 +3996,7 @@
|
||||
@@ -3881,7 +3992,7 @@
|
||||
// Ensure we have an index if one was not provided.
|
||||
if (typeof elementIndex != "number" && typeof tabIndex != "number") {
|
||||
// Move the new tab after another tab if needed, to the end otherwise.
|
||||
@@ -376,7 +372,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (
|
||||
!bulkOrderedOpen &&
|
||||
((openerTab &&
|
||||
@@ -3904,7 +4019,7 @@
|
||||
@@ -3904,7 +4015,7 @@
|
||||
) {
|
||||
elementIndex = Infinity;
|
||||
} else if (previousTab.visible) {
|
||||
@@ -385,7 +381,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} else if (previousTab == FirefoxViewHandler.tab) {
|
||||
elementIndex = 0;
|
||||
}
|
||||
@@ -3932,14 +4047,14 @@
|
||||
@@ -3932,10 +4043,10 @@
|
||||
}
|
||||
// Ensure index is within bounds.
|
||||
if (tab.pinned) {
|
||||
@@ -399,12 +395,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
index = Math.min(index, allItems.length);
|
||||
}
|
||||
/** @type {MozTabbrowserTab|undefined} */
|
||||
- let itemAfter = allItems.at(index);
|
||||
+ let itemAfter = allItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index);
|
||||
|
||||
// Prevent a flash of unstyled content by setting up the tab content
|
||||
// and inherited attributes before appending it (see Bug 1592054):
|
||||
@@ -3947,7 +4062,7 @@
|
||||
@@ -3947,7 +4058,7 @@
|
||||
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
|
||||
@@ -413,7 +404,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
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);
|
||||
@@ -4268,6 +4383,9 @@
|
||||
@@ -4268,6 +4379,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -423,7 +414,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
this.removeTabs(selectedTabs, { telemetrySource });
|
||||
}
|
||||
|
||||
@@ -4520,6 +4638,7 @@
|
||||
@@ -4520,6 +4634,7 @@
|
||||
telemetrySource,
|
||||
} = {}
|
||||
) {
|
||||
@@ -431,7 +422,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
|
||||
// can be considered equivalent to closing the window.
|
||||
if (
|
||||
@@ -4604,6 +4723,7 @@
|
||||
@@ -4604,6 +4719,7 @@
|
||||
if (lastToClose) {
|
||||
this.removeTab(lastToClose, aParams);
|
||||
}
|
||||
@@ -439,7 +430,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -4641,6 +4761,12 @@
|
||||
@@ -4641,6 +4757,12 @@
|
||||
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
|
||||
}
|
||||
|
||||
@@ -452,7 +443,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// Handle requests for synchronously removing an already
|
||||
// asynchronously closing tab.
|
||||
if (!animate && aTab.closing) {
|
||||
@@ -4655,7 +4781,9 @@
|
||||
@@ -4655,7 +4777,9 @@
|
||||
// frame created for it (for example, by updating the visually selected
|
||||
// state).
|
||||
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
|
||||
@@ -463,7 +454,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (
|
||||
!this._beginRemoveTab(aTab, {
|
||||
closeWindowFastpath: true,
|
||||
@@ -4821,7 +4949,7 @@
|
||||
@@ -4821,7 +4945,7 @@
|
||||
closeWindowWithLastTab != null
|
||||
? closeWindowWithLastTab
|
||||
: !window.toolbar.visible ||
|
||||
@@ -472,7 +463,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
|
||||
if (closeWindow) {
|
||||
// We've already called beforeunload on all the relevant tabs if we get here,
|
||||
@@ -4845,6 +4973,7 @@
|
||||
@@ -4845,6 +4969,7 @@
|
||||
|
||||
newTab = true;
|
||||
}
|
||||
@@ -480,7 +471,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
aTab._endRemoveArgs = [closeWindow, newTab];
|
||||
|
||||
// swapBrowsersAndCloseOther will take care of closing the window without animation.
|
||||
@@ -4885,9 +5014,7 @@
|
||||
@@ -4885,9 +5010,7 @@
|
||||
aTab._mouseleave();
|
||||
|
||||
if (newTab) {
|
||||
@@ -491,7 +482,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} else {
|
||||
TabBarVisibility.update();
|
||||
}
|
||||
@@ -5016,6 +5143,8 @@
|
||||
@@ -5016,6 +5139,8 @@
|
||||
this.tabs[i]._tPos = i;
|
||||
}
|
||||
|
||||
@@ -500,7 +491,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (!this._windowIsClosing) {
|
||||
if (wasPinned) {
|
||||
this.tabContainer._positionPinnedTabs();
|
||||
@@ -5141,8 +5270,8 @@
|
||||
@@ -5141,8 +5266,8 @@
|
||||
return closedCount;
|
||||
}
|
||||
|
||||
@@ -511,7 +502,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (unloadBlocked) {
|
||||
return;
|
||||
}
|
||||
@@ -5230,6 +5359,7 @@
|
||||
@@ -5230,6 +5355,7 @@
|
||||
}
|
||||
|
||||
let excludeTabs = new Set(aExcludeTabs);
|
||||
@@ -519,7 +510,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
|
||||
// If this tab has a successor, it should be selectable, since
|
||||
// hiding or closing a tab removes that tab as a successor.
|
||||
@@ -5242,13 +5372,13 @@
|
||||
@@ -5242,13 +5368,13 @@
|
||||
!excludeTabs.has(aTab.owner) &&
|
||||
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
|
||||
) {
|
||||
@@ -535,7 +526,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
);
|
||||
|
||||
let tab = this.tabContainer.findNextTab(aTab, {
|
||||
@@ -5264,7 +5394,7 @@
|
||||
@@ -5264,7 +5390,7 @@
|
||||
}
|
||||
|
||||
if (tab) {
|
||||
@@ -544,7 +535,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
|
||||
// If no qualifying visible tab was found, see if there is a tab in
|
||||
@@ -5285,7 +5415,7 @@
|
||||
@@ -5285,7 +5411,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -553,7 +544,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
}
|
||||
|
||||
_blurTab(aTab) {
|
||||
@@ -5686,10 +5816,10 @@
|
||||
@@ -5686,10 +5812,10 @@
|
||||
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
|
||||
}
|
||||
|
||||
@@ -566,7 +557,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
aTab.selected ||
|
||||
aTab.closing ||
|
||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||
@@ -5986,7 +6116,7 @@
|
||||
@@ -5986,7 +6112,7 @@
|
||||
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (this.isTab(element) && element.pinned) {
|
||||
@@ -575,13 +566,13 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
} else {
|
||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||
}
|
||||
@@ -6012,10 +6142,16 @@
|
||||
@@ -6012,10 +6138,16 @@
|
||||
this.#handleTabMove(
|
||||
element,
|
||||
() => {
|
||||
- let neighbor = this.tabs[tabIndex];
|
||||
- if (forceUngrouped && neighbor?.group) {
|
||||
+ let neighbor = gZenGlanceManager.getTabOrGlanceParent(this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[tabIndex]);
|
||||
+ let neighbor = gZenGlanceManager.getTabOrGlanceParent(this.tabs[tabIndex]);
|
||||
+ if ((forceUngrouped && neighbor?.group) || neighbor?.group?.hasAttribute("split-view-group")) {
|
||||
neighbor = neighbor.group;
|
||||
}
|
||||
@@ -594,7 +585,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||
neighbor.after(element);
|
||||
} else {
|
||||
@@ -6084,7 +6220,9 @@
|
||||
@@ -6084,17 +6216,26 @@
|
||||
targetElement = targetElement.group;
|
||||
}
|
||||
}
|
||||
@@ -604,8 +595,12 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
+ }
|
||||
// Don't allow mixing pinned and unpinned tabs.
|
||||
if (element.pinned && !targetElement?.pinned) {
|
||||
targetElement = this.tabs[this.pinnedTabCount - 1];
|
||||
@@ -6094,7 +6232,14 @@
|
||||
- targetElement = this.tabs[this.pinnedTabCount - 1];
|
||||
+ targetElement = this.tabs.filter(tab => !tab.hasAttribute('zen-glance-tab'))[this.pinnedTabCount - 1];
|
||||
moveBefore = false;
|
||||
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
||||
- targetElement = this.tabs[this.pinnedTabCount];
|
||||
+ targetElement = this.tabs.filter(tab => !tab.hasAttribute('zen-glance-tab'))[this.pinnedTabCount];
|
||||
moveBefore = true;
|
||||
}
|
||||
|
||||
@@ -620,7 +615,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
if (element.pinned && this.tabContainer.verticalMode) {
|
||||
return this.tabContainer.verticalPinnedTabsContainer;
|
||||
}
|
||||
@@ -6154,7 +6299,7 @@
|
||||
@@ -6154,7 +6295,7 @@
|
||||
if (!this.isTab(aTab)) {
|
||||
throw new Error("Can only move a tab into a tab group");
|
||||
}
|
||||
@@ -629,7 +624,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -6248,6 +6393,10 @@
|
||||
@@ -6248,6 +6389,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
@@ -640,7 +635,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -7145,7 +7294,7 @@
|
||||
@@ -7145,7 +7290,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
@@ -649,7 +644,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -8044,6 +8193,7 @@
|
||||
@@ -8044,6 +8189,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
@@ -657,7 +652,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -9009,7 +9159,7 @@ var TabContextMenu = {
|
||||
@@ -9009,7 +9155,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
@@ -666,7 +661,7 @@ index d5aa64842a35c6697263c63fd3a0571b64b01344..7e9aa77a5ea59b9002c7ce4b88432247
|
||||
// Move Tab items
|
||||
let contextMoveTabOptions = document.getElementById(
|
||||
"context_moveTabOptions"
|
||||
@@ -9278,6 +9428,7 @@ var TabContextMenu = {
|
||||
@@ -9278,6 +9424,7 @@ var TabContextMenu = {
|
||||
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user