LibWeb: Use a switch to handle TextTransform values

This makes it more obvious that we're missing some of these. (And makes
it easier to find this code when searching for a specific value.)
This commit is contained in:
Sam Atkins 2023-09-07 17:43:10 +01:00 committed by Sam Atkins
parent f7209fb9d4
commit ce775ea701
Notes: sideshowbarker 2024-07-17 01:55:29 +09:00

View file

@ -34,11 +34,19 @@ static bool is_all_whitespace(StringView string)
static ErrorOr<DeprecatedString> apply_text_transform(DeprecatedString const& string, CSS::TextTransform text_transform) static ErrorOr<DeprecatedString> apply_text_transform(DeprecatedString const& string, CSS::TextTransform text_transform)
{ {
if (text_transform == CSS::TextTransform::Uppercase) switch (text_transform) {
case CSS::TextTransform::Uppercase:
return Unicode::to_unicode_uppercase_full(string); return Unicode::to_unicode_uppercase_full(string);
if (text_transform == CSS::TextTransform::Lowercase) case CSS::TextTransform::Lowercase:
return Unicode::to_unicode_lowercase_full(string); return Unicode::to_unicode_lowercase_full(string);
return string; case CSS::TextTransform::None:
return string;
case CSS::TextTransform::Capitalize:
case CSS::TextTransform::FullSizeKana:
case CSS::TextTransform::FullWidth:
// FIXME: Implement these!
return string;
}
} }
void TextNode::invalidate_text_for_rendering() void TextNode::invalidate_text_for_rendering()