summaryrefslogtreecommitdiffstats
path: root/toolkit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:53:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:53:15 +0000
commit50e4c49ba64ce680143c83b142ae5a7ec30fde54 (patch)
tree269a97c1e612c69c97e0a622db091ba5392965c9 /toolkit
parentAdding debian version 125.0.2-1. (diff)
downloadfirefox-50e4c49ba64ce680143c83b142ae5a7ec30fde54.tar.xz
firefox-50e4c49ba64ce680143c83b142ae5a7ec30fde54.zip
Merging upstream version 125.0.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/modules/LightweightThemeConsumer.sys.mjs21
-rw-r--r--toolkit/xre/nsWindowsWMain.cpp23
2 files changed, 20 insertions, 24 deletions
diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs
index cf388eb3d3..0d3993370b 100644
--- a/toolkit/modules/LightweightThemeConsumer.sys.mjs
+++ b/toolkit/modules/LightweightThemeConsumer.sys.mjs
@@ -183,7 +183,26 @@ const toolkitVariableMap = [
"--newtab-background-color-secondary",
{ lwtProperty: "ntp_card_background" },
],
- ["--newtab-text-primary-color", { lwtProperty: "ntp_text" }],
+ [
+ "--newtab-text-primary-color",
+ {
+ lwtProperty: "ntp_text",
+ processColor(rgbaChannels, element) {
+ if (!rgbaChannels) {
+ element.removeAttribute("lwt-newtab-brighttext");
+ return null;
+ }
+
+ const { r, g, b } = rgbaChannels;
+ element.toggleAttribute(
+ "lwt-newtab-brighttext",
+ 0.2125 * r + 0.7154 * g + 0.0721 * b > 110
+ );
+
+ return _rgbaToString(rgbaChannels);
+ },
+ },
+ ],
];
export function LightweightThemeConsumer(aDocument) {
diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp
index 2a91deec5c..7eb9e11046 100644
--- a/toolkit/xre/nsWindowsWMain.cpp
+++ b/toolkit/xre/nsWindowsWMain.cpp
@@ -111,32 +111,9 @@ static void FreeAllocStrings(int argc, char** argv) {
delete[] argv;
}
-// Remove "/prefetch:##" argument from the command line, if present. (See
-// GeckoChildProcessHost.cpp for details.)
-//
-// Colons are not permitted in path-elements on Windows, so a string of this
-// form is extremely unlikely to appear with the intent of being a legitimate
-// path-argument.
-void RemovePrefetchArguments(int& argc, WCHAR** argv) {
- size_t prefetchArgsCount [[maybe_unused]] = 0;
- for (int i = 0; i < argc; ++i) {
- constexpr const wchar_t prefix[] = L"/prefetch:";
- auto const cmp = wcsncmp(argv[i], prefix, ARRAYSIZE(prefix) - 1);
- if (cmp == 0) {
- std::copy(argv + i + 1, argv + argc, argv + i);
- --argc;
- --i;
- prefetchArgsCount++;
- }
- }
- MOZ_ASSERT(prefetchArgsCount <= 1,
- "at most one /prefetch:## argument should be present");
-}
-
int wmain(int argc, WCHAR** argv) {
SanitizeEnvironmentVariables();
SetDllDirectoryW(L"");
- RemovePrefetchArguments(argc, argv);
// Only run this code if LauncherProcessWin.h was included beforehand, thus
// signalling that the hosting process should support launcher mode.