mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibWeb: Use correct comparison logic in NamedNodeMap::get_attribute()
Previously, we were doing a case insensitive comparison, which could return the wrong result if the attribute name was uppercase.
This commit is contained in:
committed by
Tim Ledbetter
parent
a0fb092d94
commit
f378f41526
@@ -153,7 +153,7 @@ Attr const* NamedNodeMap::get_attribute(FlyString const& qualified_name, size_t*
|
||||
// 2. Return the first attribute in element’s attribute list whose qualified name is qualifiedName; otherwise null.
|
||||
for (auto const& attribute : m_attributes) {
|
||||
if (compare_as_lowercase) {
|
||||
if (attribute->name().equals_ignoring_ascii_case(qualified_name))
|
||||
if (attribute->name().equals_ignoring_ascii_case(qualified_name) && !AK::any_of(attribute->name().bytes(), is_ascii_upper_alpha))
|
||||
return attribute;
|
||||
} else {
|
||||
if (attribute->name() == qualified_name)
|
||||
|
||||
Reference in New Issue
Block a user