Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d0f53b880e13dd2d3c97dd7b55450fc5abf6cdb5
      
https://github.com/WebKit/WebKit/commit/d0f53b880e13dd2d3c97dd7b55450fc5abf6cdb5
  Author: Antti Koivisto <[email protected]>
  Date:   2026-07-01 (Wed, 01 Jul 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/function-shadow-expected.txt
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/style/StyleScope.h
    M Source/WebCore/style/StyleSubstitutionContext.h
    M Source/WebCore/style/StyleSubstitutionResolver.cpp
    M Source/WebCore/style/StyleSubstitutionResolver.h
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  [css-mixins-1] Resolve names in @function in the scope where the function was 
defined
https://bugs.webkit.org/show_bug.cgi?id=318322
rdar://181107185

Reviewed by Alan Baradlay.

If a function is defined in a different scope than the caller the names in the 
function body
must be resolved in the definition scope.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-mixins/function-shadow-expected.txt:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
* Source/WebCore/style/StyleScope.h:
(WebCore::Style::resolveTreeScopedReference):
(WebCore::Style::Scope::resolveTreeScopedReference): Deleted.

Provide ScopedName resolved for the tested scope to the argument callable.
Also make standalone and use std::invocable concept for better error messages.

* Source/WebCore/style/StyleSubstitutionContext.h:
(WebCore::Style::add):

Include the function's scope in the substitution context so same-named 
functions in
different scopes are not treated as a cycle.

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

Initialize body and argument declarations with the function scope, and key the 
cycle guard
on the resolved function scope.

* Source/WebCore/style/StyleSubstitutionResolver.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::generatePositionOption):
* Source/WebCore/style/Styleable.cpp:
(WebCore::keyframesRuleExistsForAnimation):

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



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

Reply via email to