selector-css3.js revision 1e4299e83b45ff5cf2fc6b545f0186ecf831ec87
/*
an+b = get every _a_th node starting at the _b_th
0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element
1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n")
an+0 = get every _a_th element, "0" may be omitted
*/
var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_)
n = RegExp.$2, // "n"
result = [],
op;
if (oddeven) {
a = 2; // always every other
op = '+';
n = 'n';
} else if ( isNaN(a) ) {
a = (n) ? 1 : 0; // start from the first or no repeat
}
if (a === 0) { // just the first
if (reverse) {
}
return true;
} else {
return false;
}
} else if (a < 0) {
a = Math.abs(a);
}
if (!reverse) {
return true;
}
}
} else {
return true;
}
}
}
return false;
};
'root': function(node) {
},
'nth-child': function(node, m) {
},
'nth-last-child': function(node, m) {
},
'nth-of-type': function(node, m) {
},
'nth-last-of-type': function(node, m) {
},
'first-child': function(node) {
},
'last-child': function(node) {
},
'first-of-type': function(node) {
},
'last-of-type': function(node) {
},
'only-child': function(node) {
},
'only-of-type': function(node) {
},
'empty': function(node) {
},
'not': function(node, m) {
},
'contains': function(node, m) {
},
'checked': function(node) {
}
});
'^=': '^{val}', // Match starts with value
'$=': '{val}$', // Match ends with value
'*=': '{val}' // Match contains value as substring
});
while (sib) {
return true;
}
}
return false;
}