Skip to content

Commit

Permalink
Make 270849@main have no effect when site isolation is off
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265063
rdar://118574473

Unreviewed.

It was supposed to only change behavior when site isolation was on.
It broke the tests http/tests/inspector/target/provisional-load-cancels-previous-load.html
and TestWebKitAPI.ProcessSwap.QuickBackForwardNavigationWithPSON.
This fixes those two tests and restores existing behavior with site isolation off.
There is still work to do when site isolation is on.  A lot of work.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Canonical link: https://commits.webkit.org/270912@main
  • Loading branch information
achristensen07 committed Nov 17, 2023
1 parent 027711e commit 839bf83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/WebKit/UIProcess/WebPageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6647,7 +6647,12 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces
else if (m_needsInitialLinkDecorationFilteringData)
sendCachedLinkDecorationFilteringData();
#endif
Ref frameProcessBeforeNavigation { frame.provisionalFrame() ? frame.provisionalFrame()->process() : frame.isMainFrame() && m_provisionalPage ? m_provisionalPage->process() : frame.process() };

// FIXME: preferences().siteIsolationEnabled() here indicates there's an issue.
// See rdar://118574473 and rdar://118575766 for the kinds of things that might
// be broken with site isolation enabled.
Ref frameProcessBeforeNavigation { frame.provisionalFrame() ? frame.provisionalFrame()->process() : preferences().siteIsolationEnabled() && frame.isMainFrame() && m_provisionalPage ? m_provisionalPage->process() : frame.process() };

Ref listener = frame.setUpPolicyListenerProxy([this, protectedThis = Ref { *this }, frameProcessBeforeNavigation = WTFMove(frameProcessBeforeNavigation), processInitiatingNavigation = process, frame = Ref { frame }, sender = WTFMove(sender), navigation, navigationAction, frameInfo] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, std::optional<NavigatingToAppBoundDomain> isAppBoundDomain, WasNavigationIntercepted wasNavigationIntercepted) mutable {
WEBPAGEPROXY_RELEASE_LOG(Loading, "decidePolicyForNavigationAction: listener called: frameID=%llu, isMainFrame=%d, navigationID=%llu, policyAction=%u, safeBrowsingWarning=%d, isAppBoundDomain=%d, wasNavigationIntercepted=%d", frame->frameID().object().toUInt64(), frame->isMainFrame(), navigation ? navigation->navigationID() : 0, (unsigned)policyAction, !!safeBrowsingWarning, !!isAppBoundDomain, wasNavigationIntercepted == WasNavigationIntercepted::Yes);

Expand Down

0 comments on commit 839bf83

Please sign in to comment.