Browse Source

LibWeb: Make 'auto' LengthStyleValues return 'auto' identifier

I think I broke this in my previous StyleValue clean-up. This prevented
properties like `foo: auto;` from parsing, if they did not accept
Lengths.
Sam Atkins 3 years ago
parent
commit
fd8c94c094
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Userland/Libraries/LibWeb/CSS/StyleValue.h

+ 2 - 0
Userland/Libraries/LibWeb/CSS/StyleValue.h

@@ -955,8 +955,10 @@ public:
 
     virtual bool has_auto() const override { return m_length.is_auto(); }
     virtual bool has_length() const override { return true; }
+    virtual bool has_identifier() const override { return has_auto(); }
     virtual String to_string() const override { return m_length.to_string(); }
     virtual Length to_length() const override { return m_length; }
+    virtual ValueID to_identifier() const override { return has_auto() ? ValueID::Auto : ValueID::Invalid; }
 
     virtual bool equals(StyleValue const& other) const override
     {