diff --git a/Libraries/LibWeb/CSS/Parser/Token.h b/Libraries/LibWeb/CSS/Parser/Token.h index a01b5ae7034..de4c59ae39a 100644 --- a/Libraries/LibWeb/CSS/Parser/Token.h +++ b/Libraries/LibWeb/CSS/Parser/Token.h @@ -187,3 +187,11 @@ private: }; } + +template<> +struct AK::Formatter : Formatter { + ErrorOr format(FormatBuilder& builder, Web::CSS::Parser::Token const& token) + { + return Formatter::format(builder, token.to_string()); + } +}; diff --git a/Libraries/LibWeb/CSS/Parser/TokenStream.h b/Libraries/LibWeb/CSS/Parser/TokenStream.h index 6c99421f5b4..f76bc8c5889 100644 --- a/Libraries/LibWeb/CSS/Parser/TokenStream.h +++ b/Libraries/LibWeb/CSS/Parser/TokenStream.h @@ -189,6 +189,13 @@ public: } } + String dump_string() + { + // FIXME: The whitespace is only needed because we strip it when parsing property values. Remove it here once + // we stop doing that. + return MUST(String::join(" "sv, m_tokens)); + } + private: // https://drafts.csswg.org/css-syntax/#token-stream-tokens Span m_tokens;