utils/dom/getancestors
@ckeditor/ckeditor5-utils/src/dom/getancestors
module
Filtering
Functions
-
getAncestors( node ) → Array.<(Node | DocumentFragment)>
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 | DocumentFragment)>
Array of given
node
parents.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.