mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Optimise most basic case of .replaceChild() when updating childNodes
This commit is contained in:
parent
532fd19d69
commit
faa581be86
1 changed files with 4 additions and 1 deletions
|
@ -218,7 +218,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