diff --git a/README.md b/README.md index db459c12c..80b4ad75b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Zen is currently built using Firefox version `138.0.4`! 🚀 -- [`Zen Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 138.0.4`! +- [`Zen Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 139.0`! - Check out the latest [release notes](https://zen-browser.app/release-notes)! - Part of our mission is to keep Zen up-to-date with the latest version of Firefox, so you can enjoy the latest features and security updates! diff --git a/build/firefox-cache/l10n-last-commit-hash b/build/firefox-cache/l10n-last-commit-hash index 5ec4a514c..714d02686 100644 --- a/build/firefox-cache/l10n-last-commit-hash +++ b/build/firefox-cache/l10n-last-commit-hash @@ -1 +1 @@ -f5fd58c29d2c9bfcc5dcfc8f4abbe69016e13b44 \ No newline at end of file +82a08ea3ce2d17f21f3d45f4b5607a37590b0158 \ No newline at end of file diff --git a/l10n b/l10n index 102a19cde..644474b8c 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit 102a19cdee3cee5e6f963902f1546e61a0283954 +Subproject commit 644474b8c92e306288d835698eb6714081a650d8 diff --git a/package.json b/package.json index 09926cc0b..49f629c73 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "lint": "npx prettier . --check && autopep8 --diff scripts/ src/", "prepare": "husky", "reset-ff": "surfer reset", - "surfer": "surfer" + "surfer": "surfer", + "test": "python3 scripts/run_tests.py", + "test:dbg": "python3 scripts/run_tests.py --jsdebugger --debug-on-failure" }, "repository": { "type": "git", diff --git a/scripts/run_tests.py b/scripts/run_tests.py new file mode 100644 index 000000000..5f6ceaece --- /dev/null +++ b/scripts/run_tests.py @@ -0,0 +1,45 @@ +import os +import sys +import subprocess +from pathlib import Path + + +def main(): + project_root = Path(__file__).resolve().parent.parent + package_json = project_root / 'package.json' + + # Ensure script is run from project root + if not package_json.exists(): + print("Please run this script from the root of the project", file=sys.stderr) + sys.exit(1) + + args = sys.argv[1:] + path = "" + for arg in args: + if not arg.startswith("--"): + path = arg + break + + # Collect any additional arguments + other_args = [arg for arg in args if arg != path] + + engine_dir = project_root / 'engine' + os.chdir(engine_dir) + + def run_mach_with_paths(test_paths): + command = ['./mach', 'mochitest'] + other_args + test_paths + subprocess.run(command, check=True) + + if path in ("", "all"): + test_dirs = [p for p in Path("zen/tests").iterdir() if p.is_dir()] + test_paths = [str(p) for p in test_dirs] + run_mach_with_paths(test_paths) + else: + run_mach_with_paths([f"zen/tests/{path}"]) + + # Return to original directory + os.chdir(project_root) + + +if __name__ == "__main__": + main() diff --git a/src/Cargo-lock.patch b/src/Cargo-lock.patch index 14a1afd67..269e99681 100644 --- a/src/Cargo-lock.patch +++ b/src/Cargo-lock.patch @@ -1,8 +1,8 @@ diff --git a/Cargo.lock b/Cargo.lock -index 38508fffccbce801a02d4a4211f368674307c4d3..5ce56c36da2e242ad81621c2032eb68dcd26e960 100644 +index f7ebed9b2a71da90c5751cfd5d5f018cc8b73612..96e881c7782198f1e58be2578f167c7079a8191e 100644 --- a/Cargo.lock +++ b/Cargo.lock -@@ -3931,8 +3931,6 @@ dependencies = [ +@@ -4014,8 +4014,6 @@ dependencies = [ [[package]] name = "mime_guess" version = "2.0.4" diff --git a/src/Cargo-toml.patch b/src/Cargo-toml.patch index 841496923..2ac15f242 100644 --- a/src/Cargo-toml.patch +++ b/src/Cargo-toml.patch @@ -1,8 +1,8 @@ diff --git a/Cargo.toml b/Cargo.toml -index d3d529b487f80d4b4f3bfa13cdd3f62946352db8..b35a9e0e3339d48d1cd0cab7b22d030f330e40d1 100644 +index 8c6b99bc629ec26e01ab3746f2ae46174bfaa0b1..5791c7470923c7c15986089b40357ce80365e942 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -217,6 +217,9 @@ rure = { path = "third_party/rust/rure" } +@@ -233,6 +233,9 @@ rure = { path = "third_party/rust/rure" } # Patch `plist` to work with `indexmap` 2.* plist = { path = "third_party/rust/plist" } diff --git a/src/browser/actors/WebRTCParent-sys-mjs.patch b/src/browser/actors/WebRTCParent-sys-mjs.patch index 19e78d204..4b6a910a5 100644 --- a/src/browser/actors/WebRTCParent-sys-mjs.patch +++ b/src/browser/actors/WebRTCParent-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/actors/WebRTCParent.sys.mjs b/browser/actors/WebRTCParent.sys.mjs -index 40e3a057a1d4b2f9bcfb73fa5ff96b2555865434..a92bed06766dd930bd336d56cd9ddcf3c6c0eeca 100644 +index 4ed2dd19207fc38b9e5cc22ea2947aba94b2f5ad..ffc88d62dc46683399c68cdfd35f1b1efde70902 100644 --- a/browser/actors/WebRTCParent.sys.mjs +++ b/browser/actors/WebRTCParent.sys.mjs @@ -152,6 +152,7 @@ export class WebRTCParent extends JSWindowActorParent { diff --git a/src/browser/app/profile/browser.inc b/src/browser/app/profile/browser.inc index 5eec1f692..9774e4fdd 100644 --- a/src/browser/app/profile/browser.inc +++ b/src/browser/app/profile/browser.inc @@ -9,6 +9,9 @@ pref("browser.tabs.closeWindowWithLastTab", false); pref("browser.tabs.loadBookmarksInTabs", false); pref("browser.tabs.hoverPreview.enabled", false); pref("browser.tabs.dragdrop.moveOverThresholdPercent", 50); +pref("browser.tabs.unloadTabInContextMenu", true); +pref("browser.tabs.fadeOutExplicitlyUnloadedTabs", true); + pref('browser.toolbars.bookmarks.visibility', 'never'); pref("browser.bookmarks.openInTabClosesMenu", false); pref("browser.menu.showViewImageInfo", true); diff --git a/src/browser/app/profile/features.inc b/src/browser/app/profile/features.inc index 83993709f..c9d70b809 100644 --- a/src/browser/app/profile/features.inc +++ b/src/browser/app/profile/features.inc @@ -64,14 +64,6 @@ pref('zen.urlbar.show-domain-only-in-sidebar', true); pref('zen.urlbar.hide-one-offs', true); pref('zen.urlbar.enable-overrides', false); -// Exoerimental: Apply a blend mode to the websites so they can render rounded corners -// IMPORTANT: Remove once firefox 139 is released -#ifdef XP_MACOSX -pref('zen.view.experimental-rounded-view', false); -#else -pref('zen.view.experimental-rounded-view', true); -#endif - // Glance pref('zen.glance.enabled', true); pref('zen.glance.hold-duration', 300); // in ms @@ -99,18 +91,12 @@ pref('zen.view.grey-out-inactive-windows', true); pref('zen.view.hide-window-controls', true); pref('zen.view.experimental-no-window-controls', false); -pref('zen.tabs.dim-pending', true); - pref('zen.keyboard.shortcuts.enabled', true); pref('zen.keyboard.shortcuts.version', 0); // Empty string means default shortcuts pref('zen.keyboard.shortcuts.disable-mainkeyset-clear', false); // for debugging pref('zen.themes.updated-value-observer', false); -pref('zen.tab-unloader.enabled', true); -pref('zen.tab-unloader.timeout-minutes', 40); -pref('zen.tab-unloader.excluded-urls', "example.com,example.org"); - pref('zen.pinned-tab-manager.debug', false); pref('zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url', false); pref('zen.pinned-tab-manager.close-shortcut-behavior', 'reset-unload-switch'); diff --git a/src/browser/app/profile/firefox-js.patch b/src/browser/app/profile/firefox-js.patch index 714b3a3c4..edf869d4e 100644 --- a/src/browser/app/profile/firefox-js.patch +++ b/src/browser/app/profile/firefox-js.patch @@ -1,8 +1,8 @@ diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js -index eda8312b0edd34ed22c94c224167680ac6c9c459..56de47f79c553dab2676e127f5320e352b7d3a77 100644 +index beced8067e6c8b5c8cf8e3f6060ba259ec9a294d..33a264e7f9cf97944da3888bdb957fa6e7c4c346 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js -@@ -3377,3 +3377,5 @@ pref("toolkit.contentRelevancy.enabled", false); +@@ -3398,3 +3398,5 @@ pref("toolkit.contentRelevancy.enabled", false); pref("toolkit.contentRelevancy.ingestEnabled", false); // Pref to enable extra logging for the content relevancy feature pref("toolkit.contentRelevancy.log", false); diff --git a/src/browser/app/profile/performance.inc b/src/browser/app/profile/performance.inc index 58dda0f30..e590308e7 100644 --- a/src/browser/app/profile/performance.inc +++ b/src/browser/app/profile/performance.inc @@ -12,6 +12,19 @@ pref("gfx.canvas.accelerated", true); pref("media.hardware-video-decoding.enabled", true); pref("layers.gpu-process.enabled", true); +#ifdef XP_MACOSX +// Pref to control the reponse taken on macOS when the OS is under memory +// pressure. Changes to the pref take effect immediately. Browser restart not +// required. The pref value is a bitmask: +// 0x0: No response (other than recording for telemetry, crash reporting) +// 0x1: Use the tab unloading feature to reduce memory use. Requires that +// the above "browser.tabs.unloadOnLowMemory" pref be set to true for tab +// unloading to occur. +// 0x2: Issue the internal "memory-pressure" notification to reduce memory use +// 0x3: Both 0x1 and 0x2. +pref("browser.lowMemoryResponseMask", 3); +#endif + // Prefetching: pref("network.dns.disablePrefetch", false); pref("network.prefetch-next", true); diff --git a/src/browser/base/content/browser-js.patch b/src/browser/base/content/browser-js.patch index 6fb2a10e9..7baa95e01 100644 --- a/src/browser/base/content/browser-js.patch +++ b/src/browser/base/content/browser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js -index ea79d296e7dd0f8fd812b0677a252af5cf7ad26e..08568d90f888cc262a23ffaa72e985e7c3463b93 100644 +index 6d664917a5a3bb1cea8a747e42e8bc0065ec999e..5059293ebfa29d646455b7a3505bd6eae408ba64 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -33,6 +33,7 @@ ChromeUtils.defineESModuleGetters(this, { @@ -10,19 +10,18 @@ index ea79d296e7dd0f8fd812b0677a252af5cf7ad26e..08568d90f888cc262a23ffaa72e985e7 DevToolsSocketStatus: "resource://devtools/shared/security/DevToolsSocketStatus.sys.mjs", DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs", -@@ -2338,6 +2339,11 @@ var XULBrowserWindow = { +@@ -2340,6 +2341,10 @@ var XULBrowserWindow = { AboutReaderParent.updateReaderButton(gBrowser.selectedBrowser); TranslationsParent.onLocationChange(gBrowser.selectedBrowser); + gZenViewSplitter.onLocationChange(gBrowser.selectedBrowser); + gZenWorkspaces.onLocationChange(gBrowser.selectedBrowser); -+ gZenTabUnloader.onLocationChange(gBrowser.selectedBrowser); + gZenPinnedTabManager.onLocationChange(gBrowser.selectedBrowser); + PictureInPicture.updateUrlbarToggle(gBrowser.selectedBrowser); if (!gMultiProcessBrowser) { -@@ -4814,7 +4820,7 @@ function switchToTabHavingURI( +@@ -4816,7 +4821,7 @@ function switchToTabHavingURI( ignoreQueryString || replaceQueryString, ignoreFragmentWhenComparing ); @@ -31,7 +30,7 @@ index ea79d296e7dd0f8fd812b0677a252af5cf7ad26e..08568d90f888cc262a23ffaa72e985e7 for (let i = 0; i < browsers.length; i++) { let browser = browsers[i]; let browserCompare = cleanURL( -@@ -4857,7 +4863,7 @@ function switchToTabHavingURI( +@@ -4859,7 +4864,7 @@ function switchToTabHavingURI( } if (!doAdopt) { diff --git a/src/browser/base/content/browser-xhtml.patch b/src/browser/base/content/browser-xhtml.patch index d0cb0ab80..223335125 100644 --- a/src/browser/base/content/browser-xhtml.patch +++ b/src/browser/base/content/browser-xhtml.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/browser.xhtml b/browser/base/content/browser.xhtml -index 51a25aaa5558e6e17246d54a7ed95d5ddf3ecdab..08809c25c01d159a9903f1921936b178d51f9875 100644 +index 8f8c5536cb6e54300897180ca3f950974c60e930..79305485631f14712d8b2674f477b641ec53fcd6 100644 --- a/browser/base/content/browser.xhtml +++ b/browser/base/content/browser.xhtml @@ -26,6 +26,7 @@ @@ -10,7 +10,7 @@ index 51a25aaa5558e6e17246d54a7ed95d5ddf3ecdab..08809c25c01d159a9903f1921936b178 persist="screenX screenY width height sizemode" data-l10n-sync="true"> -@@ -104,8 +105,11 @@ +@@ -105,8 +106,11 @@ @@ -22,7 +22,7 @@ index 51a25aaa5558e6e17246d54a7ed95d5ddf3ecdab..08809c25c01d159a9903f1921936b178 # All sets except for popupsets (commands, keys, and stringbundles) -@@ -127,9 +131,11 @@ +@@ -128,9 +132,11 @@ diff --git a/src/browser/base/content/zen-assets.inc.xhtml b/src/browser/base/content/zen-assets.inc.xhtml index a22c86635..449855cb2 100644 --- a/src/browser/base/content/zen-assets.inc.xhtml +++ b/src/browser/base/content/zen-assets.inc.xhtml @@ -29,19 +29,16 @@ # Scripts used all over the browser - + + + + + + + + + + + + + diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn index b083e20ef..96ac35a48 100644 --- a/src/browser/base/content/zen-assets.jar.inc.mn +++ b/src/browser/base/content/zen-assets.jar.inc.mn @@ -50,7 +50,6 @@ content/browser/zen-components/ZenKeyboardShortcuts.mjs (../../zen/kbs/ZenKeyboardShortcuts.mjs) - content/browser/zen-components/ZenTabUnloader.mjs (../../zen/tabs/ZenTabUnloader.mjs) content/browser/zen-components/ZenPinnedTabsStorage.mjs (../../zen/tabs/ZenPinnedTabsStorage.mjs) content/browser/zen-components/ZenPinnedTabManager.mjs (../../zen/tabs/ZenPinnedTabManager.mjs) * content/browser/zen-styles/zen-tabs.css (../../zen/tabs/zen-tabs.css) diff --git a/src/browser/base/content/zen-keysets.inc.xhtml b/src/browser/base/content/zen-keysets.inc.xhtml index 1b3c25f23..5efa7c2cb 100644 --- a/src/browser/base/content/zen-keysets.inc.xhtml +++ b/src/browser/base/content/zen-keysets.inc.xhtml @@ -43,10 +43,6 @@ - - - - diff --git a/src/browser/base/content/zen-preloaded.inc.xhtml b/src/browser/base/content/zen-preloaded.inc.xhtml index 4859caf9e..5cc1fb9b4 100644 --- a/src/browser/base/content/zen-preloaded.inc.xhtml +++ b/src/browser/base/content/zen-preloaded.inc.xhtml @@ -1,13 +1,11 @@ # This needs to be here, before all the other scripts, because it's used before # the window is fully loaded. # Make sure they are loaded before the global-scripts.inc file. - + + + + + + + + diff --git a/src/browser/base/content/zen-sidebar-icons.inc.xhtml b/src/browser/base/content/zen-sidebar-icons.inc.xhtml index c840b8ccb..73575ba13 100644 --- a/src/browser/base/content/zen-sidebar-icons.inc.xhtml +++ b/src/browser/base/content/zen-sidebar-icons.inc.xhtml @@ -2,7 +2,7 @@ { // Search within main document and highlight matched keyword. -@@ -197,6 +198,10 @@ function init_all() { +@@ -196,6 +197,10 @@ function init_all() { register_module("paneSearch", gSearchPane); register_module("panePrivacy", gPrivacyPane); register_module("paneContainers", gContainersPane); diff --git a/src/browser/components/preferences/preferences-xhtml.patch b/src/browser/components/preferences/preferences-xhtml.patch index d198e5f63..7dcd7ca03 100644 --- a/src/browser/components/preferences/preferences-xhtml.patch +++ b/src/browser/components/preferences/preferences-xhtml.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/preferences/preferences.xhtml b/browser/components/preferences/preferences.xhtml -index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2590c1705 100644 +index b3b128cb5eb8c005c642965a8c8e5e68bf756e77..6e128d45c983b267e349b08097c56380dd04be3d 100644 --- a/browser/components/preferences/preferences.xhtml +++ b/browser/components/preferences/preferences.xhtml @@ -44,6 +44,8 @@ @@ -11,7 +11,7 @@ index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2 -@@ -105,6 +107,11 @@ +@@ -104,6 +106,11 @@ @@ -23,7 +23,7 @@ index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2 @@ -74,7 +74,7 @@ index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2 @@ -86,7 +86,7 @@ index 43be2b6ac84827bd13723e0211a3ade401934591..513584d7e720451efdb87350ac07d8b2 -@@ -246,6 +292,10 @@ +@@ -245,6 +291,10 @@ #include sync.inc.xhtml #include experimental.inc.xhtml #include moreFromMozilla.inc.xhtml diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 512d2e91d..0c6998664 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -1219,4 +1219,9 @@ Preferences.addAll([ type: 'bool', default: false, }, + { + id: 'browser.tabs.unloadOnLowMemory', + type: 'bool', + default: true, + }, ]); diff --git a/src/browser/components/preferences/zenTabsManagement.inc.xhtml b/src/browser/components/preferences/zenTabsManagement.inc.xhtml index 6c6e92954..d54059530 100644 --- a/src/browser/components/preferences/zenTabsManagement.inc.xhtml +++ b/src/browser/components/preferences/zenTabsManagement.inc.xhtml @@ -37,18 +37,7 @@ - - - - - - - + preference="browser.tabs.unloadOnLowMemory"/> `; -@@ -175,7 +178,7 @@ +@@ -180,7 +183,7 @@ } set _visuallySelected(val) { @@ -30,7 +30,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 return; } -@@ -211,7 +214,7 @@ +@@ -216,7 +219,7 @@ } get visible() { @@ -39,7 +39,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 } get hidden() { -@@ -282,7 +285,7 @@ +@@ -287,7 +290,7 @@ return false; } @@ -48,7 +48,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 } get lastAccessed() { -@@ -454,6 +457,8 @@ +@@ -459,6 +462,8 @@ this.style.MozUserFocus = "ignore"; } else if ( event.target.classList.contains("tab-close-button") || @@ -57,7 +57,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 event.target.classList.contains("tab-icon-overlay") || event.target.classList.contains("tab-audio-button") ) { -@@ -508,6 +513,10 @@ +@@ -513,6 +518,10 @@ this.style.MozUserFocus = ""; } @@ -68,7 +68,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 on_click(event) { if (event.button != 0) { return; -@@ -554,6 +563,7 @@ +@@ -559,6 +568,7 @@ telemetrySource: lazy.TabMetrics.METRIC_SOURCE.TAB_STRIP, }); } else { @@ -76,7 +76,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 gBrowser.removeTab(this, { animate: true, triggeringEvent: event, -@@ -564,6 +574,14 @@ +@@ -569,6 +579,14 @@ // (see tabbrowser-tabs 'click' handler). gBrowser.tabContainer._blockDblClick = true; } @@ -91,7 +91,7 @@ index dc92771ebc65095dfebbddc238ee6d4fffd897bf..fa35f6835498f8e51f060479addb2523 } on_dblclick(event) { -@@ -587,6 +605,8 @@ +@@ -592,6 +610,8 @@ animate: true, triggeringEvent: event, }); diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index dfaaacb14..e028d0f09 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,15 +1,11 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f255c4ebc9 100644 +index d5aa64842a35c6697263c63fd3a0571b64b01344..6943dc7f1d3d95ab1da315cbdbda0b032cf200f1 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js -@@ -415,11 +415,45 @@ +@@ -413,11 +413,41 @@ return this.tabContainer.visibleTabs; } -+ zenInsertTabAtIndex(...args) { -+ return this.#insertTabAtElementIndex(...args); -+ } -+ + get _numVisiblePinTabsWithoutCollapsed() { + let i = 0; + for (let item of this.tabContainer.ariaFocusableItems) { @@ -50,7 +46,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } return i; } -@@ -571,6 +605,7 @@ +@@ -569,6 +599,7 @@ this.tabpanels.appendChild(panel); let tab = this.tabs[0]; @@ -58,7 +54,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 tab.linkedPanel = uniqueId; this._selectedTab = tab; this._selectedBrowser = browser; -@@ -836,11 +871,13 @@ +@@ -834,11 +865,13 @@ } this.showTab(aTab); @@ -75,7 +71,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 this.moveTabTo(aTab, { tabIndex: this.pinnedTabCount, forceUngrouped: true, -@@ -857,12 +894,15 @@ +@@ -855,12 +888,15 @@ } if (this.tabContainer.verticalMode) { @@ -92,7 +88,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 }); } else { this.moveTabTo(aTab, { -@@ -1046,6 +1086,8 @@ +@@ -1044,6 +1080,8 @@ let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"]; @@ -101,7 +97,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if ( aIconURL && !aLoadingPrincipal && -@@ -1056,6 +1098,9 @@ +@@ -1054,6 +1092,9 @@ ); return; } @@ -111,7 +107,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 let browser = this.getBrowserForTab(aTab); browser.mIconURL = aIconURL; -@@ -1305,6 +1350,7 @@ +@@ -1303,6 +1344,7 @@ if (!this._previewMode) { newTab.recordTimeFromUnloadToReload(); newTab.updateLastAccessed(); @@ -119,7 +115,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 oldTab.updateLastAccessed(); // if this is the foreground window, update the last-seen timestamps. if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) { -@@ -1457,6 +1503,9 @@ +@@ -1455,6 +1497,9 @@ } let activeEl = document.activeElement; @@ -129,7 +125,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // If focus is on the old tab, move it to the new tab. if (activeEl == oldTab) { newTab.focus(); -@@ -1780,7 +1829,8 @@ +@@ -1778,7 +1823,8 @@ } _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) { @@ -139,7 +135,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 return false; } -@@ -1888,7 +1938,7 @@ +@@ -1886,7 +1932,7 @@ newIndex = this.selectedTab._tPos + 1; } @@ -148,7 +144,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (this.isTabGroupLabel(targetTab)) { throw new Error( "Replacing a tab group label with a tab is not supported" -@@ -2152,6 +2202,7 @@ +@@ -2150,6 +2196,7 @@ uriIsAboutBlank, userContextId, skipLoad, @@ -156,7 +152,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } = {}) { let b = document.createXULElement("browser"); // Use the JSM global to create the permanentKey, so that if the -@@ -2225,8 +2276,7 @@ +@@ -2223,8 +2270,7 @@ // we use a different attribute name for this? b.setAttribute("name", name); } @@ -166,7 +162,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 b.setAttribute("transparent", "true"); } -@@ -2391,7 +2441,7 @@ +@@ -2389,7 +2435,7 @@ let panel = this.getPanel(browser); let uniqueId = this._generateUniquePanelID(); @@ -175,7 +171,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 aTab.linkedPanel = uniqueId; // Inject the into the DOM if necessary. -@@ -2450,8 +2500,8 @@ +@@ -2448,8 +2494,8 @@ // If we transitioned from one browser to two browsers, we need to set // hasSiblings=false on both the existing browser and the new browser. if (this.tabs.length == 2) { @@ -186,7 +182,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } else { aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; } -@@ -2679,6 +2729,7 @@ +@@ -2680,6 +2726,7 @@ schemelessInput, hasValidUserGestureActivation = false, textDirectiveUserActivation = false, @@ -194,7 +190,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } = {} ) { // all callers of addTab that pass a params object need to pass -@@ -2689,6 +2740,12 @@ +@@ -2690,6 +2737,12 @@ ); } @@ -207,7 +203,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (!UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.start("browser.tabs.opening", "initting", window); } -@@ -2752,6 +2809,16 @@ +@@ -2753,6 +2806,16 @@ noInitialLabel, skipBackgroundNotify, }); @@ -222,9 +218,9 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 + t.setAttribute("zen-empty-tab", "true"); + } if (insertTab) { - if (typeof index == "number") { - elementIndex = this.#tabIndexToElementIndex(index); -@@ -2779,6 +2846,7 @@ + // Insert the tab into the tab container in the correct position. + // For now, we support `index` as an alias for `tabIndex`. +@@ -2783,6 +2846,7 @@ openWindowInfo, skipLoad, triggeringRemoteType, @@ -232,7 +228,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 })); if (focusUrlBar) { -@@ -2898,6 +2966,12 @@ +@@ -2902,6 +2966,12 @@ } } @@ -245,25 +241,8 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // Additionally send pinned tab events if (pinned) { this._notifyPinnedStatus(t); -@@ -2945,12 +3019,15 @@ - * @param {string} [label=] - * @returns {MozTabbrowserTabGroup} - */ -- _createTabGroup(id, color, collapsed, label = "") { -+ _createTabGroup(id, color, collapsed, label = "", pinned = false, essential = false, splitViewGroup = false) { - let group = document.createXULElement("tab-group", { is: "tab-group" }); - group.id = id; - group.collapsed = collapsed; - group.color = color; - group.label = label; -+ group.pinned = pinned; -+ group.essential = essential; -+ if (splitViewGroup) group.setAttribute('split-view-group', true); - return group; - } - -@@ -2993,10 +3070,10 @@ - insertBefore = null, +@@ -2990,10 +3060,10 @@ + isAdoptingGroup = false, isUserTriggered = false, telemetryUserCreateSource = "unknown", + forSplitView = false, @@ -274,10 +253,10 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } if (!color) { -@@ -3011,7 +3088,12 @@ - id = `${Date.now()}-${Math.round(Math.random() * 100)}`; - } - let group = this._createTabGroup(id, color, false, label); +@@ -3014,7 +3084,12 @@ + label, + isAdoptingGroup + ); - this.tabContainer.insertBefore( + if (forSplitView) { + group.setAttribute('split-view-group', true); @@ -288,7 +267,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 group, insertBefore?.group ?? insertBefore ); -@@ -3342,6 +3424,7 @@ +@@ -3303,6 +3378,7 @@ openWindowInfo, skipLoad, triggeringRemoteType, @@ -296,7 +275,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } ) { // If we don't have a preferred remote type (or it is `NOT_REMOTE`), and -@@ -3411,6 +3494,7 @@ +@@ -3372,6 +3448,7 @@ openWindowInfo, name, skipLoad, @@ -304,7 +283,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 }); } -@@ -3599,7 +3683,7 @@ +@@ -3560,7 +3637,7 @@ // Add a new tab if needed. if (!tab) { let createLazyBrowser = @@ -313,7 +292,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 let url = "about:blank"; if (tabData.entries?.length) { -@@ -3637,7 +3721,29 @@ +@@ -3598,7 +3675,29 @@ skipLoad: true, preferredRemoteType, }); @@ -343,7 +322,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (select) { tabToSelect = tab; } -@@ -3661,7 +3767,8 @@ +@@ -3622,7 +3721,8 @@ // needs calling: shouldUpdateForPinnedTabs = true; } @@ -353,7 +332,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 let { groupId } = tabData; const tabGroup = tabGroupWorkingData.get(groupId); // if a tab refers to a tab group we don't know, skip any group -@@ -3675,7 +3782,10 @@ +@@ -3636,7 +3736,10 @@ tabGroup.stateData.id, tabGroup.stateData.color, tabGroup.stateData.collapsed, @@ -365,7 +344,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 ); tabsFragment.appendChild(tabGroup.node); } -@@ -3723,8 +3833,16 @@ +@@ -3684,8 +3787,16 @@ // to remove the old selected tab. if (tabToSelect) { let leftoverTab = this.selectedTab; @@ -384,26 +363,26 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } if (tabs.length > 1 || !tabs[0].selected) { -@@ -3912,7 +4030,7 @@ +@@ -3881,7 +3992,7 @@ // Ensure we have an index if one was not provided. - if (typeof index != "number") { + if (typeof elementIndex != "number" && typeof tabIndex != "number") { // Move the new tab after another tab if needed, to the end otherwise. -- index = Infinity; -+ index = Services.prefs.getBoolPref("zen.view.show-newtab-button-top") ? this._numVisiblePinTabsWithoutCollapsed : Infinity; +- elementIndex = Infinity; ++ elementIndex = Services.prefs.getBoolPref("zen.view.show-newtab-button-top") ? this._numVisiblePinTabsWithoutCollapsed : Infinity; if ( !bulkOrderedOpen && ((openerTab && -@@ -3935,7 +4053,7 @@ +@@ -3904,7 +4015,7 @@ ) { - index = Infinity; + elementIndex = Infinity; } else if (previousTab.visible) { -- index = previousTab.elementIndex + 1; -+ index = (typeof previousTab.elementIndex === 'undefined') ? index : (previousTab.elementIndex + 1); +- elementIndex = previousTab.elementIndex + 1; ++ elementIndex = (typeof previousTab.elementIndex === 'undefined') ? index : (previousTab.elementIndex + 1); } else if (previousTab == FirefoxViewHandler.tab) { - index = 0; + elementIndex = 0; } -@@ -3958,18 +4076,18 @@ - +@@ -3932,10 +4043,10 @@ + } // Ensure index is within bounds. if (tab.pinned) { - index = Math.max(index, 0); @@ -413,12 +392,11 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } else { - index = Math.max(index, this.pinnedTabCount); + index = Math.max(index, this._numVisiblePinTabsWithoutCollapsed); - index = Math.min(index, this.tabContainer.ariaFocusableItems.length); + index = Math.min(index, allItems.length); } - /** @type {MozTabbrowserTab|undefined} */ -- let itemAfter = this.tabContainer.ariaFocusableItems.at(index); -+ let itemAfter = this.tabContainer.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).at(index); +@@ -3947,7 +4058,7 @@ + this.tabContainer._invalidateCachedTabs(); - if (tabGroup) { @@ -426,7 +404,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 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); -@@ -4290,6 +4408,9 @@ +@@ -4268,6 +4379,9 @@ return; } @@ -436,7 +414,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 this.removeTabs(selectedTabs, { telemetrySource }); } -@@ -4542,6 +4663,7 @@ +@@ -4520,6 +4634,7 @@ telemetrySource, } = {} ) { @@ -444,7 +422,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // When 'closeWindowWithLastTab' pref is enabled, closing all tabs // can be considered equivalent to closing the window. if ( -@@ -4626,6 +4748,7 @@ +@@ -4604,6 +4719,7 @@ if (lastToClose) { this.removeTab(lastToClose, aParams); } @@ -452,7 +430,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } catch (e) { console.error(e); } -@@ -4663,6 +4786,12 @@ +@@ -4641,6 +4757,12 @@ aTab._closeTimeNoAnimTimerId = Glean.browserTabclose.timeNoAnim.start(); } @@ -465,7 +443,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // Handle requests for synchronously removing an already // asynchronously closing tab. if (!animate && aTab.closing) { -@@ -4677,7 +4806,9 @@ +@@ -4655,7 +4777,9 @@ // frame created for it (for example, by updating the visually selected // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; @@ -476,7 +454,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -4840,7 +4971,7 @@ +@@ -4821,7 +4945,7 @@ closeWindowWithLastTab != null ? closeWindowWithLastTab : !window.toolbar.visible || @@ -485,7 +463,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -4864,6 +4995,7 @@ +@@ -4845,6 +4969,7 @@ newTab = true; } @@ -493,7 +471,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 aTab._endRemoveArgs = [closeWindow, newTab]; // swapBrowsersAndCloseOther will take care of closing the window without animation. -@@ -4903,9 +5035,7 @@ +@@ -4885,9 +5010,7 @@ aTab._mouseleave(); if (newTab) { @@ -504,7 +482,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } else { TabBarVisibility.update(); } -@@ -5034,6 +5164,8 @@ +@@ -5016,6 +5139,8 @@ this.tabs[i]._tPos = i; } @@ -513,18 +491,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (!this._windowIsClosing) { if (wasPinned) { this.tabContainer._positionPinnedTabs(); -@@ -5159,8 +5291,8 @@ - return closedCount; - } - -- async explicitUnloadTabs(tabs) { -- let unloadBlocked = await this.runBeforeUnloadForTabs(tabs); -+ async explicitUnloadTabs(tabs, skipPermitUnload = false) { -+ let unloadBlocked = skipPermitUnload ? false : await this.runBeforeUnloadForTabs(tabs); - if (unloadBlocked) { - return; - } -@@ -5248,6 +5380,7 @@ +@@ -5230,6 +5355,7 @@ } let excludeTabs = new Set(aExcludeTabs); @@ -532,7 +499,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // If this tab has a successor, it should be selectable, since // hiding or closing a tab removes that tab as a successor. -@@ -5260,13 +5393,13 @@ +@@ -5242,13 +5368,13 @@ !excludeTabs.has(aTab.owner) && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") ) { @@ -548,7 +515,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 ); let tab = this.tabContainer.findNextTab(aTab, { -@@ -5282,7 +5415,7 @@ +@@ -5264,7 +5390,7 @@ } if (tab) { @@ -557,7 +524,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } // If no qualifying visible tab was found, see if there is a tab in -@@ -5303,7 +5436,7 @@ +@@ -5285,7 +5411,7 @@ }); } @@ -566,7 +533,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } _blurTab(aTab) { -@@ -5704,10 +5837,10 @@ +@@ -5686,10 +5812,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -579,7 +546,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -6001,7 +6134,7 @@ +@@ -5986,7 +6112,7 @@ // Don't allow mixing pinned and unpinned tabs. if (this.isTab(element) && element.pinned) { @@ -588,13 +555,13 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 } else { tabIndex = Math.max(tabIndex, this.pinnedTabCount); } -@@ -6027,10 +6160,16 @@ +@@ -6012,10 +6138,16 @@ this.#handleTabMove( element, () => { - let neighbor = this.tabs[tabIndex]; -- if (forceUngrouped && neighbor.group) { -+ let neighbor = gZenGlanceManager.getTabOrGlanceParent(this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[tabIndex]); +- if (forceUngrouped && neighbor?.group) { ++ let neighbor = gZenGlanceManager.getTabOrGlanceParent(this.tabs[tabIndex]); + if ((forceUngrouped && neighbor?.group) || neighbor?.group?.hasAttribute("split-view-group")) { neighbor = neighbor.group; } @@ -607,7 +574,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (neighbor && this.isTab(element) && tabIndex > element._tPos) { neighbor.after(element); } else { -@@ -6099,7 +6238,9 @@ +@@ -6084,17 +6216,26 @@ targetElement = targetElement.group; } } @@ -617,8 +584,12 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 + } // Don't allow mixing pinned and unpinned tabs. if (element.pinned && !targetElement?.pinned) { - targetElement = this.tabs[this.pinnedTabCount - 1]; -@@ -6109,7 +6250,14 @@ +- targetElement = this.tabs[this.pinnedTabCount - 1]; ++ targetElement = this.tabs.filter(tab => !tab.hasAttribute('zen-glance-tab'))[this.pinnedTabCount - 1]; + moveBefore = false; + } else if (!element.pinned && targetElement && targetElement.pinned) { +- targetElement = this.tabs[this.pinnedTabCount]; ++ targetElement = this.tabs.filter(tab => !tab.hasAttribute('zen-glance-tab'))[this.pinnedTabCount]; moveBefore = true; } @@ -633,7 +604,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 if (element.pinned && this.tabContainer.verticalMode) { return this.tabContainer.verticalPinnedTabsContainer; } -@@ -6169,7 +6317,7 @@ +@@ -6154,7 +6295,7 @@ if (!this.isTab(aTab)) { throw new Error("Can only move a tab into a tab group"); } @@ -642,7 +613,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 return; } if (aTab.group && aTab.group.id === aGroup.id) { -@@ -6263,6 +6411,10 @@ +@@ -6248,6 +6389,10 @@ moveActionCallback(); @@ -653,7 +624,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // Clear tabs cache after moving nodes because the order of tabs may have // changed. this.tabContainer._invalidateCachedTabs(); -@@ -7080,7 +7232,7 @@ +@@ -7145,7 +7290,7 @@ // preventDefault(). It will still raise the window if appropriate. break; } @@ -662,7 +633,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 window.focus(); aEvent.preventDefault(); break; -@@ -7981,6 +8133,7 @@ +@@ -8044,6 +8189,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -670,7 +641,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; } -@@ -8954,7 +9107,7 @@ var TabContextMenu = { +@@ -9009,7 +9155,7 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !this.multiselected; @@ -679,7 +650,7 @@ index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f2 // Move Tab items let contextMoveTabOptions = document.getElementById( "context_moveTabOptions" -@@ -9223,6 +9376,7 @@ var TabContextMenu = { +@@ -9278,6 +9424,7 @@ var TabContextMenu = { telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP, }); } else { diff --git a/src/browser/components/tabbrowser/content/tabs-js.patch b/src/browser/components/tabbrowser/content/tabs-js.patch index 79748328e..6b263722d 100644 --- a/src/browser/components/tabbrowser/content/tabs-js.patch +++ b/src/browser/components/tabbrowser/content/tabs-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js -index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed3ca882e1 100644 +index 84d633471c89230b981d8a07babef4e0c76c0338..1a9c56846ff27d68c16b939fb759ea9596403cef 100644 --- a/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js @@ -83,7 +83,7 @@ @@ -11,7 +11,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } return true; }; -@@ -286,6 +286,7 @@ +@@ -293,6 +293,7 @@ on_TabGroupCollapse(event) { this._invalidateCachedVisibleTabs(); this._unlockTabSizing(); @@ -19,7 +19,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed // If the user's selected tab is in the collapsing group, kick them off // the tab. If no tabs exist outside the group, create a new one and -@@ -342,7 +343,7 @@ +@@ -349,7 +350,7 @@ // and we're not hitting the scroll buttons. if ( event.button != 0 || @@ -28,16 +28,16 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed event.composedTarget.localName == "toolbarbutton" ) { return; -@@ -692,7 +693,7 @@ +@@ -699,7 +700,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.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenEssentials); ++ let pinnedTabs = this.ariaFocusableItems.slice(0, gBrowser._numZenEssentials); let tabsPerRow = 0; let position = 0; for (let pinnedTab of pinnedTabs) { -@@ -764,7 +765,7 @@ +@@ -772,7 +773,7 @@ } else if (isTabGroupLabel(tab) && !tab.group.collapsed) { this._lockTabSizing(); this.#keepTabSizeLocked = true; @@ -46,7 +46,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed expandGroupOnDrop = true; } } -@@ -913,6 +914,10 @@ +@@ -921,6 +922,10 @@ } let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0); @@ -57,7 +57,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed if ( (effects == "move" || effects == "copy") && document == draggedTab.ownerDocument && -@@ -1069,6 +1074,18 @@ +@@ -1077,6 +1082,18 @@ this._tabDropIndicator.hidden = true; event.stopPropagation(); @@ -76,23 +76,22 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed if (draggedTab && dropEffect == "copy") { let duplicatedDraggedTab; let duplicatedTabs = []; -@@ -1108,10 +1125,11 @@ +@@ -1116,10 +1133,11 @@ } } else { let isPinned = draggedTab.pinned; - let numPinned = gBrowser.pinnedTabCount; -- let tabs = this.ariaFocusableItems.slice( -- isPinned ? 0 : numPinned, -- isPinned ? numPinned : undefined + let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed; + let essential = draggedTab.hasAttribute("zen-essential"); -+ let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice( + 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"; -@@ -1203,7 +1221,7 @@ +@@ -1211,7 +1229,7 @@ item.removeAttribute("tabdrop-samewindow"); resolve(); }; @@ -101,7 +100,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed postTransitionCleanup(); } else { let onTransitionEnd = transitionendEvent => { -@@ -1327,6 +1345,7 @@ +@@ -1337,6 +1355,7 @@ let nextItem = this.ariaFocusableItems[newIndex]; let tabGroup = isTab(nextItem) && nextItem.group; @@ -109,7 +108,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed gBrowser.loadTabs(urls, { inBackground, replace, -@@ -1359,6 +1378,17 @@ +@@ -1369,6 +1388,17 @@ this.finishMoveTogetherSelectedTabs(draggedTab); this.finishAnimateTabMove(); @@ -127,7 +126,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed this.#expandGroupOnDrop(draggedTab); if ( -@@ -1582,7 +1612,7 @@ +@@ -1597,7 +1627,7 @@ } get newTabButton() { @@ -136,7 +135,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } get verticalMode() { -@@ -1606,29 +1636,55 @@ +@@ -1621,29 +1651,54 @@ if (this.#allTabs) { return this.#allTabs; } @@ -180,8 +179,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed + if (glanceTab) { + // insert right after the parent tab. note: it must be inserted before + // the last pinned tab so it can be inserted in the correct order -+ allTabs.splice(Math.max(i + 1, lastPinnedTabIdx), 0, glanceTab); -+ i++; ++ allTabs.splice(Math.max(i++, lastPinnedTabIdx), 0, glanceTab); + } else if (tab.classList.contains("vertical-pinned-tabs-container-separator")) { + // remove the separator from the list + allTabs.splice(i, 1); @@ -200,16 +198,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } /** -@@ -1648,7 +1704,7 @@ - */ - get visibleTabs() { - if (!this.#visibleTabs) { -- this.#visibleTabs = this.openTabs.filter(tab => tab.visible); -+ this.#visibleTabs = this.openTabs.filter(tab => tab.visible && !tab.hasAttribute("zen-empty-tab")); - } - return this.#visibleTabs; - } -@@ -1683,36 +1739,40 @@ +@@ -1698,23 +1753,18 @@ } let elementIndex = 0; @@ -237,21 +226,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed let visibleTabsInGroup = child.tabs.filter(tab => tab.visible); visibleTabsInGroup.forEach(tab => { tab.elementIndex = elementIndex++; - }); - focusableItems.push(...visibleTabsInGroup); - } -+ for (let tab of child.tabs) { -+ let glanceTab = tab.glanceTab; -+ if (isTab(glanceTab)) { -+ glanceTab.elementIndex = elementIndex - 1; -+ focusableItems.push(glanceTab); -+ } -+ } -+ } -+ let glanceTab = child.glanceTab; -+ if (isTab(child) && glanceTab) { -+ glanceTab.elementIndex = elementIndex - 1; -+ focusableItems.push(glanceTab); +@@ -1724,10 +1774,7 @@ } } @@ -263,7 +238,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed return this.#focusableItems; } -@@ -1720,6 +1780,7 @@ +@@ -1735,6 +1782,7 @@ _invalidateCachedTabs() { this.#allTabs = null; this._invalidateCachedVisibleTabs(); @@ -271,7 +246,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } _invalidateCachedVisibleTabs() { -@@ -1734,8 +1795,8 @@ +@@ -1749,8 +1797,8 @@ #isContainerVerticalPinnedGrid(tab) { return ( this.verticalMode && @@ -282,7 +257,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed !this.expandOnHover ); } -@@ -1751,7 +1812,7 @@ +@@ -1766,7 +1814,7 @@ if (node == null) { // We have a container for non-tab elements at the end of the scrollbox. @@ -291,7 +266,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } node.before(tab); -@@ -1846,7 +1907,7 @@ +@@ -1861,7 +1909,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. @@ -300,7 +275,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed const newTab2 = this.newTabButton; const newTabVertical = document.getElementById( "vertical-tabs-newtab-button" -@@ -1941,10 +2002,12 @@ +@@ -1956,10 +2004,12 @@ _handleTabSelect(aInstant) { let selectedTab = this.selectedItem; @@ -313,68 +288,24 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed selectedTab._notselectedsinceload = false; } -@@ -2085,16 +2148,15 @@ - // Move pinned tabs to another container when the tabstrip is toggled to vertical - // and when session restore code calls _positionPinnedTabs; update styling whenever - // the number of pinned tabs changes. -- let verticalTabsContainer = document.getElementById( -- "vertical-pinned-tabs-container" -- ); -+ let verticalTabsContainer = this.verticalPinnedTabsContainer; - let numPinned = gBrowser.pinnedTabCount; -- -- if (gBrowser.pinnedTabCount !== verticalTabsContainer.children.length) { -- let tabs = this.visibleTabs; -+ if (!gZenWorkspaces._hasInitializedTabsStrip) return; -+ let count = gZenWorkspaces.makeSurePinTabIsInCorrectPosition(); -+ if (gBrowser.pinnedTabCount !== (verticalTabsContainer.children.length - count - 1 + gZenWorkspaces.getCurrentEssentialsContainer().children.length)) { -+ let tabs = this.allTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")); - for (let i = 0; i < numPinned; i++) { - tabs[i].style.marginInlineStart = ""; -- verticalTabsContainer.appendChild(tabs[i]); -+ tabs[i].hasAttribute("zen-essential") ? gZenWorkspaces.getCurrentEssentialsContainer().appendChild(tabs[i].group?.hasAttribute("split-view-group") ? tabs[i].group : tabs[i]) : verticalTabsContainer.insertBefore(tabs[i].group?.hasAttribute("split-view-group") ? tabs[i].group : tabs[i], verticalTabsContainer.lastChild); - } - } - -@@ -2102,9 +2164,7 @@ - } - - _resetVerticalPinnedTabs() { -- let verticalTabsContainer = document.getElementById( -- "vertical-pinned-tabs-container" -- ); -+ let verticalTabsContainer = this.verticalPinnedTabsContainer; - - if (!verticalTabsContainer.children.length) { - return; -@@ -2117,7 +2177,7 @@ +@@ -2132,6 +2182,7 @@ } _positionPinnedTabs() { -- let tabs = this.visibleTabs; -+ let tabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")); ++ if (true) return; + let tabs = this.visibleTabs; let numPinned = gBrowser.pinnedTabCount; let absPositionHorizontalTabs = - this.overflowing && tabs.length > numPinned && numPinned > 0; -@@ -2127,7 +2187,7 @@ - - if (this.verticalMode) { - this._updateVerticalPinnedTabs(); -- } else if (absPositionHorizontalTabs) { -+ } else if (absPositionHorizontalTabs && false) { - let layoutData = this._pinnedTabsLayoutCache; - let uiDensity = document.documentElement.getAttribute("uidensity"); - if (!layoutData || layoutData.uiDensity != uiDensity) { -@@ -2191,7 +2251,7 @@ +@@ -2206,7 +2257,7 @@ return; } - let tabs = this.visibleTabs.slice(0, gBrowser.pinnedTabCount); -+ let tabs = this.visibleTabs.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice(0, gBrowser._numZenEssentials); ++ let tabs = this.ariaFocusableItems.slice(0, gBrowser._numZenEssentials); let directionX = screenX > dragData.animLastScreenX; let directionY = screenY > dragData.animLastScreenY; -@@ -2199,7 +2259,7 @@ +@@ -2214,7 +2265,7 @@ dragData.animLastScreenX = screenX; let { width: tabWidth, height: tabHeight } = @@ -383,28 +314,18 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed let shiftSizeX = tabWidth * movingTabs.length; let shiftSizeY = tabHeight; dragData.tabWidth = tabWidth; -@@ -2262,7 +2322,7 @@ - // * We're doing a binary search in order to reduce the amount of - // tabs we need to check. - -- tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab); -+ tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab && !t.hasAttribute("zen-glance-tab")); - let firstTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2; - let lastTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2; - let tabCenterX = directionX ? lastTabCenterX : firstTabCenterX; -@@ -2374,12 +2434,16 @@ +@@ -2389,12 +2440,16 @@ this.#clearDragOverCreateGroupTimer(); - let isPinned = draggedTab.pinned; - let numPinned = gBrowser.pinnedTabCount; -- let tabs = this.ariaFocusableItems.slice( -- isPinned ? 0 : numPinned, -- isPinned ? numPinned : undefined + let isPinned = draggedTab?.group ? draggedTab.group.pinned : draggedTab.pinned; + let numPinned = gBrowser._numVisiblePinTabsWithoutCollapsed; + let essential = draggedTab.hasAttribute("zen-essential"); -+ let tabs = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab")).slice( + let tabs = this.ariaFocusableItems.slice( +- isPinned ? 0 : numPinned, +- isPinned ? numPinned : undefined + isPinned ? (essential ? 0 : gBrowser._numZenEssentials) : numPinned, + isPinned ? (essential ? gBrowser._numZenEssentials : numPinned) : undefined ); @@ -414,7 +335,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed if (this.#rtlMode) { tabs.reverse(); -@@ -2393,7 +2457,7 @@ +@@ -2408,7 +2463,7 @@ let size = this.verticalMode ? "height" : "width"; let translateAxis = this.verticalMode ? "translateY" : "translateX"; let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft"; @@ -423,7 +344,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed let translateX = event.screenX - dragData.screenX; let translateY = event.screenY - dragData.screenY; -@@ -2407,12 +2471,21 @@ +@@ -2422,12 +2477,21 @@ let lastTab = tabs.at(-1); let lastMovingTab = movingTabs.at(-1); let firstMovingTab = movingTabs[0]; @@ -446,7 +367,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed translate += this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos; } else if (isPinned && this.verticalMode) { -@@ -2431,12 +2504,15 @@ +@@ -2446,6 +2510,9 @@ // Shift the `.tab-group-label-container` to shift the label element. item = item.parentElement; } @@ -456,14 +377,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed item.style.transform = `${translateAxis}(${translate}px)`; } - dragData.translatePos = translate; - -- tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab); -+ tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab && !t.hasAttribute("zen-glance-tab")); - - /** - * When the `draggedTab` is just starting to move, the `draggedTab` is in -@@ -2568,6 +2644,9 @@ +@@ -2583,6 +2650,9 @@ break; } let element = tabs[mid]; @@ -473,20 +387,18 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed let elementForSize = isTabGroupLabel(element) ? element.parentElement : element; -@@ -2588,7 +2667,11 @@ - - let dropElement = getOverlappedElement(); +@@ -2605,6 +2675,10 @@ if (!dropElement) { -- dropElement = this.ariaFocusableItems[oldDropElementIndex]; -+ dropElement = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab"))[oldDropElementIndex]; -+ } + dropElement = this.ariaFocusableItems[oldDropElementIndex]; + } + if (dropElement?.group?.hasAttribute("split-view-group")) { + // We focus the group label element, not the group itself. + dropElement = dropElement.group.labelElement; - } ++ } let newDropElementIndex = dropElement ? dropElement.elementIndex -@@ -2598,7 +2681,7 @@ + : oldDropElementIndex; +@@ -2613,7 +2687,7 @@ let shouldCreateGroupOnDrop; let dropBefore; if (dropElement) { @@ -495,7 +407,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed ? dropElement.parentElement : dropElement; -@@ -2660,12 +2743,12 @@ +@@ -2675,12 +2749,12 @@ } } @@ -510,7 +422,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed dropElement != draggedTab && isTab(dropElement) && !dropElement?.group && -@@ -2735,7 +2818,7 @@ +@@ -2750,7 +2824,7 @@ // Shift background tabs to leave a gap where the dragged tab // would currently be dropped. for (let item of tabs) { @@ -519,7 +431,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed continue; } -@@ -2744,6 +2827,9 @@ +@@ -2759,6 +2833,9 @@ if (isTabGroupLabel(item)) { // Shift the `.tab-group-label-container` to shift the label element. item = item.parentElement; @@ -529,7 +441,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed } item.style.transform = transform; } -@@ -2796,8 +2882,9 @@ +@@ -2811,8 +2888,9 @@ ); } @@ -541,7 +453,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed return; } -@@ -2809,6 +2896,12 @@ +@@ -2824,6 +2902,12 @@ item = item.parentElement; } item.style.transform = ""; @@ -554,7 +466,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed item.removeAttribute("dragover-createGroup"); } this.removeAttribute("movingtab-createGroup"); -@@ -2855,7 +2948,7 @@ +@@ -2870,7 +2954,7 @@ let postTransitionCleanup = () => { movingTab._moveTogetherSelectedTabsData.animate = false; }; @@ -563,7 +475,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed postTransitionCleanup(); } else { let onTransitionEnd = transitionendEvent => { -@@ -3028,7 +3121,7 @@ +@@ -3043,7 +3127,7 @@ } _notifyBackgroundTab(aTab) { @@ -572,7 +484,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed return; } -@@ -3154,6 +3247,9 @@ +@@ -3169,6 +3253,9 @@ return null; } } diff --git a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch index f761f121f..1c8633947 100644 --- a/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarInput-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs -index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372cc11ed40 100644 +index 0c5145c3d31862bd2c6b5ed2faa88f02425ffde1..1cf86995514b2c00360f6ed681f0c640dac8ab56 100644 --- a/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs @@ -68,6 +68,13 @@ XPCOMUtils.defineLazyPreferenceGetter( @@ -16,7 +16,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 const DEFAULT_FORM_HISTORY_NAME = "searchbar-history"; const SEARCH_BUTTON_CLASS = "urlbar-search-button"; -@@ -349,7 +356,16 @@ export class UrlbarInput { +@@ -355,7 +362,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 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 this._suppressPrimaryAdjustment = false; } -@@ -425,6 +441,10 @@ export class UrlbarInput { +@@ -431,6 +447,10 @@ export class UrlbarInput { hideSearchTerms = false, isSameDocument = false ) { @@ -44,7 +44,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 // We only need to update the searchModeUI on tab switch conditionally // as we only persist searchMode with ScotchBonnet enabled. if ( -@@ -698,8 +718,16 @@ export class UrlbarInput { +@@ -735,8 +755,16 @@ export class UrlbarInput { return; } } @@ -62,7 +62,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 } /** -@@ -1093,7 +1121,11 @@ export class UrlbarInput { +@@ -1142,7 +1170,11 @@ export class UrlbarInput { } if (!this.#providesSearchMode(result)) { @@ -74,8 +74,8 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 + } } - this.controller.recordSelectedResult(event, result); -@@ -2125,6 +2157,10 @@ export class UrlbarInput { + if (isCanonized) { +@@ -2191,6 +2223,10 @@ export class UrlbarInput { await this.#updateLayoutBreakoutDimensions(); } @@ -86,7 +86,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 startLayoutExtend() { if (!this.#allowBreakout || this.hasAttribute("breakout-extend")) { // Do not expand if the Urlbar does not support being expanded or it is -@@ -2147,6 +2183,12 @@ export class UrlbarInput { +@@ -2205,6 +2241,12 @@ export class UrlbarInput { this.setAttribute("breakout-extend", "true"); @@ -99,7 +99,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 // 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")) { -@@ -2166,6 +2208,24 @@ export class UrlbarInput { +@@ -2224,6 +2266,24 @@ export class UrlbarInput { return; } @@ -124,7 +124,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 this.removeAttribute("breakout-extend"); this.#updateTextboxPosition(); } -@@ -2485,7 +2545,7 @@ export class UrlbarInput { +@@ -2553,7 +2613,7 @@ export class UrlbarInput { this.textbox.parentNode.style.setProperty( "--urlbar-container-height", @@ -133,7 +133,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 ); this.textbox.style.setProperty( "--urlbar-height", -@@ -2900,6 +2960,7 @@ export class UrlbarInput { +@@ -2968,6 +3028,7 @@ export class UrlbarInput { } _toggleActionOverride(event) { @@ -141,7 +141,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 if ( event.keyCode == KeyEvent.DOM_VK_SHIFT || event.keyCode == KeyEvent.DOM_VK_ALT || -@@ -2998,7 +3059,7 @@ export class UrlbarInput { +@@ -3069,7 +3130,7 @@ export class UrlbarInput { */ _trimValue(val) { let trimmedValue = lazy.UrlbarPrefs.get("trimURLs") @@ -150,7 +150,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 : val; // Only trim value if the directionality doesn't change to RTL and we're not // showing a strikeout https protocol. -@@ -3368,6 +3429,10 @@ export class UrlbarInput { +@@ -3439,6 +3500,10 @@ export class UrlbarInput { } reuseEmpty = true; } @@ -161,7 +161,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 if ( where == "tab" && reuseEmpty && -@@ -3375,6 +3440,9 @@ export class UrlbarInput { +@@ -3446,6 +3511,9 @@ export class UrlbarInput { ) { where = "current"; } @@ -171,7 +171,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 return where; } -@@ -3632,6 +3700,7 @@ export class UrlbarInput { +@@ -3703,6 +3771,7 @@ export class UrlbarInput { this.setResultForCurrentValue(null); this.handleCommand(); this.controller.clearLastQueryContextCache(); @@ -179,7 +179,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 this._suppressStartQuery = false; }); -@@ -3639,7 +3708,6 @@ export class UrlbarInput { +@@ -3710,7 +3779,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. @@ -187,7 +187,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 let controller = this.document.commandDispatcher.getControllerForCommand("cmd_paste"); -@@ -4053,6 +4121,11 @@ export class UrlbarInput { +@@ -4136,6 +4204,11 @@ export class UrlbarInput { } _on_click(event) { @@ -199,7 +199,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 if ( event.target == this.inputField || event.target == this._inputContainer || -@@ -4124,7 +4197,7 @@ export class UrlbarInput { +@@ -4207,7 +4280,7 @@ export class UrlbarInput { } } @@ -208,7 +208,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 this.view.autoOpen({ event }); } else { if (this._untrimOnFocusAfterKeydown) { -@@ -4164,9 +4237,16 @@ export class UrlbarInput { +@@ -4247,9 +4320,16 @@ export class UrlbarInput { } _on_mousedown(event) { @@ -226,7 +226,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 if ( event.target != this.inputField && -@@ -4178,6 +4258,10 @@ export class UrlbarInput { +@@ -4261,6 +4341,10 @@ export class UrlbarInput { this.focusedViaMousedown = !this.focused; this._preventClickSelectsAll = this.focused; @@ -237,7 +237,7 @@ index 4b69136aa31bfef3a1d3b57ad0c75fe07fa26be0..66ef8de0d2a767376740ca57d75b5372 // Keep the focus status, since the attribute may be changed // upon calling this.focus(). -@@ -4218,7 +4302,7 @@ export class UrlbarInput { +@@ -4301,7 +4385,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. diff --git a/src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch b/src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch index 37ca86d1e..19d26fc05 100644 --- a/src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs -index b1481a11ef38037bec13939928f72f9772e335a9..925f0dc34bf84bb9e0f143f5c1973a87e7b4f8ac 100644 +index 899e808c5f8cf14577404e3d1766fe967b32b065..82854a04edc21ac4552d06d6ba45c4714b5ef5cb 100644 --- a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs +++ b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs @@ -35,6 +35,8 @@ const QUERYINDEX_SWITCHTAB = 9; @@ -9,14 +9,14 @@ index b1481a11ef38037bec13939928f72f9772e335a9..925f0dc34bf84bb9e0f143f5c1973a87 +const QUERYINDEX_PINNEDTITLE = 13; +const QUERYINDEX_PINNEDURL = 14; - // Constants to support an alternative frecency algorithm. - const PAGES_USE_ALT_FRECENCY = Services.prefs.getBoolPref( -@@ -65,11 +67,14 @@ const SQL_BOOKMARK_TAGS_FRAGMENT = `EXISTS(SELECT 1 FROM moz_bookmarks WHERE fk + // This SQL query fragment provides the following: + // - whether the entry is bookmarked (QUERYINDEX_BOOKMARKED) +@@ -56,11 +58,14 @@ const SQL_BOOKMARK_TAGS_FRAGMENT = `EXISTS(SELECT 1 FROM moz_bookmarks WHERE fk // condition once, and avoid evaluating "btitle" and "tags" when it is false. function defaultQuery(conditions = "") { let query = `SELECT :query_type, h.url, h.title, ${SQL_BOOKMARK_TAGS_FRAGMENT}, -- h.visit_count, h.typed, h.id, t.open_count, ${PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date -+ h.visit_count, h.typed, h.id, t.open_count, ${PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date, +- h.visit_count, h.typed, h.id, t.open_count, ${lazy.PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date ++ h.visit_count, h.typed, h.id, t.open_count, ${lazy.PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date, + zp.title AS pinned_title, zp.url AS pinned_url FROM moz_places h LEFT JOIN moz_openpages_temp t @@ -26,8 +26,8 @@ index b1481a11ef38037bec13939928f72f9772e335a9..925f0dc34bf84bb9e0f143f5c1973a87 + ON zp.url = h.url WHERE ( (:switchTabsEnabled AND t.open_count > 0) OR - ${PAGES_FRECENCY_FIELD} <> 0 -@@ -83,7 +88,7 @@ function defaultQuery(conditions = "") { + ${lazy.PAGES_FRECENCY_FIELD} <> 0 +@@ -74,7 +79,7 @@ function defaultQuery(conditions = "") { :matchBehavior, :searchBehavior, NULL) ELSE AUTOCOMPLETE_MATCH(:searchString, h.url, @@ -36,7 +36,7 @@ index b1481a11ef38037bec13939928f72f9772e335a9..925f0dc34bf84bb9e0f143f5c1973a87 h.visit_count, h.typed, 0, t.open_count, :matchBehavior, :searchBehavior, NULL) -@@ -1132,11 +1137,14 @@ Search.prototype = { +@@ -1130,11 +1135,14 @@ Search.prototype = { let lastVisit = lastVisitPRTime ? lazy.PlacesUtils.toDate(lastVisitPRTime).getTime() : undefined; diff --git a/src/browser/components/urlbar/UrlbarView-sys-mjs.patch b/src/browser/components/urlbar/UrlbarView-sys-mjs.patch index 6d5678e36..6942e8b88 100644 --- a/src/browser/components/urlbar/UrlbarView-sys-mjs.patch +++ b/src/browser/components/urlbar/UrlbarView-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/urlbar/UrlbarView.sys.mjs b/browser/components/urlbar/UrlbarView.sys.mjs -index d5382623595de8daed8cd13ea2eb2de329a4bd92..c3b5d1bad0bf4e1c5a5875a83751cfa96cdf1510 100644 +index e17f3d34367d6567c89f632b6d1ce537608a6829..7528dfb0abc8ea8d9315591cd529a341b4c3962a 100644 --- a/browser/components/urlbar/UrlbarView.sys.mjs +++ b/browser/components/urlbar/UrlbarView.sys.mjs @@ -609,7 +609,7 @@ export class UrlbarView { diff --git a/src/browser/extensions/newtab/lib/ActivityStream-sys-mjs.patch b/src/browser/extensions/newtab/lib/ActivityStream-sys-mjs.patch index 86da56280..03800640f 100644 --- a/src/browser/extensions/newtab/lib/ActivityStream-sys-mjs.patch +++ b/src/browser/extensions/newtab/lib/ActivityStream-sys-mjs.patch @@ -1,8 +1,8 @@ diff --git a/browser/extensions/newtab/lib/ActivityStream.sys.mjs b/browser/extensions/newtab/lib/ActivityStream.sys.mjs -index 14183ad7165dc91126b4409b26f669409c4e9905..be979225b89b193b9e9c8903de5740dc04a8999f 100644 +index a00011de585a40b91d33364a04c6bf5c86145ecd..f98b6d11519a80aff307513fd77361179f9914a4 100644 --- a/browser/extensions/newtab/lib/ActivityStream.sys.mjs +++ b/browser/extensions/newtab/lib/ActivityStream.sys.mjs -@@ -215,7 +215,7 @@ export const PREFS_CONFIG = new Map([ +@@ -228,7 +228,7 @@ export const PREFS_CONFIG = new Map([ "showSponsoredTopSites", { title: "Show sponsored top sites", diff --git a/src/browser/locales/en-US/installer/custom-properties.patch b/src/browser/locales/en-US/installer/custom-properties.patch index a3e5f497b..b0f1e3adb 100644 --- a/src/browser/locales/en-US/installer/custom-properties.patch +++ b/src/browser/locales/en-US/installer/custom-properties.patch @@ -1,8 +1,8 @@ diff --git a/browser/locales/en-US/installer/custom.properties b/browser/locales/en-US/installer/custom.properties -index a9dc6fb90caa50a9ba9ec63a6cd90b4d8dcc2bc0..48d11c0c5a3b926d2d29c30d1ca8630941514210 100644 +index 8c33192e589de1d819cbb21c31cec0480ed4c85e..9db296363303c153dc05ad9e85493f1197bb1efd 100644 --- a/browser/locales/en-US/installer/custom.properties +++ b/browser/locales/en-US/installer/custom.properties -@@ -77,7 +77,7 @@ STATUS_INSTALL_LANG=Installing Language Files (${AB_CD})… +@@ -73,7 +73,7 @@ STATUS_INSTALL_APP=Installing $BrandShortName… STATUS_UNINSTALL_MAIN=Uninstalling $BrandShortName… STATUS_CLEANUP=A Little Housekeeping… diff --git a/src/browser/modules/ExtensionsUI-sys-mjs.patch b/src/browser/modules/ExtensionsUI-sys-mjs.patch index adc60af5b..f48c81dbb 100644 --- a/src/browser/modules/ExtensionsUI-sys-mjs.patch +++ b/src/browser/modules/ExtensionsUI-sys-mjs.patch @@ -1,8 +1,8 @@ diff --git a/browser/modules/ExtensionsUI.sys.mjs b/browser/modules/ExtensionsUI.sys.mjs -index 3f74e47bf7602fa800d1cf3034ec67055cc792b6..e700b88d1aee80c946e234f89f695a31d71ff608 100644 +index 9734d95742035dbe6f608ad3cdaaefc6ed5b83bc..9a7bbb272025e84968d3173faca259f558746c5e 100644 --- a/browser/modules/ExtensionsUI.sys.mjs +++ b/browser/modules/ExtensionsUI.sys.mjs -@@ -436,7 +436,7 @@ export var ExtensionsUI = { +@@ -466,7 +466,7 @@ export var ExtensionsUI = { eventCallback, removeOnDismissal: true, popupOptions: { diff --git a/src/browser/themes/BuiltInThemeConfig-sys-mjs.patch b/src/browser/themes/BuiltInThemeConfig-sys-mjs.patch index 01ba3d2fb..38ee55686 100644 --- a/src/browser/themes/BuiltInThemeConfig-sys-mjs.patch +++ b/src/browser/themes/BuiltInThemeConfig-sys-mjs.patch @@ -1,8 +1,8 @@ diff --git a/browser/themes/BuiltInThemeConfig.sys.mjs b/browser/themes/BuiltInThemeConfig.sys.mjs -index 081187147736f56abfe5866a69e00ac13a8dd940..9a980fe858c1a77af7634037aebc332d237e9c11 100644 +index a5361f1f0ec57f575f8d76e118ff762dc7547501..db5c5eb2059b4ceef3911fd807bf985408859d1a 100644 --- a/browser/themes/BuiltInThemeConfig.sys.mjs +++ b/browser/themes/BuiltInThemeConfig.sys.mjs -@@ -33,13 +33,6 @@ export const BuiltInThemeConfig = new Map([ +@@ -33,11 +33,4 @@ export const BuiltInThemeConfig = new Map([ path: "resource://builtin-themes/dark/", }, ], @@ -13,6 +13,4 @@ index 081187147736f56abfe5866a69e00ac13a8dd940..9a980fe858c1a77af7634037aebc332d - path: "resource://builtin-themes/alpenglow/", - }, - ], - [ - "2022red-colorway@mozilla.org", - { + ]); diff --git a/src/browser/themes/addons/jar-mn.patch b/src/browser/themes/addons/jar-mn.patch deleted file mode 100644 index 46bba0ff6..000000000 --- a/src/browser/themes/addons/jar-mn.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/browser/themes/addons/jar.mn b/browser/themes/addons/jar.mn -index 69bb3000d6d2d249d1d77262dc2a0057d0318308..bbed04a6b6f11c582e17e08201db260b9ed496b7 100644 ---- a/browser/themes/addons/jar.mn -+++ b/browser/themes/addons/jar.mn -@@ -5,8 +5,8 @@ - browser.jar: - % resource builtin-themes %content/builtin-themes/ - -- content/builtin-themes/alpenglow (alpenglow/*.svg) -- content/builtin-themes/alpenglow/manifest.json (alpenglow/manifest.json) -+# content/builtin-themes/alpenglow (alpenglow/*.svg) -+# content/builtin-themes/alpenglow/manifest.json (alpenglow/manifest.json) - - content/builtin-themes/dark (dark/*.svg) - content/builtin-themes/dark (dark/*.css) -@@ -100,3 +100,5 @@ browser.jar: - content/builtin-themes/colorways/2022innovator/balanced/manifest.json (colorways/2022-independent-voices/innovator/balanced/manifest.json) - content/builtin-themes/colorways/2022innovator/bold (colorways/2022-independent-voices/innovator/bold/*.svg) - content/builtin-themes/colorways/2022innovator/bold/manifest.json (colorways/2022-independent-voices/innovator/bold/manifest.json) -+ -+#include zen-addons.inc.mn -\ No newline at end of file diff --git a/src/browser/themes/addons/zen-addons.inc.mn b/src/browser/themes/addons/zen-addons.inc.mn deleted file mode 100644 index 8b1378917..000000000 --- a/src/browser/themes/addons/zen-addons.inc.mn +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/browser/themes/linux/browser-css.patch b/src/browser/themes/linux/browser-css.patch index 1edfc2df5..600647925 100644 --- a/src/browser/themes/linux/browser-css.patch +++ b/src/browser/themes/linux/browser-css.patch @@ -1,5 +1,5 @@ diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css -index 5c9891e5ed4b865ed4ecc98d794a239b0f96a8f9..53e69289620dd7e89dad167fb3a59b162545dd89 100644 +index 195cf888a61893cc9b0015e07e27bce94ec9d409..5f4cb6a1922730e8a0f1e9ad04169fb092917938 100644 --- a/browser/themes/linux/browser.css +++ b/browser/themes/linux/browser.css @@ -42,7 +42,8 @@ diff --git a/src/browser/themes/osx/browser-css.patch b/src/browser/themes/osx/browser-css.patch index 740607be6..e4bd72c82 100644 --- a/src/browser/themes/osx/browser-css.patch +++ b/src/browser/themes/osx/browser-css.patch @@ -1,5 +1,5 @@ diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css -index 7fc76bc82bd5d6311442b85a76d885dcfb6d753d..61b1b3ac8241c4f12e4ca8966a7ac1fae0eb41ee 100644 +index 9f795cd5b67b12ed4e6d0838d6e0b8e1048f6e50..e9d9326f174a25140113de40f4c57e8bc67677ff 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -38,7 +38,7 @@ diff --git a/src/browser/themes/shared/customizableui/panelUI-shared-css.patch b/src/browser/themes/shared/customizableui/panelUI-shared-css.patch deleted file mode 100644 index 8a1ac44bc..000000000 --- a/src/browser/themes/shared/customizableui/panelUI-shared-css.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/browser/themes/shared/customizableui/panelUI-shared.css b/browser/themes/shared/customizableui/panelUI-shared.css -index bdbfd3521b4921f7d6d44623181019a8263b5825..e69b1fb9ee7e553f1183f7a52f9104d6f99d4288 100644 ---- a/browser/themes/shared/customizableui/panelUI-shared.css -+++ b/browser/themes/shared/customizableui/panelUI-shared.css -@@ -18,7 +18,7 @@ - --menu-panel-width-wide: 29em; - - --arrowpanel-menuitem-margin-block: 0; -- --arrowpanel-menuitem-margin-inline: 8px; -+ --arrowpanel-menuitem-margin-inline: 4px; - --arrowpanel-menuitem-margin: var(--arrowpanel-menuitem-margin-block) var(--arrowpanel-menuitem-margin-inline); - --arrowpanel-menuitem-padding-block: 8px; - --arrowpanel-menuitem-padding-inline: 8px; -@@ -819,8 +819,8 @@ toolbarbutton[constrain-size="true"][cui-areatype="panel"] > .toolbarbutton-badg - /* Firefox Account Toolbar Panel */ - - #fxa-avatar-image { -- width: 16px; -- height: 16px; -+ width: 20px; -+ height: 20px; - } - - :root { diff --git a/src/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock-css.patch b/src/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock-css.patch deleted file mode 100644 index c3f531c69..000000000 --- a/src/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock-css.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock.css b/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock.css -index 787e3153e2e07b383445e94aa9e25177eb49c929..a017e4c003f6c3b9af7c226c637b37aea6baa7e5 100644 ---- a/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock.css -+++ b/browser/themes/shared/tabbrowser/fullscreen-and-pointerlock.css -@@ -7,7 +7,7 @@ - :root[inDOMFullscreen] #sidebar-box, - :root[inDOMFullscreen] #sidebar-main, - :root[inDOMFullscreen] #sidebar-splitter, --:root[inFullscreen]:not([macOSNativeFullscreen]) toolbar:not([fullscreentoolbar=true]), -+:root[inFullscreen]:not([macOSNativeFullscreen]) toolbar:not([fullscreentoolbar=true]):not(.zen-dont-hide-on-fullscreen), - :root[inFullscreen] .global-notificationbox { - visibility: collapse; - } diff --git a/src/browser/themes/shared/tabbrowser/tabs-css.patch b/src/browser/themes/shared/tabbrowser/tabs-css.patch index 70608338a..3cc083b47 100644 --- a/src/browser/themes/shared/tabbrowser/tabs-css.patch +++ b/src/browser/themes/shared/tabbrowser/tabs-css.patch @@ -1,8 +1,8 @@ diff --git a/browser/themes/shared/tabbrowser/tabs.css b/browser/themes/shared/tabbrowser/tabs.css -index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73ed810ba5 100644 +index 5b9ad123d819c6ef068acd427416957a1d0939fe..311caa27ee268c95215d459be02a93d20e129f8b 100644 --- a/browser/themes/shared/tabbrowser/tabs.css +++ b/browser/themes/shared/tabbrowser/tabs.css -@@ -32,7 +32,7 @@ +@@ -33,7 +33,7 @@ --tab-block-margin: 4px; --tab-icon-end-margin: 5.5px; --tab-label-line-height: 1.7; @@ -11,7 +11,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 --tab-hover-background-color: color-mix(in srgb, currentColor 11%, transparent); --tab-selected-textcolor: var(--toolbar-color); --tab-selected-bgcolor: var(--toolbar-bgcolor); -@@ -210,8 +210,7 @@ +@@ -211,8 +211,7 @@ } #tabbrowser-tabs[positionpinnedtabs] > #tabbrowser-arrowscrollbox > &[pinned] { @@ -21,7 +21,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 } #tabbrowser-tabs[movingtab] &:is(:active, [multiselected]) { -@@ -257,7 +256,6 @@ +@@ -258,7 +257,6 @@ } :root:not([uidensity=compact], [sidebar-expand-on-hover]) &[pinned] { @@ -29,7 +29,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 } &:is([selected], [multiselected]) { -@@ -271,6 +269,7 @@ +@@ -272,6 +270,7 @@ border-radius: inherit; position: relative; overflow: hidden; @@ -37,15 +37,34 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 &::before { position: absolute; -@@ -458,6 +457,7 @@ +@@ -459,14 +458,11 @@ .tab-icon-image { -moz-context-properties: fill, stroke; fill: currentColor; + border-radius: 4px; - /* Apply crisp rendering for favicons at exactly 2dppx resolution */ - @media (resolution: 2dppx) { -@@ -557,7 +557,7 @@ + /* stylelint-disable-next-line media-query-no-invalid */ + @media -moz-pref("browser.tabs.fadeOutUnloadedTabs") { + &[pending] { +- filter: grayscale(100%); +- @media (prefers-color-scheme: dark) { +- filter: grayscale(100%) invert(); +- } + opacity: 0.5; + /* Fade the favicon out */ + transition-property: filter, opacity; +@@ -483,10 +479,6 @@ + /* stylelint-disable-next-line media-query-no-invalid */ + @media -moz-pref("browser.tabs.fadeOutExplicitlyUnloadedTabs") { + &[pending][discarded] { +- filter: grayscale(100%); +- @media (prefers-color-scheme: dark) { +- filter: grayscale(100%) invert(); +- } + opacity: 0.5; + /* Fade the favicon out */ + transition-property: filter, opacity; +@@ -559,7 +551,7 @@ z-index: 1; /* Overlay tab title */ #tabbrowser-tabs[orient=vertical] & { @@ -54,7 +73,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 } &[crashed] { -@@ -565,7 +565,7 @@ +@@ -567,7 +559,7 @@ } #tabbrowser-tabs[orient="vertical"]:not([expanded]) &:not([crashed]), @@ -63,7 +82,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 &[soundplaying] { list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-playing-small.svg"); } -@@ -595,7 +595,7 @@ +@@ -597,7 +589,7 @@ background-image: linear-gradient(var(--audio-overlay-extra-background)), linear-gradient(var(--toolbox-bgcolor)); -moz-context-properties: fill; @@ -72,7 +91,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 color-scheme: var(--tab-selected-color-scheme); border-radius: var(--border-radius-circle); -@@ -1362,7 +1362,7 @@ tab-group { +@@ -1365,7 +1357,7 @@ tab-group { } } @@ -81,7 +100,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 #vertical-tabs-newtab-button { appearance: none; min-height: var(--tab-min-height); -@@ -1373,7 +1373,7 @@ tab-group { +@@ -1376,7 +1368,7 @@ tab-group { margin-inline: var(--tab-inner-inline-margin); #tabbrowser-tabs[orient="vertical"]:not([expanded]) & > .toolbarbutton-text { @@ -90,7 +109,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 } &:hover { -@@ -1397,7 +1397,7 @@ tab-group { +@@ -1400,7 +1392,7 @@ tab-group { * flex container. #tabs-newtab-button is a child of the arrowscrollbox where * we don't want a gap (between tabs), so we have to add some margin. */ @@ -99,7 +118,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 margin-block: var(--tab-block-margin); } -@@ -1471,8 +1471,6 @@ tab-group { +@@ -1474,8 +1466,6 @@ tab-group { } :root:not([sidebar-expand-on-hover]) & { @@ -108,7 +127,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 /* stylelint-disable-next-line media-query-no-invalid */ @media not -moz-pref("sidebar.visibility", "expand-on-hover") { /* We need these rules to apply at all times when the sidebar.visibility -@@ -1586,7 +1584,6 @@ tab-group { +@@ -1585,7 +1575,6 @@ tab-group { &:not([expanded]) { .tabbrowser-tab[pinned] { @@ -116,7 +135,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 } .tab-background { -@@ -1717,7 +1714,7 @@ tab-group { +@@ -1716,7 +1705,7 @@ tab-group { toolbarbutton:not(#firefox-view-button), toolbarpaletteitem:not(#wrapper-firefox-view-button) ) ~ #tabbrowser-tabs { @@ -125,7 +144,7 @@ index 6ca85d9d4d593271fe49138ea736bd96651c05f5..bcae5b6829190d6e36a32b36d20c1c73 padding-inline-start: calc(var(--tab-overflow-pinned-tabs-width) + 2px); margin-inline-start: 2px; } -@@ -1751,7 +1748,6 @@ toolbar:not(#TabsToolbar) #firefox-view-button { +@@ -1750,7 +1739,6 @@ toolbar:not(#TabsToolbar) #firefox-view-button { list-style-image: url(chrome://global/skin/icons/plus.svg); } diff --git a/src/browser/themes/shared/toolbarbuttons-css.patch b/src/browser/themes/shared/toolbarbuttons-css.patch index 3205424c2..b4a805c18 100644 --- a/src/browser/themes/shared/toolbarbuttons-css.patch +++ b/src/browser/themes/shared/toolbarbuttons-css.patch @@ -1,8 +1,8 @@ diff --git a/browser/themes/shared/toolbarbuttons.css b/browser/themes/shared/toolbarbuttons.css -index 26b58ee104a432a359ba2667d2e49a9231e81fef..7cb950e7b3fcb6f599e9cb645ea24a515e2cc491 100644 +index d84326072652a48d7fc9b61c585fb00ac4b506ab..c91654eb852460721cf7e45623fb471027f06d90 100644 --- a/browser/themes/shared/toolbarbuttons.css +++ b/browser/themes/shared/toolbarbuttons.css -@@ -218,7 +218,7 @@ toolbar[brighttext] .toolbaritem-combined-buttons > separator { +@@ -249,7 +249,7 @@ toolbar[brighttext] .toolbaritem-combined-buttons > separator { #nav-bar-overflow-button { list-style-image: url("chrome://global/skin/icons/chevron.svg"); @@ -11,7 +11,7 @@ index 26b58ee104a432a359ba2667d2e49a9231e81fef..7cb950e7b3fcb6f599e9cb645ea24a51 display: none; } -@@ -428,7 +428,7 @@ toolbarbutton.bookmark-item:not(.subviewbutton) { +@@ -459,7 +459,7 @@ toolbarbutton.bookmark-item:not(.subviewbutton) { */ align-items: stretch; > .toolbarbutton-icon { diff --git a/src/browser/themes/shared/urlbar-searchbar-css.patch b/src/browser/themes/shared/urlbar-searchbar-css.patch index 181a0ca00..40744ee2a 100644 --- a/src/browser/themes/shared/urlbar-searchbar-css.patch +++ b/src/browser/themes/shared/urlbar-searchbar-css.patch @@ -1,5 +1,5 @@ diff --git a/browser/themes/shared/urlbar-searchbar.css b/browser/themes/shared/urlbar-searchbar.css -index e237ee9edea85c1d2ef22f988df6b22755e343e6..abee0dc035833c4334e55bd8cd7483bbcc71f97f 100644 +index 23661cf489d97cdbd6d4c66de199fd9dc0c8475f..2677dc60a92cebe014c817414a6067be9543cf98 100644 --- a/browser/themes/shared/urlbar-searchbar.css +++ b/browser/themes/shared/urlbar-searchbar.css @@ -5,7 +5,7 @@ @@ -11,10 +11,10 @@ index e237ee9edea85c1d2ef22f988df6b22755e343e6..abee0dc035833c4334e55bd8cd7483bb --urlbar-margin-inline: 5px; --urlbar-padding-block: 4px; } -@@ -292,10 +292,14 @@ - } +@@ -303,10 +303,14 @@ #urlbar[breakout][breakout-extend] { + height: auto; + :root:not([zen-single-toolbar='true']) { margin-left: calc(-1 * var(--urlbar-margin-inline)); + } diff --git a/src/browser/themes/shared/zen-icons/icons.css b/src/browser/themes/shared/zen-icons/icons.css index d58716081..9bdcf40d2 100644 --- a/src/browser/themes/shared/zen-icons/icons.css +++ b/src/browser/themes/shared/zen-icons/icons.css @@ -670,7 +670,7 @@ #unified-extensions-context-menu menuitem { background-image: var(--menu-image) !important; background-size: 16px !important; - background-position: var(--fp-contextmenu-menuitem-padding-inline) center !important; + background-position: var(--zen-contextmenu-menuitem-padding-inline) center !important; background-repeat: no-repeat !important; -moz-context-properties: fill, fill-opacity !important; fill: currentColor !important; @@ -679,7 +679,7 @@ @media not (-moz-platform: windows) { menu > .menu-iconic-text, menuitem > .menu-iconic-text { - padding-inline-start: var(--fp-contextmenu-menuicon-margin-inline) !important; + padding-inline-start: var(--zen-contextmenu-menuicon-margin-inline) !important; } } @@ -1051,8 +1051,7 @@ menuitem[id='placesContext_new:separator'] { --menu-image: url('close-all.svg'); } -#context_zenUnloadTab, -#context_zenUnloadWebPanel, +#context_unloadTab, #context_zenTabActions { --menu-image: url('close-all.svg'); } @@ -1156,8 +1155,8 @@ menuitem[id='placesContext_new:separator'] { ), :not(:not(menubar) > menu, #ContentSelectDropdown) > menupopup > menucaption { padding-inline-start: calc( - var(--fp-contextmenu-menuitem-padding-inline) + 16px + - var(--fp-contextmenu-menuicon-margin-inline) + var(--zen-contextmenu-menuitem-padding-inline) + var(--zen-contextmenu-menuicon-margin-inline) / + 2 ) !important; } diff --git a/src/browser/themes/windows/browser-css.patch b/src/browser/themes/windows/browser-css.patch index c9034e1ab..9fbae15f8 100644 --- a/src/browser/themes/windows/browser-css.patch +++ b/src/browser/themes/windows/browser-css.patch @@ -1,21 +1,12 @@ diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css -index 3e75a5f366e76acf4b9457a510b58b0cb8af580f..99b5712d533e99f3bb3f13c1485e771ab66731cd 100644 +index 007aec91e089a1d2df20235890b268b820b0a529..ac0592cbcec62ffefb58b491dff48749852f2d88 100644 --- a/browser/themes/windows/browser.css +++ b/browser/themes/windows/browser.css -@@ -34,7 +34,6 @@ - /* stylelint-disable-next-line media-query-no-invalid */ - @media -moz-pref("widget.windows.mica.toplevel-backdrop", 2) { - /* For acrylic, do the same we do for popups to guarantee some contrast */ -- background-color: light-dark(rgba(255, 255, 255, .6), rgba(0, 0, 0, .6)); - } - } - } -@@ -57,7 +56,7 @@ - } +@@ -31,7 +31,6 @@ + /* stylelint-disable-next-line media-query-no-invalid */ + @media -moz-pref("widget.windows.mica.toplevel-backdrop", 2) { + /* For acrylic, do the same we do for popups to guarantee some contrast */ +- background-color: light-dark(rgba(255, 255, 255, .6), rgba(0, 0, 0, .6)); } + } -- &[sizemode="normal"] #navigator-toolbox { -+ &[sizemode="normal"] #browser { - border-top: .5px solid ActiveBorder; - &:-moz-window-inactive { - border-top-color: InactiveBorder; diff --git a/src/build/moz-build.patch b/src/build/moz-build.patch index 46aee904f..596a09b20 100644 --- a/src/build/moz-build.patch +++ b/src/build/moz-build.patch @@ -1,8 +1,8 @@ diff --git a/build/moz.build b/build/moz.build -index ad78395c33bba4f6a7bd73bae2a3b6e0658ed59e..a3ba1001a60b764c9ef1c824917fe4d5b81ed0b2 100644 +index f7a912ec35dd089ea9a7e712765e954854f55cb3..a84534efbc7662f81573a4a80bc045e0a6d2ed3e 100644 --- a/build/moz.build +++ b/build/moz.build -@@ -90,7 +90,7 @@ if CONFIG["MOZ_APP_BASENAME"]: +@@ -89,7 +89,7 @@ if CONFIG["MOZ_APP_BASENAME"]: if CONFIG[var]: appini_defines[var] = True diff --git a/src/build/pgo/profileserver-py.patch b/src/build/pgo/profileserver-py.patch index 410baf650..43c0496b2 100644 --- a/src/build/pgo/profileserver-py.patch +++ b/src/build/pgo/profileserver-py.patch @@ -1,5 +1,5 @@ diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py -index c59efbdc5382da897dcac31da7039cdc92e1d7dc..9b14add5b0c5afec5b7efc7f9df7d04d3169fc80 100755 +index 6017810c873f6be5a5d133dc9386f7cd8879e81b..6d399e0c8135d2c27157c81d75515de04c39f1d7 100755 --- a/build/pgo/profileserver.py +++ b/build/pgo/profileserver.py @@ -18,7 +18,13 @@ from mozprofile import FirefoxProfile, Preferences diff --git a/src/docshell/base/nsAboutRedirector-cpp.patch b/src/docshell/base/nsAboutRedirector-cpp.patch index 0445eae4a..0b06ee9fb 100644 --- a/src/docshell/base/nsAboutRedirector-cpp.patch +++ b/src/docshell/base/nsAboutRedirector-cpp.patch @@ -1,5 +1,5 @@ diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp -index e95ff966b34576439c745aa206ff534a835c956f..5691cb2baa76b7cd543bb030b7c8d3028359bc4c 100644 +index 77491402cb2921ad52c028ee8fe940636cbe3cf1..e93265e1bb96a07a6d9a66074f191cb8c16fa37a 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp @@ -108,7 +108,7 @@ static const RedirEntry kRedirMap[] = { diff --git a/src/dom/base/use_counter_metrics-yaml.patch b/src/dom/base/use_counter_metrics-yaml.patch index 8dca6c2b2..d8d22a451 100644 --- a/src/dom/base/use_counter_metrics-yaml.patch +++ b/src/dom/base/use_counter_metrics-yaml.patch @@ -1,8 +1,8 @@ diff --git a/dom/base/use_counter_metrics.yaml b/dom/base/use_counter_metrics.yaml -index 58755773c26952b79df258dd8f55147c77db9c5f..041bd3fe99303621733cd3543e196b6a03950526 100644 +index 6d2b80297f728af4e6b363e09dac4244d9ffd312..03ca7d1c7f27430923f146a3d3a708a09e351948 100644 --- a/dom/base/use_counter_metrics.yaml +++ b/dom/base/use_counter_metrics.yaml -@@ -21402,6 +21402,22 @@ use.counter.css.page: +@@ -21527,6 +21527,22 @@ use.counter.css.page: send_in_pings: - use-counters @@ -25,7 +25,7 @@ index 58755773c26952b79df258dd8f55147c77db9c5f..041bd3fe99303621733cd3543e196b6a css_transform_origin: type: counter description: > -@@ -33372,6 +33388,22 @@ use.counter.css.doc: +@@ -33497,6 +33513,22 @@ use.counter.css.doc: send_in_pings: - use-counters diff --git a/src/dom/html/HTMLMediaElement-cpp.patch b/src/dom/html/HTMLMediaElement-cpp.patch index 28fd4c3af..e1a74fbd8 100644 --- a/src/dom/html/HTMLMediaElement-cpp.patch +++ b/src/dom/html/HTMLMediaElement-cpp.patch @@ -1,8 +1,8 @@ diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp -index 677a2f25b16f4cf724b57d86a2b83acf40ec6164..e06f85366866c1cc99d27bc10cbebf2cb986e5cb 100644 +index add22d0f3c462eae3d5b5140779ff7a4e25f9321..7653df83680ee0e6c765432b1539fe1c90bfae35 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp -@@ -455,6 +455,7 @@ class HTMLMediaElement::MediaControlKeyListener final +@@ -452,6 +452,7 @@ class HTMLMediaElement::MediaControlKeyListener final // audible state. Therefore, in that case we would noitfy the audible state // when media starts playing. if (mState == MediaPlaybackState::ePlayed) { @@ -10,8 +10,8 @@ index 677a2f25b16f4cf724b57d86a2b83acf40ec6164..e06f85366866c1cc99d27bc10cbebf2c NotifyAudibleStateChanged(mIsOwnerAudible ? MediaAudibleState::eAudible : MediaAudibleState::eInaudible); -@@ -6967,6 +6968,9 @@ void HTMLMediaElement::FireTimeUpdate(TimeupdateType aType) { - DispatchAsyncEvent(std::move(runner)); +@@ -6955,6 +6956,9 @@ void HTMLMediaElement::FireTimeUpdate(TimeupdateType aType) { + QueueTask(std::move(runner)); mQueueTimeUpdateRunnerTime = TimeStamp::Now(); mLastCurrentTime = CurrentTime(); + if (aType == TimeupdateType::eMandatory) { diff --git a/src/dom/script/ScriptLoader-cpp.patch b/src/dom/script/ScriptLoader-cpp.patch index 0749ac240..d2578f8b7 100644 --- a/src/dom/script/ScriptLoader-cpp.patch +++ b/src/dom/script/ScriptLoader-cpp.patch @@ -1,8 +1,8 @@ diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp -index b3bec3821582d48c79cd88a4efe5c7bae1fd42e6..0bb81a8b0fa9478c894f80cfa81fd04c67fdd79f 100644 +index 51f63f998e47aa4b1dffc3cacdb0a698b33b4623..0387738ce1f29b5db4a5d03a3b2f5f3a91011125 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp -@@ -2670,6 +2670,36 @@ void ScriptLoader::CalculateBytecodeCacheFlag(ScriptLoadRequest* aRequest) { +@@ -2679,6 +2679,36 @@ void ScriptLoader::CalculateBytecodeCacheFlag(ScriptLoadRequest* aRequest) { hasFetchCountMin = false; break; } diff --git a/src/gfx/wr/webrender/src/picture-rs.patch b/src/gfx/wr/webrender/src/picture-rs.patch index 01081c9ac..8f4eb7ae6 100644 --- a/src/gfx/wr/webrender/src/picture-rs.patch +++ b/src/gfx/wr/webrender/src/picture-rs.patch @@ -1,8 +1,8 @@ diff --git a/gfx/wr/webrender/src/picture.rs b/gfx/wr/webrender/src/picture.rs -index 7a811bc074959e0f0e7e25603acc4bf50edce4dc..4954cd9b2b3c9efdbe32343152c877186751ec26 100644 +index 3b0671ec8ffb8cbd0843e18569a948203c2b9cfe..77d4953cc9bf07d38efd26f4fe95e465b244598c 100644 --- a/gfx/wr/webrender/src/picture.rs +++ b/gfx/wr/webrender/src/picture.rs -@@ -7957,7 +7957,12 @@ fn get_relative_scale_offset( +@@ -8027,7 +8027,12 @@ fn get_relative_scale_offset( CoordinateSpaceMapping::Local => ScaleOffset::identity(), CoordinateSpaceMapping::ScaleOffset(scale_offset) => scale_offset, CoordinateSpaceMapping::Transform(m) => { diff --git a/src/image/decoders/nsJXLDecoder-h.patch b/src/image/decoders/nsJXLDecoder-h.patch index 779ccc634..864cd4e2e 100644 --- a/src/image/decoders/nsJXLDecoder-h.patch +++ b/src/image/decoders/nsJXLDecoder-h.patch @@ -1,8 +1,8 @@ diff --git a/image/decoders/nsJXLDecoder.h b/image/decoders/nsJXLDecoder.h -index 6cde7456ca03f79e74401c1d215b9d50453ebf41..2f593ca3b70100c600b86e753d7a458c83b4f15c 100644 +index 0b723878aefdc5a37c2cffb72a561f859ad79cdf..6d39326dbefa9a85cc02b426de5c9f9149fe612d 100644 --- a/image/decoders/nsJXLDecoder.h +++ b/image/decoders/nsJXLDecoder.h -@@ -48,6 +48,18 @@ class nsJXLDecoder final : public Decoder { +@@ -46,6 +46,18 @@ class nsJXLDecoder final : public Decoder { Vector mBuffer; Vector mOutBuffer; JxlBasicInfo mInfo{}; diff --git a/src/layout/generic/nsIFrame-cpp.patch b/src/layout/generic/nsIFrame-cpp.patch index 2cdfeb03e..fee4aa308 100644 --- a/src/layout/generic/nsIFrame-cpp.patch +++ b/src/layout/generic/nsIFrame-cpp.patch @@ -1,8 +1,8 @@ diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp -index 0fff882bd3b643e3ab59cfaada984bef0ae7fee4..71e981251fa9395cbb14927d9bd3473c1e18a2cb 100644 +index fe05efa67f97e0d8cc327a4744a225ed5c6132c9..cce0dfb537fa1735b8e7ff67684d373a3081a527 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp -@@ -11721,6 +11721,11 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() const { +@@ -11810,6 +11810,11 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() const { gfx::Matrix4x4 matrix = nsStyleTransformMatrix::ReadTransforms( uiReset->mMozWindowTransform, refBox, float(appUnitsPerDevPixel)); diff --git a/src/layout/style/nsStyleStruct-cpp.patch b/src/layout/style/nsStyleStruct-cpp.patch index d6c824210..5c567261f 100644 --- a/src/layout/style/nsStyleStruct-cpp.patch +++ b/src/layout/style/nsStyleStruct-cpp.patch @@ -1,8 +1,8 @@ diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp -index f89bade8099183baa55b38ccc3c77c7ba9f1a290..8ada58a7965e7f2c9375d8b9bf64a5c78d80bf3f 100644 +index 8f587542ad248f7c0183e1787c81f37170c7ba54..3b213204e0faabb7ad8988872c8b39c776b87d73 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp -@@ -3204,6 +3204,9 @@ nsStyleUIReset::nsStyleUIReset() +@@ -3229,6 +3229,9 @@ nsStyleUIReset::nsStyleUIReset() mWindowShadow(StyleWindowShadow::Auto), mWindowOpacity(1.0), mMozWindowInputRegionMargin(StyleLength::Zero()), @@ -12,7 +12,7 @@ index f89bade8099183baa55b38ccc3c77c7ba9f1a290..8ada58a7965e7f2c9375d8b9bf64a5c7 mTransitions( nsStyleAutoArray::WITH_SINGLE_INITIAL_ELEMENT), mTransitionTimingFunctionCount(1), -@@ -3247,6 +3250,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource) +@@ -3272,6 +3275,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource) mWindowOpacity(aSource.mWindowOpacity), mMozWindowInputRegionMargin(aSource.mMozWindowInputRegionMargin), mMozWindowTransform(aSource.mMozWindowTransform), diff --git a/src/layout/style/nsStyleStruct-h.patch b/src/layout/style/nsStyleStruct-h.patch index fe63fcaff..7c54dd5fc 100644 --- a/src/layout/style/nsStyleStruct-h.patch +++ b/src/layout/style/nsStyleStruct-h.patch @@ -1,8 +1,8 @@ diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h -index 472c15a359ecd7ad0834d479f1acc53b4527f5ac..9f8377ab507b5883b92621160987a97e0be80014 100644 +index 1c6e2b5a3d4a0ca2b5ef50a84c220958885ce3e3..d74f5558ab70c53fc2649f0f3ab40a456c3e1c6a 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h -@@ -1876,6 +1876,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset { +@@ -2003,6 +2003,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset { // The margin of the window region that should be transparent to events. mozilla::StyleLength mMozWindowInputRegionMargin; mozilla::StyleTransform mMozWindowTransform; diff --git a/src/modules/libpref/init/StaticPrefList-yaml.patch b/src/modules/libpref/init/StaticPrefList-yaml.patch index 544d7c3c3..45e97e255 100644 --- a/src/modules/libpref/init/StaticPrefList-yaml.patch +++ b/src/modules/libpref/init/StaticPrefList-yaml.patch @@ -1,8 +1,8 @@ diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml -index c4e19fc5231c2378ddb25f462cd1584aa9eac760..eb0cec062abf0c97bf5ca33e85aeacd496c296a8 100644 +index c3b88faf0b3294a143139487d3dac1127b84bd4f..7fdb31b61ced2e1f9131396ed88f1216ce7c5b1f 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml -@@ -18804,6 +18804,7 @@ +@@ -18839,6 +18839,7 @@ mirror: always #endif diff --git a/src/netwerk/protocol/http/moz-build.patch b/src/netwerk/protocol/http/moz-build.patch index 94e828ee6..e53895066 100644 --- a/src/netwerk/protocol/http/moz-build.patch +++ b/src/netwerk/protocol/http/moz-build.patch @@ -1,8 +1,8 @@ diff --git a/netwerk/protocol/http/moz.build b/netwerk/protocol/http/moz.build -index a83080d963322d7baa581f1ca61f93d42bb5a938..0741be2ffc5449be829af7f6067d1abcdc86d155 100644 +index 4e60ca2b579aa3e02c7769fd966e36d297dd0068..24dbb5de95d4f7dbec354c30f9b2c4d64384225e 100644 --- a/netwerk/protocol/http/moz.build +++ b/netwerk/protocol/http/moz.build -@@ -223,7 +223,7 @@ LOCAL_INCLUDES += [ +@@ -222,7 +222,7 @@ LOCAL_INCLUDES += [ "/netwerk/url-classifier", ] diff --git a/src/old-configure-in.patch b/src/old-configure-in.patch deleted file mode 100644 index ef93907c4..000000000 --- a/src/old-configure-in.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/old-configure.in b/old-configure.in -index 036734708f20d658248a8b5b3a6d8adc2530a878..4e1f0d96cd355cc1195b58548b29c1a5d6bedaa8 100644 ---- a/old-configure.in -+++ b/old-configure.in -@@ -89,7 +89,7 @@ dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME) - if test -z "$MOZ_MACBUNDLE_ID"; then - MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'` - fi --MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID} -+MOZ_MACBUNDLE_ID=app.zen-browser.zen - if test "$MOZ_DEBUG"; then - MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug - fi diff --git a/src/toolkit/actors/PictureInPictureChild-sys-mjs.patch b/src/toolkit/actors/PictureInPictureChild-sys-mjs.patch index dc39ee311..014a8c6f4 100644 --- a/src/toolkit/actors/PictureInPictureChild-sys-mjs.patch +++ b/src/toolkit/actors/PictureInPictureChild-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/actors/PictureInPictureChild.sys.mjs b/toolkit/actors/PictureInPictureChild.sys.mjs -index 7ae1aa58bbaeab7a1835a3ea8328735d4f4ecfb1..9d0679dde3c031c2459c09ffbc157f32bc7d003a 100644 +index e4dea54a29e2a1575d76091061781a504da38465..d5248eebdd018feca7bb9d5ee3284d6f253a4b35 100644 --- a/toolkit/actors/PictureInPictureChild.sys.mjs +++ b/toolkit/actors/PictureInPictureChild.sys.mjs @@ -291,6 +291,7 @@ export class PictureInPictureLauncherChild extends JSWindowActorChild { diff --git a/src/toolkit/content/aboutSupport-xhtml.patch b/src/toolkit/content/aboutSupport-xhtml.patch index b2bd09de8..b47e893ac 100644 --- a/src/toolkit/content/aboutSupport-xhtml.patch +++ b/src/toolkit/content/aboutSupport-xhtml.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml -index 296259cd0360a403e8659e22d0c08e968529a38a..bde1ee8d0a05e6ce2eb3ff8ff8a19ba28c20af98 100644 +index 7f57218f3573488445ea363e0c4532b292d53167..511f578b4ae38a496ca936adf2fef1f587249f47 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -10,6 +10,7 @@ diff --git a/src/toolkit/content/widgets/arrowscrollbox-js.patch b/src/toolkit/content/widgets/arrowscrollbox-js.patch index 669f1b62e..fc8de2984 100644 --- a/src/toolkit/content/widgets/arrowscrollbox-js.patch +++ b/src/toolkit/content/widgets/arrowscrollbox-js.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js -index f9191af09f1b7a1654aff62807e7dad573afc172..f49ad7cb08f5d2be4a03046c191361f8c8a004bc 100644 +index e2000d0f0c33e0e497e79dd206e195235bc5094e..ac69cb75d2be93a1f72fb61bea200d3dcbcdd77f 100644 --- a/toolkit/content/widgets/arrowscrollbox.js +++ b/toolkit/content/widgets/arrowscrollbox.js @@ -98,6 +98,7 @@ @@ -10,7 +10,7 @@ index f9191af09f1b7a1654aff62807e7dad573afc172..f49ad7cb08f5d2be4a03046c191361f8 let contentSize = slot.getBoundingClientRect()[this.#verticalMode ? "height" : "width"]; // NOTE(emilio): This should be contentSize > scrollClientSize, but due -@@ -639,7 +640,7 @@ +@@ -642,7 +643,7 @@ on_wheel(event) { // Don't consume the event if we can't scroll. diff --git a/src/toolkit/content/widgets/infobar-css.patch b/src/toolkit/content/widgets/infobar-css.patch index e9ea31ab6..58e234616 100644 --- a/src/toolkit/content/widgets/infobar-css.patch +++ b/src/toolkit/content/widgets/infobar-css.patch @@ -1,8 +1,8 @@ diff --git a/toolkit/content/widgets/infobar.css b/toolkit/content/widgets/infobar.css -index 7818f1ef1dcc62e184bd5e3e8d6d936acf77d2ea..4803c07a183e2df70e8fdc9769bb4bb15a73f39b 100644 +index 9b28d3179db134bb14b4c4d840d5f3aac1dc7b3f..5cdd1a379e5a5156d0adeac78b0af300440d84b5 100644 --- a/toolkit/content/widgets/infobar.css +++ b/toolkit/content/widgets/infobar.css -@@ -94,3 +94,18 @@ strong { +@@ -96,3 +96,18 @@ strong { :host([type=system]) .content { margin-inline-start: 0; } diff --git a/src/toolkit/content/xul-css.patch b/src/toolkit/content/xul-css.patch index 2a6d7beb1..0da05e4a2 100644 --- a/src/toolkit/content/xul-css.patch +++ b/src/toolkit/content/xul-css.patch @@ -1,8 +1,8 @@ diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css -index 134acec351c818eb824e2c98fa380d99ebaf8fac..3774893d98617634150f1f85568e212d98f9404c 100644 +index f730088432526521037a8933a6ee00af8c378f11..ef2bb2ecd364327a348602ff070814f653843081 100644 --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css -@@ -468,7 +468,8 @@ deck > *|*:not(:-moz-native-anonymous) { +@@ -446,7 +446,8 @@ deck > *|*:not(:-moz-native-anonymous) { } tabpanels > .deck-selected, diff --git a/src/toolkit/modules/AppConstants-sys-mjs.patch b/src/toolkit/modules/AppConstants-sys-mjs.patch index 509134e10..449b2d770 100644 --- a/src/toolkit/modules/AppConstants-sys-mjs.patch +++ b/src/toolkit/modules/AppConstants-sys-mjs.patch @@ -1,8 +1,8 @@ diff --git a/toolkit/modules/AppConstants.sys.mjs b/toolkit/modules/AppConstants.sys.mjs -index bf7a0ec9570a8657d192fd28c9b4852aa8869225..59f5466582757320ab1f70ec26d76fc589e0a335 100644 +index a794e82288d30c979f2d2798bded49fb4dd3118b..cd1875dc048607447e25d30341052a6930d1c08f 100644 --- a/toolkit/modules/AppConstants.sys.mjs +++ b/toolkit/modules/AppConstants.sys.mjs -@@ -174,6 +174,8 @@ export var AppConstants = Object.freeze({ +@@ -172,6 +172,8 @@ export var AppConstants = Object.freeze({ MOZ_UPDATE_CHANNEL: "@MOZ_UPDATE_CHANNEL@", MOZ_WIDGET_TOOLKIT: "@MOZ_WIDGET_TOOLKIT@", diff --git a/src/toolkit/modules/moz-build.patch b/src/toolkit/modules/moz-build.patch index 7f2898cb4..80ebcdb83 100644 --- a/src/toolkit/modules/moz-build.patch +++ b/src/toolkit/modules/moz-build.patch @@ -1,8 +1,8 @@ diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build -index b7dd298c4ffa1b95531e3646d57a52e524fcf801..da23bcd2a8b4b49ce07f4602f5e624bf4bfbfc8d 100644 +index e6a9634bc5ae26a5bc82402a8a0f37e1fedc27ca..e27cab2a984b2d09033bc956df90519e01f683d7 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build -@@ -282,6 +282,7 @@ for var in ( +@@ -277,6 +277,7 @@ for var in ( "DLL_SUFFIX", "DEBUG_JS_MODULES", "OMNIJAR_NAME", diff --git a/src/toolkit/moz-configure.patch b/src/toolkit/moz-configure.patch index ece47403e..7de07a34c 100644 --- a/src/toolkit/moz-configure.patch +++ b/src/toolkit/moz-configure.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/moz.configure b/toolkit/moz.configure -index 09b3065c214ecceacb6f264cdacbb777252f33ea..97ee12093d6330ae9da4aa1bea2ecd5b76843110 100644 +index f9b96c0a62ae1e222eebeb6f8ca4fbf4c65703b4..6a439a22ee71a03709411fb8480278104d3996d1 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -22,6 +22,7 @@ def check_moz_app_id(moz_app_id, build_project): @@ -33,7 +33,7 @@ index 09b3065c214ecceacb6f264cdacbb777252f33ea..97ee12093d6330ae9da4aa1bea2ecd5b help="Set distribution-specific id", ) set_config("MOZ_DISTRIBUTION_ID", depends("--with-distribution-id")(lambda v: v[0])) -@@ -881,9 +886,9 @@ set_config("MOZ_SYSTEM_AV1", True, when="--with-system-av1") +@@ -932,9 +937,9 @@ set_config("MOZ_SYSTEM_AV1", True, when="--with-system-av1") option("--disable-jxl", help="Disable jxl image support") @@ -46,7 +46,7 @@ index 09b3065c214ecceacb6f264cdacbb777252f33ea..97ee12093d6330ae9da4aa1bea2ecd5b return True -@@ -2019,7 +2024,7 @@ set_define("A11Y_LOG", True, when=a11y_log) +@@ -2060,7 +2065,7 @@ set_define("A11Y_LOG", True, when=a11y_log) # ============================================================== @depends(milestone) def require_signing(milestone): diff --git a/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch b/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch index 246cf44d8..3aa9ef85a 100644 --- a/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch +++ b/src/toolkit/mozapps/extensions/AddonManager-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/mozapps/extensions/AddonManager.sys.mjs b/toolkit/mozapps/extensions/AddonManager.sys.mjs -index 883e8389eec97815adfdb8c62fc15482f6d7f0e7..234c956ba799666a3cba6fd6dcdad774ffc6b79e 100644 +index e09ea87de86b06d1b505e59d4f0c4a090533ca71..9e8291ee5a83a686f3a129c3c6872bb7c84fdcd9 100644 --- a/toolkit/mozapps/extensions/AddonManager.sys.mjs +++ b/toolkit/mozapps/extensions/AddonManager.sys.mjs @@ -1221,12 +1221,12 @@ var AddonManagerInternal = { diff --git a/src/toolkit/mozapps/extensions/content/aboutaddons-html.patch b/src/toolkit/mozapps/extensions/content/aboutaddons-html.patch index 6dbf2cc06..7a4b1608d 100644 --- a/src/toolkit/mozapps/extensions/content/aboutaddons-html.patch +++ b/src/toolkit/mozapps/extensions/content/aboutaddons-html.patch @@ -1,8 +1,8 @@ diff --git a/toolkit/mozapps/extensions/content/aboutaddons.html b/toolkit/mozapps/extensions/content/aboutaddons.html -index 67808c799aca92a0c71731ab0c345bb478522368..5ddcbcecd43b2b04eb4c0e5b86eebd69b142a5a3 100644 +index 77702576f03cc8db7ec85bd871e6366fef935d54..edd5f27303802091c84572a7a2d3933c03cf09d9 100644 --- a/toolkit/mozapps/extensions/content/aboutaddons.html +++ b/toolkit/mozapps/extensions/content/aboutaddons.html -@@ -82,6 +82,7 @@ +@@ -86,6 +86,7 @@ type="module" src="chrome://global/content/elements/moz-five-star.mjs" > diff --git a/src/toolkit/profile/nsToolkitProfileService-cpp.patch b/src/toolkit/profile/nsToolkitProfileService-cpp.patch index 7535d4ee2..c4f1276f1 100644 --- a/src/toolkit/profile/nsToolkitProfileService-cpp.patch +++ b/src/toolkit/profile/nsToolkitProfileService-cpp.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp -index e6722fb8f379c3032301fc3c1c49d894a566c28a..f6c560bb3f2ffdba4eaed876f7679245235fde8c 100644 +index 4ebdcd3bd8739955972eab938f1f394e928503d2..f731ff5667bc5f615bb6a780c1cb6a6fb1cb6b48 100644 --- a/toolkit/profile/nsToolkitProfileService.cpp +++ b/toolkit/profile/nsToolkitProfileService.cpp @@ -82,6 +82,8 @@ using namespace mozilla; @@ -11,7 +11,7 @@ index e6722fb8f379c3032301fc3c1c49d894a566c28a..f6c560bb3f2ffdba4eaed876f7679245 struct KeyValue { KeyValue(const char* aKey, const char* aValue) : key(aKey), value(aValue) {} -@@ -1404,7 +1406,7 @@ nsresult nsToolkitProfileService::CreateDefaultProfile( +@@ -1391,7 +1393,7 @@ nsresult nsToolkitProfileService::CreateDefaultProfile( if (mUseDevEditionProfile) { name.AssignLiteral(DEV_EDITION_NAME); } else if (mUseDedicatedProfile) { diff --git a/src/toolkit/themes/linux/global/menu-css.patch b/src/toolkit/themes/linux/global/menu-css.patch deleted file mode 100644 index d258de565..000000000 --- a/src/toolkit/themes/linux/global/menu-css.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/toolkit/themes/linux/global/menu.css b/toolkit/themes/linux/global/menu.css -index da47f78790a251bb573d992476dc5dac9a870857..6c7d6cbdaf3f0bd35a52c80785577a6bc0d55e29 100644 ---- a/toolkit/themes/linux/global/menu.css -+++ b/toolkit/themes/linux/global/menu.css -@@ -52,7 +52,6 @@ menulist > menupopup > :is(menuitem, menucaption, menu) { - - .menu-text { - /* This is (18 + the size of end-padding on .menu-iconic-left)px */ -- margin-inline-start: 21px; - } - - .menu-accel, diff --git a/src/toolkit/themes/shared/menu-shared-css.patch b/src/toolkit/themes/shared/menu-shared-css.patch deleted file mode 100644 index 4840d087c..000000000 --- a/src/toolkit/themes/shared/menu-shared-css.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/toolkit/themes/shared/menu-shared.css b/toolkit/themes/shared/menu-shared.css -index 40b4fdd66cf54f9d16be2c78be1b003abbd91e60..6be265511e625f78551c07cf21234f47fba9ed1d 100644 ---- a/toolkit/themes/shared/menu-shared.css -+++ b/toolkit/themes/shared/menu-shared.css -@@ -100,13 +100,7 @@ menucaption { - list-style-image: none; - max-width: 42em; - -- @media (-moz-platform: linux) { -- padding: 4px 6px; -- } -- -- @media (-moz-platform: macos) { -- padding: 3px 9px; -- } -+ padding: 6px 5px; - } - - menu, diff --git a/src/toolkit/themes/shared/popup-css.patch b/src/toolkit/themes/shared/popup-css.patch index b5db33881..1cec9bea6 100644 --- a/src/toolkit/themes/shared/popup-css.patch +++ b/src/toolkit/themes/shared/popup-css.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/themes/shared/popup.css b/toolkit/themes/shared/popup.css -index 5701d305fdfc0407ead51aa52eefee38e7429de8..642325e981e9597eaaefefa725852a49b49ee6dc 100644 +index efc623e403b9517ffe4ec557e7c777274c350a7a..14400c90334be37e53dfbb5e07efa983ef8fef40 100644 --- a/toolkit/themes/shared/popup.css +++ b/toolkit/themes/shared/popup.css @@ -22,8 +22,8 @@ panel { diff --git a/src/tools/signing/macos/mach_commands-py.patch b/src/tools/signing/macos/mach_commands-py.patch index c61833a08..73169aa91 100644 --- a/src/tools/signing/macos/mach_commands-py.patch +++ b/src/tools/signing/macos/mach_commands-py.patch @@ -1,5 +1,5 @@ diff --git a/tools/signing/macos/mach_commands.py b/tools/signing/macos/mach_commands.py -index a513ad723805459c194d27b42dac68e9babba468..3a08bb0987f9d6cf01c05f8ebb56efa91a5b9d0e 100644 +index 454a9bbc35802fbf811065e8e1ca592674016bb3..d6b0cf119664e0534a3898f72ffbcd3aade9c89d 100644 --- a/tools/signing/macos/mach_commands.py +++ b/tools/signing/macos/mach_commands.py @@ -37,7 +37,6 @@ from mozbuild.base import MachCommandConditions as conditions diff --git a/src/xpfe/appshell/AppWindow-cpp.patch b/src/xpfe/appshell/AppWindow-cpp.patch index 0f5525701..e29273d13 100644 --- a/src/xpfe/appshell/AppWindow-cpp.patch +++ b/src/xpfe/appshell/AppWindow-cpp.patch @@ -1,5 +1,5 @@ diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp -index a5e57d3086c57c4307b2c93b2814064d752d08ed..d0a83dd574ed03028ad3e79f8f0fba868bb5bec1 100644 +index 22dbf9028167d5555a91c7087040a1909a27e2a2..356b9722a1a4815f5fdde0ff13bf8f89d7f26f87 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -1866,7 +1866,7 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( diff --git a/src/zen/@types/zen.d.ts b/src/zen/@types/zen.d.ts index de6132587..bbfcb5df5 100644 --- a/src/zen/@types/zen.d.ts +++ b/src/zen/@types/zen.d.ts @@ -279,10 +279,6 @@ declare namespace MockedExports { const PlaceUtilsSYSMJS: { PlacesUtils: { - promiseFaviconData: ( - pageUrl: string | URL | nsIURI, - preferredWidth?: number - ) => Promise; // TS-TODO: Add the rest. }; }; diff --git a/src/zen/common/ZenCustomizableUI.sys.mjs b/src/zen/common/ZenCustomizableUI.sys.mjs index 179104ced..ce2e75139 100644 --- a/src/zen/common/ZenCustomizableUI.sys.mjs +++ b/src/zen/common/ZenCustomizableUI.sys.mjs @@ -49,7 +49,7 @@ export var ZenCustomizableUI = new (class { const sidebarBox = window.MozXULElement.parseXULToFragment(` { + setTimeout(async () => { try { - PlacesUtils.favicons.getFaviconURLForPage( - tab.linkedBrowser?.currentURI, - (url) => { - if (url) gBrowser.setIcon(tab, url.spec); - }, - - 0 + let favicon = await PlacesUtils.favicons.getFaviconForPage( + Services.io.newURI(pin.url) ); + if (favicon) { + gBrowser.setIcon(tab, favicon.dataURI); + } } catch (error) { console.warn('Error getting favicon URL:', error); } @@ -169,7 +167,7 @@ const enhancedPins = await Promise.all( pins.map(async (pin) => { try { - const image = await this.getFaviconAsBase64(Services.io.newURI(pin.url).spec); + const image = await this.getFaviconAsBase64(Services.io.newURI(pin.url)); return { ...pin, iconUrl: image || null, @@ -399,10 +397,10 @@ ); } - _onTabClick(e) { + async _onTabClick(e) { const tab = e.target?.closest('tab'); if (e.button === 1 && tab) { - this._onCloseTabShortcut(e, tab); + await this._onCloseTabShortcut(e, tab); } } @@ -535,7 +533,7 @@ } } - _onCloseTabShortcut( + async _onCloseTabShortcut( event, selectedTab = gBrowser.selectedTab, behavior = lazy.zenPinnedTabCloseShortcutBehavior @@ -556,22 +554,17 @@ case 'unload-switch': case 'reset-switch': case 'switch': - let { permitUnload } = selectedTab.linkedBrowser?.permitUnload(); - if (!permitUnload) { - return; - } - this._handleTabSwitch(selectedTab); - if (behavior.includes('reset')) { - this._resetTabToStoredState(selectedTab); - } if (behavior.includes('unload')) { if (selectedTab.hasAttribute('glance-id')) { break; } - // Do not unload about:* pages - if (!selectedTab.linkedBrowser?.currentURI.spec.startsWith('about:')) { - gZenTabUnloader.explicitUnloadTabs([selectedTab], { permitUnload }); - } + await gBrowser.explicitUnloadTabs([selectedTab]); + } + if (selectedTab.selected) { + this._handleTabSwitch(selectedTab); + } + if (behavior.includes('reset')) { + this._resetTabToStoredState(selectedTab); } break; case 'reset': @@ -640,23 +633,14 @@ async getFaviconAsBase64(pageUrl) { try { - // Get the favicon data - const faviconData = await PlacesUtils.promiseFaviconData(pageUrl); - - // The data comes as an array buffer, we need to convert it to base64 - // First create a byte array from the data - const array = new Uint8Array(faviconData.data); - - // Convert to base64 - const base64String = btoa( - Array.from(array) - .map((b) => String.fromCharCode(b)) - .join('') - ); - - // Return as a proper data URL - return `data:${faviconData.mimeType};base64,${base64String}`; + const faviconData = await PlacesUtils.favicons.getFaviconForPage(pageUrl); + if (!faviconData) { + // empty favicon + return 'data:image/png;base64,'; + } + return faviconData.dataURI; } catch (ex) { + console.error('Failed to get favicon:', ex); // console.error("Failed to get favicon:", ex); return `page-icon:${pageUrl}`; // Use this as a fallback } diff --git a/src/zen/tabs/ZenTabUnloader.mjs b/src/zen/tabs/ZenTabUnloader.mjs deleted file mode 100644 index 117da7c9b..000000000 --- a/src/zen/tabs/ZenTabUnloader.mjs +++ /dev/null @@ -1,331 +0,0 @@ -{ - const lazy = {}; - - XPCOMUtils.defineLazyPreferenceGetter( - lazy, - 'zenTabUnloaderEnabled', - 'zen.tab-unloader.enabled', - false - ); - - XPCOMUtils.defineLazyPreferenceGetter( - lazy, - 'zenTabUnloaderTimeout', - 'zen.tab-unloader.timeout-minutes', - 20 - ); - - XPCOMUtils.defineLazyPreferenceGetter( - lazy, - 'zenTabUnloaderExcludedUrls', - 'zen.tab-unloader.excluded-urls', - '' - ); - - const ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS = [ - '^about:', - '^chrome:', - '^devtools:', - '^file:', - '^resource:', - '^view-source:', - '^view-image:', - ]; - - class ZenTabsObserver { - static ALL_EVENTS = [ - 'TabAttrModified', - 'TabPinned', - 'TabUnpinned', - 'TabShow', - 'TabHide', - 'TabOpen', - 'TabClose', - 'TabSelect', - 'TabMultiSelect', - ]; - - #listeners = []; - - constructor() { - this.#listenAllEvents(); - } - - #listenAllEvents() { - const eventListener = this.#eventListener.bind(this); - for (const event of ZenTabsObserver.ALL_EVENTS) { - window.addEventListener(event, eventListener); - } - window.addEventListener('unload', () => { - for (const event of ZenTabsObserver.ALL_EVENTS) { - window.removeEventListener(event, eventListener); - } - }); - } - - #eventListener(event) { - for (const listener of this.#listeners) { - listener(event.type, event); - } - } - - addTabsListener(listener) { - this.#listeners.push(listener); - } - } - - class ZenTabsIntervalUnloader { - static INTERVAL = 1000 * 60; // 1 minute - - interval = null; - /** @type {ZenTabUnloader} */ - unloader = null; - - constructor(unloader) { - this.unloader = unloader; - this.interval = setInterval( - this.intervalListener.bind(this), - ZenTabsIntervalUnloader.INTERVAL - ); - } - - intervalListener() { - if (!lazy.zenTabUnloaderEnabled) { - return; - } - const currentTimestamp = Date.now(); - const tabs = gZenWorkspaces.allStoredTabs; - for (let i = 0; i < tabs.length; i++) { - const tab = tabs[i]; - if (this.unloader.canUnloadTab(tab, currentTimestamp)) { - this.unloader.unload(tab); - } - } - } - } - - class ZenTabUnloader extends ZenDOMOperatedFeature { - static ACTIVITY_MODIFIERS = ['muted', 'soundplaying', 'label', 'attention']; - - #excludedUrls = []; - #compiledExcludedUrls = []; - #lastCheckedUrlTimestamp = 0; - - constructor() { - super(); - - this.#excludedUrls = this.lazyExcludeUrls; - if (!lazy.zenTabUnloaderEnabled) { - return; - } - this.intervalUnloader = new ZenTabsIntervalUnloader(this); - } - - init() { - if (!lazy.zenTabUnloaderEnabled) { - return; - } - this.insertIntoContextMenu(); - this.observer = new ZenTabsObserver(); - this.observer.addTabsListener(this.onTabEvent.bind(this)); - } - - onTabEvent(action, event) { - const tab = event.target; - switch (action) { - case 'TabPinned': - case 'TabUnpinned': - case 'TabShow': - case 'TabHide': - break; - case 'TabAttrModified': - this.handleTabAttrModified(tab, event); - break; - case 'TabOpen': - this.handleTabOpen(tab); - break; - case 'TabClose': - this.handleTabClose(tab); - break; - case 'TabSelect': - case 'TabMultiSelect': - this.updateTabActivity(tab); - break; - default: - console.warn('ZenTabUnloader: Unhandled tab event', action); - break; - } - } - - onLocationChange(browser) { - const tab = browser.ownerGlobal.gBrowser.getTabForBrowser(browser); - this.updateTabActivity(tab); - } - - handleTabClose(tab) { - tab.lastActivity = null; - } - - handleTabOpen(tab) { - this.updateTabActivity(tab); - } - - handleTabAttrModified(tab, event) { - for (const modifier of ZenTabUnloader.ACTIVITY_MODIFIERS) { - if (event.detail.changed.includes(modifier)) { - this.updateTabActivity(tab); - break; - } - } - } - - updateTabActivity(tab) { - const currentTimestamp = Date.now(); - tab.lastActivity = currentTimestamp; - } - - insertIntoContextMenu() { - const element = window.MozXULElement.parseXULToFragment(` - - - - - - - - - `); - document.getElementById('context_closeDuplicateTabs').parentNode.appendChild(element); - } - - get lazyExcludeUrls() { - return [ - ...ZEN_TAB_UNLOADER_DEFAULT_EXCLUDED_URLS, - ...lazy.zenTabUnloaderExcludedUrls.split(',').map((url) => url.trim()), - ]; - } - - arraysEqual(a, b) { - if (a === b) return true; - if (a == null || b == null) return false; - if (a.length !== b.length) return false; - - const currentTimestamp = Date.now(); - if (currentTimestamp - this.#lastCheckedUrlTimestamp < 5 * 1000) { - return true; - } - - this.#lastCheckedUrlTimestamp = currentTimestamp; - // If you don't care about the order of the elements inside - // the array, you should sort both arrays here. - // Please note that calling sort on an array will modify that array. - // you might want to clone your array first. - - for (let i = 0; i < a.length; ++i) { - if (a[i] !== b[i]) return false; - } - return true; - } - - get excludedUrls() { - // Check if excludedrls is the same as the pref value - const excludedUrls = this.lazyExcludeUrls; - if ( - !this.arraysEqual(this.#excludedUrls, excludedUrls) || - !this.#compiledExcludedUrls.length - ) { - this.#excludedUrls = excludedUrls; - this.#compiledExcludedUrls = excludedUrls.map((url) => new RegExp(url)); - } - return this.#compiledExcludedUrls; - } - - unload(tab, skipPermitUnload = false) { - gBrowser.explicitUnloadTabs([tab], skipPermitUnload); - tab.removeAttribute('linkedpanel'); - } - - unloadTab() { - const tabs = TabContextMenu.contextTab.multiselected - ? gBrowser.selectedTabs - : [TabContextMenu.contextTab]; - this.explicitUnloadTabs(tabs); - } - - explicitUnloadTabs(tabs, extraArgs = {}) { - for (let i = 0; i < tabs.length; i++) { - if (this.canUnloadTab(tabs[i], Date.now(), true, extraArgs)) { - this.unload(tabs[i], true); - } - } - } - - preventUnloadTab() { - const tabs = TabContextMenu.contextTab.multiselected - ? gBrowser.selectedTabs - : [TabContextMenu.contextTab]; - for (let i = 0; i < tabs.length; i++) { - const tab = tabs[i]; - tab.zenIgnoreUnload = true; - } - } - - ignoreUnloadTab() { - const tabs = TabContextMenu.contextTab.multiselected - ? gBrowser.selectedTabs - : [TabContextMenu.contextTab]; - for (let i = 0; i < tabs.length; i++) { - const tab = tabs[i]; - tab.zenIgnoreUnload = false; - } - } - - canUnloadTab(tab, currentTimestamp, ignoreTimestamp = false, extraArgs = {}) { - if ( - (tab.pinned && !ignoreTimestamp) || - tab.selected || - (tab.multiselected && !ignoreTimestamp) || - (tab.hasAttribute('busy') && !ignoreTimestamp) || - !tab.linkedPanel || - tab.splitView || - tab.group?.hasAttribute('split-view-group') || - tab.attention || - tab.hasAttribute('glance-id') || - tab.linkedBrowser?.zenModeActive || - (tab.pictureinpicture && !ignoreTimestamp) || - (tab.soundPlaying && !ignoreTimestamp) || - (tab.zenIgnoreUnload && !ignoreTimestamp) || - (this.excludedUrls.some((url) => url.test(tab.linkedBrowser?.currentURI.spec)) && - tab.linkedBrowser?.currentURI.spec !== 'about:blank') - ) { - return false; - } - if (ignoreTimestamp) { - return this._tabPermitsUnload(tab, extraArgs); - } - const lastActivity = tab.lastActivity; - if (!lastActivity) { - return false; - } - const diff = currentTimestamp - lastActivity; - // Check if the tab has been inactive for more than the timeout - return ( - diff > lazy.zenTabUnloaderTimeout * 60 * 1000 && this._tabPermitsUnload(tab, extraArgs) - ); - } - - _tabPermitsUnload(tab, extraArgs) { - return typeof extraArgs.permitUnload === 'undefined' - ? tab.linkedBrowser?.permitUnload()?.permitUnload - : extraArgs.permitUnload; - } - } - - window.gZenTabUnloader = new ZenTabUnloader(); -} diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 697352edc..4af16fbac 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -337,13 +337,6 @@ } } - /* Dim pending tabs if preference is enabled */ - @media -moz-pref('zen.tabs.dim-pending') { - &[pending='true'] .tab-icon-image { - opacity: 0.5; - } - } - /* --- Glance Tab Styles (Nested .tabbrowser-tab) --- */ /* Styles for a tab nested within another tab (representing a "glance"?) */ & .tabbrowser-tab { diff --git a/src/zen/tests/glance/browser.toml b/src/zen/tests/glance/browser.toml index b03b2368a..8de9e9e12 100644 --- a/src/zen/tests/glance/browser.toml +++ b/src/zen/tests/glance/browser.toml @@ -6,3 +6,6 @@ support-files = [ ["browser_glance_basic.js"] ["browser_glance_expand.js"] ["browser_glance_close.js"] +["browser_glance_next_tab.js"] +["browser_glance_prev_tab.js"] +["browser_glance_select_parent.js"] diff --git a/src/zen/tests/glance/browser_glance_expand.js b/src/zen/tests/glance/browser_glance_expand.js index b9db4b100..44e2d65a0 100644 --- a/src/zen/tests/glance/browser_glance_expand.js +++ b/src/zen/tests/glance/browser_glance_expand.js @@ -20,11 +20,6 @@ add_task(async function test_Glance_Basic_Open() { selectedTab._tPos, 'The glance tab should be on the right of the selected tab' ); - Assert.equal( - glanceTab._tPos, - gBrowser.tabs.length - 1, - 'The glance tab should be the last tab' - ); BrowserTestUtils.removeTab(glanceTab); }, false); }); @@ -67,8 +62,8 @@ add_task(async function test_Glance_Basic_Open() { await openGlanceOnTab(async (glanceTab) => { await gZenGlanceManager.fullyOpenGlance(); Assert.equal( - glanceTab._tPos, - 3, + glanceTab, + gBrowser.visibleTabs.find((tab) => !tab.pinned), 'The glance tab should be the first normal tab (Ignoring empty tabs)' ); BrowserTestUtils.removeTab(glanceTab); @@ -85,18 +80,10 @@ add_task(async function test_Glance_New_From_essential() { gZenPinnedTabManager.addToEssentials(selectedTab); await openGlanceOnTab(async (glanceTab) => { await gZenGlanceManager.fullyOpenGlance(); - await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true, { - skipAnimation: true, - }); - Assert.equal( - gBrowser.selectedTab._tPos, - 1, - 'The new tab should be the first normal tab (Ignoring empty tabs)' - ); - Assert.equal( - glanceTab._tPos, - 2, - 'The glance tab should be the second normal tab (Ignoring empty tabs)' + ok(!glanceTab.pinned, 'The glance tab should not be pinned'); + ok( + !glanceTab.parentNode.hasAttribute('container'), + 'The glance tab should not be in an essentials container' ); await BrowserTestUtils.removeTab(gBrowser.selectedTab); BrowserTestUtils.removeTab(glanceTab); diff --git a/src/zen/tests/glance/browser_glance_next_tab.js b/src/zen/tests/glance/browser_glance_next_tab.js new file mode 100644 index 000000000..b14d3c3f9 --- /dev/null +++ b/src/zen/tests/glance/browser_glance_next_tab.js @@ -0,0 +1,18 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Glance_Next_Tab() { + const selectedTab = gBrowser.selectedTab; + await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true, { + skipAnimation: true, + }); + const tabToCheck = gBrowser.selectedTab; + gBrowser.selectedTab = selectedTab; + await openGlanceOnTab(async (glanceTab) => { + const next = gBrowser.tabContainer.findNextTab(glanceTab, { direction: 1 }); + Assert.equal(next, tabToCheck, 'Next glance tab should equal'); + }); + await BrowserTestUtils.removeTab(gBrowser.selectedTab); +}); diff --git a/src/zen/tests/glance/browser_glance_prev_tab.js b/src/zen/tests/glance/browser_glance_prev_tab.js new file mode 100644 index 000000000..c2b90f016 --- /dev/null +++ b/src/zen/tests/glance/browser_glance_prev_tab.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Glance_Prev_Tab() { + await openGlanceOnTab(async (glanceTab) => { + await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true, { + skipAnimation: true, + }); + const tabToCheck = gBrowser.selectedTab; + gBrowser.selectedTab = glanceTab; + const next = gBrowser.tabContainer.findNextTab(glanceTab, { direction: -1 }); + Assert.equal(next, tabToCheck, 'Previous glance tab should equal'); + await BrowserTestUtils.removeTab(tabToCheck); + }); +}); diff --git a/src/zen/tests/glance/browser_glance_select_parent.js b/src/zen/tests/glance/browser_glance_select_parent.js new file mode 100644 index 000000000..29b55ac62 --- /dev/null +++ b/src/zen/tests/glance/browser_glance_select_parent.js @@ -0,0 +1,23 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Glance_Select_Parent() { + await openGlanceOnTab(async (glanceTab) => { + ok( + glanceTab.hasAttribute('zen-glance-tab'), + 'The glance tab should have the zen-glance-tab attribute' + ); + await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true, { + skipAnimation: true, + }); + const tabToRemove = gBrowser.selectedTab; + gBrowser.selectedTab = gZenGlanceManager.getTabOrGlanceParent(glanceTab); + await BrowserTestUtils.waitForCondition(() => { + return glanceTab.selected; + }); + ok(true, 'The glance tab should be selected'); + await BrowserTestUtils.removeTab(tabToRemove); + }); +}); diff --git a/src/zen/tests/pinned/browser.toml b/src/zen/tests/pinned/browser.toml index e07b1951d..f3adcb07b 100644 --- a/src/zen/tests/pinned/browser.toml +++ b/src/zen/tests/pinned/browser.toml @@ -1,3 +1,10 @@ + +["browser_pinned_unload_changed.js"] +["browser_pinned_unload_noreset.js"] +["browser_pinned_nounload_reset.js"] +["browser_pinned_switch.js"] +["browser_pinned_reset_noswitch.js"] +["browser_pinned_close.js"] ["browser_pinned_changed.js"] ["browser_pinned_created.js"] ["browser_pinned_edit_label.js"] diff --git a/src/zen/tests/pinned/browser_pinned_changed.js b/src/zen/tests/pinned/browser_pinned_changed.js index beee3a6f5..576c16946 100644 --- a/src/zen/tests/pinned/browser_pinned_changed.js +++ b/src/zen/tests/pinned/browser_pinned_changed.js @@ -3,7 +3,7 @@ 'use strict'; -add_task(async function test_Create_Pinned() { +add_task(async function test_Changed_Pinned() { let resolvePromise; const promise = new Promise((resolve) => { resolvePromise = resolve; diff --git a/src/zen/tests/pinned/browser_pinned_close.js b/src/zen/tests/pinned/browser_pinned_close.js new file mode 100644 index 000000000..c3c009ae2 --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_close.js @@ -0,0 +1,34 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Unload_NoReset_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'close']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok(tab.closing, 'The tab should be closing after being closed'); + resolvePromise(); + }, 100); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/pinned/browser_pinned_nounload_reset.js b/src/zen/tests/pinned/browser_pinned_nounload_reset.js new file mode 100644 index 000000000..9930b0268 --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_nounload_reset.js @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_NoUnload_Changed_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'reset-switch']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + + BrowserTestUtils.startLoadingURIString(browser, 'https://example.com/2'); + await BrowserTestUtils.browserLoaded(browser, false, 'https://example.com/2'); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should have a zen-pinned-changed attribute after being pinned' + ); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok( + !tab.hasAttribute('zen-pinned-changed'), + 'The tab should not have a zen-pinned-changed attribute after being closed' + ); + ok( + !tab.hasAttribute('discarded'), + 'The tab should not be discarded after being closed' + ); + ok(tab != gBrowser.selectedTab, 'The tab should not be selected after being closed'); + resolvePromise(); + }, 100); + }, 0); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/pinned/browser_pinned_reset_noswitch.js b/src/zen/tests/pinned/browser_pinned_reset_noswitch.js new file mode 100644 index 000000000..969e68f31 --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_reset_noswitch.js @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Unload_NoReset_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'reset']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + + BrowserTestUtils.startLoadingURIString(browser, 'https://example.com/2'); + await BrowserTestUtils.browserLoaded(browser, false, 'https://example.com/2'); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should have a zen-pinned-changed attribute after being pinned' + ); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok( + !tab.hasAttribute('zen-pinned-changed'), + 'The tab should not have a zen-pinned-changed attribute after being closed' + ); + ok( + !tab.hasAttribute('discarded'), + 'The tab should not be discarded after being closed' + ); + ok(tab === gBrowser.selectedTab, 'The tab should not be selected after being closed'); + resolvePromise(); + }, 100); + }, 0); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/pinned/browser_pinned_switch.js b/src/zen/tests/pinned/browser_pinned_switch.js new file mode 100644 index 000000000..d0a2caa56 --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_switch.js @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Unload_NoReset_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'switch']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + + BrowserTestUtils.startLoadingURIString(browser, 'https://example.com/2'); + await BrowserTestUtils.browserLoaded(browser, false, 'https://example.com/2'); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should have a zen-pinned-changed attribute after being pinned' + ); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should not have a zen-pinned-changed attribute after being closed' + ); + ok( + !tab.hasAttribute('discarded'), + 'The tab should not be discarded after being closed' + ); + ok(tab != gBrowser.selectedTab, 'The tab should not be selected after being closed'); + resolvePromise(); + }, 100); + }, 0); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/pinned/browser_pinned_unload_changed.js b/src/zen/tests/pinned/browser_pinned_unload_changed.js new file mode 100644 index 000000000..5d7bc6f53 --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_unload_changed.js @@ -0,0 +1,49 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Unload_Changed_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'reset-unload-switch']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + + BrowserTestUtils.startLoadingURIString(browser, 'https://example.com/2'); + await BrowserTestUtils.browserLoaded(browser, false, 'https://example.com/2'); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should have a zen-pinned-changed attribute after being pinned' + ); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok( + !tab.hasAttribute('zen-pinned-changed'), + 'The tab should not have a zen-pinned-changed attribute after being closed' + ); + + ok(tab.hasAttribute('discarded'), 'The tab should not be discarded after being closed'); + ok(tab != gBrowser.selectedTab, 'The tab should not be selected after being closed'); + resolvePromise(); + }, 100); + }, 0); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/pinned/browser_pinned_unload_noreset.js b/src/zen/tests/pinned/browser_pinned_unload_noreset.js new file mode 100644 index 000000000..538c84bac --- /dev/null +++ b/src/zen/tests/pinned/browser_pinned_unload_noreset.js @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Unload_NoReset_Pinned() { + await SpecialPowers.pushPrefEnv({ + set: [['zen.pinned-tab-manager.close-shortcut-behavior', 'unload-switch']], + }); + + let resolvePromise; + const promise = new Promise((resolve) => { + resolvePromise = resolve; + }); + + await BrowserTestUtils.withNewTab({ gBrowser, url: 'https://example.com/1' }, async (browser) => { + const tab = gBrowser.getTabForBrowser(browser); + tab.addEventListener( + 'ZenPinnedTabCreated', + async function (event) { + const pinTabID = tab.getAttribute('zen-pin-id'); + ok(pinTabID, 'The tab should have a zen-pin-id attribute after being pinned'); + + BrowserTestUtils.startLoadingURIString(browser, 'https://example.com/2'); + await BrowserTestUtils.browserLoaded(browser, false, 'https://example.com/2'); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should have a zen-pinned-changed attribute after being pinned' + ); + document.getElementById('cmd_close').doCommand(); + setTimeout(() => { + ok( + tab.hasAttribute('zen-pinned-changed'), + 'The tab should not have a zen-pinned-changed attribute after being closed' + ); + ok(tab.hasAttribute('discarded'), 'The tab should not be discarded after being closed'); + ok(tab != gBrowser.selectedTab, 'The tab should not be selected after being closed'); + resolvePromise(); + }, 100); + }, 0); + }, + { once: true } + ); + gBrowser.pinTab(tab); + await promise; + }); +}); diff --git a/src/zen/tests/run.sh b/src/zen/tests/run.sh deleted file mode 100644 index 0046ab1ca..000000000 --- a/src/zen/tests/run.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e - -# make sure we are on root -if [ ! -f "package.json" ]; then - echo "Please run this script from the root of the project" - exit 1 -fi - -path="$1" -other_args="" -for arg in "$@"; do - if [ "$arg" != "$path" ]; then - other_args="$other_args $arg" - fi -done -cd ./engine -if [ "$path" = "all" ] || [ "$path" = "" ]; then - all_tests=$(find zen/tests -type d) - all_paths="" - for test in $all_tests; do - all_paths="$all_paths zen/tests/$(basename $test)" - done - ./mach mochitest $other_args $all_paths -else - ./mach mochitest $other_args zen/tests/$path -fi -cd .. diff --git a/src/zen/tests/workspaces/browser.toml b/src/zen/tests/workspaces/browser.toml index e0069362e..c4c36f8b2 100644 --- a/src/zen/tests/workspaces/browser.toml +++ b/src/zen/tests/workspaces/browser.toml @@ -6,3 +6,4 @@ support-files = [ ["browser_basic_workspaces.js"] ["browser_workspace_bookmarks.js"] ["browser_double_click_newtab.js"] +["browser_overflow_scrollbox.js"] diff --git a/src/zen/tests/workspaces/browser_overflow_scrollbox.js b/src/zen/tests/workspaces/browser_overflow_scrollbox.js new file mode 100644 index 000000000..1125edb83 --- /dev/null +++ b/src/zen/tests/workspaces/browser_overflow_scrollbox.js @@ -0,0 +1,43 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_task(async function test_Check_ScrollBox_Overflow() { + const scrollbox = gZenWorkspaces.activeScrollbox; + scrollbox.smoothScroll = false; + const tabsToRemove = []; + while (!scrollbox.overflowing) { + await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true); + tabsToRemove.push(gBrowser.selectedTab); + } + + // An extra tab to ensure the scrollbox is overflowing + await BrowserTestUtils.openNewForegroundTab(window.gBrowser, 'https://example.com/', true); + tabsToRemove.push(gBrowser.selectedTab); + + ok(scrollbox.overflowing, 'The scrollbox should be overflowing after opening enough tabs'); + + ok(scrollbox.scrollPosition === 0, 'The scrollbox should be scrolled to the top'); + + gBrowser.selectedTab = gBrowser.tabs[gBrowser.tabs.length - 1]; + await new Promise((resolve) => { + setTimeout(() => { + Assert.greater(scrollbox.scrollPosition, 0, 'The scrollbox should be scrolled to the bottom'); + resolve(); + }, 200); + }); + + gBrowser.selectedTab = gBrowser.visibleTabs[0]; + await new Promise((resolve) => { + setTimeout(() => { + // TODO: Use a real scroll position check instead of a hardcoded value + Assert.less(scrollbox.scrollPosition, 60, 'The scrollbox should be scrolled to the top'); + resolve(); + }, 200); + }); + + for (const tab of tabsToRemove) { + await BrowserTestUtils.removeTab(tab); + } +}); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 92313268c..920184e2d 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -2810,41 +2810,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } } - makeSurePinTabIsInCorrectPosition() { - if (!this.pinnedTabsContainer) { - return 0; // until we initialize the pinned tabs container - } - const tabsInsidePinTab = Array.from(this.pinnedTabsContainer.parentElement.children).filter( - (child) => child.tagName === 'tab' - ); - let changed = false; - for (const tab of tabsInsidePinTab) { - if (tab.getAttribute('zen-glance-tab') === 'true') { - continue; - } - if (tab.getAttribute('zen-essential') === 'true') { - const container = this.getCurrentEssentialsContainer(); - container.appendChild(tab); - changed = true; - continue; - } - const workspaceId = tab.getAttribute('zen-workspace-id'); - if (!workspaceId) { - continue; - } - const contaienr = this.workspaceElement(workspaceId).pinnedTabsContainer; - contaienr.insertBefore(tab, contaienr.lastChild); - changed = true; - } - if (changed) { - gBrowser.tabContainer._invalidateCachedTabs(); - } - // Return the number of essentials INSIDE the pinned tabs container so we can correctly change their parent - return Array.from(this.pinnedTabsContainer.children).filter( - (child) => child.getAttribute('zen-essential') === 'true' - ).length; - } - // Context menu management _contextMenuId = null; diff --git a/surfer.json b/surfer.json index 494b1a3f6..b713e5204 100644 --- a/surfer.json +++ b/surfer.json @@ -6,7 +6,7 @@ "version": { "product": "firefox", "version": "138.0.4", - "candidate": "138.0.4" + "candidate": "139.0" }, "buildOptions": { "generateBranding": true