MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / reparent_children

Method reparent_children

css-inline/src/html/document.rs:284–290  ·  view source on GitHub ↗

Remove all the children from node and append them to `new_parent`.

(&mut self, node: NodeId, new_parent: NodeId)

Source from the content-addressed store, hash-verified

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 ///

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected