Fix HTMLTemplateElement.innerHTML

https://github.com/w3c/DOM-Parsing/issues/1
This commit is contained in:
Anthony Ramine 2015-09-04 10:43:20 +02:00
parent a5cefe41d0
commit b3820047da
4 changed files with 23 additions and 28 deletions

View file

@ -203,7 +203,14 @@ impl<'a> Serializable for &'a Node {
try!(serializer.start_elem(name.clone(), attr_refs));
}
for handle in node.children() {
let children = if let Some(tpl) = HTMLTemplateElementCast::to_ref(node) {
// https://github.com/w3c/DOM-Parsing/issues/1
NodeCast::from_ref(&*tpl.Content()).children()
} else {
node.children()
};
for handle in children {
try!(handle.r().serialize(serializer, IncludeNode));
}