Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dd8f85cb43ada51ab9a34ec35816be6667b9c5d7
https://github.com/WebKit/WebKit/commit/dd8f85cb43ada51ab9a34ec35816be6667b9c5d7
Author: Sihui Liu <[email protected]>
Date: 2026-06-18 (Thu, 18 Jun 2026)
Changed paths:
M Source/WebCore/loader/FrameLoader.cpp
M Source/WebCore/loader/FrameLoader.h
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
[Site Isolation] Notify parent frame via checkCompleted() when child async
back/forward navigation is cancelled
https://bugs.webkit.org/show_bug.cgi?id=316873
rdar://179296676
Reviewed by Basuke Suzuki.
When UseUIProcessForBackForwardItemLoading is on and a cross-document
navigation starts in a child frame that has an
async back/forward navigation pending, loadWithDocumentLoader() calls
stopCheck() => invalidatePolicyListeners(), which
fires the pending BF policy callback with PolicyAction::Ignore. The Ignore
handler (and the wasCancelled path) was
clearing the async-wait state on the child but never calling checkCompleted()
on the parent. This left the parent
blocked, so its window.onload never fired.
This patch fixes the issue by moving the parent checkCompleted() call into
clearAsyncBackForwardNavigationState()
itself, so every cancellation site automatically unblocks the parent. An
early-return guard (state == None) ensures
there is no behavioral change for non-SI code paths where the async-wait state
is never set.
WebPage::goToBackForwardItem() is also restructured to call
clearAsyncBackForwardNavigationState() only on the cancelled
path, not before the normal goToItem() call; this is safer since the Pending
state keeps the parent correctly blocked
until didBeginDocument() clears it once the new load starts.
Test: SiteIsolation.CancelledChildAsyncBackForwardNotifiesParent
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearAsyncBackForwardNavigationState):
* Source/WebCore/loader/FrameLoader.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::dispatchDecidePolicyForBackForwardNavigationAction):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation,
CancelledChildAsyncBackForwardNotifiesParent)):
Canonical link: https://commits.webkit.org/315480@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications