Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cf3fc160de0cc6098114087d485b0f989123108d
      
https://github.com/WebKit/WebKit/commit/cf3fc160de0cc6098114087d485b0f989123108d
  Author: Brian Weinstein <[email protected]>
  Date:   2025-06-18 (Wed, 18 Jun 2025)

  Changed paths:
    M Source/WebCore/contentextensions/ContentExtensionCompiler.cpp
    M Source/WebCore/contentextensions/ContentExtensionParser.cpp
    M Source/WebCore/contentextensions/ContentExtensionParser.h
    M Source/WebKit/UIProcess/API/APIContentRuleList.cpp
    M Source/WebKit/UIProcess/API/APIContentRuleList.h
    M Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp
    M Source/WebKit/UIProcess/API/APIContentRuleListStore.h
    M Source/WebKit/UIProcess/API/Cocoa/WKContentRuleList.mm
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

  Log Message:
  -----------
  DNR: Parsing of translated content blocker rules should be done off the main 
thread
https://bugs.webkit.org/show_bug.cgi?id=294679
rdar://153200218

Reviewed by Alex Christensen.

The only part that isn't thread safe about parsing of the content blocker rules 
is parsing the CSS
selectors used in display-none rules. However, these will currently never be 
present in translated rules from
DNR. If we add support for turning DNR rules into content blocker CSS 
display-none rules, we will need
to revisit this. This PR adds a variable indicating whether or not CSS 
selectors will be expected in parsing
all the way down the stack. If a CSS selector is seen when it isn't expected, 
an assert will be hit and
the rule will be ignored.

A better fix here would be to make the CSS parsing thread safe, and that is 
tracked by:
rdar://153748194 (CSS selector validation in content blocker rule list parsing 
should be thread safe)

* Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp:
(API::ContentRuleListStore::compileContentRuleList):
(API::ContentRuleListStore::compileContentRuleListFile):
* Source/WebKit/UIProcess/API/APIContentRuleListStore.h:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::WebExtensionContext::compileDeclarativeNetRequestRules):

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