Merge branch 'dev' into window-sync

Signed-off-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
This commit is contained in:
mr. m
2025-11-13 13:58:38 +01:00
committed by GitHub
234 changed files with 3952 additions and 2692 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
index 67b2806835baba3070f295d6b96f97077639995a..5f28e0073c893c57c1d6c37deaacf7b097351d60 100644
index f1cabb13ca4f86a2bafc1d93b7f882218a108eb2..2389b1addf24d17bd41fca65cfeb6f944479076d 100644
--- a/browser/components/BrowserGlue.sys.mjs
+++ b/browser/components/BrowserGlue.sys.mjs
@@ -8,6 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
@@ -10,7 +10,7 @@ index 67b2806835baba3070f295d6b96f97077639995a..5f28e0073c893c57c1d6c37deaacf7b0
AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs",
AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs",
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
@@ -1458,7 +1459,7 @@ BrowserGlue.prototype = {
@@ -1452,7 +1453,7 @@ BrowserGlue.prototype = {
windowcount++;
let tabbrowser = win.gBrowser;
if (tabbrowser) {
@@ -19,7 +19,7 @@ index 67b2806835baba3070f295d6b96f97077639995a..5f28e0073c893c57c1d6c37deaacf7b0
}
}
@@ -1623,6 +1624,8 @@ BrowserGlue.prototype = {
@@ -1617,6 +1618,8 @@ BrowserGlue.prototype = {
} else if (profileDataVersion < APP_DATA_VERSION) {
lazy.ProfileDataUpgrader.upgrade(profileDataVersion, APP_DATA_VERSION);
}

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/asrouter/modules/FeatureCallout.sys.mjs b/browser/components/asrouter/modules/FeatureCallout.sys.mjs
index 2a2c5a6fe903694abbac0be86c7b3c8adc1d0275..5571b827198474a2635a9bd968adbc8c96dbc353 100644
index 4ea9c9e88a1831dad7e42ebd8d0dd507102e8280..316aa626e525f05caac7f315e0ea7ae9d822b6af 100644
--- a/browser/components/asrouter/modules/FeatureCallout.sys.mjs
+++ b/browser/components/asrouter/modules/FeatureCallout.sys.mjs
@@ -776,6 +776,7 @@ export class FeatureCallout {
@@ -777,6 +777,7 @@ export class FeatureCallout {
) {
return false;
}

View File

@@ -1,15 +1,15 @@
diff --git a/browser/components/customizableui/ToolbarContextMenu.sys.mjs b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
index 852cf2eee9113753fa0797be6dec80dcb9207703..93bb093e679320033a37b2af14e8e0e3c7621f94 100644
index 95621ae202378fb1ebceca5623a98b790b9eb5ff..835b831fb4f005ae4be72ce0953ac9254e6b4891 100644
--- a/browser/components/customizableui/ToolbarContextMenu.sys.mjs
+++ b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
@@ -242,8 +242,8 @@ export var ToolbarContextMenu = {
@@ -242,9 +242,7 @@ export var ToolbarContextMenu = {
// Show/hide sidebar and vertical tabs menu items
let sidebarRevampEnabled = Services.prefs.getBoolPref("sidebar.revamp");
let showSidebarActions =
- ["tabbrowser-tabs", "sidebar-button"].includes(toolbarItem?.id) ||
- toolbarItem?.localName == "toolbarspring";
+ (["tabbrowser-tabs", "sidebar-button"].includes(toolbarItem?.id) ||
+ toolbarItem?.localName == "toolbarspring") && false;
- toolbarItem?.localName == "toolbarspring" ||
- isTitlebarSpacer;
+ false;
let toggleVerticalTabsItem = document.getElementById(
"toolbar-context-toggle-vertical-tabs"
);

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/customizableui/content/panelUI.inc.xhtml b/browser/components/customizableui/content/panelUI.inc.xhtml
index 85acb96a3deefed708ea768b2f163e7fd6480b97..bb3aed53758da7dafcfed4492acb0cbf2b80cd2f 100644
index 6cb22be6526b17d952a90fd414c49a31e9afde7a..84f8156e88027a79a40f14c77c83d6a2d19c8a72 100644
--- a/browser/components/customizableui/content/panelUI.inc.xhtml
+++ b/browser/components/customizableui/content/panelUI.inc.xhtml
@@ -132,7 +132,7 @@
@@ -139,7 +139,7 @@
<panel id="appMenu-notification-popup"
class="popup-notification-panel panel-no-padding"
type="arrow"

View File

@@ -1,18 +1,8 @@
diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js
index 7156397d597579f745ea20ae2b9327433a31c8ec..13b844a63e79e227c96faf153ee5908759306407 100644
index d6393080aa8aff6c0f7b2043fd408b6f6249d0c4..bf37b46c4743b7619393c730720204380635666a 100644
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -518,8 +518,7 @@ const PanelUI = {
tempPanel.setAttribute("animate", "false");
}
tempPanel.setAttribute("context", "");
- document
- .getElementById(CustomizableUI.AREA_NAVBAR)
+ aAnchor.closest("toolbar")
.appendChild(tempPanel);
let multiView = document.createXULElement("panelmultiview");
@@ -610,10 +609,12 @@ const PanelUI = {
@@ -608,10 +608,12 @@ const PanelUI = {
if (hasKids && !this.navbar.hasAttribute("nonemptyoverflow")) {
this.navbar.setAttribute("nonemptyoverflow", "true");
this.overflowPanel.setAttribute("hasfixeditems", "true");
@@ -25,12 +15,12 @@ index 7156397d597579f745ea20ae2b9327433a31c8ec..13b844a63e79e227c96faf153ee59087
}
},
@@ -961,7 +962,7 @@ const PanelUI = {
@@ -959,7 +961,7 @@ const PanelUI = {
el.removeAttribute("data-lazy-l10n-id");
});
- this.notificationPanel.openPopup(anchor, "bottomright topright");
+ this.notificationPanel.openPopup(anchor, gZenUIManager.panelUIPosition);
+ this.notificationPanel.openPopup(anchor, gZenUIManager.panelUIPosition(this.notificationPanel, anchor));
},
_clearNotificationPanel() {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/extensions/parent/ext-browser.js b/browser/components/extensions/parent/ext-browser.js
index 89b0bb3b92c15b89499ffc6cf35dcee7ebb89e48..327afaea3821cdca8d7f58bfaa65c7ce3dbfa7a3 100644
index 2488267f4be5142bcacf984635d9e9ecdb5f02e9..03127808b3cae28850cc276fac0f1acbca85d326 100644
--- a/browser/components/extensions/parent/ext-browser.js
+++ b/browser/components/extensions/parent/ext-browser.js
@@ -354,6 +354,7 @@ class TabTracker extends TabTrackerBase {
@@ -18,7 +18,7 @@ index 89b0bb3b92c15b89499ffc6cf35dcee7ebb89e48..327afaea3821cdca8d7f58bfaa65c7ce
this._tabs.set(nativeTab, id);
if (nativeTab.linkedBrowser) {
@@ -1271,6 +1273,10 @@ class TabManager extends TabManagerBase {
@@ -1273,6 +1275,10 @@ class TabManager extends TabManagerBase {
}
canAccessTab(nativeTab) {

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js
index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3ed3a3058e 100644
index bbfbe9c703dff25bf939369f5b99cdaa76a5ae24..c28688d488960c1de73baf4c0e69b9f8401e4226 100644
--- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js
@@ -330,12 +330,23 @@ class PlacesViewBase {
@@ -328,12 +328,23 @@ class PlacesViewBase {
this._cleanPopup(aPopup);
@@ -29,7 +29,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
this._insertNewItemToPopup(child, fragment);
}
aPopup.insertBefore(fragment, aPopup._endMarker);
@@ -393,6 +404,7 @@ class PlacesViewBase {
@@ -391,6 +402,7 @@ class PlacesViewBase {
"scheme",
PlacesUIUtils.guessUrlSchemeForUI(aPlacesNode.uri)
);
@@ -37,7 +37,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
} else if (PlacesUtils.containerTypes.includes(type)) {
element = document.createXULElement("menu");
element.setAttribute("container", "true");
@@ -980,25 +992,33 @@ class PlacesToolbar extends PlacesViewBase {
@@ -1014,25 +1026,33 @@ class PlacesToolbar extends PlacesViewBase {
this._rootElt.firstChild.remove();
}
@@ -82,7 +82,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
);
++startIndex;
if (elt.localName != "toolbarseparator") {
@@ -1006,15 +1026,12 @@ class PlacesToolbar extends PlacesViewBase {
@@ -1040,15 +1060,12 @@ class PlacesToolbar extends PlacesViewBase {
}
}
if (!elt) {
@@ -101,7 +101,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
});
});
@@ -1024,7 +1041,7 @@ class PlacesToolbar extends PlacesViewBase {
@@ -1058,7 +1075,7 @@ class PlacesToolbar extends PlacesViewBase {
let fragment = document.createDocumentFragment();
for (let i = startIndex; i < limit; ++i) {
@@ -110,7 +110,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
}
await new Promise(resolve => window.requestAnimationFrame(resolve));
if (!this._isAlive) {
@@ -1086,6 +1103,8 @@ class PlacesToolbar extends PlacesViewBase {
@@ -1120,6 +1137,8 @@ class PlacesToolbar extends PlacesViewBase {
"scheme",
PlacesUIUtils.guessUrlSchemeForUI(aChild.uri)
);
@@ -119,7 +119,7 @@ index ee6050d411df009d8b61e49d7fdaba79f1bc5db1..0149528329dad3d48449175a35d96d3e
}
}
@@ -2234,7 +2253,7 @@ this.PlacesPanelview = class PlacesPanelview extends PlacesViewBase {
@@ -2268,7 +2287,7 @@ this.PlacesPanelview = class PlacesPanelview extends PlacesViewBase {
PlacesUIUtils.guessUrlSchemeForUI(placesNode.uri)
);
element.setAttribute("label", PlacesUIUtils.getBestTitle(placesNode));

View File

@@ -1,10 +1,11 @@
diff --git a/browser/components/preferences/jar.mn b/browser/components/preferences/jar.mn
index a786155d80a9f1f09d209f2da11437ee2d662739..2e422b48b452698275118d336d1b16af6a221577 100644
index 65efb0666785cc79e58015e19ec55216bf4ec9c4..95941c52ffd4c9ee36f584413fb96d59721113db 100644
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -30,3 +30,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)
@@ -33,3 +33,5 @@ browser.jar:
content/browser/preferences/widgets/setting-pane.mjs (widgets/setting-pane/setting-pane.mjs)
content/browser/preferences/widgets/security-privacy-card.mjs (widgets/security-privacy/security-privacy-card/security-privacy-card.mjs)
content/browser/preferences/widgets/security-privacy-card.css (widgets/security-privacy/security-privacy-card/security-privacy-card.css)
+
+ content/browser/preferences/zen-settings.js
\ No newline at end of file

View File

@@ -1,20 +1,8 @@
diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml
index 891cf7108cf4606c99a902afa420e744b9690b87..2bdbc1f0b6ac2c883dcbd706aed0615fad5e0760 100644
index ff577c035ff6128f7ae948bc810082c92b3a624c..40f94fff53c63bdff28eaa68f9b0736d53c5b4f8 100644
--- a/browser/components/preferences/main.inc.xhtml
+++ b/browser/components/preferences/main.inc.xhtml
@@ -29,6 +29,11 @@
<vbox id="startupPageBox">
<checkbox id="browserRestoreSession"
data-l10n-id="startup-restore-windows-and-tabs"/>
+ <vbox class="indent">
+ <checkbox id="zenWorkspaceContinueWhereLeftOff"
+ data-l10n-id="zen-workspace-continue-where-left-off"
+ preference="zen.workspaces.continue-where-left-off"/>
+ </vbox>
#ifdef XP_WIN
<hbox id="windowsLaunchOnLoginBox" align="center" hidden="true">
<checkbox id="windowsLaunchOnLogin"
@@ -189,7 +194,8 @@
@@ -141,7 +141,8 @@
<!-- Browser layout -->
<groupbox data-category="paneGeneral"
data-subcategory="layout"
@@ -24,7 +12,7 @@ index 891cf7108cf4606c99a902afa420e744b9690b87..2bdbc1f0b6ac2c883dcbd706aed0615f
<label><html:h2 data-l10n-id="browser-layout-header"/></label>
<radiogroup id="browserLayoutRadioGroup" preference="sidebar.verticalTabs">
<radio id="browserLayoutHorizontalTabs" data-l10n-id="browser-layout-horizontal-tabs" value="false"/>
@@ -420,6 +426,7 @@
@@ -346,6 +347,7 @@
languages-customize-add.label,
" />
</hbox>

View File

@@ -1,8 +1,20 @@
diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js
index 259bc260328af1b1f2b95866e7cf92dec341a4b0..3cebff51774b2542a8d4d888aa99dc10929c80be 100644
index 46283d3eacfea0f419afa3bdfd2a51e411502a20..4fe229706eb0145a21042b8b3cca323682e89e76 100644
--- a/browser/components/preferences/main.js
+++ b/browser/components/preferences/main.js
@@ -443,7 +443,7 @@ function getBundleForLocales(newLocales) {
@@ -1117,6 +1117,11 @@ let SETTINGS_CONFIG = {
id: "browserRestoreSession",
l10nId: "startup-restore-windows-and-tabs",
},
+ {
+ id: "zenWorkspaceContinueWhereLeftOff",
+ l10nId: "zen-workspace-continue-where-left-off",
+ control: "moz-checkbox",
+ },
{
id: "windowsLaunchOnLogin",
l10nId: "windows-launch-on-login",
@@ -1611,7 +1616,7 @@ function getBundleForLocales(newLocales) {
])
);
return new Localization(

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js
index 1fb8a954f61e89736b369f5fa01bb4f89fff16ad..3030c32cb66529f14e575428654778abd312dfd8 100644
index c949c1800cb4c200c273c4019a61553b0e236994..0846ab1a348d3c5904e967aeb36eb846ba3cffa9 100644
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -117,6 +117,7 @@ ChromeUtils.defineLazyGetter(this, "gSubDialog", function () {
@@ -10,7 +10,7 @@ index 1fb8a954f61e89736b369f5fa01bb4f89fff16ad..3030c32cb66529f14e575428654778ab
],
resizeCallback: async ({ title, frame }) => {
// Search within main document and highlight matched keyword.
@@ -196,6 +197,10 @@ function init_all() {
@@ -224,6 +225,10 @@ function init_all() {
register_module("paneSearch", gSearchPane);
register_module("panePrivacy", gPrivacyPane);
register_module("paneContainers", gContainersPane);
@@ -19,5 +19,5 @@ index 1fb8a954f61e89736b369f5fa01bb4f89fff16ad..3030c32cb66529f14e575428654778ab
+ register_module("paneZenCKS", gZenCKSSettings);
+ register_module("paneZenMarketplace", gZenMarketplaceManager);
if (Services.prefs.getBoolPref("browser.translations.newSettingsUI.enable")) {
register_module("paneTranslations", gTranslationsPane);
for (let [subPane, config] of Object.entries(CONFIG_PANES)) {
subPane = friendlyPrefCategoryNameToInternalName(subPane);

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml
index 0081bb470c9b15b39441ff844680e5e91b05fb86..3e4e7c43cf0e4feffb80623491de6222bb88a64b 100644
index 4500e3a3a7d54bd7647cd09ab0e11df782fb7a69..9506e860966e974b377b3e2e71c91f9d2c4a0c92 100644
--- a/browser/components/preferences/preferences.xhtml
+++ b/browser/components/preferences/preferences.xhtml
@@ -45,6 +45,8 @@
@@ -11,7 +11,7 @@ index 0081bb470c9b15b39441ff844680e5e91b05fb86..3e4e7c43cf0e4feffb80623491de6222
<link rel="localization" href="branding/brand.ftl"/>
<link rel="localization" href="browser/browser.ftl"/>
<!-- Used by fontbuilder.js -->
@@ -106,6 +108,11 @@
@@ -109,6 +111,11 @@
<hbox flex="1">
<vbox class="navigation">
@@ -23,7 +23,7 @@ index 0081bb470c9b15b39441ff844680e5e91b05fb86..3e4e7c43cf0e4feffb80623491de6222
<!-- category list -->
<richlistbox id="categories" data-l10n-id="category-list" data-l10n-attrs="aria-label">
<richlistitem id="category-general"
@@ -118,6 +125,50 @@
@@ -121,6 +128,50 @@
<label class="category-name" flex="1" data-l10n-id="pane-general-title"></label>
</richlistitem>
@@ -74,7 +74,7 @@ index 0081bb470c9b15b39441ff844680e5e91b05fb86..3e4e7c43cf0e4feffb80623491de6222
<richlistitem id="category-home"
class="category"
value="paneHome"
@@ -229,11 +280,6 @@
@@ -232,11 +283,6 @@
<html:a href="about:policies" target="_blank" data-l10n-id="managed-notice"/>
</hbox>
</hbox>
@@ -86,7 +86,7 @@ index 0081bb470c9b15b39441ff844680e5e91b05fb86..3e4e7c43cf0e4feffb80623491de6222
</hbox>
</hbox>
<vbox id="mainPrefPane">
@@ -247,6 +293,10 @@
@@ -250,6 +296,10 @@
#include sync.inc.xhtml
#include experimental.inc.xhtml
#include moreFromMozilla.inc.xhtml

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/preferences/sync.inc.xhtml b/browser/components/preferences/sync.inc.xhtml
index e59c536fc2fa06b11be9378a28285ac16fd16958..cf17ee3b6347b950fcf5bf260cd0631c77ffd1d3 100644
index 31b95644f820eda3267d3b52913ed0845abc1c80..1c8869418f7c88ed33601860dafd2c4eb0d5731f 100644
--- a/browser/components/preferences/sync.inc.xhtml
+++ b/browser/components/preferences/sync.inc.xhtml
@@ -223,6 +223,10 @@

View File

@@ -707,13 +707,39 @@ var gZenWorkspacesSettings = {
}
},
};
let toggleZenCycleByAttrWarning = {
observe() {
const warning = document.getElementById('zenTabsCycleByAttributeWarning');
warning.hidden = !(
Services.prefs.getBoolPref('zen.tabs.ctrl-tab.ignore-essential-tabs', false) &&
Services.prefs.getBoolPref('browser.ctrlTab.sortByRecentlyUsed', false)
);
},
};
toggleZenCycleByAttrWarning.observe(); // call it once on initial load
Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs
Services.prefs.addObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
Services.prefs.addObserver(
'zen.tabs.ctrl-tab.ignore-essential-tabs',
toggleZenCycleByAttrWarning
);
Services.prefs.addObserver('browser.ctrlTab.sortByRecentlyUsed', toggleZenCycleByAttrWarning);
window.addEventListener('unload', () => {
Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
Services.prefs.removeObserver(
'zen.tabs.ctrl-tab.ignore-essential-tabs',
toggleZenCycleByAttrWarning
);
Services.prefs.removeObserver(
'browser.ctrlTab.sortByRecentlyUsed',
toggleZenCycleByAttrWarning
);
});
},
};
@@ -1135,4 +1161,24 @@ Preferences.addAll([
type: 'bool',
default: true,
},
{
id: 'zen.tabs.ctrl-tab.ignore-essential-tabs',
type: 'bool',
default: false,
},
{
id: 'zen.tabs.ctrl-tab.ignore-pending-tabs',
type: 'bool',
default: false,
},
{
id: 'zen.tabs.close-on-back-with-no-history',
type: 'bool',
default: false,
},
]);
Preferences.addSetting({
id: 'zenWorkspaceContinueWhereLeftOff',
pref: 'zen.workspaces.continue-where-left-off',
});

View File

@@ -26,6 +26,17 @@
<checkbox id="zenWorkspacesForceContainerTabsToWorkspace"
data-l10n-id="zen-settings-workspaces-force-container-tabs-to-workspace"
preference="zen.workspaces.force-container-workspace"/>
<checkbox id="zenTabsCloseOnBackWithNoHistory"
data-l10n-id="zen-tabs-close-on-back-with-no-history"
preference="zen.tabs.close-on-back-with-no-history"/>
<checkbox data-l10n-id="zen-tabs-cycle-ignore-pending-tabs"
preference="zen.tabs.ctrl-tab.ignore-pending-tabs"/>
<checkbox data-l10n-id="zen-tabs-cycle-by-attribute"
preference="zen.tabs.ctrl-tab.ignore-essential-tabs"/>
<description id="zenTabsCycleByAttributeWarning"
class="description-deemphasized"
data-l10n-id="zen-tabs-cycle-by-attribute-warning"
hidden="true"/>
</groupbox>
<hbox id="zenTabsUnloadCategory"

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/search/SearchUIUtils.sys.mjs b/browser/components/search/SearchUIUtils.sys.mjs
index 55f90f4e802480728bbd5ef962b507183e017997..2a83f861fe6edee2b127c8d7946abcdcdbf677f5 100644
index 15fdb0cd7664c2b49977902d7f4c7a117d82cf15..6aedbc18de6604b63b2586e7d9745a4c4e7e38ae 100644
--- a/browser/components/search/SearchUIUtils.sys.mjs
+++ b/browser/components/search/SearchUIUtils.sys.mjs
@@ -430,7 +430,7 @@ export var SearchUIUtils = {
@@ -434,7 +434,7 @@ export var SearchUIUtils = {
triggeringSearchEngine: engine.name,
},
});

View File

@@ -1,17 +1,17 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d89fb95494 100644
index 1cdbc0f41bf5b55dfbbd850cb618c6d870f7a261..f13ed1412bb7ae6623aa2605d7691d10540eb659 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -126,6 +126,8 @@ const TAB_EVENTS = [
"TabUngrouped",
@@ -127,6 +127,8 @@ const TAB_EVENTS = [
"TabGroupCollapse",
"TabGroupExpand",
"TabSplitViewActivate",
+ "TabAddedToEssentials",
+ "TabRemovedFromEssentials",
];
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -1904,6 +1906,8 @@ var SessionStoreInternal = {
@@ -1911,6 +1913,8 @@ var SessionStoreInternal = {
case "TabPinned":
case "TabUnpinned":
case "SwapDocShells":
@@ -20,7 +20,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
this.saveStateDelayed(win);
break;
case "TabGroupCreate":
@@ -2139,7 +2143,6 @@ var SessionStoreInternal = {
@@ -2151,7 +2155,6 @@ var SessionStoreInternal = {
if (closedWindowState) {
let newWindowState;
if (
@@ -28,7 +28,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
!lazy.SessionStartup.willRestore()
) {
// We want to split the window up into pinned tabs and unpinned tabs.
@@ -2372,11 +2375,9 @@ var SessionStoreInternal = {
@@ -2384,11 +2387,9 @@ var SessionStoreInternal = {
tabbrowser.selectedTab.label;
}
@@ -40,7 +40,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
// Store the window's close date to figure out when each individual tab
// was closed. This timestamp should allow re-arranging data based on how
@@ -3361,7 +3362,7 @@ var SessionStoreInternal = {
@@ -3373,7 +3374,7 @@ var SessionStoreInternal = {
if (!isPrivateWindow && tabState.isPrivate) {
return;
}
@@ -49,7 +49,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
return;
}
@@ -4073,6 +4074,11 @@ var SessionStoreInternal = {
@@ -4089,6 +4090,11 @@ var SessionStoreInternal = {
Math.min(tabState.index, tabState.entries.length)
);
tabState.pinned = false;
@@ -61,7 +61,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
if (inBackground === false) {
aWindow.gBrowser.selectedTab = newTab;
@@ -4509,6 +4515,7 @@ var SessionStoreInternal = {
@@ -4525,6 +4531,7 @@ var SessionStoreInternal = {
// Append the tab if we're opening into a different window,
tabIndex: aSource == aTargetWindow ? pos : Infinity,
pinned: state.pinned,
@@ -69,7 +69,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
userContextId: state.userContextId,
skipLoad: true,
preferredRemoteType,
@@ -5358,7 +5365,7 @@ var SessionStoreInternal = {
@@ -5374,7 +5381,7 @@ var SessionStoreInternal = {
for (let i = tabbrowser.pinnedTabCount; i < tabbrowser.tabs.length; i++) {
let tab = tabbrowser.tabs[i];
@@ -78,7 +78,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
removableTabs.push(tab);
}
}
@@ -5418,7 +5425,7 @@ var SessionStoreInternal = {
@@ -5434,7 +5441,7 @@ var SessionStoreInternal = {
}
let workspaceID = aWindow.getWorkspaceID();
@@ -87,7 +87,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
winData.workspaceID = workspaceID;
}
},
@@ -5609,11 +5616,12 @@ var SessionStoreInternal = {
@@ -5625,11 +5632,12 @@ var SessionStoreInternal = {
}
let tabbrowser = aWindow.gBrowser;
@@ -101,7 +101,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
// update the internal state data for this window
for (let tab of tabs) {
if (tab == aWindow.FirefoxViewHandler.tab) {
@@ -5624,6 +5632,7 @@ var SessionStoreInternal = {
@@ -5640,6 +5648,7 @@ var SessionStoreInternal = {
tabsData.push(tabData);
}
@@ -109,7 +109,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
// update tab group state for this window
winData.groups = [];
for (let tabGroup of aWindow.gBrowser.tabGroups) {
@@ -5636,7 +5645,7 @@ var SessionStoreInternal = {
@@ -5652,7 +5661,7 @@ var SessionStoreInternal = {
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected).
if (aWindow.FirefoxViewHandler.tab?.selected) {
@@ -118,7 +118,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
winData.title = tabbrowser.tabs[0].label;
}
winData.selected = selectedIndex;
@@ -5748,8 +5757,8 @@ var SessionStoreInternal = {
@@ -5764,8 +5773,8 @@ var SessionStoreInternal = {
// selectTab represents.
let selectTab = 0;
if (overwriteTabs) {
@@ -129,7 +129,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
selectTab = Math.min(selectTab, winData.tabs.length);
}
@@ -5792,6 +5801,8 @@ var SessionStoreInternal = {
@@ -5808,6 +5817,8 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
@@ -138,7 +138,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -6348,6 +6359,25 @@ var SessionStoreInternal = {
@@ -6371,6 +6382,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.
@@ -164,7 +164,7 @@ index eb62ff3e733e43fdaa299babddea3ba0125abb06..8f20ba50b06f5b75d7de08eb4d1b27d8
if (tabData.pinned) {
tabbrowser.pinTab(tab);
@@ -7263,7 +7293,7 @@ var SessionStoreInternal = {
@@ -7289,7 +7319,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) {

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/sidebar/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js
index c4edb5442e5243b7d9fe35e1774b2fc651903601..d58076fedafe07d3401ab1723eaa837fabbae09f 100644
index 220c3c83fa09daaec433803a4655a20114a137a6..1ef8adc3ecfa61839bb993f7fc090133bffe77db 100644
--- a/browser/components/sidebar/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js
@@ -779,7 +779,7 @@ var SidebarController = {
@@ -793,7 +793,7 @@ var SidebarController = {
setPosition() {
// First reset all ordinals to match DOM ordering.
let contentArea = document.getElementById("tabbrowser-tabbox");

View File

@@ -1,12 +1,12 @@
diff --git a/browser/components/tabbrowser/AsyncTabSwitcher.sys.mjs b/browser/components/tabbrowser/AsyncTabSwitcher.sys.mjs
index 773f595e89e268578ba153907babec95b58a155a..abe86fc3d243a85c4a8dbee854a2d0130f7270fd 100644
index bcd7689e9d68ef8b171c327188174334c4271e21..f69180acb87644f109aa91b871e347f1b1835f53 100644
--- a/browser/components/tabbrowser/AsyncTabSwitcher.sys.mjs
+++ b/browser/components/tabbrowser/AsyncTabSwitcher.sys.mjs
@@ -937,6 +937,7 @@ export class AsyncTabSwitcher {
return !(
@@ -938,6 +938,7 @@ export class AsyncTabSwitcher {
this.tabbrowser._printPreviewBrowsers.has(browser) ||
this.tabbrowser.splitViewBrowsers.includes(browser) ||
lazy.PictureInPicture.isOriginatingBrowser(browser)
+ || browser?.hasAttribute('zen-glance-background')
+ || browser?.parentNode?.parentNode?.parentNode?.classList?.contains("zen-glance-background")
);
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/TabsList.sys.mjs b/browser/components/tabbrowser/TabsList.sys.mjs
index 20a543dede6bf4428c8af19c5d0589788ddd8eaa..27a378e70f5b280b720c95ba8dac2cc4e88985be 100644
index b394a980869d5e5df01b6afdd81e0f41c090e6ec..236c99db0dfa5ebcba50d55c1e4eb6ab7b8110b2 100644
--- a/browser/components/tabbrowser/TabsList.sys.mjs
+++ b/browser/components/tabbrowser/TabsList.sys.mjs
@@ -87,7 +87,7 @@ class TabsListBase {

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/browser-ctrlTab.js b/browser/components/tabbrowser/content/browser-ctrlTab.js
index 22db482e62e754135d8a6cf824914a3e3e06c45c..bdc18d575b33e788f9628b4cb648d5c3e8781666 100644
index 958728cde19dd7cc24692baa89e11fcab816ab82..32e2b6af2536133f170bd5e14c47392ded8440eb 100644
--- a/browser/components/tabbrowser/content/browser-ctrlTab.js
+++ b/browser/components/tabbrowser/content/browser-ctrlTab.js
@@ -252,7 +252,8 @@ var ctrlTab = {
@@ -249,7 +249,8 @@ var ctrlTab = {
},
get tabList() {
@@ -12,7 +12,7 @@ index 22db482e62e754135d8a6cf824914a3e3e06c45c..bdc18d575b33e788f9628b4cb648d5c3
},
init: function ctrlTab_init() {
@@ -463,7 +464,7 @@ var ctrlTab = {
@@ -460,7 +461,7 @@ var ctrlTab = {
// If the tab is hidden, don't add it to the list unless it's selected
// (Normally hidden tabs would be unhidden when selected, but that doesn't
// happen for Firefox View).
@@ -21,7 +21,7 @@ index 22db482e62e754135d8a6cf824914a3e3e06c45c..bdc18d575b33e788f9628b4cb648d5c3
return;
}
@@ -487,7 +488,7 @@ var ctrlTab = {
@@ -484,7 +485,7 @@ var ctrlTab = {
},
open: function ctrlTab_open() {
@@ -30,7 +30,7 @@ index 22db482e62e754135d8a6cf824914a3e3e06c45c..bdc18d575b33e788f9628b4cb648d5c3
return;
}
@@ -765,7 +766,7 @@ var ctrlTab = {
@@ -763,7 +764,7 @@ var ctrlTab = {
_initRecentlyUsedTabs() {
this._recentlyUsedTabs = Array.prototype.filter.call(
gBrowser.tabs,

View File

@@ -0,0 +1,439 @@
diff --git a/browser/components/tabbrowser/content/drag-and-drop.js b/browser/components/tabbrowser/content/drag-and-drop.js
index c97c661656868bc7faaf7c66c9702eea056aafe1..aa9f0ed071e4898cac2b98a4d81e95df6a41b8dd 100644
--- a/browser/components/tabbrowser/content/drag-and-drop.js
+++ b/browser/components/tabbrowser/content/drag-and-drop.js
@@ -32,6 +32,9 @@
* @returns {MozTabbrowserTab|vbox}
*/
const elementToMove = element => {
+ if (element.group?.hasAttribute("split-view-group")) {
+ return element.group;
+ }
if (isTab(element)) {
return element;
}
@@ -118,6 +121,10 @@
}
let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
+ if (draggedTab && dropEffect === "move") {
+ gZenPinnedTabManager.applyDragoverClass(event, draggedTab);
+ gZenViewSplitter.onBrowserDragEndToSplit(event);
+ }
if (
(dropEffect == "move" || dropEffect == "copy") &&
document == draggedTab.ownerDocument &&
@@ -272,6 +279,18 @@
this.#tabDropIndicator.hidden = true;
event.stopPropagation();
+ if (draggedTab?.hasAttribute("zen-has-splitted")) {
+ draggedTab.removeAttribute("zen-has-splitted");
+ draggedTab._visuallySelected = false;
+ }
+ if (draggedTab && dropEffect == "move") {
+ let moved = gZenPinnedTabManager.moveToAnotherTabContainerIfNecessary(event, movingTabs);
+
+ if (moved) {
+ this.finishMoveTogetherSelectedTabs(draggedTab);
+ return;
+ }
+ }
if (draggedTab && dropEffect == "copy") {
let duplicatedDraggedTab;
let duplicatedTabs = [];
@@ -297,8 +316,9 @@
let translateOffsetY = oldTranslateY % tabHeight;
let newTranslateX = oldTranslateX - translateOffsetX;
let newTranslateY = oldTranslateY - translateOffsetY;
- let isPinned = draggedTab.pinned;
- let numPinned = gBrowser.pinnedTabCount;
+ let isPinned = draggedTab?.group ? draggedTab.group.pinned : draggedTab.pinned;
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential");
if (this.#isContainerVerticalPinnedGrid(draggedTab)) {
// Update both translate axis for pinned vertical expanded tabs
@@ -314,8 +334,8 @@
}
} else {
let tabs = this.#tabbrowserTabs.ariaFocusableItems.slice(
- isPinned ? 0 : numPinned,
- isPinned ? numPinned : undefined
+ isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned,
+ isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined
);
let size = this.#tabbrowserTabs.verticalMode ? "height" : "width";
let screenAxis = this.#tabbrowserTabs.verticalMode
@@ -368,11 +388,13 @@
this.#dragToPinPromoCard,
];
let shouldPin =
+ false &&
isTab(draggedTab) &&
!draggedTab.pinned &&
(overPinnedDropIndicator ||
dragToPinTargets.some(el => el.contains(event.target)));
let shouldUnpin =
+ false &&
isTab(draggedTab) &&
draggedTab.pinned &&
this.#tabbrowserTabs.arrowScrollbox.contains(event.target);
@@ -390,6 +412,7 @@
(oldTranslateY && oldTranslateY != newTranslateY);
} else if (this.#tabbrowserTabs.verticalMode) {
shouldTranslate &&= oldTranslateY && oldTranslateY != newTranslateY;
+ shouldTranslate = false;
} else {
shouldTranslate &&= oldTranslateX && oldTranslateX != newTranslateX;
}
@@ -446,7 +469,7 @@
item.removeAttribute("tabdrop-samewindow");
resolve();
};
- if (gReduceMotion) {
+ if (true || gReduceMotion) {
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -586,6 +609,7 @@
let nextItem = this.#tabbrowserTabs.ariaFocusableItems[newIndex];
let tabGroup = isTab(nextItem) && nextItem.group;
+ if (gZenViewSplitter.handleTabDrop(event, urls, replace, inBackground)) return;
gBrowser.loadTabs(urls, {
inBackground,
replace,
@@ -623,7 +647,16 @@
this.#expandGroupOnDrop(draggedTab);
}
this.#resetTabsAfterDrop(draggedTab.ownerDocument);
-
+ if (!dt.mozUserCancelled && dt.dropEffect == "none" && !this._isCustomizing) {
+ const moved = gZenViewSplitter.moveTabToSplitView(event, draggedTab);
+ if (moved) {
+ delete draggedTab._dragData;
+ return;
+ }
+ } else if (dt.mozUserCancelled) {
+ gZenViewSplitter.onBrowserDragEndToSplit(event, true);
+ if (gZenViewSplitter._lastOpenedTab) gZenViewSplitter._lastOpenedTab._visuallySelected = false;
+ }
if (
dt.mozUserCancelled ||
dt.dropEffect != "none" ||
@@ -827,7 +860,10 @@
#getDragTarget(event, { ignoreSides = false } = {}) {
let { target } = event;
while (target) {
- if (isTab(target) || isTabGroupLabel(target)) {
+ if (isTab(target) || isTabGroupLabel(target) || target?.classList?.contains("tab-group-label-container")) {
+ if (target.classList?.contains("tab-group-label-container")) {
+ target = target.querySelector(".tab-group-label");
+ }
break;
}
target = target.parentNode;
@@ -844,14 +880,17 @@
return null;
}
}
+ if (target?.group?.hasAttribute("split-view-group")) {
+ target = target.group.labelElement;
+ }
return target;
}
#isContainerVerticalPinnedGrid(tab) {
return (
this.#tabbrowserTabs.verticalMode &&
- tab.pinned &&
- this.#tabbrowserTabs.hasAttribute("expanded") &&
+ (tab.hasAttribute("zen-essential")) &&
+ (this.hasAttribute("expanded") || document.documentElement.hasAttribute("zen-sidebar-expanded")) &&
!this.#tabbrowserTabs.expandOnHover
);
}
@@ -882,7 +921,8 @@
isTabGroupLabel(draggedTab) &&
draggedTab._dragData?.expandGroupOnDrop
) {
- draggedTab.group.collapsed = false;
+ draggedTab.group.collapsed = draggedTab.group.hasAttribute("has-active");
+ gZenFolders.animateGroupMove(draggedTab.group, true);
}
}
@@ -947,10 +987,7 @@
if (this.#isContainerVerticalPinnedGrid(tab)) {
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
// Set this before adjusting dragged tab's position
- let pinnedTabs = this.#tabbrowserTabs.visibleTabs.slice(
- 0,
- gBrowser.pinnedTabCount
- );
+ let pinnedTabs = this.#tabbrowserTabs.ariaFocusableItems.slice(0, gBrowser._numZenEssentials);
let tabsPerRow = 0;
let position = RTL_UI
? window.windowUtils.getBoundsWithoutFlushing(
@@ -1117,7 +1154,7 @@
let dropEffect = this.getDropEffectForTabDrag(event);
let isMovingInTabStrip = !fromTabList && dropEffect == "move";
let collapseTabGroupDuringDrag =
- isMovingInTabStrip && isTabGroupLabel(tab) && !tab.group.collapsed;
+ isMovingInTabStrip && isTabGroupLabel(tab) && (!tab.group.collapsed || tab.group.hasAttribute("has-active"));
tab._dragData = {
offsetX: this.#tabbrowserTabs.verticalMode
@@ -1127,7 +1164,7 @@
? event.screenY - window.screenY - tabOffset
: event.screenY - window.screenY,
scrollPos:
- this.#tabbrowserTabs.verticalMode && tab.pinned
+ this.#tabbrowserTabs.verticalMode && tab.pinned && false
? this.#tabbrowserTabs.pinnedTabsContainer.scrollPosition
: this.#tabbrowserTabs.arrowScrollbox.scrollPosition,
screenX: event.screenX,
@@ -1156,6 +1193,7 @@
if (collapseTabGroupDuringDrag) {
tab.group.collapsed = true;
+ gZenFolders.animateGroupMove(tab.group);
}
}
}
@@ -1174,6 +1212,16 @@
when the tab is first selected to be dragged.
*/
#updateTabStylesOnDrag(tab) {
+ let { movingTabs: zenMovingTabs } = tab._dragData;
+ for (let movingTab of zenMovingTabs.slice(zenMovingTabs.findIndex(t => t._tPos == tab._tPos))) {
+ if (isTabGroupLabel(tab)) {
+ movingTab = movingTab.parentElement;
+ }
+ // "dragtarget" contains the following rules which must only be set AFTER the above
+ // elements have been adjusted. {z-index: 3 !important, position: absolute !important}
+ movingTab.setAttribute("zen-dragtarget", "");
+ }
+ return;
let isPinned = tab.pinned;
let numPinned = gBrowser.pinnedTabCount;
let allTabs = this.#tabbrowserTabs.ariaFocusableItems;
@@ -1624,10 +1672,7 @@
return;
}
- let tabs = this.#tabbrowserTabs.visibleTabs.slice(
- 0,
- gBrowser.pinnedTabCount
- );
+ let tabs = this.#tabbrowserTabs.ariaFocusableItems.slice(0, gBrowser._numZenEssentials);
let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY;
@@ -1636,6 +1681,8 @@
let { width: tabWidth, height: tabHeight } =
draggedTab.getBoundingClientRect();
+ tabWidth += 4; // Add 4px to account for the gap
+ tabHeight += 4;
let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth;
@@ -1672,8 +1719,8 @@
let lastBoundX =
lastTabInRow.screenX +
lastTabInRow.getBoundingClientRect().width -
- (lastMovingTabScreenX + tabWidth);
- let lastBoundY = periphery.screenY - (lastMovingTabScreenY + tabHeight);
+ (lastMovingTabScreenX + tabWidth) + 4;
+ let lastBoundY = lastTab.screenY - lastMovingTabScreenY;
translateX = Math.min(Math.max(translateX, firstBoundX), lastBoundX);
translateY = Math.min(Math.max(translateY, firstBoundY), lastBoundY);
@@ -1833,13 +1880,18 @@
this.#clearDragOverGroupingTimer();
this.#clearPinnedDropIndicatorTimer();
- let isPinned = draggedTab.pinned;
- let numPinned = gBrowser.pinnedTabCount;
+ let isPinned = draggedTab?.group ? draggedTab.group.pinned : draggedTab.pinned;
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential");
+ const isDraggingFolder = isTabGroupLabel(draggedTab) && draggedTab.group?.isZenFolder;
let allTabs = this.#tabbrowserTabs.ariaFocusableItems;
let tabs = allTabs.slice(
- isPinned ? 0 : numPinned,
- isPinned ? numPinned : undefined
+ (isPinned && essential) ? 0 : gBrowser._numZenEssentials,
+ isPinned ? (essential ? gBrowser._numZenEssentials : (isDraggingFolder ? numPinned : undefined)) : undefined
);
+ if (draggedTab.group?.hasAttribute("split-view-group")) {
+ draggedTab = draggedTab.group.labelElement;
+ }
if (this.#rtlMode) {
tabs.reverse();
@@ -1854,7 +1906,7 @@
let translateAxis = this.#tabbrowserTabs.verticalMode
? "translateY"
: "translateX";
- let { width: tabWidth, height: tabHeight } = bounds(draggedTab);
+ let { width: tabWidth, height: tabHeight } = bounds(draggedTab.group?.hasAttribute("split-view-group") ? draggedTab.group : draggedTab);
let tabSize = this.#tabbrowserTabs.verticalMode ? tabHeight : tabWidth;
let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY;
@@ -1870,6 +1922,12 @@
);
let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0];
+ if (lastMovingTab.group?.hasAttribute("split-view-group")) {
+ lastMovingTab = lastMovingTab.group;
+ }
+ if (firstMovingTab.group?.hasAttribute("split-view-group")) {
+ firstMovingTab = firstMovingTab.group;
+ }
let endEdge = ele => ele[screenAxis] + bounds(ele)[size];
let lastMovingTabScreen = endEdge(lastMovingTab);
let firstMovingTabScreen = firstMovingTab[screenAxis];
@@ -1884,6 +1942,13 @@
let endBound = this.#rtlMode
? endEdge(this.#tabbrowserTabs) - lastMovingTabScreen
: periphery[screenAxis] - 1 - lastMovingTabScreen;
+ {
+ let firstTab = tabs.at(this.#rtlMode ? -1 : 0);
+ let lastTab = tabs.at(this.#rtlMode ? 0 : -1);
+ startBound = firstTab[screenAxis] - firstMovingTabScreen;
+ endBound = endEdge(lastTab) - lastMovingTabScreen;
+ endBound = gZenPinnedTabManager.getLastTabBound(endBound, lastTab, isDraggingFolder);
+ }
translate = Math.min(Math.max(translate, startBound), endBound);
// Center the tab under the cursor if the tab is not under the cursor while dragging
@@ -2075,6 +2140,8 @@
};
let dropElement = getOverlappedElement();
+ if (dropElement?.hasAttribute("split-view-group")) dropElement = dropElement.labelElement;
+ gZenPinnedTabManager.animateSeparatorMove(movingTabs, dropElement, isPinned, event);
let newDropElementIndex;
if (dropElement) {
@@ -2157,7 +2224,7 @@
? Services.prefs.getIntPref(
"browser.tabs.dragDrop.moveOverThresholdPercent"
) / 100
- : 0.5;
+ : Services.prefs.getIntPref('zen.view.drag-and-drop.move-over-threshold') / 100;
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
let shouldMoveOver = overlapPercent > moveOverThreshold;
if (logicalForward && shouldMoveOver) {
@@ -2190,6 +2257,7 @@
// If dragging a group over another group, don't make it look like it is
// possible to drop the dragged group inside the other group.
if (
+ false &&
isTabGroupLabel(draggedTab) &&
dropElement?.group &&
(!dropElement.group.collapsed ||
@@ -2216,20 +2284,13 @@
let isOutOfBounds = isPinned
? dropElement.elementIndex >= numPinned
: dropElement.elementIndex < numPinned;
- if (isOutOfBounds) {
- // Drop after last pinned tab
- dropElement = this.#tabbrowserTabs.ariaFocusableItems[numPinned - 1];
- dropBefore = false;
- }
}
- if (
- gBrowser._tabGroupsEnabled &&
- isTab(draggedTab) &&
- !isPinned &&
- (!numPinned || newDropElementIndex > numPinned)
- ) {
+ if (isTab(draggedTab) || isTabGroupLabel(draggedTab)) {
let dragOverGroupingThreshold = 1 - moveOverThreshold;
+ if (draggedTab && !dropElement?.group) {
+ gZenFolders.highlightGroupOnDragOver(null);
+ }
let groupingDelay = Services.prefs.getIntPref(
"browser.tabs.dragDrop.createGroup.delayMS"
);
@@ -2237,6 +2298,7 @@
// When dragging tab(s) over an ungrouped tab, signal to the user
// that dropping the tab(s) will create a new tab group.
let shouldCreateGroupOnDrop =
+ false &&
!movingTabsSet.has(dropElement) &&
isTab(dropElement) &&
!dropElement?.group &&
@@ -2245,6 +2307,7 @@
// When dragging tab(s) over a collapsed tab group label, signal to the
// user that dropping the tab(s) will add them to the group.
let shouldDropIntoCollapsedTabGroup =
+ false &&
isTabGroupLabel(dropElement) &&
dropElement.group.collapsed &&
overlapPercent > dragOverGroupingThreshold;
@@ -2302,6 +2365,14 @@
dropElement = dropElementGroup.tabs[0];
dropBefore = true;
}
+ ({ dropElement, colorCode, dropBefore } = gZenFolders.handleDragOverTabGroupLabel(
+ dropElement,
+ draggedTab,
+ overlapPercent,
+ movingTabs,
+ dropBefore,
+ colorCode
+ ));
}
this.#setDragOverGroupColor(colorCode);
this.#tabbrowserTabs.toggleAttribute(
@@ -2324,10 +2395,11 @@
dragData.dropBefore = dropBefore;
dragData.animDropElementIndex = newDropElementIndex;
+ gZenFolders.setFolderIndentation(movingTabs, dropElement);
// Shift background tabs to leave a gap where the dragged tab
// would currently be dropped.
for (let item of tabs) {
- if (item == draggedTab) {
+ if (item == draggedTab || (item.group?.hasAttribute("split-view-group") && item.group == draggedTab.group)) {
continue;
}
@@ -2417,11 +2489,13 @@
}
finishAnimateTabMove() {
+ gZenPinnedTabManager.onDragFinish();
if (!this.#isMovingTab()) {
return;
}
this.#setMovingTabMode(false);
+ gZenFolders.highlightGroupOnDragOver(null);
for (let item of this.#tabbrowserTabs.ariaFocusableItems) {
this.#resetGroupTarget(item);
@@ -2457,7 +2531,7 @@
tab.style.left = "";
tab.style.top = "";
tab.style.maxWidth = "";
- tab.removeAttribute("dragtarget");
+ tab.removeAttribute("zen-dragtarget");
}
for (let label of draggedTabDocument.getElementsByClassName(
"tab-group-label-container"
@@ -2467,7 +2541,7 @@
label.style.left = "";
label.style.top = "";
label.style.maxWidth = "";
- label.removeAttribute("dragtarget");
+ label.removeAttribute("zen-dragtarget");
}
let periphery = draggedTabDocument.getElementById(
"tabbrowser-arrowscrollbox-periphery"

View File

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

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394b7dbc6a7 100644
index c0eafd4faf8d57b8486c5bf8917375850ec8147e..2ab3908f421d6bc126eb7a0f886646ad0c761fb5 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -432,15 +432,64 @@
@@ -450,15 +450,64 @@
return this.tabContainer.visibleTabs;
}
@@ -69,7 +69,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
set selectedTab(val) {
if (
gSharedTabWarning.willShowSharedTabWarning(val) ||
@@ -588,6 +637,7 @@
@@ -613,6 +662,7 @@
this.tabpanels.appendChild(panel);
let tab = this.tabs[0];
@@ -77,7 +77,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tab.linkedPanel = uniqueId;
this._selectedTab = tab;
this._selectedBrowser = browser;
@@ -873,13 +923,17 @@
@@ -898,13 +948,17 @@
}
this.showTab(aTab);
@@ -96,7 +96,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.setAttribute("pinned", "true");
this._updateTabBarForPinnedTabs();
@@ -892,11 +946,15 @@
@@ -917,11 +971,15 @@
}
this.#handleTabMove(aTab, () => {
@@ -113,7 +113,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
aTab.style.marginInlineStart = "";
@@ -1073,6 +1131,8 @@
@@ -1098,6 +1156,8 @@
let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"];
@@ -122,7 +122,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
aIconURL &&
!LOCAL_PROTOCOLS.some(protocol => aIconURL.startsWith(protocol))
@@ -1082,6 +1142,9 @@
@@ -1107,6 +1167,9 @@
);
return;
}
@@ -132,7 +132,15 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aIconURL;
@@ -1445,6 +1508,7 @@
@@ -1379,7 +1442,6 @@
// Preview mode should not reset the owner
if (!this._previewMode && !oldTab.selected) {
- oldTab.owner = null;
}
let lastRelatedTab = this._lastRelatedTabMap.get(oldTab);
@@ -1470,6 +1532,7 @@
if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed();
@@ -140,7 +148,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -1597,6 +1661,9 @@
@@ -1622,6 +1685,9 @@
}
let activeEl = document.activeElement;
@@ -150,7 +158,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1920,7 +1987,8 @@
@@ -1945,7 +2011,8 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
@@ -160,7 +168,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return false;
}
@@ -2028,7 +2096,7 @@
@@ -2053,7 +2120,7 @@
newIndex = this.selectedTab._tPos + 1;
}
@@ -169,7 +177,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.isTabGroupLabel(targetTab)) {
throw new Error(
"Replacing a tab group label with a tab is not supported"
@@ -2303,6 +2371,7 @@
@@ -2328,6 +2395,7 @@
uriIsAboutBlank,
userContextId,
skipLoad,
@@ -177,7 +185,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2376,8 +2445,7 @@
@@ -2401,8 +2469,7 @@
// we use a different attribute name for this?
b.setAttribute("name", name);
}
@@ -187,7 +195,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
b.setAttribute("transparent", "true");
}
@@ -2542,7 +2610,7 @@
@@ -2567,7 +2634,7 @@
let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID();
@@ -196,7 +204,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary.
@@ -2601,8 +2669,8 @@
@@ -2626,8 +2693,8 @@
// If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) {
@@ -207,7 +215,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
}
@@ -2779,7 +2847,6 @@
@@ -2814,7 +2881,6 @@
this.selectedTab = this.addTrustedTab(BROWSER_NEW_TAB_URL, {
tabIndex: tab._tPos + 1,
userContextId: tab.userContextId,
@@ -215,7 +223,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
focusUrlBar: true,
});
resolve(this.selectedBrowser);
@@ -2859,6 +2926,8 @@
@@ -2923,6 +2989,8 @@
schemelessInput,
hasValidUserGestureActivation = false,
textDirectiveUserActivation = false,
@@ -224,7 +232,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2869,6 +2938,12 @@
@@ -2933,10 +3001,17 @@
);
}
@@ -237,7 +245,20 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -2932,6 +3007,19 @@
+ if (!gURLBar.hasAttribute("zen-newtab")) {
// If we're opening a foreground tab, set the owner by default.
ownerTab ??= inBackground ? null : this.selectedTab;
@@ -2944,6 +3019,7 @@
if (this.selectedTab.owner) {
this.selectedTab.owner = null;
}
+ }
// Find the tab that opened this one, if any. This is used for
// determining positioning, and inherited attributes such as the
@@ -2996,6 +3072,19 @@
noInitialLabel,
skipBackgroundNotify,
});
@@ -257,7 +278,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (insertTab) {
// Insert the tab into the tab container in the correct position.
this.#insertTabAtIndex(t, {
@@ -2940,6 +3028,7 @@
@@ -3004,6 +3093,7 @@
ownerTab,
openerTab,
pinned,
@@ -265,7 +286,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
bulkOrderedOpen,
tabGroup: tabGroup ?? openerTab?.group,
});
@@ -2958,6 +3047,7 @@
@@ -3022,6 +3112,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -273,7 +294,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}));
if (focusUrlBar) {
@@ -3078,6 +3168,12 @@
@@ -3146,6 +3237,12 @@
}
}
@@ -286,7 +307,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Additionally send pinned tab events
if (pinned) {
this.#notifyPinnedStatus(t);
@@ -3248,10 +3344,10 @@
@@ -3330,10 +3427,10 @@
isAdoptingGroup = false,
isUserTriggered = false,
telemetryUserCreateSource = "unknown",
@@ -298,7 +319,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
if (!color) {
@@ -3272,9 +3368,14 @@
@@ -3354,9 +3451,14 @@
label,
isAdoptingGroup
);
@@ -315,7 +336,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
group.addTabs(tabs);
@@ -3395,7 +3496,7 @@
@@ -3477,7 +3579,7 @@
}
this.#handleTabMove(tab, () =>
@@ -324,7 +345,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
}
@@ -3597,6 +3698,7 @@
@@ -3679,6 +3781,7 @@
openWindowInfo,
skipLoad,
triggeringRemoteType,
@@ -332,7 +353,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
) {
// If we don't have a preferred remote type (or it is `NOT_REMOTE`), and
@@ -3666,6 +3768,7 @@
@@ -3748,6 +3851,7 @@
openWindowInfo,
name,
skipLoad,
@@ -340,7 +361,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
}
@@ -3853,7 +3956,7 @@
@@ -3935,7 +4039,7 @@
// Add a new tab if needed.
if (!tab) {
let createLazyBrowser =
@@ -349,7 +370,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let url = "about:blank";
if (tabData.entries?.length) {
@@ -3890,8 +3993,10 @@
@@ -3972,8 +4076,10 @@
insertTab: false,
skipLoad: true,
preferredRemoteType,
@@ -361,7 +382,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (select) {
tabToSelect = tab;
}
@@ -3903,7 +4008,8 @@
@@ -3985,7 +4091,8 @@
this.pinTab(tab);
// Then ensure all the tab open/pinning information is sent.
this._fireTabOpen(tab, {});
@@ -371,7 +392,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group
@@ -3917,7 +4023,10 @@
@@ -3999,7 +4106,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
@@ -383,7 +404,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3962,9 +4071,23 @@
@@ -4044,9 +4154,23 @@
// to remove the old selected tab.
if (tabToSelect) {
let leftoverTab = this.selectedTab;
@@ -407,7 +428,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -4155,11 +4278,14 @@
@@ -4237,11 +4361,14 @@
if (ownerTab) {
tab.owner = ownerTab;
}
@@ -423,7 +444,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -4171,7 +4297,7 @@
@@ -4253,7 +4380,7 @@
let lastRelatedTab =
openerTab && this._lastRelatedTabMap.get(openerTab);
let previousTab = lastRelatedTab || openerTab || this.selectedTab;
@@ -432,7 +453,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tabGroup = previousTab.group;
}
if (
@@ -4182,7 +4308,7 @@
@@ -4264,7 +4391,7 @@
) {
elementIndex = Infinity;
} else if (previousTab.visible) {
@@ -441,7 +462,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (previousTab == FirefoxViewHandler.tab) {
elementIndex = 0;
}
@@ -4210,14 +4336,14 @@
@@ -4292,14 +4419,14 @@
}
// Ensure index is within bounds.
if (tab.pinned) {
@@ -460,7 +481,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (pinned && !itemAfter?.pinned) {
itemAfter = null;
@@ -4228,7 +4354,7 @@
@@ -4310,7 +4437,7 @@
this.tabContainer._invalidateCachedTabs();
@@ -469,7 +490,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.isTab(itemAfter) && itemAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, itemAfter);
@@ -4264,6 +4390,7 @@
@@ -4346,6 +4473,7 @@
if (pinned) {
this._updateTabBarForPinnedTabs();
}
@@ -477,7 +498,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
TabBarVisibility.update();
}
@@ -4553,6 +4680,9 @@
@@ -4635,6 +4763,9 @@
return;
}
@@ -487,7 +508,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
this.removeTabs(selectedTabs, { isUserTriggered, telemetrySource });
}
@@ -4814,6 +4944,7 @@
@@ -4896,6 +5027,7 @@
telemetrySource,
} = {}
) {
@@ -495,7 +516,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
@@ -4903,6 +5034,7 @@
@@ -4985,6 +5117,7 @@
if (lastToClose) {
this.removeTab(lastToClose, aParams);
}
@@ -503,7 +524,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} catch (e) {
console.error(e);
}
@@ -4941,6 +5073,12 @@
@@ -5023,6 +5156,12 @@
aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start();
}
@@ -516,7 +537,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4955,6 +5093,9 @@
@@ -5037,6 +5176,9 @@
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
let isLastTab = this.#isLastTabInWindow(aTab);
@@ -526,7 +547,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -5003,7 +5144,13 @@
@@ -5085,7 +5227,13 @@
// We're not animating, so we can cancel the animation stopwatch.
Glean.browserTabclose.timeAnim.cancel(aTab._closeTimeAnimTimerId);
aTab._closeTimeAnimTimerId = null;
@@ -541,7 +562,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return;
}
@@ -5137,7 +5284,7 @@
@@ -5219,7 +5367,7 @@
closeWindowWithLastTab != null
? closeWindowWithLastTab
: !window.toolbar.visible ||
@@ -550,7 +571,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -5161,6 +5308,7 @@
@@ -5243,6 +5391,7 @@
newTab = true;
}
@@ -558,7 +579,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -5201,13 +5349,7 @@
@@ -5283,13 +5432,7 @@
aTab._mouseleave();
if (newTab) {
@@ -573,7 +594,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
TabBarVisibility.update();
}
@@ -5340,6 +5482,7 @@
@@ -5422,6 +5565,7 @@
this.tabs[i]._tPos = i;
}
@@ -581,7 +602,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (!this._windowIsClosing) {
// update tab close buttons state
this.tabContainer._updateCloseButtons();
@@ -5552,6 +5695,7 @@
@@ -5643,6 +5787,7 @@
}
let excludeTabs = new Set(aExcludeTabs);
@@ -589,7 +610,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// If this tab has a successor, it should be selectable, since
// hiding or closing a tab removes that tab as a successor.
@@ -5564,13 +5708,13 @@
@@ -5655,13 +5800,13 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -605,7 +626,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
);
let tab = this.tabContainer.findNextTab(aTab, {
@@ -5586,7 +5730,7 @@
@@ -5677,7 +5822,7 @@
}
if (tab) {
@@ -614,7 +635,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5607,7 +5751,7 @@
@@ -5698,7 +5843,7 @@
});
}
@@ -623,7 +644,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
_blurTab(aTab) {
@@ -6013,10 +6157,10 @@
@@ -6104,10 +6249,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -636,7 +657,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -6075,6 +6219,7 @@
@@ -6166,6 +6311,7 @@
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
*/
replaceTabWithWindow(aTab, aOptions) {
@@ -644,7 +665,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (this.tabs.length == 1) {
return null;
}
@@ -6208,7 +6353,7 @@
@@ -6299,7 +6445,7 @@
* `true` if element is a `<tab-group>`
*/
isTabGroup(element) {
@@ -653,7 +674,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
}
/**
@@ -6284,8 +6429,8 @@
@@ -6375,8 +6521,8 @@
}
// Don't allow mixing pinned and unpinned tabs.
@@ -664,7 +685,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
}
@@ -6311,10 +6456,16 @@
@@ -6402,10 +6548,16 @@
this.#handleTabMove(
element,
() => {
@@ -683,7 +704,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
@@ -6372,23 +6523,28 @@
@@ -6463,23 +6615,28 @@
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
if (this.isTabGroupLabel(targetElement)) {
targetElement = targetElement.group;
@@ -718,7 +739,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (!element.pinned && targetElement && targetElement.pinned) {
// If the caller asks to move an unpinned element next to a pinned
// tab, move the unpinned element to be the first unpinned element
@@ -6401,14 +6557,34 @@
@@ -6492,14 +6649,34 @@
// move the tab group right before the first unpinned tab.
// 4. Moving a tab group and the first unpinned tab is grouped:
// move the tab group right before the first unpinned tab's tab group.
@@ -754,7 +775,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
element.pinned
? this.tabContainer.pinnedTabsContainer
: this.tabContainer;
@@ -6417,7 +6593,7 @@
@@ -6508,7 +6685,7 @@
element,
() => {
if (moveBefore) {
@@ -763,7 +784,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
} else if (targetElement) {
targetElement.after(element);
} else {
@@ -6489,10 +6665,10 @@
@@ -6580,10 +6757,10 @@
* @param {TabMetricsContext} [metricsContext]
*/
moveTabToGroup(aTab, aGroup, metricsContext) {
@@ -776,7 +797,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6522,6 +6698,7 @@
@@ -6613,6 +6790,7 @@
let state = {
tabIndex: tab._tPos,
@@ -784,7 +805,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
};
if (tab.visible) {
state.elementIndex = tab.elementIndex;
@@ -6548,7 +6725,7 @@
@@ -6639,7 +6817,7 @@
let changedTabGroup =
previousTabState.tabGroupId != currentTabState.tabGroupId;
@@ -793,7 +814,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
tab.dispatchEvent(
new CustomEvent("TabMove", {
bubbles: true,
@@ -6585,6 +6762,10 @@
@@ -6676,6 +6854,10 @@
moveActionCallback();
@@ -804,7 +825,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -7486,7 +7667,7 @@
@@ -7576,7 +7758,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -813,7 +834,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
window.focus();
aEvent.preventDefault();
break;
@@ -7501,7 +7682,6 @@
@@ -7593,7 +7775,6 @@
}
case "TabGroupCollapse":
aEvent.target.tabs.forEach(tab => {
@@ -821,7 +842,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
});
break;
case "TabGroupCreateByUser":
@@ -8442,6 +8622,7 @@
@@ -8542,6 +8723,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -829,7 +850,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -9443,7 +9624,7 @@ var TabContextMenu = {
@@ -9543,7 +9725,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;
@@ -838,7 +859,7 @@ index c099e8646b9341a3ff55bf394037c8fc2769969b..0d524a0519bbbdf304a594d1fb56c394
// Build Ask Chat items
TabContextMenu.GenAI.buildTabMenu(
document.getElementById("context_askChat"),
@@ -9763,6 +9944,7 @@ var TabContextMenu = {
@@ -9863,6 +10045,7 @@ var TabContextMenu = {
)
);
} else {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabgroup.js b/browser/components/tabbrowser/content/tabgroup.js
index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b424098ba3e7b 100644
index aa8b22c558f9dbc0b0b1e63993477b9126fb6821..feb90bb75b78e2513362679a5b5da41fbf97ac20 100644
--- a/browser/components/tabbrowser/content/tabgroup.js
+++ b/browser/components/tabbrowser/content/tabgroup.js
@@ -14,11 +14,11 @@
@@ -77,8 +77,8 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
+ };
this.#updateLabelAriaAttributes();
this.#updateCollapsedAriaAttributes();
@@ -144,6 +163,8 @@
@@ -143,6 +162,8 @@
// mounts after getting created by `Tabbrowser.adoptTabGroup`.
this.#wasCreatedByAdoption = false;
}
@@ -87,7 +87,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
resetDefaultGroupName = () => {
this.#defaultGroupName = "";
@@ -228,7 +249,10 @@
@@ -227,7 +248,10 @@
}
});
}
@@ -99,7 +99,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
}
get color() {
@@ -322,6 +346,9 @@
@@ -321,6 +345,9 @@
}
set collapsed(val) {
@@ -109,7 +109,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
if (!!val == this.collapsed) {
return;
}
@@ -399,7 +426,6 @@
@@ -406,7 +433,6 @@
tabGroupName,
})
.then(result => {
@@ -117,7 +117,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
});
}
@@ -418,7 +444,57 @@
@@ -425,7 +451,57 @@
* @returns {MozTabbrowserTab[]}
*/
get tabs() {
@@ -176,7 +176,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
}
/**
@@ -498,7 +574,6 @@
@@ -506,7 +582,6 @@
addTabs(tabs, metricsContext) {
for (let tab of tabs) {
if (tab.pinned) {
@@ -184,7 +184,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
}
let tabToMove =
this.ownerGlobal === tab.ownerGlobal
@@ -561,7 +636,7 @@
@@ -569,7 +644,7 @@
*/
on_click(event) {
let isToggleElement =
@@ -193,7 +193,7 @@ index 1b4f6bf4ed6556492f84476d33e9103fbb1c74e9..77bd8738db6f2e65c2bfcae8347b4240
event.target === this.#overflowCountLabel;
if (isToggleElement && event.button === 0) {
event.preventDefault();
@@ -630,5 +705,6 @@
@@ -638,5 +713,6 @@
}
}

View File

@@ -1,18 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78bec02d253a 100644
index 258b9627aaa8a1d26e8aeb987a0b4c67bc1b7abc..6d334761033a0654f28fd417193d2ac2a736d9f8 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -44,6 +44,9 @@
* @returns {MozTabbrowserTab|vbox}
*/
const elementToMove = element => {
+ if (element.group?.hasAttribute("split-view-group")) {
+ return element.group;
+ }
if (isTab(element)) {
return element;
}
@@ -423,7 +426,7 @@
@@ -411,7 +411,7 @@
// and we're not hitting the scroll buttons.
if (
event.button != 0 ||
@@ -21,7 +11,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
event.composedTarget.localName == "toolbarbutton"
) {
return;
@@ -504,7 +507,6 @@
@@ -492,7 +492,6 @@
});
}
} else if (isTabGroupLabel(event.target)) {
@@ -29,7 +19,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
} else if (
event.originalTarget.closest("scrollbox") &&
!Services.prefs.getBoolPref(
@@ -540,6 +542,9 @@
@@ -528,6 +527,9 @@
}
on_keydown(event) {
@@ -39,153 +29,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
let { altKey, shiftKey } = event;
let [accel, nonAccel] =
AppConstants.platform == "macosx"
@@ -777,7 +782,7 @@
if (this.#isContainerVerticalPinnedGrid(tab)) {
// In expanded vertical mode, the max number of pinned tabs per row is dynamic
// Set this before adjusting dragged tab's position
- let pinnedTabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
+ let pinnedTabs = this.ariaFocusableItems.slice(0, gBrowser._numZenEssentials);
let tabsPerRow = 0;
let position = RTL_UI
? window.windowUtils.getBoundsWithoutFlushing(
@@ -942,7 +947,7 @@
let dropEffect = this.getDropEffectForTabDrag(event);
let isMovingInTabStrip = !fromTabList && dropEffect == "move";
let collapseTabGroupDuringDrag =
- isMovingInTabStrip && isTabGroupLabel(tab) && !tab.group.collapsed;
+ isMovingInTabStrip && isTabGroupLabel(tab) && (!tab.group.collapsed || tab.group.hasAttribute("has-active"));
tab._dragData = {
offsetX: this.verticalMode
@@ -952,7 +957,7 @@
? event.screenY - window.screenY - tabOffset
: event.screenY - window.screenY,
scrollPos:
- this.verticalMode && tab.pinned
+ this.verticalMode && tab.pinned && false
? this.pinnedTabsContainer.scrollPosition
: this.arrowScrollbox.scrollPosition,
screenX: event.screenX,
@@ -981,6 +986,7 @@
if (collapseTabGroupDuringDrag) {
tab.group.collapsed = true;
+ gZenFolders.animateGroupMove(tab.group);
}
}
}
@@ -1027,6 +1033,10 @@
}
let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
+ if (draggedTab && dropEffect === "move") {
+ gZenPinnedTabManager.applyDragoverClass(event, draggedTab);
+ gZenViewSplitter.onBrowserDragEndToSplit(event);
+ }
if (
(dropEffect == "move" || dropEffect == "copy") &&
document == draggedTab.ownerDocument &&
@@ -1154,7 +1164,8 @@
isTabGroupLabel(draggedTab) &&
draggedTab._dragData?.expandGroupOnDrop
) {
- draggedTab.group.collapsed = false;
+ draggedTab.group.collapsed = draggedTab.group.hasAttribute("has-active");
+ gZenFolders.animateGroupMove(draggedTab.group, true);
}
}
@@ -1208,6 +1219,18 @@
this._tabDropIndicator.hidden = true;
event.stopPropagation();
+ if (draggedTab?.hasAttribute("zen-has-splitted")) {
+ draggedTab.removeAttribute("zen-has-splitted");
+ draggedTab._visuallySelected = false;
+ }
+ if (draggedTab && dropEffect == "move") {
+ let moved = gZenPinnedTabManager.moveToAnotherTabContainerIfNecessary(event, movingTabs);
+
+ if (moved) {
+ this.finishMoveTogetherSelectedTabs(draggedTab);
+ return;
+ }
+ }
if (draggedTab && dropEffect == "copy") {
let duplicatedDraggedTab;
let duplicatedTabs = [];
@@ -1232,8 +1255,9 @@
let translateOffsetY = oldTranslateY % tabHeight;
let newTranslateX = oldTranslateX - translateOffsetX;
let newTranslateY = oldTranslateY - translateOffsetY;
- let isPinned = draggedTab.pinned;
- let numPinned = gBrowser.pinnedTabCount;
+ let isPinned = draggedTab?.group ? draggedTab.group.pinned : draggedTab.pinned;
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential");
if (this.#isContainerVerticalPinnedGrid(draggedTab)) {
// Update both translate axis for pinned vertical expanded tabs
@@ -1249,8 +1273,8 @@
}
} else {
let tabs = this.ariaFocusableItems.slice(
- isPinned ? 0 : numPinned,
- isPinned ? numPinned : undefined
+ isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned,
+ isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined
);
let size = this.verticalMode ? "height" : "width";
let screenAxis = this.verticalMode ? "screenY" : "screenX";
@@ -1299,11 +1323,13 @@
this.dragToPinPromoCard,
];
let shouldPin =
+ false &&
isTab(draggedTab) &&
!draggedTab.pinned &&
(overPinnedDropIndicator ||
dragToPinTargets.some(el => el.contains(event.target)));
let shouldUnpin =
+ false &&
isTab(draggedTab) &&
draggedTab.pinned &&
this.arrowScrollbox.contains(event.target);
@@ -1321,6 +1347,7 @@
(oldTranslateY && oldTranslateY != newTranslateY);
} else if (this.verticalMode) {
shouldTranslate &&= oldTranslateY && oldTranslateY != newTranslateY;
+ shouldTranslate = false;
} else {
shouldTranslate &&= oldTranslateX && oldTranslateX != newTranslateX;
}
@@ -1515,6 +1542,7 @@
let nextItem = this.ariaFocusableItems[newIndex];
let tabGroup = isTab(nextItem) && nextItem.group;
+ if (gZenViewSplitter.handleTabDrop(event, urls, replace, inBackground)) return;
gBrowser.loadTabs(urls, {
inBackground,
replace,
@@ -1553,6 +1581,17 @@
}
this.#resetTabsAfterDrop(draggedTab.ownerDocument);
+ if (!dt.mozUserCancelled && dt.dropEffect == "none" && !this._isCustomizing) {
+ const moved = gZenViewSplitter.moveTabToSplitView(event, draggedTab);
+ if (moved) {
+ delete draggedTab._dragData;
+ return;
+ }
+ } else if (dt.mozUserCancelled) {
+ gZenViewSplitter.onBrowserDragEndToSplit(event, true);
+ if (gZenViewSplitter._lastOpenedTab) gZenViewSplitter._lastOpenedTab._visuallySelected = false;
+ }
+
if (
dt.mozUserCancelled ||
dt.dropEffect != "none" ||
@@ -1719,7 +1758,6 @@
@@ -720,7 +722,6 @@
this.toggleAttribute("overflow", true);
this._updateCloseButtons();
@@ -193,7 +37,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
document
.getElementById("tab-preview-panel")
@@ -1777,7 +1815,7 @@
@@ -780,7 +781,7 @@
}
get newTabButton() {
@@ -202,7 +46,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
}
get verticalMode() {
@@ -1793,6 +1831,7 @@
@@ -796,6 +797,7 @@
}
get overflowing() {
@@ -210,7 +54,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
return this.hasAttribute("overflow");
}
@@ -1806,29 +1845,54 @@
@@ -809,29 +811,54 @@
if (pinnedChildren?.at(-1)?.id == "pinned-tabs-container-periphery") {
pinnedChildren.pop();
}
@@ -275,7 +119,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
}
/**
@@ -1895,29 +1959,23 @@
@@ -898,17 +925,10 @@
let elementIndex = 0;
@@ -295,26 +139,22 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
if (isTab(child) && child.visible) {
child.elementIndex = elementIndex++;
focusableItems.push(child);
} else if (isTabGroup(child)) {
@@ -916,11 +936,13 @@
child.labelElement.elementIndex = elementIndex++;
focusableItems.push(child.labelElement);
-
- let visibleTabsInGroup = child.tabs.filter(tab => tab.visible);
- visibleTabsInGroup.forEach(tab => {
- tab.elementIndex = elementIndex++;
- });
- focusableItems.push(...visibleTabsInGroup);
+ if (!child.hasAttribute("split-view-group")) {
+ let visibleTabsInGroup = child.childGroupsAndTabs.filter(tab => tab.visible);
+ visibleTabsInGroup.forEach(tab => {
+ tab.elementIndex = elementIndex++;
+ });
+ focusableItems.push(...visibleTabsInGroup);
+ }
}
}
@@ -1929,6 +1987,7 @@
- let visibleTabsInGroup = child.tabs.filter(tab => tab.visible);
+ if (!child.hasAttribute("split-view-group")) {
+ let visibleTabsInGroup = child.childGroupsAndTabs.filter(tab => tab.visible);
visibleTabsInGroup.forEach(tab => {
tab.elementIndex = elementIndex++;
});
focusableItems.push(...visibleTabsInGroup);
+ }
} else if (child.tagName == "tab-split-view-wrapper") {
let visibleTabsInSplitView = child.tabs.filter(tab => tab.visible);
visibleTabsInSplitView.forEach(tab => {
@@ -964,6 +986,7 @@
_invalidateCachedTabs() {
this.#allTabs = null;
this._invalidateCachedVisibleTabs();
@@ -322,18 +162,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
}
_invalidateCachedVisibleTabs() {
@@ -1944,8 +2003,8 @@
#isContainerVerticalPinnedGrid(tab) {
return (
this.verticalMode &&
- tab.pinned &&
- this.hasAttribute("expanded") &&
+ (tab.hasAttribute("zen-essential")) &&
+ (this.hasAttribute("expanded") || document.documentElement.hasAttribute("zen-sidebar-expanded")) &&
!this.expandOnHover
);
}
@@ -1961,7 +2020,7 @@
@@ -1067,7 +1090,7 @@
if (node == null) {
// We have a container for non-tab elements at the end of the scrollbox.
@@ -342,7 +171,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
}
node.before(tab);
@@ -2056,7 +2115,7 @@
@@ -1162,7 +1185,7 @@
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
// Attach the long click popup to all of them.
@@ -351,7 +180,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
const newTab2 = this.newTabButton;
const newTabVertical = document.getElementById(
"vertical-tabs-newtab-button"
@@ -2156,8 +2215,10 @@
@@ -1263,8 +1286,10 @@
*/
_handleTabSelect(aInstant) {
let selectedTab = this.selectedItem;
@@ -362,7 +191,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
selectedTab._notselectedsinceload = false;
}
@@ -2166,7 +2227,7 @@
@@ -1273,7 +1298,7 @@
* @param {boolean} [shouldScrollInstantly=false]
*/
#ensureTabIsVisible(tab, shouldScrollInstantly = false) {
@@ -371,265 +200,7 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
if (arrowScrollbox?.overflowing) {
arrowScrollbox.ensureElementIsVisible(tab, shouldScrollInstantly);
}
@@ -2305,6 +2366,16 @@
when the tab is first selected to be dragged.
*/
#updateTabStylesOnDrag(tab) {
+ let { movingTabs: zenMovingTabs } = tab._dragData;
+ for (let movingTab of zenMovingTabs.slice(zenMovingTabs.findIndex(t => t._tPos == tab._tPos))) {
+ if (isTabGroupLabel(tab)) {
+ movingTab = movingTab.parentElement;
+ }
+ // "dragtarget" contains the following rules which must only be set AFTER the above
+ // elements have been adjusted. {z-index: 3 !important, position: absolute !important}
+ movingTab.setAttribute("zen-dragtarget", "");
+ }
+ return;
let isPinned = tab.pinned;
let numPinned = gBrowser.pinnedTabCount;
let allTabs = this.ariaFocusableItems;
@@ -2578,7 +2649,7 @@
return;
}
- let tabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount);
+ let tabs = this.ariaFocusableItems.slice(0, gBrowser._numZenEssentials);
let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY;
@@ -2587,6 +2658,8 @@
let { width: tabWidth, height: tabHeight } =
draggedTab.getBoundingClientRect();
+ tabWidth += 4; // Add 4px to account for the gap
+ tabHeight += 4;
let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth;
@@ -2623,8 +2696,8 @@
let lastBoundX =
lastTabInRow.screenX +
lastTabInRow.getBoundingClientRect().width -
- (lastMovingTabScreenX + tabWidth);
- let lastBoundY = periphery.screenY - (lastMovingTabScreenY + tabHeight);
+ (lastMovingTabScreenX + tabWidth) + 4;
+ let lastBoundY = lastTab.screenY - lastMovingTabScreenY;
translateX = Math.min(Math.max(translateX, firstBoundX), lastBoundX);
translateY = Math.min(Math.max(translateY, firstBoundY), lastBoundY);
@@ -2782,13 +2855,18 @@
this.#clearDragOverGroupingTimer();
this.#clearPinnedDropIndicatorTimer();
- let isPinned = draggedTab.pinned;
- let numPinned = gBrowser.pinnedTabCount;
+ let isPinned = draggedTab?.group ? draggedTab.group.pinned : draggedTab.pinned;
+ let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed;
+ let essential = draggedTab.hasAttribute("zen-essential");
+ const isDraggingFolder = isTabGroupLabel(draggedTab) && draggedTab.group?.isZenFolder;
let allTabs = this.ariaFocusableItems;
let tabs = allTabs.slice(
- isPinned ? 0 : numPinned,
- isPinned ? numPinned : undefined
+ (isPinned && essential) ? 0 : gBrowser._numZenEssentials,
+ isPinned ? (essential ? gBrowser._numZenEssentials : (isDraggingFolder ? numPinned : undefined)) : undefined
);
+ if (draggedTab.group?.hasAttribute("split-view-group")) {
+ draggedTab = draggedTab.group.labelElement;
+ }
if (this.#rtlMode) {
tabs.reverse();
@@ -2799,7 +2877,7 @@
let screenAxis = this.verticalMode ? "screenY" : "screenX";
let size = this.verticalMode ? "height" : "width";
let translateAxis = this.verticalMode ? "translateY" : "translateX";
- let { width: tabWidth, height: tabHeight } = bounds(draggedTab);
+ let { width: tabWidth, height: tabHeight } = bounds(draggedTab.group?.hasAttribute("split-view-group") ? draggedTab.group : draggedTab);
let tabSize = this.verticalMode ? tabHeight : tabWidth;
let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY;
@@ -2815,6 +2893,12 @@
);
let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0];
+ if (lastMovingTab.group?.hasAttribute("split-view-group")) {
+ lastMovingTab = lastMovingTab.group;
+ }
+ if (firstMovingTab.group?.hasAttribute("split-view-group")) {
+ firstMovingTab = firstMovingTab.group;
+ }
let endEdge = ele => ele[screenAxis] + bounds(ele)[size];
let lastMovingTabScreen = endEdge(lastMovingTab);
let firstMovingTabScreen = firstMovingTab[screenAxis];
@@ -2829,6 +2913,11 @@
let endBound = this.#rtlMode
? endEdge(this) - lastMovingTabScreen
: periphery[screenAxis] - 1 - lastMovingTabScreen;
+ let firstTab = tabs.at(this.#rtlMode ? -1 : 0);
+ let lastTab = tabs.at(this.#rtlMode ? 0 : -1);
+ startBound = firstTab[screenAxis] - firstMovingTabScreen;
+ endBound = endEdge(lastTab) - lastMovingTabScreen;
+ endBound = gZenPinnedTabManager.getLastTabBound(endBound, lastTab, isDraggingFolder);
translate = Math.min(Math.max(translate, startBound), endBound);
// Center the tab under the cursor if the tab is not under the cursor while dragging
@@ -3018,6 +3107,8 @@
};
let dropElement = getOverlappedElement();
+ if (dropElement?.hasAttribute("split-view-group")) dropElement = dropElement.labelElement;
+ gZenPinnedTabManager.animateSeparatorMove(movingTabs, dropElement, isPinned, event);
let newDropElementIndex;
if (dropElement) {
@@ -3099,7 +3190,7 @@
? Services.prefs.getIntPref(
"browser.tabs.dragDrop.moveOverThresholdPercent"
) / 100
- : 0.5;
+ : Services.prefs.getIntPref('zen.view.drag-and-drop.move-over-threshold') / 100;
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
let shouldMoveOver = overlapPercent > moveOverThreshold;
if (logicalForward && shouldMoveOver) {
@@ -3132,6 +3223,7 @@
// If dragging a group over another group, don't make it look like it is
// possible to drop the dragged group inside the other group.
if (
+ false &&
isTabGroupLabel(draggedTab) &&
dropElement?.group &&
(!dropElement.group.collapsed ||
@@ -3158,20 +3250,13 @@
let isOutOfBounds = isPinned
? dropElement.elementIndex >= numPinned
: dropElement.elementIndex < numPinned;
- if (isOutOfBounds) {
- // Drop after last pinned tab
- dropElement = this.ariaFocusableItems[numPinned - 1];
- dropBefore = false;
- }
}
- if (
- gBrowser._tabGroupsEnabled &&
- isTab(draggedTab) &&
- !isPinned &&
- (!numPinned || newDropElementIndex > numPinned)
- ) {
+ if (isTab(draggedTab) || isTabGroupLabel(draggedTab)) {
let dragOverGroupingThreshold = 1 - moveOverThreshold;
+ if (draggedTab && !dropElement?.group) {
+ gZenFolders.highlightGroupOnDragOver(null);
+ }
let groupingDelay = Services.prefs.getIntPref(
"browser.tabs.dragDrop.createGroup.delayMS"
);
@@ -3179,6 +3264,7 @@
// When dragging tab(s) over an ungrouped tab, signal to the user
// that dropping the tab(s) will create a new tab group.
let shouldCreateGroupOnDrop =
+ false &&
!movingTabsSet.has(dropElement) &&
isTab(dropElement) &&
!dropElement?.group &&
@@ -3187,6 +3273,7 @@
// When dragging tab(s) over a collapsed tab group label, signal to the
// user that dropping the tab(s) will add them to the group.
let shouldDropIntoCollapsedTabGroup =
+ false &&
isTabGroupLabel(dropElement) &&
dropElement.group.collapsed &&
overlapPercent > dragOverGroupingThreshold;
@@ -3231,19 +3318,14 @@
dropElement = dropElementGroup;
colorCode = undefined;
} else if (isTabGroupLabel(dropElement)) {
- if (dropBefore) {
- // Dropping right before the tab group.
- dropElement = dropElementGroup;
- colorCode = undefined;
- } else if (dropElementGroup.collapsed) {
- // Dropping right after the collapsed tab group.
- dropElement = dropElementGroup;
- colorCode = undefined;
- } else {
- // Dropping right before the first tab in the tab group.
- dropElement = dropElementGroup.tabs[0];
- dropBefore = true;
- }
+ ({ dropElement, colorCode, dropBefore } = gZenFolders.handleDragOverTabGroupLabel(
+ dropElement,
+ draggedTab,
+ overlapPercent,
+ movingTabs,
+ dropBefore,
+ colorCode
+ ));
}
this.#setDragOverGroupColor(colorCode);
this.toggleAttribute("movingtab-addToGroup", colorCode);
@@ -3262,11 +3344,11 @@
dragData.dropElement = dropElement;
dragData.dropBefore = dropBefore;
dragData.animDropElementIndex = newDropElementIndex;
-
+ gZenFolders.setFolderIndentation(movingTabs, dropElement);
// Shift background tabs to leave a gap where the dragged tab
// would currently be dropped.
for (let item of tabs) {
- if (item == draggedTab) {
+ if (item == draggedTab || (item.group?.hasAttribute("split-view-group") && item.group == draggedTab.group)) {
continue;
}
@@ -3388,12 +3470,14 @@
element?.removeAttribute("dragover-groupTarget");
}
- finishAnimateTabMove() {
- if (!this.#isMovingTab()) {
+ finishAnimateTabMove(always = false) {
+ gZenPinnedTabManager.onDragFinish();
+ if (!this.#isMovingTab() && !always) {
return;
}
this.#setMovingTabMode(false);
+ gZenFolders.highlightGroupOnDragOver(null);
for (let item of this.ariaFocusableItems) {
this.#resetGroupTarget(item);
@@ -3440,17 +3524,16 @@
tab.style.left = "";
tab.style.top = "";
tab.style.maxWidth = "";
- tab.removeAttribute("dragtarget");
+ tab.removeAttribute("zen-dragtarget");
}
for (let label of draggedTabDocument.getElementsByClassName(
"tab-group-label-container"
)) {
label.style.width = "";
- label.style.height = "";
label.style.left = "";
label.style.top = "";
label.style.maxWidth = "";
- label.removeAttribute("dragtarget");
+ label.removeAttribute("zen-dragtarget");
}
let periphery = draggedTabDocument.getElementById(
"tabbrowser-arrowscrollbox-periphery"
@@ -3522,7 +3605,7 @@
let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false;
};
- if (gReduceMotion) {
+ if (true || gReduceMotion) {
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -3686,7 +3769,7 @@
@@ -1406,7 +1431,7 @@
}
_notifyBackgroundTab(aTab) {
@@ -638,25 +209,3 @@ index 1425607ef87d6c28fb676e722617edfb51ba12a1..97cdeaf7cde41f39d70bd50ac8ca78be
return;
}
@@ -3795,7 +3878,10 @@
#getDragTarget(event, { ignoreSides = false } = {}) {
let { target } = event;
while (target) {
- if (isTab(target) || isTabGroupLabel(target)) {
+ if (isTab(target) || isTabGroupLabel(target) || target?.classList?.contains("tab-group-label-container")) {
+ if (target.classList?.contains("tab-group-label-container")) {
+ target = target.querySelector(".tab-group-label");
+ }
break;
}
target = target.parentNode;
@@ -3812,6 +3898,9 @@
return null;
}
}
+ if (target?.group?.hasAttribute("split-view-group")) {
+ target = target.group.labelElement;
+ }
return target;
}

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/urlbar/UrlbarController.sys.mjs b/browser/components/urlbar/UrlbarController.sys.mjs
index a1faf7e4278c66865f267283515f22052769928d..297391205ab3cd96bed2e5a3e36a181c6da90098 100644
index 880f65b493ba5e9b9750e84c2ba5d08b99e3dad9..c4a495887926fc6f13312a29998d03bfe907f0e2 100644
--- a/browser/components/urlbar/UrlbarController.sys.mjs
+++ b/browser/components/urlbar/UrlbarController.sys.mjs
@@ -297,7 +297,6 @@ export class UrlbarController {
@@ -299,7 +299,6 @@ export class UrlbarController {
const isMac = AppConstants.platform == "macosx";
// Handle readline/emacs-style navigation bindings on Mac.
if (
@@ -10,7 +10,7 @@ index a1faf7e4278c66865f267283515f22052769928d..297391205ab3cd96bed2e5a3e36a181c
this.view.isOpen &&
event.ctrlKey &&
(event.key == "n" || event.key == "p")
@@ -441,6 +440,8 @@ export class UrlbarController {
@@ -443,6 +442,8 @@ export class UrlbarController {
});
}
event.preventDefault();

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d355858bcf37b 100644
index 4b7232f3261f8589b734c2238170e6968d7ea0bf..d8c0b404724e9b0dc2b5a2d21420357586fb7f14 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -76,6 +76,13 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () =>
@@ -84,6 +84,13 @@ ChromeUtils.defineLazyGetter(lazy, "logger", () =>
lazy.UrlbarUtils.getLogger({ prefix: "Input" })
);
@@ -16,7 +16,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
const DEFAULT_FORM_HISTORY_NAME = "searchbar-history";
const UNLIMITED_MAX_RESULTS = 99;
@@ -437,7 +444,16 @@ export class UrlbarInput {
@@ -454,7 +461,16 @@ export class UrlbarInput {
// See _on_select(). HTMLInputElement.select() dispatches a "select"
// event but does not set the primary selection.
this._suppressPrimaryAdjustment = true;
@@ -33,7 +33,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
this._suppressPrimaryAdjustment = false;
}
@@ -513,6 +529,10 @@ export class UrlbarInput {
@@ -530,6 +546,10 @@ export class UrlbarInput {
hideSearchTerms = false,
isSameDocument = false
) {
@@ -44,7 +44,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (!this.isAddressbar) {
throw new Error(
"Cannot set URI for UrlbarInput that is not an address bar"
@@ -790,8 +810,16 @@ export class UrlbarInput {
@@ -807,8 +827,16 @@ export class UrlbarInput {
return;
}
}
@@ -62,7 +62,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
}
/**
@@ -1207,7 +1235,11 @@ export class UrlbarInput {
@@ -1224,7 +1252,11 @@ export class UrlbarInput {
}
if (!this.#providesSearchMode(result)) {
@@ -75,7 +75,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
}
if (isCanonized) {
@@ -2298,6 +2330,32 @@ export class UrlbarInput {
@@ -2347,6 +2379,32 @@ export class UrlbarInput {
await this.#updateLayoutBreakoutDimensions();
}
@@ -108,7 +108,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
startLayoutExtend() {
if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) {
// Do not expand if the Urlbar does not support being expanded or it is
@@ -2312,6 +2370,13 @@ export class UrlbarInput {
@@ -2361,6 +2419,13 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true");
@@ -122,7 +122,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2331,6 +2396,24 @@ export class UrlbarInput {
@@ -2380,6 +2445,24 @@ export class UrlbarInput {
return;
}
@@ -147,7 +147,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
this.removeAttribute("breakout-extend");
this.#updateTextboxPosition();
}
@@ -2361,7 +2444,7 @@ export class UrlbarInput {
@@ -2410,7 +2493,7 @@ export class UrlbarInput {
forceUnifiedSearchButtonAvailable = false
) {
let prevState = this.getAttribute("pageproxystate");
@@ -156,7 +156,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
this.setAttribute("pageproxystate", state);
this._inputContainer.setAttribute("pageproxystate", state);
this._identityBox?.setAttribute("pageproxystate", state);
@@ -2595,10 +2678,12 @@ export class UrlbarInput {
@@ -2646,10 +2729,12 @@ export class UrlbarInput {
return;
}
this.textbox.style.top = px(
@@ -169,7 +169,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
);
}
@@ -2658,9 +2743,10 @@ export class UrlbarInput {
@@ -2709,9 +2794,10 @@ export class UrlbarInput {
return;
}
@@ -181,7 +181,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
);
this.textbox.style.setProperty(
"--urlbar-height",
@@ -3093,6 +3179,7 @@ export class UrlbarInput {
@@ -3144,6 +3230,7 @@ export class UrlbarInput {
}
_toggleActionOverride(event) {
@@ -189,7 +189,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (
event.keyCode == KeyEvent.DOM_VK_SHIFT ||
event.keyCode == KeyEvent.DOM_VK_ALT ||
@@ -3197,7 +3284,7 @@ export class UrlbarInput {
@@ -3248,7 +3335,7 @@ export class UrlbarInput {
return val;
}
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
@@ -198,7 +198,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
: val;
// Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol.
@@ -3501,6 +3588,7 @@ export class UrlbarInput {
@@ -3552,6 +3639,7 @@ export class UrlbarInput {
resultDetails = null,
browser = this.window.gBrowser.selectedBrowser
) {
@@ -206,7 +206,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (this.isAddressbar) {
this.#prepareAddressbarLoad(
url,
@@ -3608,6 +3696,10 @@ export class UrlbarInput {
@@ -3659,6 +3747,10 @@ export class UrlbarInput {
}
reuseEmpty = true;
}
@@ -217,7 +217,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (
where == "tab" &&
reuseEmpty &&
@@ -3615,6 +3707,9 @@ export class UrlbarInput {
@@ -3666,6 +3758,9 @@ export class UrlbarInput {
) {
where = "current";
}
@@ -227,7 +227,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
return where;
}
@@ -3872,6 +3967,7 @@ export class UrlbarInput {
@@ -3923,6 +4018,7 @@ export class UrlbarInput {
this.setResultForCurrentValue(null);
this.handleCommand();
this.controller.clearLastQueryContextCache();
@@ -235,7 +235,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
this._suppressStartQuery = false;
});
@@ -3879,7 +3975,6 @@ export class UrlbarInput {
@@ -3930,7 +4026,6 @@ export class UrlbarInput {
contextMenu.addEventListener("popupshowing", () => {
// Close the results pane when the input field contextual menu is open,
// because paste and go doesn't want a result selection.
@@ -243,7 +243,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
let controller =
this.document.commandDispatcher.getControllerForCommand("cmd_paste");
@@ -3991,7 +4086,11 @@ export class UrlbarInput {
@@ -4040,7 +4135,11 @@ export class UrlbarInput {
if (!engineName && !source && !this.hasAttribute("searchmode")) {
return;
}
@@ -256,7 +256,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (this._searchModeIndicatorTitle) {
this._searchModeIndicatorTitle.textContent = "";
this._searchModeIndicatorTitle.removeAttribute("data-l10n-id");
@@ -4302,6 +4401,7 @@ export class UrlbarInput {
@@ -4351,6 +4450,7 @@ export class UrlbarInput {
this.document.l10n.setAttributes(
this.inputField,
@@ -264,7 +264,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
l10nId,
l10nId == "urlbar-placeholder-with-name" ? { name } : undefined
);
@@ -4413,6 +4513,11 @@ export class UrlbarInput {
@@ -4462,6 +4562,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -276,7 +276,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (
event.target == this.inputField ||
event.target == this._inputContainer
@@ -4485,7 +4590,7 @@ export class UrlbarInput {
@@ -4534,7 +4639,7 @@ export class UrlbarInput {
}
}
@@ -285,7 +285,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -4525,9 +4630,16 @@ export class UrlbarInput {
@@ -4574,9 +4679,16 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -303,7 +303,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
if (
event.target != this.inputField &&
@@ -4538,6 +4650,10 @@ export class UrlbarInput {
@@ -4587,6 +4699,10 @@ export class UrlbarInput {
this.focusedViaMousedown = !this.focused;
this._preventClickSelectsAll = this.focused;
@@ -314,7 +314,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
// Keep the focus status, since the attribute may be changed
// upon calling this.focus().
@@ -4573,7 +4689,7 @@ export class UrlbarInput {
@@ -4622,7 +4738,7 @@ export class UrlbarInput {
}
// Don't close the view when clicking on a tab; we may want to keep the
// view open on tab switch, and the TabSelect event arrived earlier.
@@ -323,7 +323,7 @@ index afc7a6c6ddbf4cf5a5b27c0bd60577b833c63093..f28c9a1ac086af429a93bd01be5d3558
break;
}
@@ -4890,7 +5006,7 @@ export class UrlbarInput {
@@ -4939,7 +5055,7 @@ export class UrlbarInput {
// When we are in actions search mode we can show more results so
// increase the limit.
let maxResults =

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
index 20be2dbbb8471aeb43a9bf77888c9858a0b61186..a9f974a78c5676d1340a3543852e4126c1d32b04 100644
index c12d875172650dddfe7de623a776149517c83302..66e923ed2c84e350dd7ba7a20e362666cec8f307 100644
--- a/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
+++ b/browser/components/urlbar/UrlbarMuxerStandard.sys.mjs
@@ -852,6 +852,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
@@ -854,6 +854,7 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
}
if (result.providerName == "UrlbarProviderTabToSearch") {
@@ -10,7 +10,7 @@ index 20be2dbbb8471aeb43a9bf77888c9858a0b61186..a9f974a78c5676d1340a3543852e4126
// Discard the result if a tab-to-search result was added already.
if (!state.canAddTabToSearch) {
return false;
@@ -1498,7 +1499,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
@@ -1500,7 +1501,9 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
usedLimits.maxResultCount++;
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarPrefs.sys.mjs b/browser/components/urlbar/UrlbarPrefs.sys.mjs
index 46ad55519aecd6c14034a9faa91c7ad8e5c1c422..e8d9c06499a2b273483edd21faf902c936462b59 100644
index 531cecb9da3465d392ea82248e6ebb3fe6476b47..f3cce2a66bb8465ae022df0c1b9823e7e88cba21 100644
--- a/browser/components/urlbar/UrlbarPrefs.sys.mjs
+++ b/browser/components/urlbar/UrlbarPrefs.sys.mjs
@@ -731,6 +731,7 @@ function makeResultGroups({ showSearchSuggestionsFirst }) {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
index b2c3bfa6fbe83fceb019196c210baaa7b4881372..02f2c8be89f163e16c5fd29f9b7e145e16ea53ed 100644
index 91abb674d26dc7e2a919c94087b180a6148248fd..80551acd18228f19cb179f71adc4f58bc893ac14 100644
--- a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
+++ b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs
@@ -44,11 +44,13 @@ function defaultQuery(conditions = "") {
@@ -26,7 +26,7 @@ index b2c3bfa6fbe83fceb019196c210baaa7b4881372..02f2c8be89f163e16c5fd29f9b7e145e
h.visit_count, h.typed,
0, t.open_count,
:matchBehavior, :searchBehavior, NULL)
@@ -1120,11 +1122,13 @@ Search.prototype = {
@@ -1126,11 +1128,13 @@ Search.prototype = {
? lazy.PlacesUtils.toDate(lastVisitPRTime).getTime()
: undefined;
let tabGroup = row.getResultByName("groupId");

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/urlbar/UrlbarProvidersManager.sys.mjs b/browser/components/urlbar/UrlbarProvidersManager.sys.mjs
index ece407214669009e263b507b5236ab28da33efe9..8f22426295e2b001438918f44d2c22ed7a697c2f 100644
index b864cf9a9159d1f4e162ff5e8895a2bc95dee881..b30ee47b4f6d9025648ca5d93ee79f993cb6f4c2 100644
--- a/browser/components/urlbar/UrlbarProvidersManager.sys.mjs
+++ b/browser/components/urlbar/UrlbarProvidersManager.sys.mjs
@@ -845,6 +845,7 @@ export class Query {
@@ -873,6 +873,7 @@ export class Query {
if (
result.heuristic &&
this.context.searchMode &&

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs
index f38e860e46fa979b3e0c66ecd3eb88a64df60fc1..d130bbc7488ff3de926823974a1df13dc8e61fbc 100644
index 079c9f18550b54b2a1cc030174849896fd23234e..605bb3433b61443037659d126ba17b033e5a4394 100644
--- a/browser/components/urlbar/UrlbarUtils.sys.mjs
+++ b/browser/components/urlbar/UrlbarUtils.sys.mjs
@@ -74,6 +74,7 @@ export var UrlbarUtils = {
@@ -77,6 +77,7 @@ export var UrlbarUtils = {
RESTRICT_SEARCH_KEYWORD: "restrictSearchKeyword",
SUGGESTED_INDEX: "suggestedIndex",
TAIL_SUGGESTION: "tailSuggestion",
@@ -10,7 +10,7 @@ index f38e860e46fa979b3e0c66ecd3eb88a64df60fc1..d130bbc7488ff3de926823974a1df13d
}),
// Defines provider types.
@@ -133,6 +134,7 @@ export var UrlbarUtils = {
@@ -136,6 +137,7 @@ export var UrlbarUtils = {
OTHER_NETWORK: 6,
ADDON: 7,
ACTIONS: 8,
@@ -18,7 +18,7 @@ index f38e860e46fa979b3e0c66ecd3eb88a64df60fc1..d130bbc7488ff3de926823974a1df13d
}),
// Per-result exposure telemetry.
@@ -544,6 +546,8 @@ export var UrlbarUtils = {
@@ -547,6 +549,8 @@ export var UrlbarUtils = {
return this.RESULT_GROUP.HEURISTIC_FALLBACK;
case "UrlbarProviderHistoryUrlHeuristic":
return this.RESULT_GROUP.HEURISTIC_HISTORY_URL;

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarValueFormatter.sys.mjs b/browser/components/urlbar/UrlbarValueFormatter.sys.mjs
index 50961e4beb75012ef0ed6f261a95854712cc69d7..93bcfca9270ff34dbe6386789fdae6066457438d 100644
index beff1d41e47efad09256459589176d96c69f7a8a..c850dad31454d61c4edb6e183db07b2d51fb9fc8 100644
--- a/browser/components/urlbar/UrlbarValueFormatter.sys.mjs
+++ b/browser/components/urlbar/UrlbarValueFormatter.sys.mjs
@@ -585,6 +585,7 @@ export class UrlbarValueFormatter {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs
index b3c7c8a995226e2cbe852d82515f9bc7077980e7..4c8611556f7f71e5f8860787ed1db9b50b9fa2e8 100644
index 38e4987dc906cf3c668995aab79fc15a02834677..de9d69a4faab3cfa249de41ef573ae2ef873b348 100644
--- a/browser/components/urlbar/UrlbarView.sys.mjs
+++ b/browser/components/urlbar/UrlbarView.sys.mjs
@@ -620,7 +620,7 @@ export class UrlbarView {
@@ -11,7 +11,7 @@ index b3c7c8a995226e2cbe852d82515f9bc7077980e7..4c8611556f7f71e5f8860787ed1db9b5
// Try to reuse the cached top-sites context. If it's not cached, then
// there will be a gap of time between when the input is focused and
// when the view opens that can be perceived as flicker.
@@ -2734,6 +2734,8 @@ export class UrlbarView {
@@ -2751,6 +2751,8 @@ export class UrlbarView {
if (row?.hasAttribute("row-selectable")) {
row?.toggleAttribute("selected", true);
}
@@ -20,7 +20,7 @@ index b3c7c8a995226e2cbe852d82515f9bc7077980e7..4c8611556f7f71e5f8860787ed1db9b5
if (element != row) {
row?.toggleAttribute("descendant-selected", true);
}
@@ -3215,7 +3217,7 @@ export class UrlbarView {
@@ -3232,7 +3234,7 @@ export class UrlbarView {
}
#enableOrDisableRowWrap() {