浏览代码

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;
 };