src/basis/dom.js
function findAncestor(node, matchFunction, bound){
    while (node && node !== bound)
    {
      if (matchFunction(node))
        break;

      node = node.parentNode;
    }

    return node || null;
  }
function findAncestor(node, matchFunction, bound){
    while (node && node !== bound)
    {
      if (matchFunction(node))
        break;

      node = node.parentNode;
    }

    return node || null;
  }
function findAncestor ( node , matchFunction , bound ) { while ( node && node !== bound ) { if ( matchFunction ( node ) ) break ; node = node . parentNode ; } return node || null ; }
Returns ancestor that matchFunction returns true for.
@param {Node} node Start node for traversal.
@param {function(node:Node):boolean} matchFunction Checking function.
@param {Node=} bound Don't traversal after bound node.
@return {Node} First ancestor node that pass matchFunction.
Returns ancestor that matchFunction returns true for .