Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 97e17db91411c05c25be1c624107db47e1f39010
https://github.com/WebKit/WebKit/commit/97e17db91411c05c25be1c624107db47e1f39010
Author: Antti Koivisto <[email protected]>
Date: 2026-06-29 (Mon, 29 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/StyleBuilderState.h
M Source/WebCore/style/StyleSubstitutionResolver.cpp
M Source/WebCore/style/StyleSubstitutionResolver.h
Log Message:
-----------
[css-mixins-1] Function body should inherit computed custom property values
from the calling context
https://bugs.webkit.org/show_bug.cgi?id=318117
rdar://180942670
Reviewed by Alan Baradlay.
https://drafts.csswg.org/css-mixins-1/#evaluating-custom-functions
"The hypothetical element `inherits` the values of all custom properties as if
it were
a child of its calling context, with its function parameters overriding
`inherited`
custom properties of the same name."
The function body's builder keeps a pointer to the calling context's builder
and resolves
inherited custom properties against it lazily, only when the body references
them, so no
snapshot of the calling style is needed. Also handles CSS-wide keyword
arguments/defaults
and results, and propagates attr()-taint through function results.
*
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::applyCustomProperty):
Resolve an inherited custom property (var() or the inherit keyword) on the
calling
context's builder on demand.
(WebCore::Style::Builder::applyCustomPropertyImpl):
(WebCore::Style::Builder::resolveFunctionResult):
Return the resolved value or, per spec, an unresolved CSS-wide keyword.
(WebCore::Style::Builder::resolveCustomPropertyValue):
* Source/WebCore/style/StyleBuilder.h:
* Source/WebCore/style/StyleBuilderState.h:
(WebCore::Style::BuilderState::callingContextBuilder const):
The calling context's builder while resolving a function's hypothetical element.
* Source/WebCore/style/StyleSubstitutionResolver.cpp:
(WebCore::Style::SubstitutionResolver::resolveAndRegisterDashedFunctionArguments):
Construct a bare CSS-wide keyword argument/default as a keyword so it resolves
against
the calling context.
(WebCore::Style::SubstitutionResolver::substituteDashedFunction):
Emit a CSS-wide keyword result as the keyword token for an untyped function
(invalid
for a typed return type), and propagate attr()-taint from the result.
* Source/WebCore/style/StyleSubstitutionResolver.h:
Canonical link: https://commits.webkit.org/316066@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications