- visible: 'a.type!="hidden"&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
- hidden: 'a.type=="hidden"||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
+ visible: '"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
+ hidden: '"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
- text: "a.type=='text'",
- radio: "a.type=='radio'",
- checkbox: "a.type=='checkbox'",
- file: "a.type=='file'",
- password: "a.type=='password'",
- submit: "a.type=='submit'",
- image: "a.type=='image'",
- reset: "a.type=='reset'",
- button: 'a.type=="button"||jQuery.nodeName(a,"button")',
+ text: "'text'==a.type",
+ radio: "'radio'==a.type",
+ checkbox: "'checkbox'==a.type",
+ file: "'file'==a.type",
+ password: "'password'==a.type",
+ submit: "'submit'==a.type",
+ image: "'image'==a.type",
+ reset: "'reset'==a.type",
+ button: '"button"==a.type||jQuery.nodeName(a,"button")',
input: "/input|select|textarea|button/i.test(a.nodeName)"
},
".": "jQuery.className.has(a,m[2])",
input: "/input|select|textarea|button/i.test(a.nodeName)"
},
".": "jQuery.className.has(a,m[2])",
_resort: function(m){
return ["", m[1], m[3], m[2], m[5]];
},
_resort: function(m){
return ["", m[1], m[3], m[2], m[5]];
},
- "[": "parseInt(m[2])?jQuery.nth(a.parentNode.firstChild,parseInt(m[2]),'nextSibling',a)==a:jQuery.find(m[2],a).length"
+ "[": "jQuery.find(m[2],a).length"
// Match: :even, :last-chlid, #id, .class
new RegExp("^([:.#]*)(" +
// Match: :even, :last-chlid, #id, .class
new RegExp("^([:.#]*)(" +
- jQuery.each( ret, function(){
- for ( var c = this.firstChild; c; c = c.nextSibling )
- if ( c.nodeType == 1 && ( jQuery.nodeName(c, m[1]) || m[1] == "*" ) )
+ for ( var i = 0; ret[i]; i++ )
+ for ( var c = ret[i].firstChild; c; c = c.nextSibling )
+ if ( c.nodeType == 1 && ( m[1] == "*" || jQuery.nodeName(c, m[1]) ) )
// Attempt to match each, individual, token in
// the specified order
var re = jQuery.token[i], fn = jQuery.token[i+1];
// Attempt to match each, individual, token in
// the specified order
var re = jQuery.token[i], fn = jQuery.token[i+1];
// Do a quick check for the existence of the actual ID attribute
// to avoid selecting by the name attribute in IE
// Do a quick check for the existence of the actual ID attribute
// to avoid selecting by the name attribute in IE
oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
// Do a quick check for node name (where applicable) so
// that div#foo searches will be really fast
ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
// Do a quick check for node name (where applicable) so
// that div#foo searches will be really fast
ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
- r = jQuery.grep( r, function(e) {
- return jQuery.className.has(e, m[2]);
- });
+ r = jQuery.classFilter( r, m[2] );
- // Remember, then wipe out, the result set
- var tmp = r;
- r = [];
-
- // Then try to find the element with the ID
- jQuery.each( tmp, function(){
- if ( this.getAttribute("id") == m[2] ) {
- r = [ this ];
- return false;
+ var tmp = [];
+
+ // Try to find the element with the ID
+ for ( var i = 0; r[i]; i++ )
+ if ( r[i].getAttribute("id") == m[2] ) {
+ tmp = [ r[i] ];
+ break;
+ classFilter: function(r,m,not){
+ m = " " + m + " ";
+ var tmp = [];
+ for ( var i = 0; r[i]; i++ ) {
+ var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
+ if ( !not && pass || not && !pass )
+ tmp.push( r[i] );
+ }
+ return tmp;
+ },
+
- jQuery.each( p, function(i,re){
-
- // Look for, and replace, string-like sequences
- // and finally build a regexp out of it
- m = re.exec( t );
+ for ( var i = 0; p[i]; i++ ) {
+ m = p[i].exec( t );
// :not() is a special case that can be optimized by
// keeping it out of the expression list
if ( m[1] == ":" && m[2] == "not" )
r = jQuery.filter(m[3], r, true).r;
// :not() is a special case that can be optimized by
// keeping it out of the expression list
if ( m[1] == ":" && m[2] == "not" )
r = jQuery.filter(m[3], r, true).r;
// Otherwise, find the expression to execute
else {
var f = jQuery.expr[m[1]];
// Otherwise, find the expression to execute
else {
var f = jQuery.expr[m[1]];
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType == 1 ) num++;
if ( num == result || result == "even" && num % 2 == 0 && num > 1 && cur == elem ||
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType == 1 ) num++;
if ( num == result || result == "even" && num % 2 == 0 && num > 1 && cur == elem ||