diff options
Diffstat (limited to 'components/script/dom/nodelist.rs')
-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 eb3353a4d6e..514221f850d 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -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)) => { |