diff --git a/Libraries/LibWeb/CSS/Selector.cpp b/Libraries/LibWeb/CSS/Selector.cpp index 3934418e38b..fa21ea031d5 100644 --- a/Libraries/LibWeb/CSS/Selector.cpp +++ b/Libraries/LibWeb/CSS/Selector.cpp @@ -159,11 +159,11 @@ void Selector::collect_ancestor_hashes() return; break; case SimpleSelector::Type::TagName: - if (append_unique_hash(simple_selector.qualified_name().name.name.hash())) + if (append_unique_hash(simple_selector.qualified_name().name.lowercase_name.hash())) return; break; case SimpleSelector::Type::Attribute: - if (append_unique_hash(simple_selector.attribute().qualified_name.name.name.hash())) + if (append_unique_hash(simple_selector.attribute().qualified_name.name.lowercase_name.hash())) return; break; default: diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index b3e8ad1c248..ce172438695 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -3212,13 +3212,13 @@ void StyleComputer::compute_math_depth(ComputedProperties& style, DOM::Element c static void for_each_element_hash(DOM::Element const& element, auto callback) { - callback(element.local_name().hash()); + callback(element.local_name().ascii_case_insensitive_hash()); if (element.id().has_value()) callback(element.id().value().hash()); for (auto const& class_ : element.class_names()) callback(class_.hash()); element.for_each_attribute([&](auto& attribute) { - callback(attribute.local_name().hash()); + callback(attribute.lowercase_name().hash()); }); } diff --git a/Tests/LibWeb/Ref/expected/css-case-insensitive-html-attributes-selector-ref.html b/Tests/LibWeb/Ref/expected/css-case-insensitive-html-attributes-selector-ref.html index 1729f2bb21e..1fa027f52be 100644 --- a/Tests/LibWeb/Ref/expected/css-case-insensitive-html-attributes-selector-ref.html +++ b/Tests/LibWeb/Ref/expected/css-case-insensitive-html-attributes-selector-ref.html @@ -3,6 +3,10 @@ div[type=one] { background: red; } + div[type=three] { + background: blue; + }