[wpt-sync] Sync PR 63736 - navigateEvent.userInitiated should be true for non-simulated clicks
Categories
(Core :: DOM: Navigation, task, P4)
Tracking
()
| 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
NavigateEventuserInitiatedproperty 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 theHTMLElement) to simulate interactions, and therefore result inuserInitiatedbeingfalse. 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-clickscenario for a direct.click()(as it is the 'exception'/specific aspect of behaviour under test), and updates the other element-interactions to usetest_driver.click(...). Giving the anchors text was required to give them 'width'/a clickable area. As a result,assert_falsebecomesassert_trueto 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!
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=109417
| Assignee | ||
Comment 2•1 month ago
|
||
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
- /navigation-api/navigate-event/navigate-form-onformdata-navigate-crash.html [wpt.fyi]:
ERROR[Gecko-linux2204-64-wayland-debug,Gecko-linux2204-64-wayland-opt,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt,Gecko-windows11-32-25h2-debug,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt],PASS[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] - /navigation-api/navigate-event/defer/tentative/defer-after-dispatch.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-back.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-cross-origin.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-restore-callback-abort.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-same-document.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-multiple-handlers-and-single-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-multiple-handlers.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-single-handler-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-single-handler.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/restore-after-bfcache.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/intercepted-navigation-after-bfcache-restore.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/navigate-history-traversal-during-onnavigate-should-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/replaceState-inside-back-handler-infinite.optional.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/intercept-cross-origin-focus-without-user-activation.html [wpt.fyi]
- Navigation API intercept() focus reset shouldn't bypass focus-without-user-activation permissions policy:
FAIL
- Navigation API intercept() focus reset shouldn't bypass focus-without-user-activation permissions policy:
- /navigation-api/navigate-event/navigate-navigation-back-cross-document.html [wpt.fyi]
- navigate event for navigation.back() - cross-document:
FAIL
- navigate event for navigation.back() - cross-document:
- /navigation-api/navigate-event/navigate-to-srcdoc.html [wpt.fyi]
- navigate event fires appropriately (and can be canceled) for adding the srcdoc attribute:
FAIL
- navigate event fires appropriately (and can be canceled) for adding the srcdoc attribute:
- /navigation-api/navigate-event/signal-abort-window-stop.html [wpt.fyi]
- window.stop() signals event.signal:
FAIL
- window.stop() signals event.signal:
Tests Disabled in Gecko Infrastructure
- /navigation-api/navigate-event/defer/tentative/defer-after-dispatch.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-back.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-cross-origin.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-restore-callback-abort.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-same-document.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-multiple-handlers-and-single-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-multiple-handlers.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-single-handler-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/defer-with-single-handler.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/defer/tentative/restore-after-bfcache.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/intercepted-navigation-after-bfcache-restore.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/navigate-history-traversal-during-onnavigate-should-reject.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/navigation-traverseTo-in-iframe-same-document-preventDefault.html [wpt.fyi]:
SKIP - /navigation-api/navigate-event/replaceState-inside-back-handler-infinite.optional.html [wpt.fyi]:
SKIP
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/be5bcf5fdfec
https://hg.mozilla.org/mozilla-central/rev/66b2ab8e7239
Description
•