LibWeb: Replace incorrect uses of String::trim_whitespace()

This commit is contained in:
Linus Groh 2022-10-01 18:25:29 +01:00 committed by Andreas Kling
parent fb21271334
commit b9220a18d1
Notes: sideshowbarker 2024-07-19 01:59:31 +09:00
4 changed files with 10 additions and 5 deletions

View file

@ -13,6 +13,7 @@
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/Infra/CharacterTypes.h>
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/CheckBox.h>
@ -300,7 +301,7 @@ String HTMLInputElement::value_sanitization_algorithm(String value) const
if (!(c == '\r' || c == '\n'))
builder.append(c);
}
return builder.to_string().trim_whitespace();
return builder.string_view().trim(Infra::ASCII_WHITESPACE);
}
} else if (type_state() == HTMLInputElement::TypeAttributeState::Number) {
// If the value of the element is not a valid floating-point number, then set it to the empty string instead.