1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

LibWeb: Replace incorrect uses of split_view() for whitespace splitting

This commit is contained in:
Linus Groh 2022-10-01 18:29:18 +01:00 committed by Andreas Kling
parent b9220a18d1
commit b86c264975
3 changed files with 6 additions and 5 deletions

View file

@ -5,7 +5,6 @@
*/
#include <AK/AnyOf.h>
#include <AK/CharacterTypes.h>
#include <AK/Debug.h>
#include <AK/StringBuilder.h>
#include <LibWeb/CSS/Parser/Parser.h>
@ -34,6 +33,7 @@
#include <LibWeb/HTML/HTMLSelectElement.h>
#include <LibWeb/HTML/HTMLTextAreaElement.h>
#include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/Infra/CharacterTypes.h>
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/InlineNode.h>
@ -328,7 +328,7 @@ CSS::CSSStyleDeclaration const* Element::inline_style() const
void Element::parse_attribute(FlyString const& name, String const& value)
{
if (name == HTML::AttributeNames::class_) {
auto new_classes = value.split_view(is_ascii_space);
auto new_classes = value.split_view(Infra::is_ascii_whitespace);
m_classes.clear();
m_classes.ensure_capacity(new_classes.size());
for (auto& new_class : new_classes) {
@ -518,7 +518,7 @@ bool Element::is_active() const
JS::NonnullGCPtr<HTMLCollection> Element::get_elements_by_class_name(FlyString const& class_names)
{
Vector<FlyString> list_of_class_names;
for (auto& name : class_names.view().split_view(' ')) {
for (auto& name : class_names.view().split_view(Infra::ASCII_WHITESPACE)) {
list_of_class_names.append(name);
}
return HTMLCollection::create(*this, [list_of_class_names = move(list_of_class_names), quirks_mode = document().in_quirks_mode()](Element const& element) {