chore: More patch fixes for firefox beta, b=(no-bug), c=common

This commit is contained in:
Mr. M 2025-04-18 20:43:44 +02:00
parent a2810d65de
commit ec3e2ab870
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
8 changed files with 200 additions and 222 deletions

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d88986bcc 100644
index 91088fab1759b9af908912648d28daa5938a29c9..999c1950e25560164463ac57773ca7fedac6255f 100644
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
@ -19,7 +19,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
const kSpecialWidgetPfx = "customizableui-special-";
@@ -317,13 +318,11 @@ var CustomizableUIInternal = {
@@ -338,13 +339,11 @@ var CustomizableUIInternal = {
"vertical-spacer",
"urlbar-container",
"spring",
@ -35,7 +35,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
this.registerArea(
CustomizableUI.AREA_NAVBAR,
{
@@ -331,7 +330,6 @@ var CustomizableUIInternal = {
@@ -352,7 +351,6 @@ var CustomizableUIInternal = {
overflowable: true,
defaultPlacements: navbarPlacements,
verticalTabsDefaultPlacements: [
@ -43,7 +43,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
"alltabs-button",
],
defaultCollapsed: false,
@@ -356,10 +354,7 @@ var CustomizableUIInternal = {
@@ -377,10 +375,7 @@ var CustomizableUIInternal = {
{
type: CustomizableUI.TYPE_TOOLBAR,
defaultPlacements: [
@ -54,7 +54,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
],
verticalTabsDefaultPlacements: [],
defaultCollapsed: null,
@@ -422,6 +417,7 @@ var CustomizableUIInternal = {
@@ -462,6 +457,7 @@ var CustomizableUIInternal = {
CustomizableUI.AREA_NAVBAR,
CustomizableUI.AREA_BOOKMARKS,
CustomizableUI.AREA_TABSTRIP,
@ -62,7 +62,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
]);
if (AppConstants.platform != "macosx") {
toolbars.add(CustomizableUI.AREA_MENUBAR);
@@ -1151,6 +1147,9 @@ var CustomizableUIInternal = {
@@ -1262,6 +1258,9 @@ var CustomizableUIInternal = {
placements = gPlacements.get(area);
}
@ -72,7 +72,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
// For toolbars that need it, mark as dirty.
let defaultPlacements = areaProperties.get("defaultPlacements");
if (
@@ -1564,7 +1563,7 @@ var CustomizableUIInternal = {
@@ -1769,7 +1768,7 @@ var CustomizableUIInternal = {
lazy.log.info(
"Widget " + aWidgetId + " not found, unable to remove from " + aArea
);
@ -81,7 +81,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
}
this.notifyDOMChange(widgetNode, null, container, true, () => {
@@ -1574,7 +1573,7 @@ var CustomizableUIInternal = {
@@ -1779,7 +1778,7 @@ var CustomizableUIInternal = {
// We also need to remove the panel context menu if it's there:
this.ensureButtonContextMenu(widgetNode);
if (gPalette.has(aWidgetId) || this.isSpecialWidget(aWidgetId)) {
@ -90,7 +90,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
} else {
window.gNavToolbox.palette.appendChild(widgetNode);
}
@@ -1704,16 +1703,16 @@ var CustomizableUIInternal = {
@@ -1947,16 +1946,16 @@ var CustomizableUIInternal = {
elem.setAttribute("skipintoolbarset", "true");
}
}
@ -110,18 +110,18 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
// Handle initial state of vertical tabs.
if (isVerticalTabs) {
// Show the vertical tabs toolbar
@@ -1873,6 +1872,10 @@ var CustomizableUIInternal = {
},
insertWidgetBefore(aNode, aNextNode, aContainer, aArea) {
@@ -2198,6 +2197,10 @@ var CustomizableUIInternal = {
* The identifier string of the area that aNode is being inserted into.
*/
insertWidgetBefore(aNode, aNextNode, aContainer, aAreaId) {
+ if (aArea === CustomizableUI.AREA_NAVBAR && aNode.ownerGlobal.gZenVerticalTabsManager._hasSetSingleToolbar) {
+ aContainer = aNode.ownerDocument.getElementById("zen-sidebar-top-buttons-customization-target");
+ aArea = "zen-sidebar-top-buttons";
+ }
this.notifyDOMChange(aNode, aNextNode, aContainer, false, () => {
this.setLocationAttributes(aNode, aArea);
this.setLocationAttributes(aNode, aAreaId);
aContainer.insertBefore(aNode, aNextNode);
@@ -2744,7 +2747,6 @@ var CustomizableUIInternal = {
@@ -3321,7 +3324,6 @@ var CustomizableUIInternal = {
if (!this.isWidgetRemovable(aWidgetId)) {
return;
}
@ -129,16 +129,16 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
let placements = gPlacements.get(oldPlacement.area);
let position = placements.indexOf(aWidgetId);
if (position != -1) {
@@ -3735,7 +3737,7 @@ var CustomizableUIInternal = {
}
},
@@ -4556,7 +4558,7 @@ var CustomizableUIInternal = {
* For all registered areas, builds those areas to reflect the current
* placement state of all widgets.
*/
- _rebuildRegisteredAreas() {
+ _rebuildRegisteredAreas(zenDontRebuildCollapsed = false) {
for (let [areaId, areaNodes] of gBuildAreas) {
let placements = gPlacements.get(areaId);
let isFirstChangedToolbar = true;
@@ -3746,7 +3748,7 @@ var CustomizableUIInternal = {
@@ -4567,7 +4569,7 @@ var CustomizableUIInternal = {
if (area.get("type") == CustomizableUI.TYPE_TOOLBAR) {
let defaultCollapsed = area.get("defaultCollapsed");
let win = areaNode.ownerGlobal;
@ -147,7 +147,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
win.setToolbarVisibility(
areaNode,
typeof defaultCollapsed == "string"
@@ -4923,6 +4925,7 @@ export var CustomizableUI = {
@@ -5858,6 +5860,7 @@ export var CustomizableUI = {
unregisterArea(aName, aDestroyPlacements) {
CustomizableUIInternal.unregisterArea(aName, aDestroyPlacements);
},
@ -155,7 +155,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
/**
* Add a widget to an area.
* If the area to which you try to add is not known to CustomizableUI,
@@ -6916,11 +6919,11 @@ class OverflowableToolbar {
@@ -7905,11 +7908,11 @@ class OverflowableToolbar {
parseFloat(style.paddingLeft) -
parseFloat(style.paddingRight) -
toolbarChildrenWidth;
@ -169,7 +169,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
});
lazy.log.debug(
@@ -6930,7 +6933,8 @@ class OverflowableToolbar {
@@ -7919,7 +7922,8 @@ class OverflowableToolbar {
// If the target has min-width: 0, their children might actually overflow
// it, so check for both cases explicitly.
let targetContentWidth = Math.max(targetWidth, targetChildrenWidth);
@ -179,7 +179,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
return { isOverflowing, targetContentWidth, totalAvailWidth };
}
@@ -7024,7 +7028,7 @@ class OverflowableToolbar {
@@ -8013,7 +8017,7 @@ class OverflowableToolbar {
}
}
if (!inserted) {
@ -188,7 +188,7 @@ index 9392b42a1de7310719a6cc8aaf11bd857e8fa69a..1c5b80678fc3a4d17b0632a765b8182d
}
child.removeAttribute("cui-anchorid");
child.removeAttribute("overflowedItem");
@@ -7369,7 +7373,7 @@ class OverflowableToolbar {
@@ -8358,7 +8362,7 @@ class OverflowableToolbar {
break;
}
case "mousedown": {

View file

@ -1,9 +1,9 @@
diff --git a/browser/components/customizableui/CustomizeMode.sys.mjs b/browser/components/customizableui/CustomizeMode.sys.mjs
index c9bdc165ff9afc8c3e43ed2cda0612b32a55450f..34f8af56753e2a898f49247036d47973c70543a9 100644
index 619bb2af5a3a0995fc93fa040696dd2854848ab5..bbc6bad906e9ccaf668ca99f4a0411f564ef1e56 100644
--- a/browser/components/customizableui/CustomizeMode.sys.mjs
+++ b/browser/components/customizableui/CustomizeMode.sys.mjs
@@ -357,7 +357,7 @@ CustomizeMode.prototype = {
this._transitioning = true;
@@ -500,7 +500,7 @@ export class CustomizeMode {
this.#transitioning = true;
let customizer = document.getElementById("customization-container");
- let browser = document.getElementById("browser");
@ -11,7 +11,7 @@ index c9bdc165ff9afc8c3e43ed2cda0612b32a55450f..34f8af56753e2a898f49247036d47973
browser.hidden = true;
customizer.hidden = false;
@@ -488,7 +488,7 @@ CustomizeMode.prototype = {
@@ -637,7 +637,7 @@ export class CustomizeMode {
}
let customizer = document.getElementById("customization-container");
@ -20,9 +20,9 @@ index c9bdc165ff9afc8c3e43ed2cda0612b32a55450f..34f8af56753e2a898f49247036d47973
customizer.hidden = true;
browser.hidden = false;
@@ -2397,6 +2397,20 @@ CustomizeMode.prototype = {
@@ -3125,6 +3125,20 @@ export class CustomizeMode {
if (makeSpaceImmediately) {
aItem.setAttribute("notransition", "true");
aDraggedOverItem.setAttribute("notransition", "true");
}
+ if (aItem.parentElement.id === "TabsToolbar-customization-target") {
+ // We change the border values so we can properly implement the native vertical tabs
@ -38,6 +38,6 @@ index c9bdc165ff9afc8c3e43ed2cda0612b32a55450f..34f8af56753e2a898f49247036d47973
+ aItem.style.borderBottomStyle = "solid";
+ }
+ }
aItem.style[prop] = borderWidth + "px";
aItem.style.removeProperty(otherProp);
aDraggedOverItem.style[prop] = borderWidth + "px";
aDraggedOverItem.style.removeProperty(otherProp);
if (makeSpaceImmediately) {

View file

@ -1,10 +1,10 @@
diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn
index 3b60d18e483bc3c4e9b4309f0dc1e4231b7116b1..e5b679b25941a7f1ed52db9fa3f7740a7220b9e4 100644
index 118709048e7de13f6ac10d0047e446b72303428f..c8cc2d7ee551b96be668a7844dab1db5abc9d684 100644
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -23,3 +23,5 @@ browser.jar:
content/browser/preferences/more-from-mozilla-qr-code-simple-cn.svg
content/browser/preferences/web-appearance-dark.svg
content/browser/preferences/web-appearance-light.svg
@@ -26,3 +26,5 @@ browser.jar:
content/browser/preferences/widgets/setting-control.mjs (widgets/setting-control/setting-control.mjs)
content/browser/preferences/widgets/setting-group.mjs (widgets/setting-group/setting-group.mjs)
content/browser/preferences/widgets/setting-group.css (widgets/setting-group/setting-group.css)
+
+ content/browser/preferences/zen-settings.js

View file

@ -1,17 +1,17 @@
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
index 951af951598c3edc9bc431dd106e68d006ec4316..eb420d6c5ea346639eee531805aabbe7726c7769 100644
index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2590c1705 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -43,6 +43,8 @@
/>
@@ -44,6 +44,8 @@
<link rel="stylesheet" href="chrome://browser/skin/preferences/privacy.css" />
<link rel="stylesheet" href="chrome://browser/content/preferences/widgets/setting-group.css" />
+#include zen-preferences-links.xhtml
+
<link rel="localization" href="branding/brand.ftl"/>
<link rel="localization" href="browser/browser.ftl"/>
<!-- Used by fontbuilder.js -->
@@ -98,6 +100,12 @@
@@ -105,6 +107,11 @@
<hbox flex="1">
<vbox class="navigation">
@ -20,11 +20,10 @@ index 951af951598c3edc9bc431dd106e68d006ec4316..eb420d6c5ea346639eee531805aabbe7
+ data-l10n-id="search-input-box2"
+ data-l10n-attrs="placeholder, style"
+ />
+
<!-- category list -->
<richlistbox id="categories" data-l10n-id="category-list" data-l10n-attrs="aria-label">
<richlistitem id="category-general"
@@ -111,6 +119,50 @@
@@ -117,6 +124,50 @@
<label class="category-name" flex="1" data-l10n-id="pane-general-title"></label>
</richlistitem>
@ -75,21 +74,19 @@ index 951af951598c3edc9bc431dd106e68d006ec4316..eb420d6c5ea346639eee531805aabbe7
<richlistitem id="category-home"
class="category"
value="paneHome"
@@ -229,11 +281,13 @@
@@ -228,11 +279,6 @@
<html:a href="about:policies" target="_blank" data-l10n-id="managed-notice"/>
</hbox>
</hbox>
+#if 0
<search-textbox
id="searchInput"
data-l10n-id="search-input-box2"
data-l10n-attrs="placeholder, style"
/>
+#endif
- <search-textbox
- id="searchInput"
- data-l10n-id="search-input-box2"
- data-l10n-attrs="placeholder, style"
- />
</hbox>
</hbox>
<vbox id="mainPrefPane">
@@ -247,6 +301,10 @@
@@ -246,6 +292,10 @@
#include sync.inc.xhtml
#include experimental.inc.xhtml
#include moreFromMozilla.inc.xhtml

View file

@ -1,11 +1,11 @@
diff --git a/browser/components/sidebar/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js
index 371190c058fa1eed91dc91b58608c934100e3a1b..440fe6fb403c3e78b3bfe68fb747d000b4a27521 100644
index 178c05099b671c4ec8d4c225955e65cff73824e2..6abb0ee2d4be94f997ee8d4bc755a393d9759099 100644
--- a/browser/components/sidebar/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js
@@ -718,7 +718,7 @@ var SidebarController = {
}
});
} else {
@@ -729,7 +729,7 @@ var SidebarController = {
setPosition() {
// First reset all ordinals to match DOM ordering.
let contentArea = document.getElementById("tabbrowser-tabbox");
- let browser = document.getElementById("browser");
+ let browser = document.getElementById("tabbrowser-tabbox");
[...browser.children].forEach((node, i) => {

View file

@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac96fd868da 100644
index dc92771ebc65095dfebbddc238ee6d4fffd897bf..ae9120f7cc8989cf625ac101d053d82582e32009 100644
--- a/browser/components/tabbrowser/content/tab.js
+++ b/browser/components/tabbrowser/content/tab.js
@@ -16,6 +16,7 @@
@@ -21,6 +21,7 @@
<hbox class="tab-group-line"/>
</vbox>
<hbox class="tab-content" align="center">
@ -10,7 +10,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
<stack class="tab-icon-stack">
<hbox class="tab-throbber"/>
<hbox class="tab-icon-pending"/>
@@ -32,8 +33,10 @@
@@ -37,8 +38,10 @@
<hbox class="tab-secondary-label">
<label class="tab-icon-sound-label tab-icon-sound-pip-label" data-l10n-id="browser-tab-audio-pip" role="presentation"/>
</hbox>
@ -21,7 +21,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
</hbox>
</stack>
`;
@@ -167,7 +170,7 @@
@@ -175,7 +178,7 @@
}
set _visuallySelected(val) {
@ -30,7 +30,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
return;
}
@@ -203,7 +206,7 @@
@@ -211,7 +214,7 @@
}
get visible() {
@ -39,7 +39,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
}
get hidden() {
@@ -274,7 +277,7 @@
@@ -282,7 +285,7 @@
return false;
}
@ -48,7 +48,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
}
get lastAccessed() {
@@ -446,6 +449,8 @@
@@ -454,6 +457,8 @@
this.style.MozUserFocus = "ignore";
} else if (
event.target.classList.contains("tab-close-button") ||
@ -57,15 +57,15 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
event.target.classList.contains("tab-icon-overlay") ||
event.target.classList.contains("tab-audio-button")
) {
@@ -544,6 +549,7 @@
if (this.multiselected) {
gBrowser.removeMultiSelectedTabs();
@@ -554,6 +559,7 @@
telemetrySource: lazy.TabMetrics.METRIC_SOURCE.TAB_STRIP,
});
} else {
+ gZenPinnedTabManager._removePinnedAttributes(this, true);
gBrowser.removeTab(this, {
animate: true,
triggeringEvent: event,
@@ -553,6 +559,14 @@
@@ -564,6 +570,14 @@
// (see tabbrowser-tabs 'click' handler).
gBrowser.tabContainer._blockDblClick = true;
}
@ -80,7 +80,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
}
on_dblclick(event) {
@@ -576,6 +590,8 @@
@@ -587,6 +601,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 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69f8d324d1 100644
index bfba253af3253a8cf547a5d69a1695651fc5c203..fca9c6c918f7d2353edd4f675dd19ca4c4208a50 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -424,11 +424,67 @@
@@ -415,11 +415,67 @@
return this.tabContainer.visibleTabs;
}
@ -72,7 +72,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}
return i;
}
@@ -558,6 +614,7 @@
@@ -549,6 +605,7 @@
this.tabpanels.appendChild(panel);
let tab = this.tabs[0];
@ -80,7 +80,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
tab.linkedPanel = uniqueId;
this._selectedTab = tab;
this._selectedBrowser = browser;
@@ -823,11 +880,13 @@
@@ -814,11 +871,13 @@
}
this.showTab(aTab);
@ -94,10 +94,10 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
);
- } else {
+ } else if (!handled) {
this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true });
}
aTab.setAttribute("pinned", "true");
@@ -841,12 +900,15 @@
this.moveTabTo(aTab, {
tabIndex: this.pinnedTabCount,
forceUngrouped: true,
@@ -835,12 +894,15 @@
}
if (this.tabContainer.verticalMode) {
@ -113,8 +113,8 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ }
});
} else {
this.moveTabTo(aTab, this.pinnedTabCount - 1, {
@@ -1029,6 +1091,8 @@
this.moveTabTo(aTab, {
@@ -1024,6 +1086,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@ -123,7 +123,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (
aIconURL &&
!aLoadingPrincipal &&
@@ -1039,6 +1103,9 @@
@@ -1034,6 +1098,9 @@
);
return;
}
@ -133,7 +133,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL;
@@ -1287,6 +1354,7 @@
@@ -1283,6 +1350,7 @@
if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed();
@ -141,7 +141,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1439,6 +1507,9 @@
@@ -1435,6 +1503,9 @@
}
let activeEl = document.activeElement;
@ -151,7 +151,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1762,7 +1833,8 @@
@@ -1758,7 +1829,8 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@ -161,16 +161,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
return false;
}
@@ -1865,7 +1937,7 @@
@@ -1866,7 +1938,7 @@
newIndex = this.selectedTab._tPos + 1;
}
- if (replace) {
+ if (replace && !(!targetTab && this.selectedTab?.hasAttribute('zen-empty-tab'))) {
let browser;
if (targetTab) {
browser = this.getBrowserForTab(targetTab);
@@ -2122,6 +2194,7 @@
if (this.isTabGroupLabel(targetTab)) {
throw new Error(
"Replacing a tab group label with a tab is not supported"
@@ -2130,6 +2202,7 @@
uriIsAboutBlank,
userContextId,
skipLoad,
@ -178,7 +178,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2195,8 +2268,7 @@
@@ -2203,8 +2276,7 @@
// we use a different attribute name for this?
b.setAttribute("name", name);
}
@ -188,7 +188,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
b.setAttribute("transparent", "true");
}
@@ -2373,7 +2445,7 @@
@@ -2369,7 +2441,7 @@
let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID();
@ -197,7 +197,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary.
@@ -2432,8 +2504,8 @@
@@ -2428,8 +2500,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) {
@ -208,7 +208,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
}
@@ -2655,6 +2727,7 @@
@@ -2657,6 +2729,7 @@
schemelessInput,
hasValidUserGestureActivation = false,
textDirectiveUserActivation = false,
@ -216,7 +216,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2665,6 +2738,12 @@
@@ -2667,6 +2740,12 @@
);
}
@ -229,7 +229,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -2728,6 +2807,16 @@
@@ -2730,6 +2809,16 @@
noInitialLabel,
skipBackgroundNotify,
});
@ -244,9 +244,9 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ t.setAttribute("zen-empty-tab", "true");
+ }
if (insertTab) {
// insert the tab into the tab container in the correct position
this._insertTabAtIndex(t, {
@@ -2752,6 +2841,7 @@
if (typeof index == "number") {
elementIndex = this.#tabIndexToElementIndex(index);
@@ -2756,6 +2845,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@ -254,7 +254,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}));
if (focusUrlBar) {
@@ -2871,6 +2961,9 @@
@@ -2875,6 +2965,9 @@
}
}
@ -264,7 +264,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Additionally send pinned tab events
if (pinned) {
this._notifyPinnedStatus(t);
@@ -2891,12 +2984,15 @@
@@ -2922,12 +3015,15 @@
* @param {string} [label=]
* @returns {MozTabbrowserTabGroup}
*/
@ -281,15 +281,15 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
return group;
}
@@ -2937,6 +3033,7 @@
@@ -2970,6 +3066,7 @@
insertBefore = null,
isUserCreated = false,
isUserTriggered = false,
telemetryUserCreateSource = "unknown",
+ forSplitView = false,
} = {}
) {
if (!tabs?.length) {
@@ -2951,7 +3048,12 @@
@@ -2988,7 +3085,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
}
let group = this._createTabGroup(id, color, false, label);
@ -303,7 +303,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
group,
insertBefore?.group ?? insertBefore
);
@@ -3268,6 +3370,7 @@
@@ -3318,6 +3420,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@ -311,7 +311,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}
) {
// If we don't have a preferred remote type, and we have a remote
@@ -3331,6 +3434,7 @@
@@ -3381,6 +3484,7 @@
openWindowInfo,
name,
skipLoad,
@ -319,7 +319,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
});
}
@@ -3509,6 +3613,27 @@
@@ -3559,6 +3663,27 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@ -347,7 +347,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3557,8 +3682,28 @@
@@ -3607,8 +3732,28 @@
skipLoad: true,
preferredRemoteType,
});
@ -378,7 +378,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
tabToSelect = tab;
}
}
@@ -3570,8 +3715,8 @@
@@ -3620,8 +3765,8 @@
// inserted in the DOM. If the tab is not yet in the DOM,
// just insert it in the right place from the start.
if (!tab.parentNode) {
@ -389,7 +389,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
tab.toggleAttribute("pinned", true);
this.tabContainer._invalidateCachedTabs();
// Then ensure all the tab open/pinning information is sent.
@@ -3581,7 +3726,8 @@
@@ -3631,7 +3776,8 @@
// needs calling:
shouldUpdateForPinnedTabs = true;
}
@ -399,7 +399,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group
@@ -3595,7 +3741,10 @@
@@ -3645,7 +3791,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
@ -411,7 +411,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3646,6 +3795,9 @@
@@ -3696,6 +3845,9 @@
this.selectedTab = tabToSelect;
this.removeTab(leftoverTab);
}
@ -421,7 +421,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -3830,7 +3982,7 @@
@@ -3882,7 +4034,7 @@
// Ensure we have an index if one was not provided.
if (typeof index != "number") {
// Move the new tab after another tab if needed, to the end otherwise.
@ -430,7 +430,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -3876,18 +4028,18 @@
@@ -3928,18 +4080,18 @@
// Ensure index is within bounds.
if (tab.pinned) {
@ -440,38 +440,38 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ index = Math.min(index, tab.hasAttribute("zen-essential") ? this._numZenEssentials : this.pinnedTabCount);
} else {
index = Math.max(index, this.pinnedTabCount);
index = Math.min(index, this.tabs.length);
index = Math.min(index, this.tabContainer.ariaFocusableItems.length);
}
/** @type {MozTabbrowserTab|undefined} */
- let tabAfter = this.tabs.at(index);
+ let tabAfter = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index);
- let itemAfter = this.tabContainer.ariaFocusableItems.at(index);
+ let itemAfter = this.tabContainer.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index);
this.tabContainer._invalidateCachedTabs();
- if (tabGroup) {
+ if (tabGroup && !tabGroup.hasAttribute("split-view-group")) {
if (tabAfter && tabAfter.group == tabGroup) {
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, tabAfter);
@@ -4199,6 +4351,9 @@
this.tabContainer.insertBefore(tab, itemAfter);
@@ -4260,6 +4412,9 @@
return;
}
+ for (let tab of selectedTabs) {
+ gZenPinnedTabManager._removePinnedAttributes(tab, true);
+ }
this.removeTabs(selectedTabs);
this.removeTabs(selectedTabs, { telemetrySource });
}
@@ -4450,6 +4605,7 @@
skipGroupCheck = false,
@@ -4512,6 +4667,7 @@
telemetrySource,
} = {}
) {
+ tabs = tabs.filter(tab => !tab.hasAttribute("zen-empty-tab"));
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
@@ -4533,6 +4689,7 @@
@@ -4596,6 +4752,7 @@
if (lastToClose) {
this.removeTab(lastToClose, aParams);
}
@ -479,16 +479,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} catch (e) {
console.error(e);
}
@@ -4556,6 +4713,7 @@
skipSessionStore,
@@ -4620,6 +4777,7 @@
telemetrySource,
} = {}
) {
+ gZenUIManager.saveScrollbarState();
if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window);
}
@@ -4572,6 +4730,12 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
@@ -4633,6 +4791,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
}
+ if (ZenWorkspaces.workspaceEnabled) {
@ -500,7 +500,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4586,7 +4750,9 @@
@@ -4647,7 +4811,9 @@
// frame created for it (for example, by updating the visually selected
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@ -511,23 +511,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -4600,7 +4766,6 @@
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
return;
}
-
let lockTabSizing =
!this.tabContainer.verticalMode &&
!aTab.pinned &&
@@ -4739,14 +4904,14 @@
!!this.tabsInCollapsedTabGroups.length;
if (
aTab.visible &&
- this.visibleTabs.length == 1 &&
+ this.visibleTabs.length == 1 && !aTab._closingGlance &&
!anyRemainingTabsInCollapsedTabGroups
) {
closeWindow =
@@ -4810,7 +4976,7 @@
closeWindowWithLastTab != null
? closeWindowWithLastTab
: !window.toolbar.visible ||
@ -536,7 +520,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -4770,6 +4935,7 @@
@@ -4834,6 +5000,7 @@
newTab = true;
}
@ -544,7 +528,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4810,9 +4976,7 @@
@@ -4873,9 +5040,7 @@
aTab._mouseleave();
if (newTab) {
@ -555,7 +539,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} else {
TabBarVisibility.update();
}
@@ -4941,6 +5105,8 @@
@@ -5004,6 +5169,8 @@
this.tabs[i]._tPos = i;
}
@ -564,7 +548,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -5064,8 +5230,8 @@
@@ -5129,8 +5296,8 @@
return closedCount;
}
@ -575,7 +559,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (unloadBlocked) {
return;
}
@@ -5159,13 +5325,13 @@
@@ -5230,13 +5397,13 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@ -591,7 +575,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
);
let tab = this.tabContainer.findNextTab(aTab, {
@@ -5181,7 +5347,7 @@
@@ -5252,7 +5419,7 @@
}
if (tab) {
@ -600,7 +584,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5202,7 +5368,7 @@
@@ -5273,7 +5440,7 @@
});
}
@ -609,7 +593,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}
_blurTab(aTab) {
@@ -5599,10 +5765,10 @@
@@ -5674,10 +5841,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@ -622,49 +606,48 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -5838,7 +6004,7 @@
moveTabTo(aTab, aIndex, { forceStandaloneTab = false } = {}) {
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
- aIndex = Math.min(aIndex, this.pinnedTabCount - 1);
+ aIndex = aTab.hasAttribute('zen-essential') ? Math.min(aIndex, this._numZenEssentials - 1) : Math.min(aIndex, this.pinnedTabCount - 1);
} else {
aIndex = Math.max(aIndex, this.pinnedTabCount);
}
@@ -5848,10 +6014,17 @@
@@ -5971,7 +6138,7 @@
this.#handleTabMove(aTab, () => {
let neighbor = this.tabs[aIndex];
- if (forceStandaloneTab && neighbor.group) {
+ const _tPos = aTab._tPos;
// Don't allow mixing pinned and unpinned tabs.
if (this.isTab(element) && element.pinned) {
- tabIndex = Math.min(tabIndex, this.pinnedTabCount - 1);
+ tabIndex = aTab.hasAttribute('zen-essential') ? Math.min(tabIndex, this._numZenEssentials - 1) : Math.min(tabIndex, this.pinnedTabCount - 1);
} else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
}
@@ -5998,9 +6165,16 @@
element,
() => {
let neighbor = this.tabs[tabIndex];
- if (forceUngrouped && neighbor.group) {
+ const _tPos = element._tPos;
+ if ((forceStandaloneTab && neighbor.group) || neighbor.group?.hasAttribute("split-view-group")) {
neighbor = neighbor.group;
}
- if (neighbor && aIndex > aTab._tPos) {
+ if (aTab.group?.hasAttribute("split-view-group")) {
+ aTab = aTab.group;
+ if (element.group?.hasAttribute("split-view-group")) {
+ element = element.group;
+ }
+ if (aTab.group?.hasAttribute("split-view-group") && neighbor == aTab.group) {
+ if (element.group?.hasAttribute("split-view-group") && neighbor == element.group) {
+ return;
+ }
+ if (neighbor && aIndex >= _tPos) {
neighbor.after(aTab);
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
this.tabContainer.insertBefore(aTab, neighbor);
@@ -5901,13 +6074,22 @@
* Bug 1955388 - prevent pinned tabs from commingling with non-pinned tabs
* when there are hidden tabs present
*/
@@ -6069,7 +6243,9 @@
targetElement = targetElement.group;
}
}
-
+ if (tab.group?.hasAttribute("split-view-group")) {
+ tab = tab.group;
+ }
+
if (tab.pinned && !targetElement?.pinned) {
// prevent pinned tab from being dragged past a non-pinned tab
// Don't allow mixing pinned and unpinned tabs.
if (element.pinned && !targetElement?.pinned) {
targetElement = this.tabs[this.pinnedTabCount - 1];
moveBefore = false;
@@ -6079,7 +6255,13 @@
moveBefore = true;
}
-
+ if (targetElement?.group?.hasAttribute("split-view-group")) {
+ targetElement = targetElement.group;
+ }
@ -672,19 +655,19 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ if (tab.hasAttribute("zen-essential")) {
+ return document.getElementById("zen-essentials-container");
+ }
if (tab.pinned && this.tabContainer.verticalMode) {
if (element.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer;
}
@@ -5937,7 +6119,7 @@
@@ -6139,7 +6321,7 @@
if (!this.isTab(aTab)) {
throw new Error("Can only move a tab into a tab group");
}
moveTabToGroup(aTab, aGroup) {
- if (aTab.pinned) {
+ if (aTab.pinned != !!aGroup.pinned) {
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -5961,6 +6143,10 @@
@@ -6233,6 +6415,10 @@
moveActionCallback();
@ -695,16 +678,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -6015,7 +6201,7 @@
@@ -6290,7 +6476,7 @@
createLazyBrowser,
};
- let numPinned = this.pinnedTabCount;
+ let numPinned = this._numVisiblePinTabs;
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
params.pinned = true;
}
@@ -6765,7 +6951,7 @@
if (
elementIndex < numPinned ||
(aTab.pinned && elementIndex == numPinned)
@@ -7050,7 +7236,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@ -713,7 +696,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
window.focus();
aEvent.preventDefault();
break;
@@ -7671,6 +7857,7 @@
@@ -7951,6 +8137,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@ -721,7 +704,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8640,7 +8827,7 @@ var TabContextMenu = {
@@ -8924,7 +9111,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;
@ -730,7 +713,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -8674,7 +8861,7 @@ var TabContextMenu = {
@@ -8958,7 +9145,7 @@ var TabContextMenu = {
let isFirstTab =
!this.contextTabs[0].group &&
(this.contextTabs[0] == visibleTabs[0] ||
@ -739,11 +722,11 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled =
@@ -8904,6 +9091,7 @@ var TabContextMenu = {
if (this.contextTab.multiselected) {
gBrowser.removeMultiSelectedTabs();
@@ -9193,6 +9380,7 @@ var TabContextMenu = {
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
});
} else {
+ gZenPinnedTabManager._removePinnedAttributes(this.contextTab, true);
gBrowser.removeTab(this.contextTab, { animate: true });
}
},
gBrowser.removeTab(this.contextTab, {
animate: true,
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,

View file

@ -130,9 +130,7 @@
},
_hideUnusedElements() {
const kElements = [
'firefox-view-button',
];
const kElements = ['firefox-view-button'];
for (let id of kElements) {
const elem = document.getElementById(id);
if (elem) {