[webkit-changes] [WebKit/WebKit] 58ebd2: Opener relationship should be preserved when switc...

Alex Christensen noreply at github.com
Mon Apr 29 21:06:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 58ebd2f088d76f1a8b5d7b502a1d303a7f955256
      https://github.com/WebKit/WebKit/commit/58ebd2f088d76f1a8b5d7b502a1d303a7f955256
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-04-29 (Mon, 29 Apr 2024)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/history/CachedFrame.cpp
    M Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoader.h
    M Source/WebCore/loader/LocalFrameLoaderClient.h
    M Source/WebCore/loader/PolicyChecker.cpp
    M Source/WebCore/page/Frame.cpp
    M Source/WebCore/page/Frame.h
    M Source/WebCore/page/LocalDOMWindow.cpp
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrame.h
    M Source/WebCore/page/RemoteFrame.cpp
    M Source/WebCore/page/RemoteFrame.h
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
    M Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp
    M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKitLegacy/mac/WebView/WebFrame.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm

  Log Message:
  -----------
  Opener relationship should be preserved when switching between local and remote frames for site isolation
https://bugs.webkit.org/show_bug.cgi?id=273433
rdar://127253523

Reviewed by Charlie Wolfe.

This moves the owner pointer and the set of opened pages from FrameLoader and RemoteFrame
to Frame so that the management of those two related structures can be shared between LocalFrame
and RemoteFrame.  I then update the pointer and set when switching from a LocalFrame to a
RemoteFrame and when switching from a RemoteFrame to a LocalFrame.

Covered by an API test, which not only tests that the opener is unchanged after these transitions,
but it also tests other types of provisional navigation failures with site isolation:
navigating to the same domain, and navigating to a new domain that has never been seen before.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::fallbackBaseURL const):
(WebCore::Document::canNavigateInternal):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initContentSecurityPolicy):
* Source/WebCore/history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* Source/WebCore/inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openURLExternally):
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::~FrameLoader):
(WebCore::shouldClearWindowName):
(WebCore::FrameLoader::hasOpenedFrames const):
(WebCore::FrameLoader::setOriginalURLForDownloadRequest):
(WebCore::FrameLoader::updateRequestAndAddExtraFields):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::effectiveReferrerPolicy const):
(WebCore::FrameLoader::switchBrowsingContextsGroup):
(WebCore::FrameLoader::detachFromAllOpenedFrames): Deleted.
(WebCore::FrameLoader::opener): Deleted.
(WebCore::FrameLoader::opener const): Deleted.
(WebCore::FrameLoader::setOpener): Deleted.
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/loader/LocalFrameLoaderClient.h:
* Source/WebCore/loader/PolicyChecker.cpp:
(WebCore::FrameLoader::PolicyChecker::checkNavigationPolicy):
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::setOpener):
(WebCore::Frame::detachFromAllOpenedFrames):
(WebCore::Frame::openedFrames):
(WebCore::Frame::hasOpenedFrames const):
* Source/WebCore/page/Frame.h:
(WebCore::Frame::opener const):
(WebCore::Frame::opener):
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::focus):
(WebCore::LocalDOMWindow::disownOpener):
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::LocalFrame):
(WebCore::LocalFrame::reinitializeDocumentSecurityContext):
(WebCore::LocalFrame::disconnectView):
(WebCore::LocalFrame::setOpener): Deleted.
(WebCore::LocalFrame::opener const): Deleted.
(WebCore::LocalFrame::opener): Deleted.
* Source/WebCore/page/LocalFrame.h:
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::createSubframe):
(WebCore::RemoteFrame::createSubframeWithContentsInAnotherProcess):
(WebCore::RemoteFrame::RemoteFrame):
* Source/WebCore/page/RemoteFrame.h:
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameClearOpener):
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::shouldSuppressJavaScriptDialogs):
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::didSameDocumentNavigationForFrameViaJSHistoryAPI):
* Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::transitionToRemote):
(WebKit::WebFrame::transitionToLocal):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::suspendForProcessSwap):
(WebKit::WebPage::suspend):
* Source/WebKitLegacy/mac/WebView/WebFrame.mm:
(-[WebFrame _clearOpener]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation, NavigateOpenerToProvisionalNavigationFailure)):

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



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


More information about the webkit-changes mailing list