LibWeb: Prefer using equals_ignoring_ascii_case

Which has an optmization if both size of the string being passed
through are FlyStrings, which actually ends up being the case
in some places during selector matching comparing attribute names.
Instead of maintaining more overloads of
Infra::is_ascii_case_insensitive_match, switch
everything over to equals_ignoring_ascii_case instead.
This commit is contained in:
Shannon Booth 2025-05-18 15:04:56 +12:00 committed by Sam Atkins
parent cfc241f61d
commit 579730d861
Notes: github-actions[bot] 2025-05-21 12:46:04 +00:00
24 changed files with 78 additions and 87 deletions

View file

@ -601,7 +601,7 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::send(Optional<DocumentOrXMLHttpRequest
// 2. If contentTypeRecord is not failure, contentTypeRecords parameters["charset"] exists, and parameters["charset"] is not an ASCII case-insensitive match for "UTF-8", then:
if (content_type_record.has_value()) {
auto charset_parameter_iterator = content_type_record->parameters().find("charset"sv);
if (charset_parameter_iterator != content_type_record->parameters().end() && !Infra::is_ascii_case_insensitive_match(charset_parameter_iterator->value, "UTF-8"sv)) {
if (charset_parameter_iterator != content_type_record->parameters().end() && !charset_parameter_iterator->value.equals_ignoring_ascii_case("UTF-8"sv)) {
// 1. Set contentTypeRecords parameters["charset"] to "UTF-8".
content_type_record->set_parameter("charset"_string, "UTF-8"_string);