diff options
-rw-r--r-- | components/script/dom/nodelist.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs index 01bc27d3a08..3e2bc5145c6 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -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)) => { |