Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6a812431046e391a799d9372c7d6c17665cf1817
https://github.com/WebKit/WebKit/commit/6a812431046e391a799d9372c7d6c17665cf1817
Author: Brian Weinstein <[email protected]>
Date: 2024-11-07 (Thu, 07 Nov 2024)
Changed paths:
M Source/WebCore/contentextensions/ContentExtensionCompiler.cpp
M Source/WebCore/contentextensions/ContentExtensionParser.cpp
M Source/WebCore/contentextensions/ContentExtensionRule.h
M Source/WebCore/contentextensions/ContentExtensionsBackend.cpp
M Source/WebCore/loader/ResourceLoadInfo.h
M Source/WebKit/UIProcess/API/APIContentRuleListStore.h
M Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp
Log Message:
-----------
Add support for unless-frame-url to content blocker machinery
https://bugs.webkit.org/show_bug.cgi?id=282771
rdar://139456686
Reviewed by Timothy Hatcher.
Similar to how we have if-frame-url, we should support unless-frame-url. This
matches how we have
both if-domain and unless-domain, and if-top-url and unless-top-url.
* Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList): Add
ActionCondition::UnlessFrameURL.
* Source/WebCore/contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadTrigger): Add a check for unless-frame-url.
* Source/WebCore/contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::checkValidity): Update the assert to
handle unless-frame-url.
* Source/WebCore/contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsFromContentRuleList
const): Handle
the ActionCondition::UnlessFrameURL case.
* Source/WebCore/loader/ResourceLoadInfo.h: Add a new enum in ActionCondition
and update the various
flag masks.
* Source/WebKit/UIProcess/API/APIContentRuleListStore.h: Bump the version
number of the content
rule list file.
* Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F(ContentExtensionTest, InvalidJSON)): Add a test that
shows specifying both
if-frame-url and unless-frame-url leads to an error.
(TestWebKitAPI::TEST_F(ContentExtensionTest, UnlessFrameURL)): Add a bunch of
tests for
unless-frame-url matching the if-frame-url ones.
Canonical link: https://commits.webkit.org/286310@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