diff --git a/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index e58ff5a5fe4..2da76e0a143 100644 --- a/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -61,17 +61,17 @@ bool HTMLBodyElement::is_presentational_hint(FlyString const& name) const void HTMLBodyElement::apply_presentational_hints(GC::Ref cascaded_properties) const { for_each_attribute([&](auto& name, auto& value) { - if (name.equals_ignoring_ascii_case("bgcolor"sv)) { + if (name == HTML::AttributeNames::bgcolor) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value auto color = parse_legacy_color_value(value); if (color.has_value()) cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create_from_color(color.value(), CSS::ColorSyntax::Legacy)); - } else if (name.equals_ignoring_ascii_case("text"sv)) { + } else if (name == HTML::AttributeNames::text) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-2 auto color = parse_legacy_color_value(value); if (color.has_value()) cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Color, CSS::CSSColorValue::create_from_color(color.value(), CSS::ColorSyntax::Legacy)); - } else if (name.equals_ignoring_ascii_case("background"sv)) { + } else if (name == HTML::AttributeNames::background) { VERIFY(m_background_style_value); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundImage, *m_background_style_value); } @@ -114,22 +114,22 @@ void HTMLBodyElement::attribute_changed(FlyString const& name, Optional { Base::attribute_changed(name, old_value, value, namespace_); - if (name.equals_ignoring_ascii_case("link"sv)) { + if (name == HTML::AttributeNames::link) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-3 auto color = parse_legacy_color_value(value.value_or(String {})); if (color.has_value()) document().set_normal_link_color(color.value()); - } else if (name.equals_ignoring_ascii_case("alink"sv)) { + } else if (name == HTML::AttributeNames::alink) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-5 auto color = parse_legacy_color_value(value.value_or(String {})); if (color.has_value()) document().set_active_link_color(color.value()); - } else if (name.equals_ignoring_ascii_case("vlink"sv)) { + } else if (name == HTML::AttributeNames::vlink) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-4 auto color = parse_legacy_color_value(value.value_or(String {})); if (color.has_value()) document().set_visited_link_color(color.value()); - } else if (name.equals_ignoring_ascii_case("background"sv)) { + } else if (name == HTML::AttributeNames::background) { // https://html.spec.whatwg.org/multipage/rendering.html#the-page:attr-background if (auto maybe_background_url = document().encoding_parse_url(value.value_or(String {})); maybe_background_url.has_value()) { m_background_style_value = CSS::ImageStyleValue::create(maybe_background_url.value()); diff --git a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index eb1212d5cf8..14645594be4 100644 --- a/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -190,7 +190,7 @@ void HTMLCanvasElement::attribute_changed(FlyString const& local_name, Optional< { Base::attribute_changed(local_name, old_value, value, namespace_); - if (local_name.equals_ignoring_ascii_case(HTML::AttributeNames::width) || local_name.equals_ignoring_ascii_case(HTML::AttributeNames::height)) { + if (local_name.is_one_of(HTML::AttributeNames::width, HTML::AttributeNames::height)) { notify_context_about_canvas_size_change(); reset_context_to_default_state(); if (auto layout_node = this->layout_node()) diff --git a/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Libraries/LibWeb/HTML/HTMLDivElement.cpp index cae2caf7dd4..3021da47925 100644 --- a/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -33,7 +33,7 @@ bool HTMLDivElement::is_presentational_hint(FlyString const& name) const void HTMLDivElement::apply_presentational_hints(GC::Ref cascaded_properties) const { for_each_attribute([&](auto& name, auto& value) { - if (name.equals_ignoring_ascii_case("align"sv)) { + if (name == HTML::AttributeNames::align) { if (value.equals_ignoring_ascii_case("left"sv)) cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::LibwebLeft)); else if (value.equals_ignoring_ascii_case("right"sv)) diff --git a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index 0c428d1fa83..3307ae7eff6 100644 --- a/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -40,7 +40,7 @@ void HTMLHeadingElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left)); else if (value == "right"sv) diff --git a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index d99d5919825..f629541a6cd 100644 --- a/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -40,7 +40,7 @@ void HTMLParagraphElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left)); else if (value == "right"sv) diff --git a/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Libraries/LibWeb/HTML/HTMLPreElement.cpp index bb068afd819..f224d4e3e40 100644 --- a/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -41,7 +41,7 @@ void HTMLPreElement::apply_presentational_hints(GC::Ref HTMLElement::apply_presentational_hints(cascaded_properties); for_each_attribute([&](auto const& name, auto const&) { - if (name.equals_ignoring_ascii_case(HTML::AttributeNames::wrap)) { + if (name == HTML::AttributeNames::wrap) { cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextWrapMode, CSS::CSSKeywordValue::create(CSS::Keyword::Wrap)); } }); diff --git a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 1c333bef71a..050fce2e769 100644 --- a/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -40,7 +40,7 @@ void HTMLTableCaptionElement::apply_presentational_hints(GC::Refset_property_from_presentational_hint(CSS::PropertyID::CaptionSide, CSS::CSSKeywordValue::create(CSS::Keyword::Bottom)); }