[webkit-changes] [WebKit/WebKit] 5f00d3: Fallback on current advanced policy protection pol...
Commit Queue
noreply at github.com
Tue Sep 17 06:08:38 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5f00d3d853546ccd37305a15c23dfc85f512d583
https://github.com/WebKit/WebKit/commit/5f00d3d853546ccd37305a15c23dfc85f512d583
Author: Matthew Finkel <m_finkel at apple.com>
Date: 2024-09-17 (Tue, 17 Sep 2024)
Changed paths:
M Source/WebCore/dom/Document.cpp
M Source/WebCore/loader/DocumentLoader.h
M Source/WebCore/loader/FrameLoadRequest.h
M Source/WebCore/loader/FrameLoader.cpp
M Source/WebKit/Shared/LoadParameters.h
M Source/WebKit/Shared/LoadParameters.serialization.in
M Source/WebKit/Shared/NavigationActionData.h
M Source/WebKit/Shared/NavigationActionData.serialization.in
M Source/WebKit/Shared/WebsitePoliciesData.cpp
M Source/WebKit/UIProcess/API/APINavigation.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/WebFrame.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Tools/TestWebKitAPI/Tests/WebKit/AdvancedPrivacyProtections.mm
Log Message:
-----------
Fallback on current advanced policy protection policy when originator's policy is not set
https://bugs.webkit.org/show_bug.cgi?id=276877
rdar://problem/132225093
Reviewed by Wenson Hsieh.
Currently we're mostly separating the originator's policy from the policy that
was provided when deciding how the navigation should be handled. However, in
some situations those policies would become intertwined and we could apply the
wrong policy. For example, after certain redirect chains, we could start
applying the originator's policy, even if the navigation was user initiated.
Part of the problem stems from the fact that deciding which policy we need to
apply is context-specific, and we often must know both our current policy and
the previous policy.
This patch attempts to reduce the complexity and make clearer which policy
should be applied. In this patch, I'm changing the originator's policy from the
OptionSet to a std::optional. This will tell us whether we have a policy or if
we still need one. Using this information, we can fallback on the current
website policy if needed.
This patch adds a couple new tests for covering some edge cases.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::urlForBindings const):
(WebCore::Document::referrerForBindings):
* Source/WebCore/loader/DocumentLoader.h:
(WebCore::DocumentLoader::navigationalAdvancedPrivacyProtections const):
(WebCore::DocumentLoader::originatorAdvancedPrivacyProtections const):
* Source/WebCore/loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::advancedPrivacyProtections const):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
* Source/WebKit/Shared/LoadParameters.h:
* Source/WebKit/Shared/LoadParameters.serialization.in:
* Source/WebKit/Shared/NavigationActionData.h:
* Source/WebKit/Shared/NavigationActionData.serialization.in:
* Source/WebKit/Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Source/WebKit/UIProcess/API/APINavigation.h:
(API::Navigation::originatorAdvancedPrivacyProtections const):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::applyLinkDecorationFilteringWithResult):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::originatorAdvancedPrivacyProtections const):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
* Tools/TestWebKitAPI/Tests/WebKit/AdvancedPrivacyProtections.mm:
(TestWebKitAPI::TEST(AdvancedPrivacyProtections, ApplyNavigationalProtectionsAfterMultiplePSON)):
(TestWebKitAPI::webViewAfterCrossSiteNavigationWithReducedPrivacy):
(TestWebKitAPI::TEST(AdvancedPrivacyProtections, HideScreenMetricsFromBindings)):
(TestWebKitAPI::TEST(AdvancedPrivacyProtections, AddNoiseToWebAudioAPIsAfterMultiplePSON)):
(TestWebKitAPI::TEST(AdvancedPrivacyProtections, AddNoiseToWebAudioAPIsAfterReducingPrivacyProtectionsAndMultiplePSON)):
Originally-landed-as: 280938.148 at safari-7619-branch (87b599e4c7e3). rdar://136108838
Canonical link: https://commits.webkit.org/283769@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