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

View file

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

View file

@ -1,10 +1,10 @@
diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn 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 --- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn +++ b/browser/components/preferences/jar.mn
@@ -23,3 +23,5 @@ browser.jar: @@ -26,3 +26,5 @@ browser.jar:
content/browser/preferences/more-from-mozilla-qr-code-simple-cn.svg content/browser/preferences/widgets/setting-control.mjs (widgets/setting-control/setting-control.mjs)
content/browser/preferences/web-appearance-dark.svg content/browser/preferences/widgets/setting-group.mjs (widgets/setting-group/setting-group.mjs)
content/browser/preferences/web-appearance-light.svg content/browser/preferences/widgets/setting-group.css (widgets/setting-group/setting-group.css)
+ +
+ content/browser/preferences/zen-settings.js + content/browser/preferences/zen-settings.js

View file

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

View file

@ -1,13 +1,13 @@
diff --git a/browser/components/sidebar/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js 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 --- a/browser/components/sidebar/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js +++ b/browser/components/sidebar/browser-sidebar.js
@@ -718,7 +718,7 @@ var SidebarController = { @@ -729,7 +729,7 @@ var SidebarController = {
} setPosition() {
}); // First reset all ordinals to match DOM ordering.
} else { let contentArea = document.getElementById("tabbrowser-tabbox");
- let browser = document.getElementById("browser"); - let browser = document.getElementById("browser");
+ let browser = document.getElementById("tabbrowser-tabbox"); + let browser = document.getElementById("tabbrowser-tabbox");
[...browser.children].forEach((node, i) => { [...browser.children].forEach((node, i) => {
node.style.order = i + 1; node.style.order = i + 1;
}); });

View file

@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js 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 --- a/browser/components/tabbrowser/content/tab.js
+++ b/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"/> <hbox class="tab-group-line"/>
</vbox> </vbox>
<hbox class="tab-content" align="center"> <hbox class="tab-content" align="center">
@ -10,7 +10,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
<stack class="tab-icon-stack"> <stack class="tab-icon-stack">
<hbox class="tab-throbber"/> <hbox class="tab-throbber"/>
<hbox class="tab-icon-pending"/> <hbox class="tab-icon-pending"/>
@@ -32,8 +33,10 @@ @@ -37,8 +38,10 @@
<hbox class="tab-secondary-label"> <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"/> <label class="tab-icon-sound-label tab-icon-sound-pip-label" data-l10n-id="browser-tab-audio-pip" role="presentation"/>
</hbox> </hbox>
@ -21,7 +21,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
</hbox> </hbox>
</stack> </stack>
`; `;
@@ -167,7 +170,7 @@ @@ -175,7 +178,7 @@
} }
set _visuallySelected(val) { set _visuallySelected(val) {
@ -30,7 +30,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
return; return;
} }
@@ -203,7 +206,7 @@ @@ -211,7 +214,7 @@
} }
get visible() { get visible() {
@ -39,7 +39,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
} }
get hidden() { get hidden() {
@@ -274,7 +277,7 @@ @@ -282,7 +285,7 @@
return false; return false;
} }
@ -48,7 +48,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
} }
get lastAccessed() { get lastAccessed() {
@@ -446,6 +449,8 @@ @@ -454,6 +457,8 @@
this.style.MozUserFocus = "ignore"; this.style.MozUserFocus = "ignore";
} else if ( } else if (
event.target.classList.contains("tab-close-button") || 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-icon-overlay") ||
event.target.classList.contains("tab-audio-button") event.target.classList.contains("tab-audio-button")
) { ) {
@@ -544,6 +549,7 @@ @@ -554,6 +559,7 @@
if (this.multiselected) { telemetrySource: lazy.TabMetrics.METRIC_SOURCE.TAB_STRIP,
gBrowser.removeMultiSelectedTabs(); });
} else { } else {
+ gZenPinnedTabManager._removePinnedAttributes(this, true); + gZenPinnedTabManager._removePinnedAttributes(this, true);
gBrowser.removeTab(this, { gBrowser.removeTab(this, {
animate: true, animate: true,
triggeringEvent: event, triggeringEvent: event,
@@ -553,6 +559,14 @@ @@ -564,6 +570,14 @@
// (see tabbrowser-tabs 'click' handler). // (see tabbrowser-tabs 'click' handler).
gBrowser.tabContainer._blockDblClick = true; gBrowser.tabContainer._blockDblClick = true;
} }
@ -80,7 +80,7 @@ index fc3a9730b394341843cfa9f559a792acb34c7d29..18d5fdb6e3368e21c68269c48cf22ac9
} }
on_dblclick(event) { on_dblclick(event) {
@@ -576,6 +590,8 @@ @@ -587,6 +601,8 @@
animate: true, animate: true,
triggeringEvent: event, triggeringEvent: event,
}); });

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 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69f8d324d1 100644 index bfba253af3253a8cf547a5d69a1695651fc5c203..fca9c6c918f7d2353edd4f675dd19ca4c4208a50 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
@@ -424,11 +424,67 @@ @@ -415,11 +415,67 @@
return this.tabContainer.visibleTabs; return this.tabContainer.visibleTabs;
} }
@ -72,7 +72,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} }
return i; return i;
} }
@@ -558,6 +614,7 @@ @@ -549,6 +605,7 @@
this.tabpanels.appendChild(panel); this.tabpanels.appendChild(panel);
let tab = this.tabs[0]; let tab = this.tabs[0];
@ -80,7 +80,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
tab.linkedPanel = uniqueId; tab.linkedPanel = uniqueId;
this._selectedTab = tab; this._selectedTab = tab;
this._selectedBrowser = browser; this._selectedBrowser = browser;
@@ -823,11 +880,13 @@ @@ -814,11 +871,13 @@
} }
this.showTab(aTab); this.showTab(aTab);
@ -94,10 +94,10 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
); );
- } else { - } else {
+ } else if (!handled) { + } else if (!handled) {
this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true }); this.moveTabTo(aTab, {
} tabIndex: this.pinnedTabCount,
aTab.setAttribute("pinned", "true"); forceUngrouped: true,
@@ -841,12 +900,15 @@ @@ -835,12 +894,15 @@
} }
if (this.tabContainer.verticalMode) { if (this.tabContainer.verticalMode) {
@ -113,8 +113,8 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ } + }
}); });
} else { } else {
this.moveTabTo(aTab, this.pinnedTabCount - 1, { this.moveTabTo(aTab, {
@@ -1029,6 +1091,8 @@ @@ -1024,6 +1086,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"]; let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@ -123,7 +123,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if ( if (
aIconURL && aIconURL &&
!aLoadingPrincipal && !aLoadingPrincipal &&
@@ -1039,6 +1103,9 @@ @@ -1034,6 +1098,9 @@
); );
return; return;
} }
@ -133,7 +133,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
let browser = this.getBrowserForTab(aTab); let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL; browser.mIconURL = aIconURL;
@@ -1287,6 +1354,7 @@ @@ -1283,6 +1350,7 @@
if (!this._previewMode) { if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload(); newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed(); newTab.updateLastAccessed();
@ -141,7 +141,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
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()) {
@@ -1439,6 +1507,9 @@ @@ -1435,6 +1503,9 @@
} }
let activeEl = document.activeElement; 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 focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) { if (activeEl == oldTab) {
newTab.focus(); newTab.focus();
@@ -1762,7 +1833,8 @@ @@ -1758,7 +1829,8 @@
} }
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) { _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@ -161,16 +161,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
return false; return false;
} }
@@ -1865,7 +1937,7 @@ @@ -1866,7 +1938,7 @@
newIndex = this.selectedTab._tPos + 1; newIndex = this.selectedTab._tPos + 1;
} }
- if (replace) { - if (replace) {
+ if (replace && !(!targetTab && this.selectedTab?.hasAttribute('zen-empty-tab'))) { + if (replace && !(!targetTab && this.selectedTab?.hasAttribute('zen-empty-tab'))) {
let browser; if (this.isTabGroupLabel(targetTab)) {
if (targetTab) { throw new Error(
browser = this.getBrowserForTab(targetTab); "Replacing a tab group label with a tab is not supported"
@@ -2122,6 +2194,7 @@ @@ -2130,6 +2202,7 @@
uriIsAboutBlank, uriIsAboutBlank,
userContextId, userContextId,
skipLoad, skipLoad,
@ -178,7 +178,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} = {}) { } = {}) {
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
@@ -2195,8 +2268,7 @@ @@ -2203,8 +2276,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 +188,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
b.setAttribute("transparent", "true"); b.setAttribute("transparent", "true");
} }
@@ -2373,7 +2445,7 @@ @@ -2369,7 +2441,7 @@
let panel = this.getPanel(browser); let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID(); let uniqueId = this._generateUniquePanelID();
@ -197,7 +197,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
aTab.linkedPanel = uniqueId; aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary. // 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 // 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 +208,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} else { } else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
} }
@@ -2655,6 +2727,7 @@ @@ -2657,6 +2729,7 @@
schemelessInput, schemelessInput,
hasValidUserGestureActivation = false, hasValidUserGestureActivation = false,
textDirectiveUserActivation = false, textDirectiveUserActivation = false,
@ -216,7 +216,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} = {} } = {}
) { ) {
// all callers of addTab that pass a params object need to pass // 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)) { if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window); UserInteraction.start("browser.tabs.opening", "initting", window);
} }
@@ -2728,6 +2807,16 @@ @@ -2730,6 +2809,16 @@
noInitialLabel, noInitialLabel,
skipBackgroundNotify, skipBackgroundNotify,
}); });
@ -244,9 +244,9 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ t.setAttribute("zen-empty-tab", "true"); + t.setAttribute("zen-empty-tab", "true");
+ } + }
if (insertTab) { if (insertTab) {
// insert the tab into the tab container in the correct position if (typeof index == "number") {
this._insertTabAtIndex(t, { elementIndex = this.#tabIndexToElementIndex(index);
@@ -2752,6 +2841,7 @@ @@ -2756,6 +2845,7 @@
initialBrowsingContextGroupId, initialBrowsingContextGroupId,
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
@ -254,7 +254,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
})); }));
if (focusUrlBar) { if (focusUrlBar) {
@@ -2871,6 +2961,9 @@ @@ -2875,6 +2965,9 @@
} }
} }
@ -264,7 +264,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Additionally send pinned tab events // Additionally send pinned tab events
if (pinned) { if (pinned) {
this._notifyPinnedStatus(t); this._notifyPinnedStatus(t);
@@ -2891,12 +2984,15 @@ @@ -2922,12 +3015,15 @@
* @param {string} [label=] * @param {string} [label=]
* @returns {MozTabbrowserTabGroup} * @returns {MozTabbrowserTabGroup}
*/ */
@ -281,15 +281,15 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
return group; return group;
} }
@@ -2937,6 +3033,7 @@ @@ -2970,6 +3066,7 @@
insertBefore = null, insertBefore = null,
isUserCreated = false, isUserTriggered = false,
telemetryUserCreateSource = "unknown", telemetryUserCreateSource = "unknown",
+ forSplitView = false, + forSplitView = false,
} = {} } = {}
) { ) {
if (!tabs?.length) { if (!tabs?.length) {
@@ -2951,7 +3048,12 @@ @@ -2988,7 +3085,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 +303,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
group, group,
insertBefore?.group ?? insertBefore insertBefore?.group ?? insertBefore
); );
@@ -3268,6 +3370,7 @@ @@ -3318,6 +3420,7 @@
initialBrowsingContextGroupId, initialBrowsingContextGroupId,
openWindowInfo, openWindowInfo,
skipLoad, skipLoad,
@ -311,7 +311,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} }
) { ) {
// 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
@@ -3331,6 +3434,7 @@ @@ -3381,6 +3484,7 @@
openWindowInfo, openWindowInfo,
name, name,
skipLoad, skipLoad,
@ -319,7 +319,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
}); });
} }
@@ -3509,6 +3613,27 @@ @@ -3559,6 +3663,27 @@
) { ) {
tabWasReused = true; tabWasReused = true;
tab = this.selectedTab; tab = this.selectedTab;
@ -347,7 +347,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (!tabData.pinned) { if (!tabData.pinned) {
this.unpinTab(tab); this.unpinTab(tab);
} else { } else {
@@ -3557,8 +3682,28 @@ @@ -3607,8 +3732,28 @@
skipLoad: true, skipLoad: true,
preferredRemoteType, preferredRemoteType,
}); });
@ -378,7 +378,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
tabToSelect = tab; tabToSelect = tab;
} }
} }
@@ -3570,8 +3715,8 @@ @@ -3620,8 +3765,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 +389,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
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.
@@ -3581,7 +3726,8 @@ @@ -3631,7 +3776,8 @@
// needs calling: // needs calling:
shouldUpdateForPinnedTabs = true; shouldUpdateForPinnedTabs = true;
} }
@ -399,7 +399,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
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
@@ -3595,7 +3741,10 @@ @@ -3645,7 +3791,10 @@
tabGroup.stateData.id, tabGroup.stateData.id,
tabGroup.stateData.color, tabGroup.stateData.color,
tabGroup.stateData.collapsed, tabGroup.stateData.collapsed,
@ -411,7 +411,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
); );
tabsFragment.appendChild(tabGroup.node); tabsFragment.appendChild(tabGroup.node);
} }
@@ -3646,6 +3795,9 @@ @@ -3696,6 +3845,9 @@
this.selectedTab = tabToSelect; this.selectedTab = tabToSelect;
this.removeTab(leftoverTab); this.removeTab(leftoverTab);
} }
@ -421,7 +421,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (tabs.length > 1 || !tabs[0].selected) { if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert(); this._updateTabsAfterInsert();
@@ -3830,7 +3982,7 @@ @@ -3882,7 +4034,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 +430,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if ( if (
!bulkOrderedOpen && !bulkOrderedOpen &&
((openerTab && ((openerTab &&
@@ -3876,18 +4028,18 @@ @@ -3928,18 +4080,18 @@
// Ensure index is within bounds. // Ensure index is within bounds.
if (tab.pinned) { if (tab.pinned) {
@ -440,38 +440,38 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ index = Math.min(index, tab.hasAttribute("zen-essential") ? this._numZenEssentials : this.pinnedTabCount); + index = Math.min(index, tab.hasAttribute("zen-essential") ? this._numZenEssentials : this.pinnedTabCount);
} else { } else {
index = Math.max(index, this.pinnedTabCount); index = Math.max(index, this.pinnedTabCount);
index = Math.min(index, this.tabs.length); index = Math.min(index, this.tabContainer.ariaFocusableItems.length);
} }
/** @type {MozTabbrowserTab|undefined} */ /** @type {MozTabbrowserTab|undefined} */
- let tabAfter = this.tabs.at(index); - let itemAfter = this.tabContainer.ariaFocusableItems.at(index);
+ let tabAfter = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index); + let itemAfter = this.tabContainer.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index);
this.tabContainer._invalidateCachedTabs(); this.tabContainer._invalidateCachedTabs();
- if (tabGroup) { - if (tabGroup) {
+ if (tabGroup && !tabGroup.hasAttribute("split-view-group")) { + 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 // Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, tabAfter); this.tabContainer.insertBefore(tab, itemAfter);
@@ -4199,6 +4351,9 @@ @@ -4260,6 +4412,9 @@
return; return;
} }
+ for (let tab of selectedTabs) { + for (let tab of selectedTabs) {
+ gZenPinnedTabManager._removePinnedAttributes(tab, true); + gZenPinnedTabManager._removePinnedAttributes(tab, true);
+ } + }
this.removeTabs(selectedTabs); this.removeTabs(selectedTabs, { telemetrySource });
} }
@@ -4450,6 +4605,7 @@ @@ -4512,6 +4667,7 @@
skipGroupCheck = false, telemetrySource,
} = {} } = {}
) { ) {
+ tabs = tabs.filter(tab => !tab.hasAttribute("zen-empty-tab")); + tabs = tabs.filter(tab => !tab.hasAttribute("zen-empty-tab"));
// 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 (
@@ -4533,6 +4689,7 @@ @@ -4596,6 +4752,7 @@
if (lastToClose) { if (lastToClose) {
this.removeTab(lastToClose, aParams); this.removeTab(lastToClose, aParams);
} }
@ -479,16 +479,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
@@ -4556,6 +4713,7 @@ @@ -4620,6 +4777,7 @@
skipSessionStore, telemetrySource,
} = {} } = {}
) { ) {
+ gZenUIManager.saveScrollbarState(); + gZenUIManager.saveScrollbarState();
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);
} }
@@ -4572,6 +4730,12 @@ @@ -4633,6 +4791,12 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
} }
+ if (ZenWorkspaces.workspaceEnabled) { + if (ZenWorkspaces.workspaceEnabled) {
@ -500,7 +500,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// 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) {
@@ -4586,7 +4750,9 @@ @@ -4647,7 +4811,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,32 +511,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if ( if (
!this._beginRemoveTab(aTab, { !this._beginRemoveTab(aTab, {
closeWindowFastpath: true, closeWindowFastpath: true,
@@ -4600,7 +4766,6 @@ @@ -4810,7 +4976,7 @@
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 =
closeWindowWithLastTab != null closeWindowWithLastTab != null
? closeWindowWithLastTab ? closeWindowWithLastTab
: !window.toolbar.visible || : !window.toolbar.visible ||
- Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab"); - Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab");
+ Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab") && !ZenWorkspaces._isClosingWindow && !ZenWorkspaces._removedByStartupPage; + Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab") && !ZenWorkspaces._isClosingWindow && !ZenWorkspaces._removedByStartupPage;
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,
@@ -4770,6 +4935,7 @@ @@ -4834,6 +5000,7 @@
newTab = true; newTab = true;
} }
@ -544,7 +528,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
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.
@@ -4810,9 +4976,7 @@ @@ -4873,9 +5040,7 @@
aTab._mouseleave(); aTab._mouseleave();
if (newTab) { if (newTab) {
@ -555,7 +539,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} else { } else {
TabBarVisibility.update(); TabBarVisibility.update();
} }
@@ -4941,6 +5105,8 @@ @@ -5004,6 +5169,8 @@
this.tabs[i]._tPos = i; this.tabs[i]._tPos = i;
} }
@ -564,7 +548,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (!this._windowIsClosing) { if (!this._windowIsClosing) {
if (wasPinned) { if (wasPinned) {
this.tabContainer._positionPinnedTabs(); this.tabContainer._positionPinnedTabs();
@@ -5064,8 +5230,8 @@ @@ -5129,8 +5296,8 @@
return closedCount; return closedCount;
} }
@ -575,7 +559,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
if (unloadBlocked) { if (unloadBlocked) {
return; return;
} }
@@ -5159,13 +5325,13 @@ @@ -5230,13 +5397,13 @@
!excludeTabs.has(aTab.owner) && !excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) { ) {
@ -591,7 +575,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
); );
let tab = this.tabContainer.findNextTab(aTab, { let tab = this.tabContainer.findNextTab(aTab, {
@@ -5181,7 +5347,7 @@ @@ -5252,7 +5419,7 @@
} }
if (tab) { if (tab) {
@ -600,7 +584,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} }
// 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
@@ -5202,7 +5368,7 @@ @@ -5273,7 +5440,7 @@
}); });
} }
@ -609,7 +593,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
} }
_blurTab(aTab) { _blurTab(aTab) {
@@ -5599,10 +5765,10 @@ @@ -5674,10 +5841,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
} }
@ -622,49 +606,48 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
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.
@@ -5838,7 +6004,7 @@ @@ -5971,7 +6138,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 @@
this.#handleTabMove(aTab, () => { // Don't allow mixing pinned and unpinned tabs.
let neighbor = this.tabs[aIndex]; if (this.isTab(element) && element.pinned) {
- if (forceStandaloneTab && neighbor.group) { - tabIndex = Math.min(tabIndex, this.pinnedTabCount - 1);
+ const _tPos = aTab._tPos; + tabIndex = aTab.hasAttribute('zen-essential') ? Math.min(tabIndex, this._numZenEssentials - 1) : Math.min(tabIndex, this.pinnedTabCount - 1);
+ if ((forceStandaloneTab && neighbor.group) || neighbor.group?.hasAttribute("split-view-group")) { } else {
neighbor = neighbor.group; 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 (element.group?.hasAttribute("split-view-group")) {
+ element = element.group;
+ }
+ if (element.group?.hasAttribute("split-view-group") && neighbor == element.group) {
+ return;
+ }
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
@@ -6069,7 +6243,9 @@
targetElement = targetElement.group;
} }
- if (neighbor && aIndex > aTab._tPos) { }
+ if (aTab.group?.hasAttribute("split-view-group")) { -
+ aTab = aTab.group;
+ }
+ if (aTab.group?.hasAttribute("split-view-group") && neighbor == aTab.group) {
+ return;
+ }
+ if (neighbor && aIndex >= _tPos) {
neighbor.after(aTab);
} 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
*/
+ if (tab.group?.hasAttribute("split-view-group")) { + if (tab.group?.hasAttribute("split-view-group")) {
+ tab = tab.group; + tab = tab.group;
+ } + }
+ // Don't allow mixing pinned and unpinned tabs.
if (tab.pinned && !targetElement?.pinned) { if (element.pinned && !targetElement?.pinned) {
// prevent pinned tab from being dragged past a non-pinned tab
targetElement = this.tabs[this.pinnedTabCount - 1]; targetElement = this.tabs[this.pinnedTabCount - 1];
moveBefore = false; @@ -6079,7 +6255,13 @@
moveBefore = true;
} }
-
+ if (targetElement?.group?.hasAttribute("split-view-group")) { + if (targetElement?.group?.hasAttribute("split-view-group")) {
+ targetElement = targetElement.group; + targetElement = targetElement.group;
+ } + }
@ -672,19 +655,19 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
+ if (tab.hasAttribute("zen-essential")) { + if (tab.hasAttribute("zen-essential")) {
+ return document.getElementById("zen-essentials-container"); + return document.getElementById("zen-essentials-container");
+ } + }
if (tab.pinned && this.tabContainer.verticalMode) { if (element.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer; 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) {
+ if (aTab.pinned != !!aGroup.pinned) { + if (aTab.pinned != !!aGroup.pinned) {
return; return;
} }
if (aTab.group && aTab.group.id === aGroup.id) { if (aTab.group && aTab.group.id === aGroup.id) {
@@ -5961,6 +6143,10 @@ @@ -6233,6 +6415,10 @@
moveActionCallback(); moveActionCallback();
@ -695,16 +678,16 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// 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();
@@ -6015,7 +6201,7 @@ @@ -6290,7 +6476,7 @@
createLazyBrowser, createLazyBrowser,
}; };
- let numPinned = this.pinnedTabCount; - let numPinned = this.pinnedTabCount;
+ let numPinned = this._numVisiblePinTabs; + let numPinned = this._numVisiblePinTabs;
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) { if (
params.pinned = true; elementIndex < numPinned ||
} (aTab.pinned && elementIndex == numPinned)
@@ -6765,7 +6951,7 @@ @@ -7050,7 +7236,7 @@
// preventDefault(). It will still raise the window if appropriate. // preventDefault(). It will still raise the window if appropriate.
break; break;
} }
@ -713,7 +696,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
window.focus(); window.focus();
aEvent.preventDefault(); aEvent.preventDefault();
break; break;
@@ -7671,6 +7857,7 @@ @@ -7951,6 +8137,7 @@
aWebProgress.isTopLevel aWebProgress.isTopLevel
) { ) {
this.mTab.setAttribute("busy", "true"); this.mTab.setAttribute("busy", "true");
@ -721,7 +704,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
gBrowser._tabAttrModified(this.mTab, ["busy"]); gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected; this.mTab._notselectedsinceload = !this.mTab.selected;
} }
@@ -8640,7 +8827,7 @@ var TabContextMenu = { @@ -8924,7 +9111,7 @@ var TabContextMenu = {
); );
contextUnpinSelectedTabs.hidden = contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected; !this.contextTab.pinned || !this.multiselected;
@ -730,7 +713,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
// Move Tab items // Move Tab items
let contextMoveTabOptions = document.getElementById( let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions" "context_moveTabOptions"
@@ -8674,7 +8861,7 @@ var TabContextMenu = { @@ -8958,7 +9145,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] ||
@ -739,11 +722,11 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..be8740305b28cfc7752ad8f48ca94e69
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent; contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled = document.getElementById("context_openTabInWindow").disabled =
@@ -8904,6 +9091,7 @@ var TabContextMenu = { @@ -9193,6 +9380,7 @@ var TabContextMenu = {
if (this.contextTab.multiselected) { telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
gBrowser.removeMultiSelectedTabs(); });
} else { } else {
+ gZenPinnedTabManager._removePinnedAttributes(this.contextTab, true); + 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() { _hideUnusedElements() {
const kElements = [ const kElements = ['firefox-view-button'];
'firefox-view-button',
];
for (let id of kElements) { for (let id of kElements) {
const elem = document.getElementById(id); const elem = document.getElementById(id);
if (elem) { if (elem) {