diff options
author | Rimvydas Naktinis <rimvydas@muse.ai> | 2023-05-14 10:42:13 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-14 13:02:32 +0200 |
commit | 42bfe5db5ffef76f0813b9846b6b180e4a84589f (patch) | |
tree | 58fe2bf992ea691412054477b54d39c7c234fcdc /Userland/Libraries/LibWeb | |
parent | 719f1db6c9a990f00a77fe143b63c63855dbf6d9 (diff) | |
download | serenity-42bfe5db5ffef76f0813b9846b6b180e4a84589f.zip |
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
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 695cae6b36..ad09ecc2eb 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -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(); |