diff --git a/.gitignore b/.gitignore index 67b3b7ef6..50ad94e54 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ build/signing/cert.pem build/signing/private_key.pem build/signing/private_key.p12 +bloat-dump.log diff --git a/package.json b/package.json index 705e3e515..0ebf49c20 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "build": "surfer build", "build:ui": "surfer build --ui", "start": "cd engine && python3 ./mach run --noprofile", + "start:bloat": "XPCOM_MEM_BLOAT_LOG=1 npm start", "import": "npm run ffprefs && npm run import:dumps && surfer import", "import:dumps": "python3 scripts/update_service_dumps.py", "export": "surfer export", diff --git a/src/zen/boosts/nsZenBoostsBackend.cpp b/src/zen/boosts/nsZenBoostsBackend.cpp index a702f5c78..1968c6ad1 100644 --- a/src/zen/boosts/nsZenBoostsBackend.cpp +++ b/src/zen/boosts/nsZenBoostsBackend.cpp @@ -46,6 +46,8 @@ namespace zen { +NS_IMPL_ISUPPORTS0(nsZenBoostsBackend) + nsZenAccentOklab nsZenBoostsBackend::mCachedAccent{0}; nsZenAccentOklab nsZenBoostsBackend::mCachedComplementary{0}; float nsZenBoostsBackend::mCachedComplementaryRotationDeg = 0.0f; @@ -345,7 +347,7 @@ inline static void GetZenBoostsDataFromBrowsingContext( } // namespace -static mozilla::StaticAutoPtr sZenBoostsBackend; +static mozilla::StaticRefPtr sZenBoostsBackend; auto nsZenBoostsBackend::GetInstance() -> nsZenBoostsBackend* { if (!XRE_IsContentProcess()) { diff --git a/src/zen/boosts/nsZenBoostsBackend.h b/src/zen/boosts/nsZenBoostsBackend.h index 4d7bcfe10..67f3af6e8 100644 --- a/src/zen/boosts/nsZenBoostsBackend.h +++ b/src/zen/boosts/nsZenBoostsBackend.h @@ -6,6 +6,7 @@ #define mozilla_ZenBoostsBackend_h_ #include "nsColor.h" +#include "nsISupportsImpl.h" #include "nsPresContext.h" #include "mozilla/RefPtr.h" @@ -22,10 +23,11 @@ struct nsZenAccentOklab { float contrastFactor; }; -class nsZenBoostsBackend final { +class nsZenBoostsBackend final : public nsISupports { public: + NS_DECL_ISUPPORTS + explicit nsZenBoostsBackend() = default; - ~nsZenBoostsBackend() = default; /** * Indicates whether the current frame being rendered is for anonymous @@ -90,6 +92,8 @@ class nsZenBoostsBackend final { bool mCachedCurrentInverted = false; private: + ~nsZenBoostsBackend() = default; + /** * The presshell of the current document being rendered. */ diff --git a/src/zen/common/modules/ZenMenubar.mjs b/src/zen/common/modules/ZenMenubar.mjs index 08ce51e81..b6c5144d7 100644 --- a/src/zen/common/modules/ZenMenubar.mjs +++ b/src/zen/common/modules/ZenMenubar.mjs @@ -50,7 +50,8 @@ export class nsZenMenuBar { const sibling = document.getElementById("viewSidebarMenuMenu"); const togglePinnedItem = window.MozXULElement.parseXULToFragment( - '' + '' ).querySelector("menuitem"); if (!gZenWorkspaces.privateWindowOrDisabled) { sibling.after(togglePinnedItem); diff --git a/src/zen/common/modules/ZenUIManager.mjs b/src/zen/common/modules/ZenUIManager.mjs index 84fe3271b..67e26a3be 100644 --- a/src/zen/common/modules/ZenUIManager.mjs +++ b/src/zen/common/modules/ZenUIManager.mjs @@ -257,7 +257,7 @@ window.gZenUIManager = { }, updateTabsToolbar() { - const kUrlbarHeight = 335; + const kUrlbarHeight = 333; gURLBar.style.setProperty( "--zen-urlbar-top", `${window.innerHeight / 2 - Math.max(kUrlbarHeight, window.windowUtils.getBoundsWithoutFlushing(gURLBar).height) / 2}px` diff --git a/src/zen/common/styles/zen-browser-ui.css b/src/zen/common/styles/zen-browser-ui.css index 42e2afe15..992a9ac13 100644 --- a/src/zen/common/styles/zen-browser-ui.css +++ b/src/zen/common/styles/zen-browser-ui.css @@ -107,6 +107,11 @@ body, } } +:root[swipe-gesture] #tabbrowser-arrowscrollbox { + /* See gh-13703 for rationale. */ + pointer-events: none; +} + #zen-browser-background { /* This is conceptually a background, but putting this on a pseudo-element * avoids it from suppressing the chrome-content separator border, etc. diff --git a/src/zen/common/styles/zen-omnibox.css b/src/zen/common/styles/zen-omnibox.css index f69e27c32..e4517d344 100644 --- a/src/zen/common/styles/zen-omnibox.css +++ b/src/zen/common/styles/zen-omnibox.css @@ -17,9 +17,8 @@ } .urlbar { - --urlbarView-separator-color: light-dark(hsl(0, 0%, 80%), hsl(0, 0%, 20%)); - --urlbarView-hover-background: var(--toolbarbutton-hover-background); - --urlbarView-highlight-background: var(--toolbarbutton-hover-background); + --urlbarview-separator-color: light-dark(hsl(0, 0%, 80%), hsl(0, 0%, 20%)); + --urlbarview-background-color-hover: var(--toolbarbutton-hover-background); border-radius: calc(var(--toolbarbutton-border-radius) - 2px); height: var(--urlbar-height); --urlbarView-results-padding: 10px !important; @@ -682,7 +681,7 @@ } #urlbar-results { - max-height: 260px; + max-height: 252px; overflow-y: auto; scrollbar-width: none; margin-block-start: calc(var(--urlbarView-results-padding) - 2px); diff --git a/src/zen/folders/zen-folders.css b/src/zen/folders/zen-folders.css index 146e94364..f3ba4cdfd 100644 --- a/src/zen/folders/zen-folders.css +++ b/src/zen/folders/zen-folders.css @@ -224,7 +224,7 @@ zen-folder[collapsed] > .tab-group-container { /* Tabs popup */ #zen-folder-tabs-popup { - --arrowpanel-padding: 0; + --panel-padding: 0; width: 250px; & #zen-folder-tabs-search-no-results { diff --git a/src/zen/mods/ZenStyleSheetCache.cpp b/src/zen/mods/ZenStyleSheetCache.cpp index dccfbd4b6..aeb723e00 100644 --- a/src/zen/mods/ZenStyleSheetCache.cpp +++ b/src/zen/mods/ZenStyleSheetCache.cpp @@ -11,6 +11,7 @@ #include "nsStyleSheetService.h" +#include "mozilla/ClearOnShutdown.h" #include "mozilla/css/SheetParsingMode.h" #include "mozilla/GlobalStyleSheetCache.h" #include "mozilla/RefPtr.h" @@ -72,6 +73,7 @@ auto ZenStyleSheetCache::Singleton() -> ZenStyleSheetCache* { MOZ_ASSERT(NS_IsMainThread()); if (!gZenModsCache) { gZenModsCache = new ZenStyleSheetCache; + ClearOnShutdown(&gZenModsCache); } return gZenModsCache; } diff --git a/src/zen/spaces/zen-workspaces.css b/src/zen/spaces/zen-workspaces.css index 3cfda3ccb..97c0d89be 100644 --- a/src/zen/spaces/zen-workspaces.css +++ b/src/zen/spaces/zen-workspaces.css @@ -346,12 +346,8 @@ zen-workspace { overflow-y: auto; } - :root[swipe-gesture] &{ - pointer-events: none; - - &::part(scrollbox) { - scrollbar-width: none; - } + :root[swipe-gesture] &::part(scrollbox) { + scrollbar-width: none; } &[overflowing] { diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 893c89bb3..55bd8280c 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -547,10 +547,12 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {