Utils.ancestors
A module containing various methods that traverse document tree ancestors.
These methods are “filter” methods, meaning they will return an
array-like object of results
from each callback invocation. A result of true
will collect
the object passed; a truthy result will collect the value returned;
a falsey result will not be collected. An example follows.
function handler( obj ) { var result = false; if (obj && obj.id === "unique") { // criterion met result = true; } return result; }
Utils.ancestors.traverse
Method that traverses a linked list of a node's parent nodes and calls a callback with the current node passed.
Return value: Array
Utils.ancestors.get
Method that traverses the parent nodes of a node-like object and shapes them into a linked list.
Return value: Array || null
Utils.ancestors.is
Method that checks if a node-like object is an ancestor of another node-like object.
Return value: Boolean