Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c69c4853e6d259a70cbadd69628a6b73f1383bc2
      
https://github.com/WebKit/WebKit/commit/c69c4853e6d259a70cbadd69628a6b73f1383bc2
  Author: Basuke Suzuki <[email protected]>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm

  Log Message:
  -----------
  [Site Isolation] Enable MultiProcessBackForwardCache automatically when Site 
Isolation is active
https://bugs.webkit.org/show_bug.cgi?id=314699
rdar://176944362

Reviewed by Sihui Liu.

The MultiProcessBackForwardCacheEnabled preference has been off-by-default and 
required to be
toggled on independently from SiteIsolationEnabled. In practice the two 
features are meant to be
used together: under Site Isolation, BFCache relies on the UIProcess 
coordination this flag
unlocks (BackForwardCache::addIfCacheable refuses any SI page when the flag is 
off, per the guard
from bug 313657).

Flip the preference on automatically at page creation time whenever 
SiteIsolationEnabled is on,
mirroring the existing pattern for UseUIProcessForBackForwardItemLoading in 
WebProcessPool.

Drop the now-redundant `enableFeature(configuration, 
@"MultiProcessBackForwardCacheEnabled")`
calls from the SiteIsolation.mm API tests (including 
GoBackToPageWithIframeBFCache) — every
affected test goes through siteIsolatedViewAndDelegate, which sets up SI, so 
the preference is
auto-enabled by the new code path.

Adjust SiteIsolation.mm tests whose pre-conditions changed because of the 
auto-enable:
- DrawAfterNavigateToDomainAgain, IframeRedirectCrossSite: extend the expected 
frame trees to
  include the cached iframe-process tree that now stays alive through the 
cross-site nav.
- NavigationWithIFrames: replace waitForDidFinishLoadInSubframe (which doesn't 
fire on BFCache
  restore) with a frameTreesMatch spin pattern.
- ShutDownFrameProcessesAfterNavigation, GoBackToPageWithIframe, ProcessReuse: 
turn BFCache off
  via the process pool config (pageCacheEnabled = NO) — the assertions in these 
tests are about
  pre-BFCache semantics (process teardown, reload-style goBack tree, 
WebProcessCache reuse
  counted via WebPages) that BFCache deliberately changes.
- siteIsolatedViewWithSharedProcess: disable BFCache on the WebProcessCache 
process pool
  (EnableProcessCache::Yes) for the same reason — those tests assert 
process-reuse semantics that
  BFCache would otherwise perturb.
- PostMessageWithMessagePorts: disable BFCache; the test exercises MessagePort 
delivery across
  site-isolated processes, not BFCache, and the same-site navigation must not 
cache the page
  holding the port.

Covered by existing SiteIsolation.MultiProcessBFCache* tests plus the adjusted 
tests above.

* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(siteIsolatedViewWithSharedProcess):
(TEST(SiteIsolation, PostMessageWithMessagePorts)):
(TEST(SiteIsolation, IframeRedirectCrossSite)):
(TEST(SiteIsolation, NavigationWithIFrames)):
(TEST(SiteIsolation, ShutDownFrameProcessesAfterNavigation)):
(TEST(SiteIsolation, DrawAfterNavigateToDomainAgain)):
(TEST(SiteIsolation, GoBackToPageWithIframe)):
(TEST(SiteIsolation, GoBackToPageWithIframeBFCache)):
(TEST(SiteIsolation, ProcessReuse)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to