Commit Graph

982582 Commits

Author SHA1 Message Date
Fatih Kilic
c674f99b18 Bug 1985073 - Fix the thread-safety issues with canvas permission prompting. a=RyanVM
Previously, as seen, I wrote some horrible code. This patch intends to fix the thread safety issue in the permission prompt code for OffscreenCanvas.

For context, with privacy.fingerprintingProtection=True and privacy.fingerprintingProtection.overrides="+CanvasImageExtractionPrompt", when a canvas is read, we randomize the data, and return the randomized data. At the same time, we show a permission prompt asking the user if they want to allow the website to read the canvas data without randomization. It is a non-blocking prompt (i.e. we allow further canvas reads, it just keeps adding the randomization).

We have two types of canvases. HTMLCanvasElement and OffscreenCanvas. The former is used in the main thread, the latter can be used in both the main thread and worker threads.

To ask for permission, we need to communicate with the parent process with the correct window. However, accessing window from a worker thread is not thread safe. We need to dispatch to the main thread to access the window.

Original Revision: https://phabricator.services.mozilla.com/D262475

Differential Revision: https://phabricator.services.mozilla.com/D263138
2025-09-05 21:00:42 +00:00
Timothy Nikkel
a6603c3ef3 Bug 1986191. Work around a null mScrollContainerFrame in an active scrolled root. a=RyanVM
We should not have a null mScrollContainerFrame in an asr that is in use, but we are getting crashes in bug 1764863 that show that this is happening at volume. We have not been successful over a long period of time of finding a testcase or some way to reproduce. We have a landed patch in bug 1984898 (based on a pernosco of one instance of this from a few years back) that we hope fixes some or most of these. The patch in bug 1984898 is a little bit big, and we have no evidence that it fixes the problem. So I am proposing this patch as something we can uplift that should work around the problem. We still want to fix any instances of that this we come across so the MOZ_DIAGNOSTIC_ASSERT will fire in nightly and early beta builds. The gfxCriticalNoteOnce will alert us if this is having negative consequences later on.

By returning false we will abort the partial display list update and delete the retained display list that contains an asr that has a null mScrollContainerFrame and we will do a full rebuild. This should avoid the problem and be much better than crashing.

Original Revision: https://phabricator.services.mozilla.com/D263224

Differential Revision: https://phabricator.services.mozilla.com/D263820
2025-09-05 01:46:09 +00:00
Steven Michaud
1c0eec2481 Bug 1986701 - Link mChildView only after mNativeLayerRoot is initialized. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D263616

Differential Revision: https://phabricator.services.mozilla.com/D263736
2025-09-05 01:45:57 +00:00
Joel Maher
dbbe73f5d7 Bug 1983773 - Do not collect full test info data on branches other than try/central. a=RyanVM DONTBUILD
not sure this should be reviewed, it is supposed to be https://phabricator.services.mozilla.com/D263609

Differential Revision: https://phabricator.services.mozilla.com/D263775
2025-09-04 17:33:20 +00:00
ffxbld
424180bd8b No Bug, mozilla-esr140 repo-update HSTS HPKP remote-settings tld-suffixes ct-logs - a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D263710
2025-09-04 13:42:53 +00:00
Daniel Holbert
59758e6b1d Bug 1985652: Use triggeringPrincipal rather than loadingPrincipal for CORS checks, if triggeringPrincipal is from an extension. a=RyanVM
This allows extensions to access their own content from scripts that they
injected into web pages, without that requested content being automatically
blocked due to failing CORS checks (since the Origin of the request is
the web page).

We have an existing pref 'extensions.content_web_accessible.enabled' whose
'false' value is meant to allow MV2 extensions to access their own resources
from their content-scripts (even if those resources aren't web-exposed). A
recent CORS strictness patch broke this use-case; so this patch relaxes the
strictness, specifically for extensions and specifically when that pref has
the permissive 'false' value.

While we're at it, this patch extends the related xpcshell test cover the case
where the pref is in its default/permissive 'false' configuration (to test the
regression being addressed by this patch), and to test that MV3 is strict under
that configuration. This patch also clarifies the other relevant pref for CORS
principal-selection to avoid implying that it's relevant to WebExtensions
(since it's not anymore).

Original Revision: https://phabricator.services.mozilla.com/D262863

Differential Revision: https://phabricator.services.mozilla.com/D263613
2025-09-04 03:38:52 +00:00
Daniel Holbert
b75ffdc7ab Bug 1970490: Use loading principal (rather than triggering principal) for CORS checks, by default. a=RyanVM
This is essentially a backout of bug 1496505, putting its change behind a new
off-by-default about:config pref[1] for now, in case there are use cases that
require it.

[1] content.cors.use_triggering_principal

Original Revision: https://phabricator.services.mozilla.com/D252611

Differential Revision: https://phabricator.services.mozilla.com/D263611
2025-09-04 03:38:50 +00:00
Mark Striemer
cd516e806e Bug 1976006 - Fix moz- input labels when localisation changes a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D258995

Differential Revision: https://phabricator.services.mozilla.com/D263495
2025-09-03 23:59:38 +00:00
Dão Gottwald
b6ae9b266e Bug 1985747 - Allow toolbarspring to shrink to 1px in the nav-bar again. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D262927

Differential Revision: https://phabricator.services.mozilla.com/D263573
2025-09-03 23:59:07 +00:00
Lee Salzman
c07482a24d Bug 1986185. r=aosmond a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D263287
2025-09-02 22:34:28 +00:00
stransky
76673d8e1c Bug 1960626 [Wayland] Align directly placed popups with toplevel bounds r=emilio a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D263244
2025-09-02 20:29:05 +00:00
stransky
3d20460a97 Bug 1979719 [Wayland] Terminate D&D operation if we don't get motion event before button release r=emilio a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D260184
2025-09-02 20:29:02 +00:00
Dana Keeler
f09f7641bb Bug 1977962 - use a subdialog for the certificate exception override dialog if available a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D258326

Differential Revision: https://phabricator.services.mozilla.com/D263455
2025-09-02 20:27:27 +00:00
Geoff Lankow
ed678723ba Bug 1977770 - Fix "View…" button in certificate exception dialog. a=RyanVM DONTBUILD
Take two, this time with the right event listener for a XUL button instead of an HTML button. :-(

Original Revision: https://phabricator.services.mozilla.com/D257650

Differential Revision: https://phabricator.services.mozilla.com/D263476
2025-09-02 20:27:04 +00:00
Julien Cristau
9f8620ad31 Bug 1986395 - fix last-watershed for linux64-aaarch64 on esr. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D263342

Differential Revision: https://phabricator.services.mozilla.com/D263343
2025-09-02 18:58:13 +00:00
Brad Werth
1142ca05c0 Bug 1959023 Part 2: Prevent macOS menubar from flickering when quitting Firefox. r=spohl a=RyanVM
This also prevents the momentary appearance of a gray, disabled-looking
menubar when quitting.

Differential Revision: https://phabricator.services.mozilla.com/D255244
2025-09-02 18:53:09 +00:00
Brad Werth
a27e723b0b Bug 1959023 Part 1: Only set the macOS menubar when the app is active. r=spohl a=RyanVM
This prevents windowDidResignMain from altering the menubar when Firefox
is not the active app. This avoids menubar changes on multiple monitors
when switching from one window to another. When Firefox becomes active
again, it will update its menubar, which is typically the same menubar
as it had before.

Differential Revision: https://phabricator.services.mozilla.com/D255243
2025-09-02 18:53:07 +00:00
Tom Schuster
0339985881 Bug 1981688 - Rename fluent string corruptedContentError-title to corruptedContentErrorv2-title. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D260266

Differential Revision: https://phabricator.services.mozilla.com/D263444
2025-09-02 18:01:29 +00:00
ffxbld
bddc068382 No Bug, mozilla-esr140 repo-update HSTS HPKP remote-settings tld-suffixes ct-logs - a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D263265
2025-09-01 13:14:15 +00:00
Valentin Gosu
6691758c45 Bug 1981502 - Parse merged version of cache-control instead of just the latest header a=RyanVM
nsHttpResponseHead::ParseHeaderLine_locked parses each header as it comes in.
It then updates its own member variables based on that header.
For cache-control, it's important to reparse the merged version of the header
instead of the most recent one, otherwise we'll miss directives present in
previous headers.

Original Revision: https://phabricator.services.mozilla.com/D260461

Differential Revision: https://phabricator.services.mozilla.com/D263269
2025-09-01 13:11:11 +00:00
longsonr
99bec85ef3 Bug 1980788 - Use std::size rather than hardcoding an array size a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D262967

Differential Revision: https://phabricator.services.mozilla.com/D263128
2025-09-01 00:23:17 +00:00
az
e124e4aaac Bug 1984505 - Improve Opus packet duration error output in WebM demuxer. r=padenot a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262818
2025-09-01 00:18:37 +00:00
Lee Salzman
44ff633cd5 Bug 1985067. r=jnicol a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262614
2025-09-01 00:18:34 +00:00
Lee Salzman
14d3f5b076 Bug 1984825. r=jnicol a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262611
2025-09-01 00:18:32 +00:00
Landry Breuil
ede5e748f7 Bug 1874059: fix build with libc++>=18 on OpenBSD and FreeBSD r=sylvestre a=RyanVM DONTBUILD
without -fvisibility=hidden, linking libxul fails with undefined hidden symbol
references to std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>

Differential Revision: https://phabricator.services.mozilla.com/D262230
2025-09-01 00:12:31 +00:00
Calixte Denizet
90bc3d36c3 Bug 1978985 - Disable printing when enablePermission is true and the pdf isn't allowed to be printed a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D263103
2025-08-29 21:37:10 +00:00
Jed Davis
13cf8c918d Bug 1982763 - Re-add CLONE_NEWIPC to the Linux GMP sandbox. a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D260923

Differential Revision: https://phabricator.services.mozilla.com/D263007
2025-08-29 01:27:22 +00:00
ffxbld
8d5666b49b No Bug, mozilla-esr140 repo-update HSTS HPKP remote-settings tld-suffixes ct-logs - a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262928
2025-08-28 12:31:17 +00:00
Eden Chuang
6bc6572d0f Bug 1938220 - Early return NS_OK of GlobalTeardownObserver::CheckCurrentGlobalCorrectness() when is on the main thread. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D258192

Differential Revision: https://phabricator.services.mozilla.com/D262897
2025-08-28 12:31:02 +00:00
Julien Cristau
cc71f694e8 Bug 1985216 - fetch from ftpmirror.gnu.org. r=firefox-build-system-reviewers,sylvestre,ahochheiden a=release
ftp.gnu.org is struggling, so use a mirror for hopefully better reliability.
2025-08-28 00:24:18 +00:00
Jon Coppeard
08142458c8 Bug 1976207 - Allow mozilla::BitSet to use atomic storage r=glandium a=RyanVM
This patch relaxes the restriction on BitSet so that it can take
mozilla::Atomic as its storage type.

The Reference assignment operator is changed so that it results in a single
update rather than a separate read and update that would not be atomic when
used with atomic storage.

Tests are added for atomic storage and to exercise the assignment operator.

Differential Revision: https://phabricator.services.mozilla.com/D259230
2025-08-27 12:49:35 +00:00
Jon Coppeard
cf6e739fbc Bug 1981280 - Make nursery owned bitmap atomic. a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262760
2025-08-27 12:11:28 +00:00
Jon Coppeard
d96c994e95 Bug 1979502 - Check slices vector not empty before accessing the last slice r=sfink a=RyanVM
|aborted| is reset to false at the end of a slice but
GCRuntime::waitBackgroundSweepEnd can be called outside of a slice.

Differential Revision: https://phabricator.services.mozilla.com/D260685
2025-08-27 12:11:25 +00:00
Daniel Holbert
0f04bc47ad Bug 1980356: Don't block in window.print() if there's a registered mozPrintCallback (e.g. for PDF.js) and if any sort of print dialog might be up. a=RyanVM
Before this patch, we would unconditionally block in window.print() if the user
had the system print dialog enabled.  That was problematic because it prevents
mozPrintCallback from doing asynchronous work, as described in the nearby
code-comment, and this resulted in PDFs printing blank for such users if they
used the "print" button (which triggered window.print()).

This patch makes the print.prefer_system_dialog codepath share the same logic
flow as the regular-print-preview codepath -- now we will *not* block if
there's a registered print callback (which allows the callback's microtasks to
proceed while the print dialog is still up).

Original Revision: https://phabricator.services.mozilla.com/D261296

Differential Revision: https://phabricator.services.mozilla.com/D262703
2025-08-27 03:03:52 +00:00
John M. Schanck
d4b467bd4f Bug 1984544 - upgrade NSS to NSS_3_112_1_RTM. r=keeler a=RyanVM UPGRADE_NSS_RELEASE
Differential Revision: https://phabricator.services.mozilla.com/D262051
2025-08-25 23:40:38 +00:00
Lee Salzman
7c14b87829 Bug 1984014 - Check for untransformed OP_SOURCE rectangles when drawing. r=aosmond a=RyanVM DONTBUILD
Sometimes we submit rectangles for drawing without a transform to bypass the transform.
However, for OP_SOURCE, we expected there to always be a transform to check when to clear
the background. This fixes the OP_SOURCE check to account for untransformed rects.

Differential Revision: https://phabricator.services.mozilla.com/D261805
2025-08-25 23:37:33 +00:00
Calixte Denizet
2782b9db1d Bug 1957680 - Trigger a fake scrollend event in case it hasn't been triggered by the browser in the pdf viewer a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262320
2025-08-25 19:51:21 +00:00
Greg Stoll
64d0b99892 Bug 1980225 - fix race condition with content analysis and printing to file a=RyanVM DONTBUILD
With content analysis active, if a DLP agent pops up a dialog but allows
the print to happen (for example, when responding REPORT_ONLY), this can
cause ::StartDocW() to fail for "printer"s that pop open a dialog for the
user to choose where to save the file. (i.e. Microsoft Print to PDF)

After trying some various hacks, the one that worked was calling
SetForegroundWindow() on a Firefox window before calling ::StartDocW().
It even works if the Firefox window that we call SetForegroundWindow()
isn't the one that the print is happening in. (which I verified by starting
a print and then quickly clicking on another window)

I put this behind a pref just in case this causes problems in the future,
but I doubt it will.

I also reverted the previous attempt to fix this by calling
::LockSetForegroundWindow(), which does not work.

Original Revision: https://phabricator.services.mozilla.com/D261572

Differential Revision: https://phabricator.services.mozilla.com/D262385
2025-08-25 19:51:07 +00:00
Gabriele Svelto
ac82b5a387 Bug 1977514 - Use posix_spawn() when launching the crash helper to work around an issue with fork() on macOS 10.15 a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D258709

Differential Revision: https://phabricator.services.mozilla.com/D262346
2025-08-25 17:28:06 +00:00
Gabriele Svelto
6357fac547 Bug 1977514 - Use nix 0.30.x in the crash helper code a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D258708

Differential Revision: https://phabricator.services.mozilla.com/D262345
2025-08-25 17:28:02 +00:00
Gabriele Svelto
9e514a4382 Bug 1977514 - Updated nix to version 0.30.1 a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D258707

Differential Revision: https://phabricator.services.mozilla.com/D262344
2025-08-25 17:27:59 +00:00
ffxbld
714b7245e2 No Bug, mozilla-esr140 repo-update HSTS HPKP remote-settings tld-suffixes ct-logs - a=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D262375
2025-08-25 13:21:04 +00:00
Eitan Isaacson
a5ebf1856c Bug 1975696 - Revert suppression of AXTitle introduced in bug 1901324. r=Jamie a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D261165

Differential Revision: https://phabricator.services.mozilla.com/D261203
2025-08-23 00:27:18 +00:00
Gabriele Svelto
7c81a53f68 Bug 1975853 - Fail gracefully if we cannot start the crash helper client a=RyanVM
Before this patch if we failed to launch the crash helper client then we
would either freeze or crash Firefox, which is not what we want. This
makes sure that errors when launching the crash helper are not
catastrophic. Additionally, this problem was triggered on a machine that
launched more than 64 child processes at startup during session restore.
That was a hard limit on Windows because of the limitations of
WaitForMultipleObjects(). I adjusted the code to also handle that
gracefully even though we don't support more than 64 child processes at
the moment. That's not a big deal because we're not yet using that
particular IPC channel, so ignoring every child process above the 63rd
doesn't change anything at the moment. Last but not least there was a
small race in the crash helper rendez-vous that might cause Linux to
attempt to generate a minidump before we had allowed a child process to
allow the crash helper to ptrace() it. This was also fixed.

Original Revision: https://phabricator.services.mozilla.com/D256299

Differential Revision: https://phabricator.services.mozilla.com/D262076
2025-08-22 16:24:58 +00:00
Alex Franchuk
67e86233d3 Bug 1981002 - Crash helper leaks a unix fd on macOS and Linux that persists past tab close a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D259986

Differential Revision: https://phabricator.services.mozilla.com/D262075
2025-08-22 16:24:54 +00:00
Gabriele Svelto
6d82d3eb47 Bug 1964600 - Introduce an IPC channel between child processes and the crash helper a=RyanVM
This channel is currently only used on Linux to rendez-vous with the
crash helper, obtain its PID and use it to enable the process to be
dumped when the Yama LSM is enabled. It will be used to actually request
a dump in the future, when the breakpad exception handler is removed.

Original Revision: https://phabricator.services.mozilla.com/D254047

Differential Revision: https://phabricator.services.mozilla.com/D262074
2025-08-22 16:24:50 +00:00
Gabriele Svelto
1ed126d239 Bug 1964600 - Daemonize the crash helper process on Linux and macOS a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D254046

Differential Revision: https://phabricator.services.mozilla.com/D262073
2025-08-22 16:24:47 +00:00
Gabriele Svelto
cddb6d587e Bug 1964600 - Allow Windows crash helper IPC to pass handles a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D254045

Differential Revision: https://phabricator.services.mozilla.com/D262072
2025-08-22 16:24:43 +00:00
Gabriele Svelto
3536a14146 Bug 1964600 - Allow macOS crash helper IPC to pass file descriptors a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D252664

Differential Revision: https://phabricator.services.mozilla.com/D262071
2025-08-22 16:24:39 +00:00
Gabriele Svelto
e35beda67b Bug 1964600 - Move the IPC waiting and connection logic directly into the server a=RyanVM
This is the second step towards daemonizing the crash helper process. The code
used to listen to incoming connections and messages is moved directly into the
server for better coupling. New and existing connections are now categorized
as belonging to Firefox parent process, a child process or an external process
(typically the WER service on Windows). The permission checks on the various
messages are now based on these categories, instead of the PIDs of the
crash helper clients.

Original Revision: https://phabricator.services.mozilla.com/D251559

Differential Revision: https://phabricator.services.mozilla.com/D262070
2025-08-22 16:24:35 +00:00