mirror of
https://github.com/servo/servo.git
synced 2025-07-29 18:20:24 +01:00
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:
commit
86da67bb1e
1 changed files with 4 additions and 1 deletions
|
@ -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)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue