diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-10 08:48:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-10 13:15:44 +0100 |
commit | a504ac3e2a57654b96501b3a1ba80f37b3381dc8 (patch) | |
tree | 767a7e21a858e4b5c6dfec77dd52b540a0e4cf49 /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | |
parent | 03cc45e5a2ecc5d173aa121404d7ed8251c109f8 (diff) | |
download | serenity-a504ac3e2a57654b96501b3a1ba80f37b3381dc8.zip |
Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case
Let's make it clear that these functions deal with ASCII case only.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLElement.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index f663cfbb57..91f6f70777 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -64,7 +64,7 @@ DeprecatedString HTMLElement::dir() const { auto dir = attribute(HTML::AttributeNames::dir); #define __ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(keyword) \ - if (dir.equals_ignoring_case(#keyword##sv)) \ + if (dir.equals_ignoring_ascii_case(#keyword##sv)) \ return #keyword##sv; ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTES #undef __ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE @@ -81,10 +81,10 @@ HTMLElement::ContentEditableState HTMLElement::content_editable_state() const { auto contenteditable = attribute(HTML::AttributeNames::contenteditable); // "true", an empty string or a missing value map to the "true" state. - if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_case("true"sv)) + if ((!contenteditable.is_null() && contenteditable.is_empty()) || contenteditable.equals_ignoring_ascii_case("true"sv)) return ContentEditableState::True; // "false" maps to the "false" state. - if (contenteditable.equals_ignoring_case("false"sv)) + if (contenteditable.equals_ignoring_ascii_case("false"sv)) return ContentEditableState::False; // Having no such attribute or an invalid value maps to the "inherit" state. return ContentEditableState::Inherit; @@ -121,15 +121,15 @@ DeprecatedString HTMLElement::content_editable() const // https://html.spec.whatwg.org/multipage/interaction.html#contenteditable WebIDL::ExceptionOr<void> HTMLElement::set_content_editable(DeprecatedString const& content_editable) { - if (content_editable.equals_ignoring_case("inherit"sv)) { + if (content_editable.equals_ignoring_ascii_case("inherit"sv)) { remove_attribute(HTML::AttributeNames::contenteditable); return {}; } - if (content_editable.equals_ignoring_case("true"sv)) { + if (content_editable.equals_ignoring_ascii_case("true"sv)) { MUST(set_attribute(HTML::AttributeNames::contenteditable, "true")); return {}; } - if (content_editable.equals_ignoring_case("false"sv)) { + if (content_editable.equals_ignoring_ascii_case("false"sv)) { MUST(set_attribute(HTML::AttributeNames::contenteditable, "false")); return {}; } |