Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 491a3d387b66906bfbae9973d01f4061b187c623
https://github.com/WebKit/WebKit/commit/491a3d387b66906bfbae9973d01f4061b187c623
Author: Basuke Suzuki <[email protected]>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/loader/FrameLoader.cpp
M Source/WebCore/loader/FrameLoader.h
M Source/WebCore/loader/NavigationAction.h
M Source/WebCore/loader/NavigationScheduler.cpp
M Source/WebCore/page/History.cpp
A Source/WebCore/page/NavigateEventDispatchResult.h
M Source/WebCore/page/Navigation.cpp
M Source/WebCore/page/Navigation.h
Log Message:
-----------
[Navigation API] Return the navigate event dispatch result through
FrameLoader instead of a bool
https://bugs.webkit.org/show_bug.cgi?id=326112
rdar://189026250
Reviewed by Alex Christensen.
Navigation::innerDispatchNavigateEvent() returns a DispatchResult enum, but
dispatchPushReplaceReloadNavigateEvent(), FrameLoader::dispatchNavigateEvent()
and the pending
navigate event function stored on NavigationAction reduced it to a bool. The
fix for
https://bugs.webkit.org/show_bug.cgi?id=325553 needs to know, where the pending
function is
called, which navigate event the dispatch fired, so these layers now return the
result itself.
The result is now NavigateEventDispatchResult, a struct holding the former enum
as its state, so
that the fix can add the identifier of the dispatched event to it. It lives in
its own header
because NavigationAction.h and FrameLoader.h need it, and they are exported to
WebKit while
Navigation.h is not.
Callers that only need to know whether the navigation continues use
isCompleted() and
isNotCompleted(), which correspond to true and false before. The pending
function returns
aborted() when its FrameLoader is gone, where it returned false.
No new tests (refactoring, no behavior change).
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::dispatchPendingNavigateEventAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::dispatchNavigateEvent):
(WebCore::FrameLoader::loadItem):
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/loader/NavigationAction.h:
(WebCore::NavigationAction::setPendingDispatchNavigateEvent):
(WebCore::NavigationAction::takePendingDispatchNavigateEvent):
* Source/WebCore/loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange):
* Source/WebCore/page/History.cpp:
(WebCore::History::stateObjectAdded):
* Source/WebCore/page/NavigateEventDispatchResult.h: Added.
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::handleSameDocumentNavigation):
(WebCore::Navigation::runNavigatePrecommitHandlers):
(WebCore::Navigation::innerDispatchNavigateEvent):
(WebCore::Navigation::dispatchTraversalNavigateEvent):
(WebCore::Navigation::dispatchPushReplaceReloadNavigateEvent):
(WebCore::Navigation::dispatchDownloadNavigateEvent):
* Source/WebCore/page/Navigation.h:
Canonical link: https://commits.webkit.org/322573@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications