Skip to main content

Module comparator

Module comparator 

Source

Structsยง

DomPositionContainment ๐Ÿ”’

Functionsยง

compare_dom_positions ๐Ÿ”’
compare_nodes_in_same_parent ๐Ÿ”’
Compare two nodes that are both children of the same parent node.
compare_offset_and_node_in_same_parent ๐Ÿ”’
Compare an offset in a parent node with a child node in that same parent node.
find_child_in_ancestors ๐Ÿ”’
If possible_ancestor is an ancestor of possible_descendant return the child of possible_ancestor that is an ancestor of possible_descendant or is possible_descendant itself.
least_common_ancestor_children ๐Ÿ”’
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.