mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
LibWeb: Store BackgroundSizeStyleValue
sub-values directly
Storing these within LengthPercentage is unnecessary
This commit is contained in:
parent
309ff33278
commit
2ebf446cbf
Notes:
github-actions[bot]
2025-10-07 09:51:23 +00:00
Author: https://github.com/Calme1709
Commit: 2ebf446cbf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6375
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 21 additions and 52 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue