@@ -190,6 +190,13 @@ fn diff_children(
190 new: &[Node],
190 new: &[Node],
191 cached_roots: &mut FxHashSet<CacheId>,
191 cached_roots: &mut FxHashSet<CacheId>,
194+ if !old.is_empty() {
195+ remove_children(change_list, registry, old);
193 debug!(" updating children shared by old and new");
200 debug!(" updating children shared by old and new");
195 let num_children_to_diff = cmp::min(new.len(), old.len());
202 let num_children_to_diff = cmp::min(new.len(), old.len());
@@ -255,6 +262,19 @@ fn diff_children(
266+ change_list: &mut ChangeListBuilder,
267+ registry: &mut EventsRegistry,
271+ registry.remove_subtree(child);
273+ // Fast way to remove all children: set the node's textContent to an empty
275+ change_list.set_text("");
258fn create(
278fn create(
259 cached_set: &CachedSet,
279 cached_set: &CachedSet,
260 change_list: &mut ChangeListBuilder,
280 change_list: &mut ChangeListBuilder,