LibWeb: Store BackgroundSizeStyleValue sub-values directly

Storing these within LengthPercentage is unnecessary
This commit is contained in:
Callum Law 2025-10-02 16:50:43 +13:00 committed by Sam Atkins
commit 2ebf446cbf
Notes: github-actions[bot] 2025-10-07 09:51:23 +00:00
5 changed files with 21 additions and 52 deletions

View file

@ -1364,9 +1364,9 @@ static RefPtr<StyleValue const> interpolate_value_impl(DOM::Element& element, Ca
return AngleStyleValue::create(Angle::make_degrees(interpolated_value));
}
case StyleValue::Type::BackgroundSize: {
auto interpolated_x = interpolate_length_percentage_or_auto(calculation_context, from.as_background_size().size_x(), to.as_background_size().size_x(), delta);
auto interpolated_y = interpolate_length_percentage_or_auto(calculation_context, from.as_background_size().size_y(), to.as_background_size().size_y(), delta);
if (!interpolated_x.has_value() || !interpolated_y.has_value())
auto interpolated_x = interpolate_value(element, calculation_context, from.as_background_size().size_x(), to.as_background_size().size_x(), delta, allow_discrete);
auto interpolated_y = interpolate_value(element, calculation_context, from.as_background_size().size_y(), to.as_background_size().size_y(), delta, allow_discrete);
if (!interpolated_x || !interpolated_y)
return {};
return BackgroundSizeStyleValue::create(*interpolated_x, *interpolated_y);