Remove all the children from node and append them to `new_parent`.
(&mut self, node: NodeId, new_parent: NodeId)
| 282 | |
| 283 | /// Remove all the children from node and append them to `new_parent`. |
| 284 | pub(super) fn reparent_children(&mut self, node: NodeId, new_parent: NodeId) { |
| 285 | // Re-read `first_child` each iteration: `append` calls `detach` internally, which clears |
| 286 | // `child.next_sibling` and updates `node.first_child` to the former second child. |
| 287 | while let Some(child) = self[node].first_child { |
| 288 | self.append(new_parent, child); |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | /// Append a new child node to a parent node. |
| 293 | /// |