LibWeb: Don't crash when appending to an XML document template element

When the XML parser appends child nodes to a template element, it must
actually append the template element's contents. This special behavior
caused us to return to the wrong parent element after adding child
nodes to a template element, leading to a crash.
This commit is contained in:
Tim Ledbetter 2025-07-13 23:04:34 +01:00 committed by Jelle Raaijmakers
commit 80ccb12a12
Notes: github-actions[bot] 2025-07-14 07:16:52 +00:00
4 changed files with 54 additions and 1 deletions

View file

@ -41,6 +41,7 @@ private:
Optional<FlyString> namespace_for_name(XML::Name const&);
GC::Ref<DOM::Document> m_document;
GC::RootVector<GC::Ref<DOM::Node>> m_template_node_stack;
GC::Ptr<DOM::Node> m_current_node;
XMLScriptingSupport m_scripting_support { XMLScriptingSupport::Enabled };
bool m_has_error { false };