utils/dom/getancestors
module
Functions
-
getAncestors( node ) → Array<Node>
module:utils/dom/getancestors~getAncestors
Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the node is a part of
DocumentFragment
thatDocumentFragment
will be returned. In contrary, if the node is appended to aDocument
, thatDocument
will not be returned (algorithms operating on DOM tree care forDocument#documentElement
at most, which will be returned).Parameters
node : Node
DOM node.
Returns
Array<Node>
Array of given
node
parents.