Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6c94926886b44e8b5d50d95ba23c2cce00a32c16
      
https://github.com/WebKit/WebKit/commit/6c94926886b44e8b5d50d95ba23c2cce00a32c16
  Author: Antti Koivisto <[email protected]>
  Date:   2026-06-30 (Tue, 30 Jun 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 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/function-attr-expected.txt
    M Source/WebCore/style/StyleBuilder.cpp
    M Source/WebCore/style/StyleBuilder.h
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.h

  Log Message:
  -----------
  [css-mixins-1] Implement argument parsing in terms of first-valid()
https://bugs.webkit.org/show_bug.cgi?id=318212
rdar://181014309

Reviewed by Alan Baradlay and Sam Weinig.

https://drafts.csswg.org/css-mixins-1/#evaluate-a-custom-function

    3. Add a custom property to argument rule with a name of the parameter’s 
name, and a value
       of first-valid(arg value, default value).

This patch implements first-valid() internally for @function use but does not 
yet expose
it externally.

* 
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:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/function-attr-expected.txt:

* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyCustomPropertyFromCallingContext):

A parameter shadows inherited custom properties; other properties are inherited 
lazily from
the calling context.

(WebCore::Style::Builder::applyCustomPropertyImpl):

In a function context an invalid value resolves to guaranteed-invalid, not 
unset.

(WebCore::Style::Builder::resolveCustomPropertyValue):

Pass the registration so first-valid() can validate candidates against the 
target syntax.

* Source/WebCore/style/StyleBuilder.h:
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::substituteFirstValid):

Substitute to the first candidate valid for the target syntax, else 
guaranteed-invalid.

(WebCore::Style::SubstitutionResolver::resolveAndRegisterDashedFunctionArguments):

Build each parameter value as first-valid(arg, default). A missing positional 
argument for a
parameter without a default makes the invocation guaranteed-invalid.

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

Leave a failed argument substitution guaranteed-invalid rather than aborting 
the function.

* Source/WebCore/style/StyleSubstitutionResolver.h:

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



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

Reply via email to