Skip to content

Enable Navigation API - #50613

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
RupinMittal:eng/ReenableNavigationAPI
Sep 13, 2025
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
RupinMittal:eng/ReenableNavigationAPI

Conversation

@RupinMittal

@RupinMittal RupinMittal commented Sep 11, 2025 •

Copy link
Copy Markdown
Contributor

a3e994b

Enable Navigation API
https://bugs.webkit.org/show_bug.cgi?id=298730
rdar://160389651

Reviewed by Charlie Wolfe.

Enable the Navigation API on Cocoa, GTK, WPE now that the PLT regression is
fixed (299858@main).

Enabling this API results in the ProcessSwap.SwapOnFormSubmission API test
failing. It fails because on [webView reload], the web process changes rather
than staying the same.

The issue is that on [webView reload], we call FrameLoader::reload which ends
up calling Navigation::initializeForNewWindow. Since there is a previous window
with previous navigation entries we should process, we go down the
shouldProcessPreviousNavigationEntries path. Then, since the navigation type is
not Traverse or Push, we end up in the last else case, which dereferences the
navigationType.

Turns out, no navigationType has been set. So the process crashes, which causes
a new process to be spun up and reload is called in that process. Hence the
process ID in the API test is not equal to the old one.

To fix this, we make FrameLoader::reload set the NavigationNavigationType as it
should have been doing before.

This issue did not arise earlier since API tests are not run with non-stable
feature flags enabled. Now that we're enabling it, this case will continue to be
tested by ProcessSwap.SwapOnFormSubmission.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::setTriggeringNavigationAPIType):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::reload):
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::initializeForNewWindow):

Canonical link: https://commits.webkit.org/299927@main

09353fe

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 💥 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv ✅ 🛠 mac-safer-cpp   🛠 jsc-armv7
✅ 🛠 tv-sim   🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@RupinMittal RupinMittal self-assigned this Sep 11, 2025
@RupinMittal RupinMittal added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Sep 11, 2025
@RupinMittal
RupinMittal force-pushed the eng/ReenableNavigationAPI branch from 63abee5 to 6acece7 Compare September 12, 2025 23:31
@RupinMittal
RupinMittal force-pushed the eng/ReenableNavigationAPI branch from 6acece7 to 09353fe Compare September 12, 2025 23:43
@RupinMittal
RupinMittal marked this pull request as ready for review September 13, 2025 01:23
@RupinMittal
RupinMittal requested a review from cdumez as a code owner September 13, 2025 01:23
@RupinMittal

Copy link
Copy Markdown
Contributor Author

Looks like the jsc-arm7 bots are in a bad state. All other bots are green, so I'm landing.

@RupinMittal RupinMittal added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Sep 13, 2025
https://bugs.webkit.org/show_bug.cgi?id=298730
rdar://160389651

Reviewed by Charlie Wolfe.

Enable the Navigation API on Cocoa, GTK, WPE now that the PLT regression is
fixed (299858@main).

Enabling this API results in the ProcessSwap.SwapOnFormSubmission API test
failing. It fails because on [webView reload], the web process changes rather
than staying the same.

The issue is that on [webView reload], we call FrameLoader::reload which ends
up calling Navigation::initializeForNewWindow. Since there is a previous window
with previous navigation entries we should process, we go down the
shouldProcessPreviousNavigationEntries path. Then, since the navigation type is
not Traverse or Push, we end up in the last else case, which dereferences the
navigationType.

Turns out, no navigationType has been set. So the process crashes, which causes
a new process to be spun up and reload is called in that process. Hence the
process ID in the API test is not equal to the old one.

To fix this, we make FrameLoader::reload set the NavigationNavigationType as it
should have been doing before.

This issue did not arise earlier since API tests are not run with non-stable
feature flags enabled. Now that we're enabling it, this case will continue to be
tested by ProcessSwap.SwapOnFormSubmission.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::setTriggeringNavigationAPIType):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::reload):
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::initializeForNewWindow):

Canonical link: https://commits.webkit.org/299927@main
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 299927@main (a3e994b): https://commits.webkit.org/299927@main

Reviewed commits have been landed. Closing PR #50613 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit a3e994b into WebKit:main Sep 13, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants