1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 23:00:01 +02:00

fix(build): disable LTO temporarily and enable PGO based on release settings

refactor(ui): remove unnecessary DOMContentLoaded listener from toolbar registration
fix(ui): trigger window resize event on closing watermark to recalculate layout
refactor(ui): improve animation structure for tab content in vertical tabs manager
This commit is contained in:
mr. M 2025-03-15 19:36:13 +01:00
parent 9406515f91
commit b6477b17d8
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
6 changed files with 51 additions and 32 deletions

View file

@ -7,8 +7,18 @@ export MOZ_MACBUNDLE_ID=${appId}
export MOZ_MACBUNDLE_NAME="Zen Browser.app" export MOZ_MACBUNDLE_NAME="Zen Browser.app"
# override LTO settings # override LTO settings
# TODO: Dont # TODO: Dont use LTO for now, it's causing a lot of issues
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
if test "$ZEN_RELEASE"; then
if test "$ZEN_GA_DISABLE_PGO"; then
export ZEN_DUMMY=1
else
export MOZ_PGO=1
ac_add_options MOZ_PGO=1
fi
fi
if test "$SURFER_COMPAT" = "x86_64"; then if test "$SURFER_COMPAT" = "x86_64"; then
ac_add_options --target=x86_64-apple-darwin ac_add_options --target=x86_64-apple-darwin

View file

@ -125,12 +125,5 @@ export var ZenCustomizableUI = new (class {
registerToolbarNodes(window) { registerToolbarNodes(window) {
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons')); window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons'));
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-bottom-buttons')); window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-bottom-buttons'));
window.addEventListener(
'DOMContentLoaded',
() => {
this._dispatchResizeEvent(window);
},
{ once: true }
);
} }
})(); })();

View file

@ -58,6 +58,7 @@
closeWatermark() { closeWatermark() {
document.documentElement.removeAttribute('zen-before-loaded'); document.documentElement.removeAttribute('zen-before-loaded');
window.dispatchEvent(new window.Event('resize')); // To recalculate the layout
if (Services.prefs.getBoolPref('zen.watermark.enabled', false)) { if (Services.prefs.getBoolPref('zen.watermark.enabled', false)) {
gZenUIManager.motion gZenUIManager.motion
.animate( .animate(

View file

@ -372,12 +372,16 @@ var gZenVerticalTabsManager = {
aTab.style.removeProperty('opacity'); aTab.style.removeProperty('opacity');
}); });
gZenUIManager.motion gZenUIManager.motion
.animate(aTab.querySelector('.tab-content'), { .animate(
filter: ['blur(1px)', 'blur(0px)'], aTab.querySelector('.tab-content'),
}, { {
duration: 0.12, filter: ['blur(1px)', 'blur(0px)'],
easing: 'ease-out', },
}) {
duration: 0.12,
easing: 'ease-out',
}
)
.then(() => { .then(() => {
aTab.querySelector('.tab-stack').style.removeProperty('filter'); aTab.querySelector('.tab-stack').style.removeProperty('filter');
}); });

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc3174ae5260b 100644 index 8eab0f9181c19c68a0a2daf0f819b3ae82ed92bc..092107b377ec4f7bc9ae86c817cded349732ffc6 100644
--- a/browser/components/customizableui/CustomizableUI.sys.mjs --- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs +++ b/browser/components/customizableui/CustomizableUI.sys.mjs
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, { @@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
@ -116,7 +116,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317
win.setToolbarVisibility( win.setToolbarVisibility(
areaNode, areaNode,
typeof defaultCollapsed == "string" typeof defaultCollapsed == "string"
@@ -4658,6 +4656,7 @@ export var CustomizableUI = { @@ -4857,6 +4855,7 @@ export var CustomizableUI = {
unregisterArea(aName, aDestroyPlacements) { unregisterArea(aName, aDestroyPlacements) {
CustomizableUIInternal.unregisterArea(aName, aDestroyPlacements); CustomizableUIInternal.unregisterArea(aName, aDestroyPlacements);
}, },
@ -124,7 +124,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317
/** /**
* Add a widget to an area. * Add a widget to an area.
* If the area to which you try to add is not known to CustomizableUI, * If the area to which you try to add is not known to CustomizableUI,
@@ -6483,11 +6482,11 @@ class OverflowableToolbar { @@ -6840,11 +6839,11 @@ class OverflowableToolbar {
parseFloat(style.paddingLeft) - parseFloat(style.paddingLeft) -
parseFloat(style.paddingRight) - parseFloat(style.paddingRight) -
toolbarChildrenWidth; toolbarChildrenWidth;
@ -134,11 +134,11 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317
this.#target == this.#toolbar this.#target == this.#toolbar
? toolbarChildrenWidth ? toolbarChildrenWidth
- : sumChildrenInlineSize(this.#target); - : sumChildrenInlineSize(this.#target);
+ : sumChildrenInlineSize(this.#target, win.gZenVerticalTabsManager._topButtonsSeparatorElement); + : sumChildrenInlineSize((win.gZenVerticalTabsManager._hasSetSingleToolbar && this.#target.id == 'nav-bar-customization-target') ? win.document.getElementById("zen-sidebar-top-buttons-customization-target") : this.#target, win.gZenVerticalTabsManager._topButtonsSeparatorElement);
}); });
lazy.log.debug( lazy.log.debug(
@@ -6497,7 +6496,8 @@ class OverflowableToolbar { @@ -6854,7 +6853,8 @@ class OverflowableToolbar {
// If the target has min-width: 0, their children might actually overflow // If the target has min-width: 0, their children might actually overflow
// it, so check for both cases explicitly. // it, so check for both cases explicitly.
let targetContentWidth = Math.max(targetWidth, targetChildrenWidth); let targetContentWidth = Math.max(targetWidth, targetChildrenWidth);
@ -148,7 +148,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317
return { isOverflowing, targetContentWidth, totalAvailWidth }; return { isOverflowing, targetContentWidth, totalAvailWidth };
} }
@@ -6591,7 +6591,7 @@ class OverflowableToolbar { @@ -6948,7 +6948,7 @@ class OverflowableToolbar {
} }
} }
if (!inserted) { if (!inserted) {
@ -157,7 +157,7 @@ index e6b9b7dcfab179e7552c146eb1551b45ad042266..d9d838a7a51f67b52b69f419024cc317
} }
child.removeAttribute("cui-anchorid"); child.removeAttribute("cui-anchorid");
child.removeAttribute("overflowedItem"); child.removeAttribute("overflowedItem");
@@ -6753,6 +6753,9 @@ class OverflowableToolbar { @@ -7110,6 +7110,9 @@ class OverflowableToolbar {
* @param {MouseEvent} aEvent the click event. * @param {MouseEvent} aEvent the click event.
*/ */
#onClickDefaultListButton(aEvent) { #onClickDefaultListButton(aEvent) {

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb0bee29ea 100644 index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..79b9161544633d319d7e550dd95334b62e85eed4 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs --- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs +++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter( @@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@ -52,7 +52,18 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
} }
/** /**
@@ -1098,7 +1116,11 @@ export class UrlbarInput { @@ -943,6 +961,10 @@ export class UrlbarInput {
// Nullify search mode before setURI so it won't try to restore it.
this.searchMode = null;
this.setURI(null, true, false, true);
+ if (this.hasAttribute("zen-floating-urlbar")) {
+ this.window.gBrowser.selectedBrowser.focus();
+ return;
+ }
if (this.value && this.focused) {
this.select();
}
@@ -1098,7 +1120,11 @@ export class UrlbarInput {
} }
if (!this.#providesSearchMode(result)) { if (!this.#providesSearchMode(result)) {
@ -65,7 +76,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
} }
this.controller.recordSelectedResult(event, result); this.controller.recordSelectedResult(event, result);
@@ -2157,6 +2179,11 @@ export class UrlbarInput { @@ -2157,6 +2183,11 @@ export class UrlbarInput {
this.setAttribute("breakout-extend", "true"); this.setAttribute("breakout-extend", "true");
@ -77,7 +88,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
// Enable the animation only after the first extend call to ensure it // Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window. // doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) { if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2176,6 +2203,11 @@ export class UrlbarInput { @@ -2176,6 +2207,11 @@ export class UrlbarInput {
return; return;
} }
@ -89,7 +100,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
this.removeAttribute("breakout-extend"); this.removeAttribute("breakout-extend");
this.#updateTextboxPosition(); this.#updateTextboxPosition();
} }
@@ -2998,7 +3030,7 @@ export class UrlbarInput { @@ -2998,7 +3034,7 @@ export class UrlbarInput {
*/ */
_trimValue(val) { _trimValue(val) {
let trimmedValue = lazy.UrlbarPrefs.get("trimURLs") let trimmedValue = lazy.UrlbarPrefs.get("trimURLs")
@ -98,7 +109,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
: val; : val;
// Only trim value if the directionality doesn't change to RTL and we're not // Only trim value if the directionality doesn't change to RTL and we're not
// showing a strikeout https protocol. // showing a strikeout https protocol.
@@ -3365,7 +3397,7 @@ export class UrlbarInput { @@ -3365,7 +3401,7 @@ export class UrlbarInput {
} else { } else {
where = lazy.BrowserUtils.whereToOpenLink(event, false, false); where = lazy.BrowserUtils.whereToOpenLink(event, false, false);
} }
@ -107,7 +118,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
if (where == "current") { if (where == "current") {
where = "tab"; where = "tab";
} else if (where == "tab") { } else if (where == "tab") {
@@ -3380,6 +3412,9 @@ export class UrlbarInput { @@ -3380,6 +3416,9 @@ export class UrlbarInput {
) { ) {
where = "current"; where = "current";
} }
@ -117,7 +128,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
return where; return where;
} }
@@ -3921,6 +3956,11 @@ export class UrlbarInput { @@ -3921,6 +3960,11 @@ export class UrlbarInput {
} }
_on_click(event) { _on_click(event) {
@ -129,7 +140,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
if ( if (
event.target == this.inputField || event.target == this.inputField ||
event.target == this._inputContainer || event.target == this._inputContainer ||
@@ -3992,7 +4032,7 @@ export class UrlbarInput { @@ -3992,7 +4036,7 @@ export class UrlbarInput {
} }
} }
@ -138,7 +149,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
this.view.autoOpen({ event }); this.view.autoOpen({ event });
} else { } else {
if (this._untrimOnFocusAfterKeydown) { if (this._untrimOnFocusAfterKeydown) {
@@ -4032,9 +4072,12 @@ export class UrlbarInput { @@ -4032,9 +4076,12 @@ export class UrlbarInput {
} }
_on_mousedown(event) { _on_mousedown(event) {
@ -152,7 +163,7 @@ index 02c328f0d0724b0cf95c820fe49a43e94a97b3c2..30387bf4f128fdc1d687ee4f6c5a51eb
if ( if (
event.target != this.inputField && event.target != this.inputField &&
@@ -4044,8 +4087,8 @@ export class UrlbarInput { @@ -4044,8 +4091,8 @@ export class UrlbarInput {
break; break;
} }