mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
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:
parent
f7209fb9d4
commit
ce775ea701
Notes:
sideshowbarker
2024-07-17 01:55:29 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/ce775ea701 Pull-request: https://github.com/SerenityOS/serenity/pull/20985
1 changed files with 11 additions and 3 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue