mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
committed by
Sam Atkins
parent
700026637d
commit
af6bc07c4f
Notes:
github-actions[bot]
2026-04-01 10:40:01 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/af6bc07c4f1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8677 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user