From af1f0c673e10debda88f6270e44285de5684bd47 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Fri, 23 Feb 2024 14:16:46 -0700 Subject: [PATCH] LibWeb: Remove old animation-direction handling from StyleComputer This is now handled by Web Animations, so if the animation was ever running backwards, this logic would re-reverse it so that it played forwards again. --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 7670653cde..a40228b8c4 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -862,10 +862,9 @@ ErrorOr StyleComputer::collect_animation_into(JS::NonnullGCPtrkey_frame_set()->keyframes_by_key; - auto is_backwards = effect->current_direction() == Animations::AnimationDirection::Backwards; auto key = static_cast(output_progress.value() * 100.0 * Animations::KeyframeEffect::AnimationKeyFrameKeyScaleFactor); - auto matching_keyframe_it = is_backwards ? keyframes.find_smallest_not_below_iterator(key) : keyframes.find_largest_not_above_iterator(key); + auto matching_keyframe_it = keyframes.find_largest_not_above_iterator(key); if (matching_keyframe_it.is_end()) { if constexpr (LIBWEB_CSS_ANIMATION_DEBUG) { dbgln(" Did not find any start keyframe for the current state ({}) :(", key); @@ -880,7 +879,7 @@ ErrorOr StyleComputer::collect_animation_into(JS::NonnullGCPtr StyleComputer::collect_animation_into(JS::NonnullGCPtr(keyframe_start - key) / static_cast(keyframe_start - keyframe_end) - : static_cast(key - keyframe_start) / static_cast(keyframe_end - keyframe_start); + return 0.f; + return static_cast(key - keyframe_start) / static_cast(keyframe_end - keyframe_start); }(); if constexpr (LIBWEB_CSS_ANIMATION_DEBUG) {