Meta: Add formatter to PropertyID code generator

This commit is contained in:
Tim Ledbetter 2025-07-03 20:49:26 +01:00 committed by Sam Atkins
commit cb4a5eca2e
Notes: github-actions[bot] 2025-07-03 20:18:25 +00:00

View file

@ -322,6 +322,14 @@ template<>
struct Traits<Web::CSS::PropertyID> : public DefaultTraits<Web::CSS::PropertyID> { struct Traits<Web::CSS::PropertyID> : public DefaultTraits<Web::CSS::PropertyID> {
static unsigned hash(Web::CSS::PropertyID property_id) { return int_hash((unsigned)property_id); } static unsigned hash(Web::CSS::PropertyID property_id) { return int_hash((unsigned)property_id); }
}; };
template<>
struct Formatter<Web::CSS::PropertyID> : Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::PropertyID const& property_id)
{
return Formatter<StringView>::format(builder, Web::CSS::string_from_property_id(property_id));
}
};
} // namespace AK } // namespace AK
)~~~"); )~~~");