1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibWeb: Fix string whitespace splitting mistake

`.split_view(Infra::ASCII_WHITESPACE)` tries to split the string view on
the string "\t\n\f\r " (not any of the individual characters of that
string).

The correct way to split this string views here is
`.split_view_if(Infra::is_ascii_whitespace)`, this is a little
inconsistent with String, so probably should be addressed.
This commit is contained in:
MacDue 2022-10-02 22:30:35 +01:00 committed by Linus Groh
parent 6bb3d4694f
commit 7c8ce42593
2 changed files with 2 additions and 2 deletions

View file

@ -76,7 +76,7 @@ void DOMTokenList::associated_attribute_changed(StringView value)
if (value.is_empty())
return;
auto split_values = value.split_view(Infra::ASCII_WHITESPACE);
auto split_values = value.split_view_if(Infra::is_ascii_whitespace);
for (auto const& split_value : split_values)
append_to_ordered_set(m_token_set, split_value);
}