Skip to main content

least_common_ancestor_children

Function least_common_ancestor_children 

Source
fn least_common_ancestor_children<'a, Traversal: NoGcTraversal>(
    no_gc: &'a NoGC,
    node_a: &Node,
    node_b: &Node,
) -> Option<(UnrootedDom<'a, Node>, UnrootedDom<'a, Node>)>
Expand description

When node_a and node_b share a least common ancestor, this function returns a tuple containing the child of the least common ancestor that is an inclusive ancestor of node_a and the child of the least common ancestor that is an inclusive ancestor of node_b. If node_a and node_b do not have a least common ancestor, this returns None.

Note: This function assumes that the least common inclusive ancestor is neither of the nodes passed as arguments.