Add new XMLSerializer().serializeToString functionality

This commit is contained in:
Felipe Janer 2019-04-01 18:39:48 -05:00
parent 9832feddf3
commit 1ffe8f059a
4 changed files with 10 additions and 2 deletions

View file

@ -167,7 +167,7 @@ fn rev_children_iter(n: &Node) -> impl Iterator<Item = DomRoot<Node>> {
impl SerializationIterator {
fn new(node: &Node, skip_first: bool) -> SerializationIterator {
let mut ret = SerializationIterator { stack: vec![] };
if skip_first || node.is::<DocumentFragment>() {
if skip_first || node.is::<DocumentFragment>() || node.is::<Document>() {
for c in rev_children_iter(node) {
ret.push_node(&*c);
}