Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 86c0467f20ee9866d8380917e7c3da05df140c4f
      
https://github.com/WebKit/WebKit/commit/86c0467f20ee9866d8380917e7c3da05df140c4f
  Author: Ben Nham <[email protected]>
  Date:   2025-10-19 (Sun, 19 Oct 2025)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm

  Log Message:
  -----------
  OOP iframes don't load when main resource has restrictive COOP policy
https://bugs.webkit.org/show_bug.cgi?id=301045
rdar://162943276

Reviewed by Ryosuke Niwa and Sihui Liu.

When the main resource response contains a restrictive COOP policy, this forces 
the creation of a
new browsing context group in `triggerBrowsingContextGroupSwitchForNavigation`. 
However, we never
add the page to the BCG. This has a number of other bad downstream effects; for 
instance, when we
then try to load an OOP iframe, it finds that the BCG it's loaded in to is 
empty, so no remote page
is created for the OOP iframe and the WebProcess backing the OOP iframe 
instantly suspends since it
thinks it's hosting no pages and no remote pages.

To fix this, have `triggerBrowsingContextGroupSwitchForNavigation` call 
`setBrowsingContextGroup`,
which also adds the page to the BCG.

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision):
(WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation):
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::testCrossOriginOpenerPolicyMainFrame):
(TestWebKitAPI::TEST(SiteIsolation, CrossOriginOpenerPolicyMainFrame)):
(TestWebKitAPI::TEST(SiteIsolation, 
CrossOriginOpenerPolicyMainFrameWithSharedProcess)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to