mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
LibWeb: Properly handle auto
when parsing background-size
This code assumed that `auto` was always stored as a LengthStyleValue, which will not be true in the next commit. (And was not a safe assumption to make anyway.)
This commit is contained in:
parent
8c03d21e95
commit
22cb74d9ff
1 changed files with 2 additions and 0 deletions
|
@ -4579,6 +4579,8 @@ RefPtr<StyleValue> Parser::parse_single_background_size_value(TokenStream<Compon
|
|||
auto transaction = tokens.begin_transaction();
|
||||
|
||||
auto get_length_percentage = [](StyleValue& style_value) -> Optional<LengthPercentage> {
|
||||
if (style_value.has_auto())
|
||||
return LengthPercentage { Length::make_auto() };
|
||||
if (style_value.is_percentage())
|
||||
return LengthPercentage { style_value.as_percentage().percentage() };
|
||||
if (style_value.has_length())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue