@@ -287,30 +287,43 @@ impl VdomInnerExclusive {
287287 self.change_list.emit_set_text(new_text);
288288 }
289289 }
290− (&Node::Text(TextNode { .. }), Node::Element(ElementNode { .. })) => {
290+ (&Node::Text(_), Node::Element(_))
291+ | (&Node::Text(_), Node::NamespacedElement(_, _)) => {
291292 debug!(" replacing a text node with an element");
292293 self.create(registry, new);
293294 self.change_list.emit_replace_with();
294295 }
295− (&Node::Element(ElementNode { .. }), Node::Text(TextNode { .. })) => {
296+ (&Node::Element(_), Node::Text(_))
297+ | (&Node::NamespacedElement(_, _), Node::Text(_)) => {
296298 debug!(" replacing an element with a text node");
297299 self.create(registry, new);
298300 self.change_list.emit_replace_with();
299301 }
300− (
301− &Node::Element(ElementNode {
302+ (&Node::Element(ref new_element_node), Node::Element(ref old_element_node))
303+ | (
304+ &Node::NamespacedElement(_, ref new_element_node),
305+ Node::Element(ref old_element_node),
306+ )
307+ | (
308+ &Node::Element(ref new_element_node),
309+ Node::NamespacedElement(_, ref old_element_node),
310+ )
311+ | (
312+ &Node::NamespacedElement(_, ref new_element_node),
313+ Node::NamespacedElement(_, ref old_element_node),
314+ ) => {
315+ let ElementNode {
302316 tag_name: new_tag_name,
303317 listeners: new_listeners,
304318 attributes: new_attributes,
305319 children: new_children,
306− }),
307− Node::Element(ElementNode {
320+ } = new_element_node;
321+ let ElementNode {
308322 tag_name: old_tag_name,
309323 listeners: old_listeners,
310324 attributes: old_attributes,
311325 children: old_children,
312− }),
313− ) => {
326+ } = old_element_node;
314327 debug!(" updating an element");
315328 if new_tag_name != old_tag_name {
316329 debug!(" different tag names; creating new element and replacing old element");
@@ -463,12 +476,7 @@ impl VdomInnerExclusive {
463476 attributes,
464477 children,
465478 }) => {
466− if ["svg", "path"].contains(&tag_name) {
467− self.change_list
468− .emit_create_element_ns(tag_name, "http://www.w3.org/2000/svg");
469− } else {
470− self.change_list.emit_create_element(tag_name);
471− }
479+ self.change_list.emit_create_element(tag_name);
472480 for l in listeners {
473481 unsafe {
474482 registry.add(l);
@@ -476,12 +484,32 @@ impl VdomInnerExclusive {
476484 self.change_list.emit_new_event_listener(l);
477485 }
478486 for attr in attributes {
479− if ["svg", "path"].contains(&tag_name) && attr.name != "xmlns" {
480− self.change_list
481− .emit_set_attribute_ns(&attr.name, &attr.value);
482− } else {
483− self.change_list.emit_set_attribute(&attr.name, &attr.value);
487+ self.change_list.emit_set_attribute(&attr.name, &attr.value);
488+ }
489+ for child in children {
490+ self.create(registry, child.clone());
491+ self.change_list.emit_append_child();
492+ }
493+ }
494+ Node::NamespacedElement(
495+ namepsace,
496+ ElementNode {
497+ tag_name,
498+ listeners,
499+ attributes,
500+ children,
501+ },
502+ ) => {
503+ self.change_list.emit_create_element_ns(tag_name, namepsace);
504+ for l in listeners {
505+ unsafe {
506+ registry.add(l);
484507 }
508+ self.change_list.emit_new_event_listener(l);
509+ }
510+ for attr in attributes {
511+ self.change_list
512+ .emit_set_attribute_ns(&attr.name, &attr.value);
485513 }
486514 for child in children {
487515 self.create(registry, child.clone());