1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:07:36 +00:00

LibWeb: Move easing parsing code out into a dedicated function

This will be used outside of StyleComputer
This commit is contained in:
Matthew Olsson 2024-02-19 19:08:55 -07:00 committed by Andreas Kling
parent c8b9c137a1
commit b33bb0997a
3 changed files with 85 additions and 81 deletions

View file

@ -10,6 +10,10 @@
#include <AK/Function.h>
#include <AK/Vector.h>
namespace Web::CSS {
class EasingStyleValue;
}
namespace Web::Animations {
// https://www.w3.org/TR/css-easing-1/#the-linear-easing-function
@ -45,6 +49,8 @@ struct StepsTimingFunction {
};
struct TimingFunction {
static TimingFunction from_easing_style_value(CSS::EasingStyleValue const&);
Variant<LinearTimingFunction, CubicBezierTimingFunction, StepsTimingFunction> function;
double operator()(double input_progress, bool before_flag) const;