LibXML: Associate prefixed elements with the correct namespace

Previously, any xmlns attributes with an associated prefix were ignored.
This commit is contained in:
Tim Ledbetter 2025-02-25 11:56:09 +00:00 committed by Jelle Raaijmakers
commit 96fc840b03
Notes: github-actions[bot] 2025-02-25 14:03:41 +00:00
2 changed files with 52 additions and 8 deletions

View file

@ -38,15 +38,21 @@ private:
virtual void comment(StringView data) override;
virtual void document_end() override;
Optional<FlyString> namespace_for_element(XML::Name const& element_name);
GC::Ref<DOM::Document> m_document;
GC::Ptr<DOM::Node> m_current_node;
XMLScriptingSupport m_scripting_support { XMLScriptingSupport::Enabled };
bool m_has_error { false };
StringBuilder text_builder;
Optional<FlyString> m_namespace;
struct NamespaceAndPrefix {
FlyString ns;
Optional<ByteString> prefix;
};
struct NamespaceStackEntry {
Optional<FlyString> ns;
Vector<NamespaceAndPrefix, 2> namespaces;
size_t depth;
};
Vector<NamespaceStackEntry, 2> m_namespace_stack;