Skip to content

Commit

Permalink
LibWeb/XML: Set attributes using Element::set_attribute_ns
Browse files Browse the repository at this point in the history
Otherwise we'd end up ignoring attr prefixes and treating them as part
of the attribute's local name.
Fixes #3137.
  • Loading branch information
alimpfard committed Jan 4, 2025
1 parent c60ad5b commit 4ad3c57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Libraries/LibWeb/XML/XMLDocumentBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ void XMLDocumentBuilder::element_start(const XML::Name& name, HashMap<XML::Name,
m_has_error = true;
}
}
MUST(node->set_attribute(MUST(FlyString::from_deprecated_fly_string(attribute.key)), MUST(String::from_byte_string(attribute.value))));
auto result = node->set_attribute_ns(m_namespace, MUST(FlyString::from_deprecated_fly_string(attribute.key)), MUST(String::from_byte_string(attribute.value)));
if (result.is_error()) {
m_has_error = true;
return;
}
}

m_current_node = node.ptr();
Expand Down

0 comments on commit 4ad3c57

Please sign in to comment.