mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
AK+LibWeb: Add {Fly,}String::to_ascii_{upper,lower}_case()
These don't have to worry about the input not being valid UTF-8 and
so can be infallible (and can even return self if no changes needed.)
We use this instead of Infra::to_ascii_{upper,lower}_case in LibWeb.
This commit is contained in:
committed by
Andreas Kling
parent
dd419b5a8d
commit
073bcfd386
@@ -1506,7 +1506,7 @@ String HTMLInputElement::value_sanitization_algorithm(String const& value) const
|
||||
// https://html.spec.whatwg.org/multipage/input.html#color-state-(type=color):value-sanitization-algorithm
|
||||
// If the value of the element is a valid simple color, then set it to the value of the element converted to ASCII lowercase;
|
||||
if (is_valid_simple_color(value))
|
||||
return MUST(Infra::to_ascii_lowercase(value));
|
||||
return value.to_ascii_lowercase();
|
||||
// otherwise, set it to the string "#000000".
|
||||
return "#000000"_string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user