Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6b06ef9d0a8df37b5bd1ae0b755a37dba8061d9
      
https://github.com/WebKit/WebKit/commit/d6b06ef9d0a8df37b5bd1ae0b755a37dba8061d9
  Author: Elijah Sawyers <[email protected]>
  Date:   2025-06-12 (Thu, 12 Jun 2025)

  Changed paths:
    M Source/WebCore/contentextensions/ContentExtension.cpp
    M Source/WebCore/contentextensions/ContentExtension.h
    M Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm

  Log Message:
  -----------
  WebKit Content Blockers: CSS display none that matches everything still 
applied even after a ignore-following-rules action was matched
https://bugs.webkit.org/show_bug.cgi?id=294281
rdar://152996225

Reviewed by Alex Christensen.

This patch fixes a bug where a global css-display-none rule would still be
applied after an ignore-following-rules rule. The fix is to only include the
global css-display-none rules in the global stylesheet until *either* an ignore-
previous-rules or ignore-following-rules rule is encountered.

Additionally, wrote a lot more tests for ignore-following-rules.

* Source/WebCore/contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::findFirstIgnoreRule const):
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
(WebCore::ContentExtensions::ContentExtension::findFirstIgnorePreviousRules 
const): Deleted.
* Source/WebCore/contentextensions/ContentExtension.h:
* Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F(ContentExtensionTest, IgnoreFollowingRules)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentRuleListNotification.mm:
(TEST(ContentRuleList, DisplayNoneAfterIgnoreFollowingRules)):

Canonical link: https://commits.webkit.org/296149@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