Auto merge of #7407 - nox:childnodes-replace, r=jdm

Optimise most basic case of .replaceChild() when updating childNodes



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7407)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-08-30 13:22:41 -06:00
commit 86da67bb1e

View file

@ -215,7 +215,10 @@ impl ChildrenList {
},
};
list.last_visited.set(Some(JS::from_ref(visited)));
} else {
} else if added.len() != 1 {
// The replaced child isn't the last visited one, and there are
// 0 or more than 1 nodes to replace it. Special care must be
// given to update the state of that ChildrenList.
match (prev, next) {
(Some(_), None) => {},
(None, Some(next)) => {