mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 11:06:10 +00:00
LibWeb: Add formatter for Web::CSS::CSSStyleValue::Type
Currently unused but I found it useful for debugging
This commit is contained in:
parent
56b6987fd0
commit
9bfd46ce31
Notes:
github-actions[bot]
2025-08-08 08:46:35 +00:00
Author: https://github.com/Calme1709
Commit: 9bfd46ce31
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5773
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/tcl3
1 changed files with 20 additions and 0 deletions
|
@ -246,3 +246,23 @@ struct AK::Formatter<Web::CSS::CSSStyleValue> : Formatter<StringView> {
|
|||
return Formatter<StringView>::format(builder, style_value.to_string(Web::CSS::SerializationMode::Normal));
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct AK::Formatter<Web::CSS::CSSStyleValue::Type> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::CSSStyleValue::Type type)
|
||||
{
|
||||
StringView type_name;
|
||||
switch (type) {
|
||||
#define __ENUMERATE_CSS_STYLE_VALUE_TYPE(title_case, snake_case, style_value_class_name) \
|
||||
case Web::CSS::CSSStyleValue::Type::title_case: \
|
||||
type_name = #title_case##sv; \
|
||||
break;
|
||||
ENUMERATE_CSS_STYLE_VALUE_TYPES
|
||||
#undef __ENUMERATE_CSS_STYLE_VALUE_TYPE
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
return Formatter<StringView>::format(builder, type_name);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue