mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 11:11:51 +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:
parent
a0fb092d94
commit
f378f41526
Notes:
github-actions[bot]
2024-11-23 21:20:22 +00:00
Author: https://github.com/tcl3
Commit: f378f41526
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2469
Reviewed-by: https://github.com/konradekk
5 changed files with 986 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue