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

LibWeb: Change implicit background-size height to auto

The spec says: "The first value gives the width of the corresponding
image, the second value its height. If only one value is given the
second is assumed to be auto."

Fixes #18782
This commit is contained in:
Rimvydas Naktinis 2023-05-14 10:42:13 +01:00 committed by Andreas Kling
parent 719f1db6c9
commit 42bfe5db5f

View file

@ -4606,12 +4606,13 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_size_value(TokenStre
auto maybe_y_value = TRY(parse_css_value(tokens.peek_token()));
if (!maybe_y_value || !property_accepts_value(PropertyID::BackgroundSize, *maybe_y_value)) {
auto y_value = LengthPercentage { Length::make_auto() };
auto x_size = get_length_percentage(*x_value);
if (!x_size.has_value())
return nullptr;
transaction.commit();
return BackgroundSizeStyleValue::create(x_size.value(), x_size.value());
return BackgroundSizeStyleValue::create(x_size.value(), y_value);
}
tokens.next_token();