microformat-shiv.js
function(rootNode, includeRoot) {
			var arr = null,
				out = [],
				classList = [],
				items,
				x,
				i,
				y,
				key;


			// build an array of v1 root names
			for(key in modules.maps) {
				if (modules.maps.hasOwnProperty(key)) {
					classList.push(modules.maps[key].root);
				}
			}

			// get all elements that have a class attribute
			includeRoot = (includeRoot) ? includeRoot : false;
			if(includeRoot && rootNode.parentNode) {
				arr = modules.domUtils.getNodesByAttribute(rootNode.parentNode, 'class');
			} else {
				arr = modules.domUtils.getNodesByAttribute(rootNode, 'class');
			}

			// loop elements that have a class attribute
			x = 0;
			i = arr.length;
			while(x < i) {

				items = modules.domUtils.getAttributeList(arr[x], 'class');

				// loop classes on an element
				y = items.length;
				while(y--) {
					// match v1 root names
					if(classList.indexOf(items[y]) > -1) {
						out.push(arr[x]);
						break;
					}

					// match v2 root name prefix
					if(modules.utils.startWith(items[y], 'h-')) {
						out.push(arr[x]);
						break;
					}
				}

				x++;
			}
			return out;
		}
function(rootNode, includeRoot) {
			var arr = null,
				out = [],
				classList = [],
				items,
				x,
				i,
				y,
				key;


			// build an array of v1 root names
			for(key in modules.maps) {
				if (modules.maps.hasOwnProperty(key)) {
					classList.push(modules.maps[key].root);
				}
			}

			// get all elements that have a class attribute
			includeRoot = (includeRoot) ? includeRoot : false;
			if(includeRoot && rootNode.parentNode) {
				arr = modules.domUtils.getNodesByAttribute(rootNode.parentNode, 'class');
			} else {
				arr = modules.domUtils.getNodesByAttribute(rootNode, 'class');
			}

			// loop elements that have a class attribute
			x = 0;
			i = arr.length;
			while(x < i) {

				items = modules.domUtils.getAttributeList(arr[x], 'class');

				// loop classes on an element
				y = items.length;
				while(y--) {
					// match v1 root names
					if(classList.indexOf(items[y]) > -1) {
						out.push(arr[x]);
						break;
					}

					// match v2 root name prefix
					if(modules.utils.startWith(items[y], 'h-')) {
						out.push(arr[x]);
						break;
					}
				}

				x++;
			}
			return out;
		}
function ( rootNode , includeRoot ) { var arr = null , out = [ ] , classList = [ ] , items , x , i , y , key ; // build an array of v1 root names for ( key in modules . maps ) { if ( modules . maps . hasOwnProperty ( key ) ) { classList . push ( modules . maps [ key ] . root ) ; } } // get all elements that have a class attribute includeRoot = ( includeRoot ) ? includeRoot : false ; if ( includeRoot && rootNode . parentNode ) { arr = modules . domUtils . getNodesByAttribute ( rootNode . parentNode , 'class' ) ; } else { arr = modules . domUtils . getNodesByAttribute ( rootNode , 'class' ) ; } // loop elements that have a class attribute x = 0 ; i = arr . length ; while ( x < i ) { items = modules . domUtils . getAttributeList ( arr [ x ] , 'class' ) ; // loop classes on an element y = items . length ; while ( y -- ) { // match v1 root names if ( classList . indexOf ( items [ y ] ) > - 1 ) { out . push ( arr [ x ] ) ; break ; } // match v2 root name prefix if ( modules . utils . startWith ( items [ y ] , 'h-' ) ) { out . push ( arr [ x ] ) ; break ; } } x ++ ; } return out ; }
finds all microformat roots in a rootNode

@param  {DOM Node} rootNode
@param  {Boolean} includeRoot
@return {Array}
finds all microformat roots in a rootNode