@@ -287,30 +287,43 @@ impl VdomInnerExclusive {
287 self.change_list.emit_set_text(new_text);
287 self.change_list.emit_set_text(new_text);
290− (&Node::Text(TextNode { .. }), Node::Element(ElementNode { .. })) => {
290+ (&Node::Text(_), Node::Element(_))
291+ | (&Node::Text(_), Node::NamespacedElement(_, _)) => {
291 debug!(" replacing a text node with an element");
292 debug!(" replacing a text node with an element");
292 self.create(registry, new);
293 self.create(registry, new);
293 self.change_list.emit_replace_with();
294 self.change_list.emit_replace_with();
295− (&Node::Element(ElementNode { .. }), Node::Text(TextNode { .. })) => {
296+ (&Node::Element(_), Node::Text(_))
297+ | (&Node::NamespacedElement(_, _), Node::Text(_)) => {
296 debug!(" replacing an element with a text node");
298 debug!(" replacing an element with a text node");
297 self.create(registry, new);
299 self.create(registry, new);
298 self.change_list.emit_replace_with();
300 self.change_list.emit_replace_with();
300− (
302+ (&Node::Element(ref new_element_node), Node::Element(ref old_element_node))
304+ &Node::NamespacedElement(_, ref new_element_node),
305+ Node::Element(ref old_element_node),
308+ &Node::Element(ref new_element_node),
309+ Node::NamespacedElement(_, ref old_element_node),
312+ &Node::NamespacedElement(_, ref new_element_node),
313+ Node::NamespacedElement(_, ref old_element_node),
301− &Node::Element(ElementNode {
315+ let ElementNode {
302 tag_name: new_tag_name,
316 tag_name: new_tag_name,
303 listeners: new_listeners,
317 listeners: new_listeners,
304 attributes: new_attributes,
318 attributes: new_attributes,
305 children: new_children,
319 children: new_children,
306− }),
320+ } = new_element_node;
307− Node::Element(ElementNode {
321+ let ElementNode {
308 tag_name: old_tag_name,
322 tag_name: old_tag_name,
309 listeners: old_listeners,
323 listeners: old_listeners,
310 attributes: old_attributes,
324 attributes: old_attributes,
311 children: old_children,
325 children: old_children,
312− }),
326+ } = old_element_node;
314 debug!(" updating an element");
327 debug!(" updating an element");
315 if new_tag_name != old_tag_name {
328 if new_tag_name != old_tag_name {
316 debug!(" different tag names; creating new element and replacing old element");
329 debug!(" different tag names; creating new element and replacing old element");
@@ -463,12 +476,7 @@ impl VdomInnerExclusive {
463 attributes,
476 attributes,
464 children,
477 children,
466− if ["svg", "path"].contains(&tag_name) {
468− .emit_create_element_ns(tag_name, "http://www.w3.org/2000/svg");
470− self.change_list.emit_create_element(tag_name);
479+ self.change_list.emit_create_element(tag_name);
472 for l in listeners {
480 for l in listeners {
474 registry.add(l);
482 registry.add(l);
@@ -476,12 +484,32 @@ impl VdomInnerExclusive {
476 self.change_list.emit_new_event_listener(l);
484 self.change_list.emit_new_event_listener(l);
478 for attr in attributes {
486 for attr in attributes {
479− if ["svg", "path"].contains(&tag_name) && attr.name != "xmlns" {
481− .emit_set_attribute_ns(&attr.name, &attr.value);
483− self.change_list.emit_set_attribute(&attr.name, &attr.value);
487+ self.change_list.emit_set_attribute(&attr.name, &attr.value);
489+ for child in children {
490+ self.create(registry, child.clone());
491+ self.change_list.emit_append_child();
494+ Node::NamespacedElement(
503+ self.change_list.emit_create_element_ns(tag_name, namepsace);
504+ for l in listeners {
508+ self.change_list.emit_new_event_listener(l);
510+ for attr in attributes {
512+ .emit_set_attribute_ns(&attr.name, &attr.value);
486 for child in children {
514 for child in children {
487 self.create(registry, child.clone());
515 self.create(registry, child.clone());