1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Don't consider nodes in different namespaces to be equal

Previously, `Node::is_equal_node()` would return true for nodes in
different namespaces that were otherwise equal.
This commit is contained in:
Tim Ledbetter 2024-07-18 14:17:37 +01:00 committed by Andreas Kling
parent 319bb6353e
commit 7ab7be694d
Notes: sideshowbarker 2024-07-19 21:36:05 +09:00

View file

@ -1573,8 +1573,8 @@ bool Node::is_equal_node(Node const* other_node) const
return false;
// If A is an element, each attribute in its attribute list has an attribute that equals an attribute in Bs attribute list.
bool has_same_attributes = true;
this_element.for_each_attribute([&](auto& name, auto& value) {
if (other_element.get_attribute(name) != value)
this_element.for_each_attribute([&](auto const& attribute) {
if (other_element.get_attribute_ns(attribute.namespace_uri(), attribute.local_name()) != attribute.value())
has_same_attributes = false;
});
if (!has_same_attributes)