Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cf1683ccb688cf4a2a8429b3edc15943febef46a
https://github.com/WebKit/WebKit/commit/cf1683ccb688cf4a2a8429b3edc15943febef46a
Author: Basuke Suzuki <[email protected]>
Date: 2026-02-02 (Mon, 02 Feb 2026)
Changed paths:
M LayoutTests/http/tests/navigation/back-iframe-no-bf-cache-expected.txt
M LayoutTests/http/tests/navigation/back-iframe-no-bf-cache.html
A LayoutTests/http/tests/navigation/cross-site-iframe-nav-expected.txt
A LayoutTests/http/tests/navigation/cross-site-iframe-nav.html
A
LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-other.html
A
LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-page.html
A
LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-popup.html
M LayoutTests/http/tests/navigation/resources/navigation-utils.js
M Source/WebKit/Shared/WebBackForwardListItem.cpp
M Source/WebKit/Shared/WebBackForwardListItem.h
M Source/WebKit/UIProcess/WebBackForwardList.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm
Log Message:
-----------
Remove unnecessary remote frame navigation pruning from BackForwardList.
https://bugs.webkit.org/show_bug.cgi?id=306679
rdar://169328011
Reviewed by Charlie Wolfe.
r288281@main (bug 285096) introduced logic to prune remote frame navigation
items from
the BackForwardList when the parent frame navigated. This was intended to
handle the
case where BFCache is disabled and iframe state cannot be preserved.
However, this pruning logic is no longer necessary because:
1. The FrameState.children mechanism preserves iframe navigation history in
BackForwardList items, even without BFCache.
2. When navigating back, recursiveGoToItem() uses the children array to restore
iframe navigation state by calling loadItem() on each child frame.
3. r306554@main added updateFrameID() to handle frame ID changes when iframes
are recreated, making the history restoration work correctly across multiple
back navigations.
The pruning logic also had the unintended side effect of causing different
behavior depending on whether Site Isolation is enabled, which is inconsistent.
This patch removes:
- The isRemoteFrameNavigation flag and associated pruning logic
- The sharesAncestor() check that was incorrectly deleting valid history items
Tests:
- http/tests/navigation/cross-site-iframe-nav.html:
New test verifying cross-site iframe history is preserved across main frame
navigations.
- API test BackNavigationOverCrossSiteIframeWithoutBFCache (was
DiscardUncachedBackItemForNavigatedOverIframe):
Updated to verify iframe history is NOT pruned.
* LayoutTests/http/tests/navigation/back-iframe-no-bf-cache-expected.txt:
* LayoutTests/http/tests/navigation/back-iframe-no-bf-cache.html:
* LayoutTests/http/tests/navigation/cross-site-iframe-nav-expected.txt: Added.
* LayoutTests/http/tests/navigation/cross-site-iframe-nav.html: Added.
* LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-other.html:
Added.
* LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-page.html:
Added.
* LayoutTests/http/tests/navigation/resources/cross-site-iframe-nav-popup.html:
Added.
* LayoutTests/http/tests/navigation/resources/navigation-utils.js:
* Source/WebKit/Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::originalURL const):
(WebKit::WebBackForwardListItem::url const):
(WebKit::WebBackForwardListItem::title const):
* Source/WebKit/Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::setIsRemoteFrameNavigation): Deleted.
(WebKit::WebBackForwardListItem::isRemoteFrameNavigation const): Deleted.
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::backForwardAddItemShared):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation,
BackNavigationOverCrossSiteIframeWithoutBFCache)):
(TestWebKitAPI::TEST(SiteIsolation,
DiscardUncachedBackItemForNavigatedOverIframe)): Deleted.
Canonical link: https://commits.webkit.org/306664@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications