jquery selector: reverting [5343], check #1960.
This commit is contained in:
parent
d726a96b1f
commit
e6fccd7103
1 changed files with 16 additions and 22 deletions
|
@ -331,15 +331,9 @@ jQuery.extend({
|
||||||
r = jQuery.classFilter(r, m[2], not);
|
r = jQuery.classFilter(r, m[2], not);
|
||||||
|
|
||||||
else if ( m[1] == "[" ) {
|
else if ( m[1] == "[" ) {
|
||||||
var type = m[3];
|
var tmp = [], type = m[3];
|
||||||
|
|
||||||
// special case, filter by exact name
|
for ( var i = 0, rl = r.length; i < rl; i++ ) {
|
||||||
if ( !not && m[2] == 'name' && type == '=' )
|
|
||||||
r = jQuery.grep( document.getElementsByName(m[5]), function(elem){
|
|
||||||
return jQuery.inArray( elem, r ) != -1;
|
|
||||||
});
|
|
||||||
else {
|
|
||||||
for ( var i = 0, rl = r.length, tmp = []; i < rl; i++ ) {
|
|
||||||
var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
|
var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
|
||||||
|
|
||||||
if ( z == null || /href|src|selected/.test(m[2]) )
|
if ( z == null || /href|src|selected/.test(m[2]) )
|
||||||
|
@ -353,8 +347,8 @@ jQuery.extend({
|
||||||
(type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
|
(type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
|
||||||
tmp.push( a );
|
tmp.push( a );
|
||||||
}
|
}
|
||||||
|
|
||||||
r = tmp;
|
r = tmp;
|
||||||
}
|
|
||||||
|
|
||||||
// We can get a speed boost by handling nth-child here
|
// We can get a speed boost by handling nth-child here
|
||||||
} else if ( m[1] == ":" && m[2] == "nth-child" ) {
|
} else if ( m[1] == ":" && m[2] == "nth-child" ) {
|
||||||
|
|
Loading…
Reference in a new issue