Преглед изворни кода

LibWeb/CSS: Add Parser::Dimension::to_string()

This will be used when printing out unsupported dimensions inside calc,
for a more useful error message.
Sam Atkins пре 7 месеци
родитељ
комит
cef1cb6aa7
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      Libraries/LibWeb/CSS/Parser/Dimension.h

+ 5 - 0
Libraries/LibWeb/CSS/Parser/Dimension.h

@@ -107,6 +107,11 @@ public:
         return percentage();
     }
 
+    String to_string() const
+    {
+        return m_value.visit([](auto const& it) { return it.to_string(); });
+    }
+
 private:
     Variant<Angle, Flex, Frequency, Length, Percentage, Resolution, Time> m_value;
 };