mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb: Parse the qualified name of XML dom elements correctly
This commit is contained in:
parent
0a2aa87107
commit
0c24c9150a
Notes:
github-actions[bot]
2024-12-09 09:14:41 +00:00
Author: https://github.com/ananas-dev
Commit: 0c24c9150a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2467
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 17 additions and 1 deletions
|
@ -99,7 +99,23 @@ void XMLDocumentBuilder::element_start(const XML::Name& name, HashMap<XML::Name,
|
|||
m_namespace_stack.last().depth += 1;
|
||||
}
|
||||
|
||||
auto node = DOM::create_element(m_document, MUST(FlyString::from_deprecated_fly_string(name)), m_namespace).release_value_but_fixme_should_propagate_errors();
|
||||
auto qualified_name_or_err = DOM::validate_and_extract(m_document->realm(), m_namespace, MUST(FlyString::from_deprecated_fly_string(name)));
|
||||
|
||||
if (qualified_name_or_err.is_error()) {
|
||||
m_has_error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
auto qualified_name = qualified_name_or_err.value();
|
||||
|
||||
auto node_or_err = DOM::create_element(m_document, qualified_name.local_name(), qualified_name.namespace_(), qualified_name.prefix());
|
||||
|
||||
if (node_or_err.is_error()) {
|
||||
m_has_error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
auto node = node_or_err.value();
|
||||
|
||||
// When an XML parser with XML scripting support enabled creates a script element,
|
||||
// it must have its parser document set and its "force async" flag must be unset.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue