Auto merge of #6507 - Ms2ger:node-insert, r=Manishearth

Fix a bug in Node::pre_insert.

It was accidentally broken in 3ce368fa28.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6507)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-06-28 14:01:47 -06:00
commit 6f25ecea3f
5 changed files with 7745 additions and 7 deletions

View file

@ -1626,11 +1626,14 @@ impl Node {
}
// Step 7-8.
let reference_child_root;
let reference_child = match child {
Some(child) if child == node => node.GetNextSibling(),
_ => None
Some(child) if child == node => {
reference_child_root = node.GetNextSibling();
reference_child_root.r()
},
_ => child
};
let reference_child = reference_child.r().or(child);
// Step 9.
let document = document_from_node(parent);