docs/vendor.js
function isNodeMatchingSelector(tNode, selector) {
    ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');
    var mode = 4 /* ELEMENT */;
    var nodeAttrs = tNode.attrs;
    var selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(1 /* SelectOnly */) : -1;
    // When processing ":not" selectors, we skip to the next ":not" if the
    // current one doesn't match
    var skipToNextSelector = false;
    for (var i = 0; i < selector.length; i++) {
        var current = selector[i];
        if (typeof current === 'number') {
            // If we finish processing a :not selector and it hasn't failed, return false
            if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
                return false;
            }
            // If we are skipping to the next :not() and this mode flag is positive,
            // it's a part of the current :not() selector, and we should keep skipping
            if (skipToNextSelector && isPositive(current))
                continue;
            skipToNextSelector = false;
            mode = current | (mode & 1 /* NOT */);
            continue;
        }
        if (skipToNextSelector)
            continue;
        if (mode & 4 /* ELEMENT */) {
            mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;
            if (current !== '' && current !== tNode.tagName) {
                if (isPositive(mode))
                    return false;
                skipToNextSelector = true;
            }
        }
        else {
            var attrName = mode & 8 /* CLASS */ ? 'class' : current;
            var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);
            if (attrIndexInNode === -1) {
                if (isPositive(mode))
                    return false;
                skipToNextSelector = true;
                continue;
            }
            var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];
            if (selectorAttrValue !== '') {
                var nodeAttrValue = void 0;
                var maybeAttrName = nodeAttrs[attrIndexInNode];
                if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) {
                    nodeAttrValue = '';
                }
                else {
                    ngDevMode && assertNotEqual(maybeAttrName, 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes');
                    nodeAttrValue = nodeAttrs[attrIndexInNode + 1];
                }
                if (mode & 8 /* CLASS */ &&
                    !isCssClassMatching(nodeAttrValue, selectorAttrValue) ||
                    mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
                    if (isPositive(mode))
                        return false;
                    skipToNextSelector = true;
                }
            }
        }
    }
    return isPositive(mode) || skipToNextSelector;
}
function isNodeMatchingSelector(tNode, selector) {
    ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');
    var mode = 4 /* ELEMENT */;
    var nodeAttrs = tNode.attrs;
    var selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(1 /* SelectOnly */) : -1;
    // When processing ":not" selectors, we skip to the next ":not" if the
    // current one doesn't match
    var skipToNextSelector = false;
    for (var i = 0; i < selector.length; i++) {
        var current = selector[i];
        if (typeof current === 'number') {
            // If we finish processing a :not selector and it hasn't failed, return false
            if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {
                return false;
            }
            // If we are skipping to the next :not() and this mode flag is positive,
            // it's a part of the current :not() selector, and we should keep skipping
            if (skipToNextSelector && isPositive(current))
                continue;
            skipToNextSelector = false;
            mode = current | (mode & 1 /* NOT */);
            continue;
        }
        if (skipToNextSelector)
            continue;
        if (mode & 4 /* ELEMENT */) {
            mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;
            if (current !== '' && current !== tNode.tagName) {
                if (isPositive(mode))
                    return false;
                skipToNextSelector = true;
            }
        }
        else {
            var attrName = mode & 8 /* CLASS */ ? 'class' : current;
            var attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);
            if (attrIndexInNode === -1) {
                if (isPositive(mode))
                    return false;
                skipToNextSelector = true;
                continue;
            }
            var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];
            if (selectorAttrValue !== '') {
                var nodeAttrValue = void 0;
                var maybeAttrName = nodeAttrs[attrIndexInNode];
                if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) {
                    nodeAttrValue = '';
                }
                else {
                    ngDevMode && assertNotEqual(maybeAttrName, 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes');
                    nodeAttrValue = nodeAttrs[attrIndexInNode + 1];
                }
                if (mode & 8 /* CLASS */ &&
                    !isCssClassMatching(nodeAttrValue, selectorAttrValue) ||
                    mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
                    if (isPositive(mode))
                        return false;
                    skipToNextSelector = true;
                }
            }
        }
    }
    return isPositive(mode) || skipToNextSelector;
}
function isNodeMatchingSelector ( tNode , selector ) { ngDevMode && assertDefined ( selector [ 0 ] , 'Selector should have a tag name' ) ; var mode = 4 /* ELEMENT */ ; var nodeAttrs = tNode . attrs ; var selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs . indexOf ( 1 /* SelectOnly */ ) : - 1 ; // When processing ":not" selectors, we skip to the next ":not" if the // current one doesn't match var skipToNextSelector = false ; for ( var i = 0 ; i < selector . length ; i ++ ) { var current = selector [ i ] ; if ( typeof current === 'number' ) { // If we finish processing a :not selector and it hasn't failed, return false if ( ! skipToNextSelector && ! isPositive ( mode ) && ! isPositive ( current ) ) { return false ; } // If we are skipping to the next :not() and this mode flag is positive, // it's a part of the current :not() selector, and we should keep skipping if ( skipToNextSelector && isPositive ( current ) ) continue ; skipToNextSelector = false ; mode = current | ( mode & 1 /* NOT */ ) ; continue ; } if ( skipToNextSelector ) continue ; if ( mode & 4 /* ELEMENT */ ) { mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */ ; if ( current !== '' && current !== tNode . tagName ) { if ( isPositive ( mode ) ) return false ; skipToNextSelector = true ; } } else { var attrName = mode & 8 /* CLASS */ ? 'class' : current ; var attrIndexInNode = findAttrIndexInNode ( attrName , nodeAttrs ) ; if ( attrIndexInNode === - 1 ) { if ( isPositive ( mode ) ) return false ; skipToNextSelector = true ; continue ; } var selectorAttrValue = mode & 8 /* CLASS */ ? current : selector [ ++ i ] ; if ( selectorAttrValue !== '' ) { var nodeAttrValue = void 0 ; var maybeAttrName = nodeAttrs [ attrIndexInNode ] ; if ( selectOnlyMarkerIdx > - 1 && attrIndexInNode > selectOnlyMarkerIdx ) { nodeAttrValue = '' ; } else { ngDevMode && assertNotEqual ( maybeAttrName , 0 /* NamespaceURI */ , 'We do not match directives on namespaced attributes' ) ; nodeAttrValue = nodeAttrs [ attrIndexInNode + 1 ] ; } if ( mode & 8 /* CLASS */ && ! isCssClassMatching ( nodeAttrValue , selectorAttrValue ) || mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue ) { if ( isPositive ( mode ) ) return false ; skipToNextSelector = true ; } } } } return isPositive ( mode ) || skipToNextSelector ; }
A utility function to match an Ivy node static data against a simple CSS selector

@param node static data to match
@param selector
@returns true if node matches the selector.
A utility function to match an Ivy node static data against a simple CSS selector