diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-09-04 10:43:20 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-09-08 10:28:24 +0200 |
commit | b3820047da0810b528800c385063a79c013cd0d6 (patch) | |
tree | a94ee85dcfb2013a6b7f12713a124c0b35a9149a /components/script/parse | |
parent | a5cefe41d0c853ca6bbaf966d17d107f6987cda2 (diff) | |
download | servo-b3820047da0810b528800c385063a79c013cd0d6.tar.gz servo-b3820047da0810b528800c385063a79c013cd0d6.zip |
Fix HTMLTemplateElement.innerHTML
https://github.com/w3c/DOM-Parsing/issues/1
Diffstat (limited to 'components/script/parse')
-rw-r--r-- | components/script/parse/html.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index d7e1535e487..7a0ae327008 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -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)); } |