cq-prolyfill.js
function evaluateQuery(parent, query) {

	var container = getContainer(parent, query._prop);
	var qValues = query._values.slice(0);
	var i;

	var cValue;
	if (query._prop === 'width' || query._prop === 'height') {
		cValue = getSize(container, query._prop);
	}
	else {
		cValue = getComputedStyle(container).getPropertyValue(query._prop);
	}

	if (query._filter) {
		var color = parseColor(cValue);
		if (query._filter[0] === 'h') {
			cValue = color[0];
		}
		else if (query._filter[0] === 's') {
			cValue = color[1];
		}
		else if (query._filter[0] === 'l') {
			cValue = color[2];
		}
		else if (query._filter[0] === 'a') {
			cValue = color[3];
		}
		else {
			return false;
		}
	}
	else if (query._valueType === 'c') {
		cValue = parseColor(cValue).join(',');
	}
	else if (query._valueType === 'l') {
		for (i = 0; i < qValues.length; i++) {
			qValues[i] = getComputedLength(qValues[i], parent);
		}
		if (typeof cValue === 'string') {
			cValue = getComputedLength(cValue, parent);
		}
	}
	else if (query._valueType === 'n') {
		cValue = parseFloat(cValue);
	}
	else if (typeof cValue === 'string') {
		cValue = cValue.trim();
	}

	if ((
		query._types[0][0] === '>'
		|| query._types[0][0] === '<'
	) && (
		typeof cValue !== 'number'
		|| typeof qValues[0] !== 'number'
	)) {
		return false;
	}

	for (i = 0; i < qValues.length; i++) {
		if (!(
			(query._types[i] === '>=' && cValue >= qValues[i])
			|| (query._types[i] === '<=' && cValue <= qValues[i])
			|| (query._types[i] === '>' && cValue > qValues[i])
			|| (query._types[i] === '<' && cValue < qValues[i])
			|| (query._types[i] === '=' && cValue === qValues[i])
		)) {
			return false;
		}
	}

	return true;

}
function evaluateQuery(parent, query) {

	var container = getContainer(parent, query._prop);
	var qValues = query._values.slice(0);
	var i;

	var cValue;
	if (query._prop === 'width' || query._prop === 'height') {
		cValue = getSize(container, query._prop);
	}
	else {
		cValue = getComputedStyle(container).getPropertyValue(query._prop);
	}

	if (query._filter) {
		var color = parseColor(cValue);
		if (query._filter[0] === 'h') {
			cValue = color[0];
		}
		else if (query._filter[0] === 's') {
			cValue = color[1];
		}
		else if (query._filter[0] === 'l') {
			cValue = color[2];
		}
		else if (query._filter[0] === 'a') {
			cValue = color[3];
		}
		else {
			return false;
		}
	}
	else if (query._valueType === 'c') {
		cValue = parseColor(cValue).join(',');
	}
	else if (query._valueType === 'l') {
		for (i = 0; i < qValues.length; i++) {
			qValues[i] = getComputedLength(qValues[i], parent);
		}
		if (typeof cValue === 'string') {
			cValue = getComputedLength(cValue, parent);
		}
	}
	else if (query._valueType === 'n') {
		cValue = parseFloat(cValue);
	}
	else if (typeof cValue === 'string') {
		cValue = cValue.trim();
	}

	if ((
		query._types[0][0] === '>'
		|| query._types[0][0] === '<'
	) && (
		typeof cValue !== 'number'
		|| typeof qValues[0] !== 'number'
	)) {
		return false;
	}

	for (i = 0; i < qValues.length; i++) {
		if (!(
			(query._types[i] === '>=' && cValue >= qValues[i])
			|| (query._types[i] === '<=' && cValue <= qValues[i])
			|| (query._types[i] === '>' && cValue > qValues[i])
			|| (query._types[i] === '<' && cValue < qValues[i])
			|| (query._types[i] === '=' && cValue === qValues[i])
		)) {
			return false;
		}
	}

	return true;

}
function evaluateQuery ( parent , query ) { var container = getContainer ( parent , query . _prop ) ; var qValues = query . _values . slice ( 0 ) ; var i ; var cValue ; if ( query . _prop === 'width' || query . _prop === 'height' ) { cValue = getSize ( container , query . _prop ) ; } else { cValue = getComputedStyle ( container ) . getPropertyValue ( query . _prop ) ; } if ( query . _filter ) { var color = parseColor ( cValue ) ; if ( query . _filter [ 0 ] === 'h' ) { cValue = color [ 0 ] ; } else if ( query . _filter [ 0 ] === 's' ) { cValue = color [ 1 ] ; } else if ( query . _filter [ 0 ] === 'l' ) { cValue = color [ 2 ] ; } else if ( query . _filter [ 0 ] === 'a' ) { cValue = color [ 3 ] ; } else { return false ; } } else if ( query . _valueType === 'c' ) { cValue = parseColor ( cValue ) . join ( ',' ) ; } else if ( query . _valueType === 'l' ) { for ( i = 0 ; i < qValues . length ; i ++ ) { qValues [ i ] = getComputedLength ( qValues [ i ] , parent ) ; } if ( typeof cValue === 'string' ) { cValue = getComputedLength ( cValue , parent ) ; } } else if ( query . _valueType === 'n' ) { cValue = parseFloat ( cValue ) ; } else if ( typeof cValue === 'string' ) { cValue = cValue . trim ( ) ; } if ( ( query . _types [ 0 ] [ 0 ] === '>' || query . _types [ 0 ] [ 0 ] === '<' ) && ( typeof cValue !== 'number' || typeof qValues [ 0 ] !== 'number' ) ) { return false ; } for ( i = 0 ; i < qValues . length ; i ++ ) { if ( ! ( ( query . _types [ i ] === '>=' && cValue >= qValues [ i ] ) || ( query . _types [ i ] === '<=' && cValue <= qValues [ i ] ) || ( query . _types [ i ] === '>' && cValue > qValues [ i ] ) || ( query . _types [ i ] === '<' && cValue < qValues [ i ] ) || ( query . _types [ i ] === '=' && cValue === qValues [ i ] ) ) ) { return false ; } } return true ; }
True if the query matches otherwise false

@param  {Element} parent
@param  {object}  query
@return {boolean}
True if the query matches otherwise false