Closed Bug 2082790 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63736 - navigateEvent.userInitiated should be true for non-simulated clicks

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

James Robertson <jamestherobertson@gmail.com> wrote:

navigateEvent.userInitiated should be true for non-simulated clicks

The Navigation API NavigateEvent userInitiated property is spec'd to be:

"True if this navigation was due to a user clicking on an a element, submitting a form element ... false otherwise"

Meanwhile, WebKit bug 306262 reports that "NavigationEvent#userInitiated is only true for fragment links or form submissions"

The scenarios mentioned in comment 2 correspond to the navigate-anchor-userInitiated and navigate-form-userInitiated test cases, both of which use test_driver.click(...) to 'trigger' element interactions.

The other navigate-anchor-... scenarios call .click() (directly on the HTMLElement) to simulate interactions, and therefore result in userInitiated being false. This isn't technically 'wrong', but it does mean there is a coverage gap, which has allowed for the bug to manifest.

This change proposes a dedicated navigate-anchor-dom-click scenario for a direct .click() (as it is the 'exception'/specific aspect of behaviour under test), and updates the other element-interactions to use test_driver.click(...). Giving the anchors text was required to give them 'width'/a clickable area. As a result, assert_false becomes assert_true to get the test cases passing again.

WebKit will no longer pass the modified scenarios, aligning with the aforementioned bug report.

As the Navigation API is listed as being a 'focus area' of Interop 2026, I figured this contribution was worth a go.

Thank you for your consideration!

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 142 tests and 1 subtests

Status Summary

Firefox

OK : 3[GitHub] 125[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-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 3[GitHub] 137[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 138[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]
FAIL : 4
ERROR: 1

Chrome

OK : 3
PASS : 3

Safari

OK : 2
FAIL : 2
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: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.