selector-css3.js revision d59c625bc91380e7d3458db5e7e9a581d670684a
/**
* The selector css3 module provides support for css3 selectors.
* @module dom
* @submodule selector-css3
* @for Selector
*/
/*
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-last-of-type': 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) {
},
},
},
'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;
}