LibWeb: Take namespace into account when matching attribute

This commit is contained in:
Netanel Haber 2024-11-27 20:24:29 +02:00 committed by Sam Atkins
commit d743fcb376
Notes: github-actions[bot] 2024-11-30 16:48:12 +00:00
5 changed files with 77 additions and 3 deletions

View file

@ -194,6 +194,16 @@ Attr const* NamedNodeMap::get_attribute_ns(Optional<FlyString> const& namespace_
return nullptr;
}
Attr const* NamedNodeMap::get_attribute_namespace_agnostic(FlyString const& local_name) const
{
for (auto const& attribute : m_attributes) {
if (attribute->local_name() == local_name)
return attribute.ptr();
}
return nullptr;
}
// https://dom.spec.whatwg.org/#concept-element-attributes-set
WebIDL::ExceptionOr<GC::Ptr<Attr>> NamedNodeMap::set_attribute(Attr& attribute)
{