javascript/selenium-core/scripts/htmlutils.js
function is_ancestor(node, target)
{
    while (target.parentNode) {
        target = target.parentNode;
        if (node == target)
            return true;
    }
    return false;
}
function is_ancestor(node, target)
{
    while (target.parentNode) {
        target = target.parentNode;
        if (node == target)
            return true;
    }
    return false;
}
function is_ancestor ( node , target ) { while ( target . parentNode ) { target = target . parentNode ; if ( node == target ) return true ; } return false ; }
Returns true if a node is an ancestor node of a target node, and false
otherwise.

@param node    the node being compared to the target node
@param target  the target node
@return        true if node is an ancestor node of target, false otherwise.
Returns true if a node is an ancestor node of a target node and false otherwise .