mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 17:11:51 +00:00
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:
parent
cfc241f61d
commit
579730d861
Notes:
github-actions[bot]
2025-05-21 12:46:04 +00:00
Author: https://github.com/shannonbooth
Commit: 579730d861
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4799
Reviewed-by: https://github.com/AtkinsSJ ✅
24 changed files with 78 additions and 87 deletions
|
@ -176,7 +176,7 @@ WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(J
|
|||
}
|
||||
}
|
||||
// 9. Otherwise, if the field element is an input element whose type attribute is in the Hidden state and name is an ASCII case-insensitive match for "_charset_":
|
||||
else if (auto* hidden_input = dynamic_cast<HTML::HTMLInputElement*>(control.ptr()); hidden_input && hidden_input->type_state() == HTMLInputElement::TypeAttributeState::Hidden && Infra::is_ascii_case_insensitive_match(name, "_charset_"sv)) {
|
||||
else if (auto* hidden_input = dynamic_cast<HTML::HTMLInputElement*>(control.ptr()); hidden_input && hidden_input->type_state() == HTMLInputElement::TypeAttributeState::Hidden && name.equals_ignoring_ascii_case("_charset_"sv)) {
|
||||
// 1. Let charset be the name of encoding if encoding is given, and "UTF-8" otherwise.
|
||||
auto charset = encoding.has_value() ? encoding.value() : "UTF-8"_string;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue