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:
parent
719f1db6c9
commit
42bfe5db5f
Notes:
sideshowbarker
2024-07-19 16:53:59 +09:00
Author: https://github.com/naktinis 🔰 Commit: https://github.com/SerenityOS/serenity/commit/42bfe5db5ff Pull-request: https://github.com/SerenityOS/serenity/pull/18826
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue