Explorar o código

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
Rimvydas Naktinis %!s(int64=2) %!d(string=hai) anos
pai
achega
42bfe5db5f
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp

+ 2 - 1
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();