LibWeb: Use correct case-sensitivity when matching attribute selectors

Also removed get_attribute_with_lowercase_qualified_name
because it was buggy, duplicated logic, and now unused.
This commit is contained in:
Gingeh 2024-11-21 20:43:10 +11:00 committed by Andreas Kling
commit ba0cc7fe46
Notes: github-actions[bot] 2024-11-23 08:51:33 +00:00
4 changed files with 12 additions and 29 deletions

View file

@ -219,8 +219,7 @@ static inline bool matches_attribute(CSS::Selector::SimpleSelector::Attribute co
auto const& attribute_name = attribute.qualified_name.name.name;
auto const* attr = element.namespace_uri() == Namespace::HTML ? element.attributes()->get_attribute_with_lowercase_qualified_name(attribute_name)
: element.attributes()->get_attribute(attribute_name);
auto const* attr = element.attributes()->get_attribute(attribute_name);
if (attribute.match_type == CSS::Selector::SimpleSelector::Attribute::MatchType::HasAttribute) {
// Early way out in case of an attribute existence selector.