lib/query.js
function getClosestNode (element, method, selector) {
        do {
            element = element[method]
        } while (element && ((selector && !matches(element, selector)) || !util.isElement(element)))
        return element
    }
function getClosestNode (element, method, selector) {
        do {
            element = element[method]
        } while (element && ((selector && !matches(element, selector)) || !util.isElement(element)))
        return element
    }
function getClosestNode ( element , method , selector ) { do { element = element [ method ] } while ( element && ( ( selector && ! matches ( element , selector ) ) || ! util . isElement ( element ) ) ) return element }
Walks the DOM tree using `method`, returns when an element node is found
Walks the DOM tree using method returns when an element node is found