LibWeb/CSS: Resolve var() in keyframe animation-timing-function

When a `@keyframes` rule contains `animation-timing-function` with a
`var()`, we cannot eagerly resolve it to an `EasingFunction` at rule
cache build time because there is no element context available. We now
store the unresolved `StyleValue` and defer resolution to
`collect_animation_into()`, where the animated element's custom
properties can be used to substitute the variable. Previously, an
`animation-timing-function` with a `var()` in a `@keyframe` would cause
a crash.
This commit is contained in:
Tim Ledbetter
2026-03-30 08:34:55 +01:00
committed by Sam Atkins
parent 700026637d
commit af6bc07c4f
Notes: github-actions[bot] 2026-04-01 10:40:01 +00:00
6 changed files with 125 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ public:
// before they are applied to an element
HashMap<CSS::PropertyID, Variant<UseInitial, NonnullRefPtr<CSS::StyleValue const>>> properties {};
Bindings::CompositeOperationOrAuto composite { Bindings::CompositeOperationOrAuto::Auto };
Optional<CSS::EasingFunction> easing {};
Variant<Empty, CSS::EasingFunction, NonnullRefPtr<CSS::StyleValue const>> easing {};
};
RedBlackTree<u64, ResolvedKeyFrame> keyframes_by_key;
};