Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a46910834aed22f3688291def7a9c396877b5ba4
      
https://github.com/WebKit/WebKit/commit/a46910834aed22f3688291def7a9c396877b5ba4
  Author: Qianlang Chen <[email protected]>
  Date:   2026-04-08 (Wed, 08 Apr 2026)

  Changed paths:
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

  Log Message:
  -----------
  [Site Isolation] Fix provisional-load-cancels-previous-load.html layout test
https://bugs.webkit.org/show_bug.cgi?id=311381

Reviewed by Basuke Suzuki.

The test crashing under site isolation was due to two issues:

1. Assertion failure in NetworkProcess::allowsFirstPartyForCookies:
   when a second cross-origin navigation starts while a provisional page
   is paused (e.g. by the inspector), processNavigatingFrom incorrectly
   used the provisional page's process. If the provisional and target
   processes matched, the UI process saw no process change needed and
   told the original process to load the cross-origin URL directly,
   crashing the network process on a cookie access check.

   Fix this by adding a navigation id comparison:
      provisionalPage->navigationID() == navigation->navigationID()
   The provisional page's process should only be used as
   processNavigatingFrom when it belongs to the same navigation (e.g. a
   server redirect). When the provisional page's load is being cancelled
   by a new navigation, the frame's committed process should be used so
   the swap is correctly detected.

2. Assertion failure in InjectedBundlePage::resetAfterTest:
   when the test completes, resetAfterTest might target a remote page
   instead of the committed test page after the test performed a
   cross-origin page navigation.

   Fix this by making InjectedBundle::page() prefer pages also having a
   local main frame instead so resetAfterTest operates on the intended
   test page.

Rework the surrounding code in both places to be a bit more readable.

Verified the test's progression with:
    run-webkit-tests --site-isolation 
provisional-load-cancels-previous-load.html

* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::hasActiveLoadForNavigation const):
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::page const):

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



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

Reply via email to