Skip to main content

detached_root

Function detached_root 

Source
pub fn detached_root(node: &Node) -> Option<Node>
Expand description

Walk node’s ancestor chain to the top. If the chain ends at a Document (or document-fragment) node the subtree is LIVE — part of a document tree — and None is returned; otherwise the topmost node is a DETACHED root and is returned. Callers use this to decide whether a source tree they are done with is theirs to free (Document::discard_subtree) or still reachable from a live document.