Browse Source

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 tháng trước cách đây
mục cha
commit
cef1cb6aa7
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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;
 };