LibWeb: Implement linear easing according to latest spec

This commit is contained in:
Gingeh 2024-11-03 14:56:16 +11:00 committed by Sam Atkins
parent 3f79d93bd3
commit c67ecf37f7
Notes: github-actions[bot] 2024-11-05 10:42:28 +00:00
9 changed files with 513 additions and 49 deletions

View file

@ -994,6 +994,8 @@ void StyleComputer::collect_animation_into(DOM::Element& element, Optional<CSS::
auto& keyframes = effect->key_frame_set()->keyframes_by_key;
// FIXME: Support progress values outside [0-1]
output_progress = clamp(output_progress.value(), 0, 1);
auto key = static_cast<u64>(output_progress.value() * 100.0 * Animations::KeyframeEffect::AnimationKeyFrameKeyScaleFactor);
auto matching_keyframe_it = keyframes.find_largest_not_above_iterator(key);
if (matching_keyframe_it.is_end()) {