Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a30d9c11bed7b232815b694f5a1867c97abcc9b8
      
https://github.com/WebKit/WebKit/commit/a30d9c11bed7b232815b694f5a1867c97abcc9b8
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-cascade/highlight-cascade-007-expected.txt
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/style/PropertyAllowlist.cpp
    M Source/WebCore/style/PropertyAllowlist.h
    M Source/WebCore/style/PropertyCascade.cpp
    M Source/WebCore/style/RuleData.cpp
    M Source/WebCore/style/RuleData.h

  Log Message:
  -----------
  Disallow vendor-prefixed and allow other properties in highlight 
pseudo-elements
https://bugs.webkit.org/show_bug.cgi?id=312085
rdar://174590593

Reviewed by Antti Koivisto.

The CSS Pseudo 4 spec [1] states that vendor-prefixed properties such as
-webkit-text-fill-color are not applicable to highlight pseudo-elements.

This adds a PropertyAllowlist for highlight pseudos (::selection,
::highlight(), ::spelling-error, ::grammar-error, ::target-text) with
the spec-defined set of applicable properties: color, background-color,
text-decoration and sub-properties, text-shadow, stroke-color,
stroke-width, and custom properties.

Also consolidates propertyAllowlistForPseudoElement() and
determinePropertyAllowlist() to use switch statements instead of
repeated if-chains.

[1] https://drafts.csswg.org/css-pseudo-4/#highlight-styling

* LayoutTests/TestExpectations: Progressions
* LayoutTests/platform/ios/TestExpectations: Skip Test on iOS
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/highlight-cascade/highlight-cascade-007-expected.txt:
 Ditto
* Source/WebCore/style/PropertyAllowlist.cpp:
(WebCore::Style::propertyAllowlistForPseudoElement):
(WebCore::Style::isValidHighlightStyleProperty):
* Source/WebCore/style/PropertyAllowlist.h:
* Source/WebCore/style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::addMatch):
* Source/WebCore/style/RuleData.cpp:
(WebCore::Style::determinePropertyAllowlist):
* Source/WebCore/style/RuleData.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to