diff --git a/AK/StringConversions.cpp b/AK/StringConversions.cpp index c9dfeaa214c..1a127ec8961 100644 --- a/AK/StringConversions.cpp +++ b/AK/StringConversions.cpp @@ -71,7 +71,7 @@ Optional> parse_first_number(Utf16View const& string, if (string.has_ascii_storage()) return parse_first_number(string.bytes(), trim_whitespace, base); - auto trimmed_string = trim_whitespace == TrimWhitespace::Yes ? string.trim_whitespace() : string; + auto trimmed_string = trim_whitespace == TrimWhitespace::Yes ? string.trim_ascii_whitespace() : string; return from_chars(trimmed_string.utf16_span().data(), trimmed_string.length_in_code_units(), base); } @@ -107,7 +107,7 @@ Optional parse_number(Utf16View const& string, TrimWhitespace trim_whitespace if (string.has_ascii_storage()) return parse_number(string.bytes(), trim_whitespace, base); - auto trimmed_string = trim_whitespace == TrimWhitespace::Yes ? string.trim_whitespace() : string; + auto trimmed_string = trim_whitespace == TrimWhitespace::Yes ? string.trim_ascii_whitespace() : string; auto result = parse_first_number(trimmed_string, TrimWhitespace::No, base); if (!result.has_value()) diff --git a/AK/Utf16View.h b/AK/Utf16View.h index 7aa17d1c8c7..22d9c0a0dea 100644 --- a/AK/Utf16View.h +++ b/AK/Utf16View.h @@ -381,7 +381,7 @@ public: return substring_view(substring_start, substring_length); } - [[nodiscard]] constexpr Utf16View trim_whitespace(TrimMode mode = TrimMode::Both) const + [[nodiscard]] constexpr Utf16View trim_ascii_whitespace(TrimMode mode = TrimMode::Both) const { static constexpr Utf16View white_space { u" \n\t\v\f\r", 6uz }; return trim(white_space, mode); diff --git a/Libraries/LibWeb/Editing/Commands.cpp b/Libraries/LibWeb/Editing/Commands.cpp index 999bdede767..da51abe991b 100644 --- a/Libraries/LibWeb/Editing/Commands.cpp +++ b/Libraries/LibWeb/Editing/Commands.cpp @@ -512,7 +512,7 @@ enum class FontSizeMode : u8 { bool command_font_size_action(DOM::Document& document, Utf16View const& value) { // 1. Strip leading and trailing whitespace from value. - auto resulting_value = value.trim_whitespace(); + auto resulting_value = value.trim_ascii_whitespace(); // 2. If value is not a valid floating point number, and would not be a valid floating point number if a single // leading "+" character were stripped, return false.