Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5767bc45a2caf7fc69e2619b4afc183ea9f213bb
      
https://github.com/WebKit/WebKit/commit/5767bc45a2caf7fc69e2619b4afc183ea9f213bb
  Author: Antti Koivisto <[email protected]>
  Date:   2026-04-12 (Sun, 12 Apr 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/dashed-function-cycles-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/dashed-function-eval-expected.txt
    M Source/WebCore/SaferCPPExpectations/ForwardDeclCheckerExpectations
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/CSSRegisteredCustomProperty.h
    M Source/WebCore/style/CustomFunctionRegistry.cpp
    M Source/WebCore/style/CustomFunctionRegistry.h
    M Source/WebCore/style/MatchResult.h
    M Source/WebCore/style/PropertyCascade.h
    M Source/WebCore/style/StyleBuilder.cpp
    M Source/WebCore/style/StyleBuilder.h
    M Source/WebCore/style/StyleBuilderState.cpp
    M Source/WebCore/style/StyleBuilderState.h
    M Source/WebCore/style/StyleCustomPropertyRegistry.cpp
    M Source/WebCore/style/StyleCustomPropertyRegistry.h
    A Source/WebCore/style/StyleLocalPropertyRegistry.cpp
    A Source/WebCore/style/StyleLocalPropertyRegistry.h
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.h
    M Source/WebCore/style/values/counter-styles/StyleCounterStyle.cpp
    M Source/WebCore/style/values/grid/StyleGridPosition.cpp

  Log Message:
  -----------
  [css-mixins-1] Register function parameter and return value types
https://bugs.webkit.org/show_bug.cgi?id=311798
rdar://174384426

Reviewed by Sam Weinig.

Registered <syntax> support for parameters and return values.

https://drafts.csswg.org/css-mixins/#evaluating-custom-functions

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/dashed-function-cycles-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/dashed-function-eval-expected.txt:
* Source/WebCore/style/CustomFunctionRegistry.cpp:
(WebCore::Style::CustomFunction::CustomFunction):
(WebCore::Style::CustomFunctionRegistry::registerFunction):

Add support for return value syntax.

* Source/WebCore/style/CustomFunctionRegistry.h:
* Source/WebCore/style/MatchResult.h:
(WebCore::Style::MatchResult::copyDeclarationsFrom):
* Source/WebCore/style/PropertyCascade.h:
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyCustomPropertyImpl):
(WebCore::Style::Builder::applyCustomProperty):
(WebCore::Style::Builder::resolveCustomPropertyForContainerQueries):
(WebCore::Style::Builder::resolveCustomPropertyValue):

Support using CustomPropertyRegistry other than the global one.

* Source/WebCore/style/StyleBuilder.h:
(WebCore::Style::Builder::matchResult const):
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::registeredProperty const):

Use local registry if it is provided.

* Source/WebCore/style/StyleBuilderState.h:
* Source/WebCore/style/StyleCustomPropertyRegistry.cpp:
(WebCore::Style::CustomPropertyRegistry::CustomPropertyRegistry):

Allow standalone CustomPropertyRegistry.

(WebCore::Style::CustomPropertyRegistry::registerForFunction):

For registering function parameter and return types.

(WebCore::Style::CustomPropertyRegistry::registerFromAPI):
(WebCore::Style::CustomPropertyRegistry::registerFromStylesheet):
(WebCore::Style::CustomPropertyRegistry::invalidate):
(WebCore::Style::CustomPropertyRegistry::notifyAnimationsOfCustomPropertyRegistration):
* Source/WebCore/style/StyleLocalPropertyRegistry.cpp: Added.
(WebCore::Style::LocalPropertyRegistry::get const):
(WebCore::Style::LocalPropertyRegistry::isInherited const):
(WebCore::Style::LocalPropertyRegistry::add):
* Source/WebCore/style/StyleLocalPropertyRegistry.h: Added.

Add a registry for local properties.

* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteVariableFallback):
(WebCore::Style::SubstitutionResolver::resolveAndRegisterDashedFunctionArguments):

Factor argument resolution and registration into a function.

(WebCore::Style::SubstitutionResolver::substituteDashedFunction):

Implement the two-phased resolution per spec. The resolved arguments are become 
initial values
of registered custom properties for the result descriptor evaluation.

The return value is also checked against the result syntex.

(WebCore::Style::SubstitutionResolver::substituteAttrFunction):

* Source/WebCore/style/StyleSubstitutionResolver.h:

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



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

Reply via email to