[wpt-sync] Sync PR 64427 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=325553
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 64427 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64427
Details from upstream follow.
Basuke Suzuki <basuke@apple.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=325553
WebKit export from bug: [<!---->Navigation API]<!----> preventDefault(<!---->)<!----> does not cancel a cross-<!---->site navigation.<!---->navigate(<!---->)<!----> that swaps processes
<pre>
[Navigation API] preventDefault() does not cancel a cross-site navigation.navigate() that swaps processesnavigation.navigate() used a synchronous navigation policy check (<a href="https://commits.webkit.org/288106@main">288106@main</a>), whose reply falls
back to Use before the UI process decides on a process swap. The source process then loaded the
destination as well as the process the UI process chose, so preventDefault() could not cancel it,
and under Site Isolation the source process was killed or committed a cross-site document in the
embedder's process (<a href="https://rdar.apple.com/188750371">rdar://188750371</a>).Cross-document navigation.navigate() now uses the asynchronous policy check like other
cross-document navigations. FrameLoader::shouldCheckNavigationPolicyAfterDispatchingEvents()
first fires the events navigate() needs, the navigate event and then beforeunload, which is the
order the HTML spec uses for push, replace and reload navigations, and then tells whether the
navigation should still go on to the policy check. A navigate() whose navigate event is
intercepted therefore no longer fires beforeunload. The events run after the load being replaced
is stopped and after scheduled navigations are cancelled, as they did when they ran after the
synchronous policy decision.Since these events already ran, the rest of the navigation treats them as done:
- continueLoadAfterNavigationPolicy() does not dispatch beforeunload again.
- If the policy check denies the navigation, the navigate event is aborted (navigateerror and
AbortError). The abort is queued and only applies while that event is still the ongoing one,
because a newer navigation cancels this policy check as it starts and aborts the event itself.
To recognize it, every NavigateEvent now has a NavigateEventIdentifier, which
NavigateEventDispatchResult carries back to the navigation that fired it.- LoadWillContinueInAnotherProcess does not abort it, since the navigation carries on elsewhere.
When the other process commits the navigation, the old frame or page is torn down through
FrameLoader::detachFromParent(). Its closeURL() unloads the document without aborting the
Navigation API, but the stopAllLoaders() that followed aborted the ongoing navigation whenever
the document was still loading, so the document got navigateerror for a navigation that had
committed. navigate() now leaves that navigation ongoing until then, which made this reachable.
detachFromParent() no longer aborts after unloading; removing an iframe still aborts, through
FrameLoader::frameDetached(), as the spec requires for a destroyed child navigable.The asynchronous check also lets a client that decides late deny navigate(); before, its answer
arrived after the synchronous fallback had already allowed the load.Two tentative deferPageSwap tests call navigate() while their popup is still parsing. The load
used to start inside that script and stop the parser, so pagehide never fired and they timed out.
They now reach their assertions: one passes and the other fails because WebKit does not
implement deferPageSwap.fast/canvas/offscreen-webgl-transfer-after-navigation-crash.html relied on
navigation.navigate("about:blank") committing before its next line ran, which tore down the
document and lost the WebGL context. It now navigates an iframe that owns the canvas and calls
transferToImageBitmap() once the iframe has loaded; without the fix from <a href="https://commits.webkit.org/309187@main">309187@main</a> it still
crashes.WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=325553">https://bugs.webkit.org/show_bug.cgi?id=325553</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/322591@main">https://commits.webkit.org/322591@main</a>
</pre>
| Assignee | ||
Updated•13 days ago
|
| Assignee | ||
Updated•9 days ago
|
| Assignee | ||
Updated•9 days ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=116752
| Assignee | ||
Comment 2•9 days ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 148 tests and 1 subtests
Status Summary
Firefox
OK : 2[GitHub] 131[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-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt, GitHub] 146[Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 147[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview]
FAIL : 2
TIMEOUT: 2
ERROR : 1
Chrome
OK : 2
PASS : 2
TIMEOUT: 2
Safari
OK : 3
PASS : 3
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-android-em-14-x86_64-opt-geckoview,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-32-25h2-opt,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] - /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/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/intercept-stops-ongoing-cross-document-navigation.html [wpt.fyi]:
TIMEOUT(Chrome:TIMEOUT, Safari:OK)- navigate() whose navigate event is intercepted stops the cross-document navigation it replaces:
TIMEOUT(Chrome:TIMEOUT, Safari:PASS)
- navigate() whose navigate event is intercepted stops the cross-document navigation it replaces:
- /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:
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/replaceState-inside-back-handler-infinite.optional.html [wpt.fyi]:
SKIP
Comment 4•5 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/130a3875ea19
https://hg.mozilla.org/mozilla-central/rev/4abae47a6493
Comment 5•5 days ago
|
||
| bugherder | ||
Description
•