lib/SelectorMatchers.js
function(element, rule){
        var elementClassName = element.className,
            elementID = element.id,
            elementTagName = element.tagName,
            elementDisplayName = element.constructor.displayName;

        if(rule.tagName && !this.tagName(rule.tagName, elementTagName, elementDisplayName)){
            return false;
        }

        if(rule.id && !this.id(rule.id, elementID)){
            return false;
        }

        if(rule.classNames && !this.className(rule.classNames, elementClassName)){
            return false;
        }
        if(rule.pseudos && !this.pseudoMatcher(rule.pseudos, element, elementTagName)){
            return false;
        }
        if(rule.attrs && !this.attributeMatcher(rule.attrs, element)){
            return false;
        }
        return true;
    }
function(element, rule){
        var elementClassName = element.className,
            elementID = element.id,
            elementTagName = element.tagName,
            elementDisplayName = element.constructor.displayName;

        if(rule.tagName && !this.tagName(rule.tagName, elementTagName, elementDisplayName)){
            return false;
        }

        if(rule.id && !this.id(rule.id, elementID)){
            return false;
        }

        if(rule.classNames && !this.className(rule.classNames, elementClassName)){
            return false;
        }
        if(rule.pseudos && !this.pseudoMatcher(rule.pseudos, element, elementTagName)){
            return false;
        }
        if(rule.attrs && !this.attributeMatcher(rule.attrs, element)){
            return false;
        }
        return true;
    }
function ( element , rule ) { var elementClassName = element . className , elementID = element . id , elementTagName = element . tagName , elementDisplayName = element . constructor . displayName ; if ( rule . tagName && ! this . tagName ( rule . tagName , elementTagName , elementDisplayName ) ) { return false ; } if ( rule . id && ! this . id ( rule . id , elementID ) ) { return false ; } if ( rule . classNames && ! this . className ( rule . classNames , elementClassName ) ) { return false ; } if ( rule . pseudos && ! this . pseudoMatcher ( rule . pseudos , element , elementTagName ) ) { return false ; } if ( rule . attrs && ! this . attributeMatcher ( rule . attrs , element ) ) { return false ; } return true ; }
Given an array, reduces the items based on the provided parsed CSS pseudo selector.
@param  {Object} element Element to test
@param  {Object} rule    Parsed pseudo CSS selector
@return {Array}          Reduced matches based on selector processing
Given an array reduces the items based on the provided parsed CSS pseudo selector .