Closed Bug 2028419 Opened 3 months ago Closed 2 months ago

[wpt-sync] Sync PR 58889 - Fix crash when starting a new navigation inside `formdata` event

Categories

(Core :: DOM: Navigation, task, P4)

task

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 58889 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/58889
Details from upstream follow.

Mason Freed <masonf@chromium.org> wrote:

Fix crash when starting a new navigation inside formdata event

During a POST form navigation, FormData::Create() is called to generate
the FormData for the NavigateEventInit. This process synchronously fires
the 'formdata' event on the form element.

If the event listener for 'formdata' starts a new navigation (e.g., via
navigation.navigate()), or detaches the frame, the original navigation
attempt would later crash because it expects ongoing_navigate_event_ to
be null when registering its own navigate event.

This CL checks if ongoing_navigate_event_ has been populated (or if the
frame has been detached) immediately after the FormData::Create() call
and aborts the original navigation if so, allowing the new navigation to
take over cleanly.

Fixed: 496425575
Change-Id: I81f5882df3999d69f0c6ddbf547eb03587e304fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7712695
Auto-Submit: Mason Freed \<masonf@chromium.org>
Reviewed-by: Noam Rosenthal \<nrosenthal@google.com>
Commit-Queue: Noam Rosenthal \<nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1607991}

Component: web-platform-tests → DOM: Navigation
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 127 tests

Status Summary

Firefox

OK : 110[Gecko-linux2404-64-opt] 111[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
PASS : 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 117[Gecko-linux2404-64-opt] 118[Gecko-linux2404-64-debug, Gecko-windows11-32-24h2-opt] 119[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-24h2-debug, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
FAIL : 4
ERROR: 1

Chrome

CRASH: 1

Safari

ERROR: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 127 tests

Status Summary

Firefox

OK : 110[Gecko-linux2404-64-opt] 111[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
PASS : 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 117[Gecko-linux2404-64-opt] 118[Gecko-linux2404-64-debug, Gecko-windows11-32-24h2-opt] 119[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-24h2-debug, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
FAIL : 4
ERROR: 1

Chrome

CRASH: 1

Safari

ERROR: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
You need to log in before you can comment on or make changes to this bug.