Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case

Let's make it clear that these functions deal with ASCII case only.
This commit is contained in:
Andreas Kling 2023-03-10 08:48:54 +01:00
parent 03cc45e5a2
commit a504ac3e2a
Notes: sideshowbarker 2024-07-17 18:13:59 +09:00
76 changed files with 480 additions and 476 deletions

View file

@ -30,15 +30,15 @@ JS::ThrowCompletionOr<void> HTMLBodyElement::initialize(JS::Realm& realm)
void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const
{
for_each_attribute([&](auto& name, auto& value) {
if (name.equals_ignoring_case("bgcolor"sv)) {
if (name.equals_ignoring_ascii_case("bgcolor"sv)) {
auto color = Color::from_string(value);
if (color.has_value())
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()));
} else if (name.equals_ignoring_case("text"sv)) {
} else if (name.equals_ignoring_ascii_case("text"sv)) {
auto color = Color::from_string(value);
if (color.has_value())
style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value()));
} else if (name.equals_ignoring_case("background"sv)) {
} else if (name.equals_ignoring_ascii_case("background"sv)) {
VERIFY(m_background_style_value);
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value);
}
@ -48,19 +48,19 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co
void HTMLBodyElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
{
HTMLElement::parse_attribute(name, value);
if (name.equals_ignoring_case("link"sv)) {
if (name.equals_ignoring_ascii_case("link"sv)) {
auto color = Color::from_string(value);
if (color.has_value())
document().set_link_color(color.value());
} else if (name.equals_ignoring_case("alink"sv)) {
} else if (name.equals_ignoring_ascii_case("alink"sv)) {
auto color = Color::from_string(value);
if (color.has_value())
document().set_active_link_color(color.value());
} else if (name.equals_ignoring_case("vlink"sv)) {
} else if (name.equals_ignoring_ascii_case("vlink"sv)) {
auto color = Color::from_string(value);
if (color.has_value())
document().set_visited_link_color(color.value());
} else if (name.equals_ignoring_case("background"sv)) {
} else if (name.equals_ignoring_ascii_case("background"sv)) {
m_background_style_value = CSS::ImageStyleValue::create(document().parse_url(value));
m_background_style_value->on_animate = [this] {
if (layout_node()) {