[webkit-changes] [WebKit/WebKit] 355ce0: Safari Content Blocker doesn't support :has() sele...

Brian Weinstein noreply at github.com
Wed Jan 18 23:47:50 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 355ce06ba535bdf2ce87a0f130d67ff866930649
      https://github.com/WebKit/WebKit/commit/355ce06ba535bdf2ce87a0f130d67ff866930649
  Author: Brian Weinstein <bweinstein at apple.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M LayoutTests/http/tests/contentextensions/css-display-none.html
    M LayoutTests/http/tests/contentextensions/css-display-none.html.json
    M Source/WebCore/contentextensions/ContentExtension.cpp
    M Source/WebCore/contentextensions/ContentExtensionParser.cpp
    M Source/WebCore/contentextensions/ContentExtensionParser.h
    M Source/WebCore/contentextensions/ContentExtensionStyleSheet.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

  Log Message:
  -----------
  Safari Content Blocker doesn't support :has() selector
https://bugs.webkit.org/show_bug.cgi?id=250609
rdar://103976010

Reviewed by Antti Koivisto and Alex Christensen.

When creating the CSSParsers for content blocker parsing and compilation, make sure to opt
into hasPseudoClassEnabled so selectors like :has work. The places this was needed were:
- ContentExtensionParser (for parsing the rules)
- ContentExtension (for the global display none rules)
- ContentExtensionStyleSheet (for the other display none rules)

Also update the contentextensions css-display-none test to test this functionality.

* Source/WebCore/contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
* Source/WebCore/contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidCSSSelector):

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




More information about the webkit-changes mailing list