Explorar o código

LibWeb: Add Formatter for ComponentValues

Sam Atkins %!s(int64=3) %!d(string=hai) anos
pai
achega
d2b8686ae4
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h

+ 8 - 0
Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h

@@ -44,3 +44,11 @@ private:
     Variant<Token, NonnullRefPtr<StyleFunctionRule>, NonnullRefPtr<StyleBlockRule>> m_value;
 };
 }
+
+template<>
+struct AK::Formatter<Web::CSS::Parser::ComponentValue> : Formatter<StringView> {
+    ErrorOr<void> format(FormatBuilder& builder, Web::CSS::Parser::ComponentValue const& component_value)
+    {
+        return Formatter<StringView>::format(builder, component_value.to_string());
+    }
+};