1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibWeb: Allow calculated values for background-size dimensions

This fixes the sizing of the arrow icons displayed to the left of
parent sections on a table of contents on Wikipedia articles, which
are sized using the equation `calc(max(0.75em, 12px))`. Now, the icon
will not expand past the edges of the box they are within, avoiding
clipping the edges of the arrows.
This commit is contained in:
Zaggy1024 2023-09-11 21:36:18 -05:00 committed by Andreas Kling
parent bdb311a434
commit 4cc3c41269
4 changed files with 31 additions and 0 deletions

View file

@ -3169,6 +3169,8 @@ RefPtr<StyleValue> Parser::parse_single_background_size_value(TokenStream<Compon
return LengthPercentage { style_value.as_percentage().percentage() };
if (style_value.is_length())
return LengthPercentage { style_value.as_length().length() };
if (style_value.is_calculated())
return LengthPercentage { style_value.as_calculated() };
return {};
};