Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: cda0ce0dcbd3537524f86dff14fed9efe368a23d https://github.com/WebKit/WebKit/commit/cda0ce0dcbd3537524f86dff14fed9efe368a23d Author: Chris Dumez <cdu...@apple.com> Date: 2024-12-04 (Wed, 04 Dec 2024)
Changed paths: M LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation-expected.txt M Source/WebCore/bindings/js/ScriptController.cpp M Source/WebCore/bindings/js/ScriptController.h M Source/WebCore/loader/FrameLoader.cpp Log Message: ----------- imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html is failing https://bugs.webkit.org/show_bug.cgi?id=284011 Reviewed by Rob Buis. When setting an iframe's src to a javascript URL and the js returns a String, we replace the document with that String, which counts as a "Replace" navigation (navigation which replaces the current HistoryItem). The test in question is expecting this since it expects `navigation.entries` to have 2 entries before AND after the JS URL navigation. The logic in FrameLoader::loadURL() was properly setting the NavigationAction's navigationType to `NavigationNavigationType::Replace`. However, before we would end up calling executeJavaScriptURL() instead of doing a proper navigation, we would not end up setting the NavigationAction object as the DocumentLoader's triggeringAction. The navigationType is supposed to get passed to Navigation::initializeForNewWindow() to make sure it replaces the current entry instead of creating a new one in this case. However, initializeForNewWindow() is called from FrameLoader::didBeginDocument() which gets it from the DocumentLoader's triggeringAction. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation-expected.txt: * Source/WebCore/bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeJavaScriptURL): * Source/WebCore/bindings/js/ScriptController.h: * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::executeJavaScriptURL): Canonical link: https://commits.webkit.org/287344@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes