LibWeb/CSS: Extract interpolation code into its own files

Apart from shrinking StyleComputer a little, we need the ability to get
the current value of a transition from outside of it.
This commit is contained in:
Sam Atkins 2024-09-19 12:58:38 +01:00 committed by Andreas Kling
commit 70d99db992
Notes: github-actions[bot] 2024-09-22 04:43:09 +00:00
4 changed files with 625 additions and 571 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/CSSStyleValue.h>
#include <LibWeb/Forward.h>
namespace Web::CSS {
ValueComparingRefPtr<CSSStyleValue const> interpolate_property(DOM::Element&, PropertyID, CSSStyleValue const& from, CSSStyleValue const& to, float delta);
NonnullRefPtr<CSSStyleValue const> interpolate_value(DOM::Element&, CSSStyleValue const& from, CSSStyleValue const& to, float delta);
NonnullRefPtr<CSSStyleValue const> interpolate_box_shadow(DOM::Element&, CSSStyleValue const& from, CSSStyleValue const& to, float delta);
RefPtr<CSSStyleValue const> interpolate_transform(DOM::Element&, CSSStyleValue const& from, CSSStyleValue const& to, float delta);
Color interpolate_color(Color from, Color to, float delta);
}