Jelajahi Sumber

LibWeb: Make the base StyleValue::to_length() return an undefined length

Previously it was returning an "auto" length. This caused all the new
"initial" values to effectively turn into auto values long before layout
had a chance to resolve them.

This broke replaced elements with intrinsic size but no specified width
or height, and is the reason that Mr. ACID2 temporarily lost his eyes.
Andreas Kling 3 tahun lalu
induk
melakukan
1fa5fba432
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Userland/Libraries/LibWeb/CSS/StyleValue.h

+ 1 - 1
Userland/Libraries/LibWeb/CSS/StyleValue.h

@@ -276,7 +276,7 @@ public:
     }
 
     virtual String to_string() const = 0;
-    virtual Length to_length() const { return Length::make_auto(); }
+    virtual Length to_length() const { return {}; }
     virtual Color to_color(const DOM::Document&) const { return {}; }
 
     CSS::ValueID to_identifier() const;