// add @ for attrib\r
"\\[([^@\\]~\\$\\*\\^\\|\\!]+)(=[^\\]]+)?\\]", "[@$1$2]",\r
// multiple queries\r
- "\\s*,\\s*", "|",\r
+ "\\s*,\\s*", "|.//",\r
// , + ~ >\r
"\\s*(\\+|~|>)\\s*", "$1",\r
//* ~ + >\r
"([\\w\\-\\*]+):only-child", "*[last()=1]/self::$1",\r
// :empty\r
"([\\w\\-\\*]+):empty", "$1[not(*) and not(normalize-space())]",\r
+ // :odd :even, this is intentional since sizzle behaves so\r
+ ":odd" , ":nth-child(even)",\r
+ ":even" , ":nth-child(odd)",\r
+ // :not\r
"(.+):not\\(([^\\)]*)\\)", rc_Not,\r
+ // :nth-child\r
"([a-zA-Z0-9\\_\\-\\*]+):nth-child\\(([^\\)]*)\\)", rc_nth_child,\r
// :contains(selectors)\r
":contains\\(([^\\)]*)\\)", "[contains(string(.),'$1')]",\r
":(enabled)", "[not(@disabled)]",\r
":(checked)", "[@$1='$1']",\r
":(disabled)", "[@$1]",\r
+ ":(first)", "[1]",\r
+ ":(last)", "[last()]",\r
// put '*' when tag is omitted\r
"(^|\\|)(\\[)", "$1*$2",\r
// Replace escaped dots and spaces\r
*/
public class SelectorEngineNativeIE8 extends SelectorEngineSizzleIE {
- public static String NATIVE_EXCEPTIONS_REGEXP = ".*(:contains|!=|:checked|:not|:nth-|:last-|:only-).*";
+ public static String NATIVE_EXCEPTIONS_REGEXP = ".*(:contains|!=|:checked|:not|:nth-|:only-|:first|:last|:even|:odd).*";
public NodeList<Element> select(String selector, Node ctx) {
if (!SelectorEngine.hasQuerySelector || selector.matches(NATIVE_EXCEPTIONS_REGEXP)) {