mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
jquery core: fix for #1960, delegating to document.getElementsByName for [name=...] selectors (not in combination with :not)
This commit is contained in:
parent
ab756ceab0
commit
4d652ca520
@ -331,9 +331,15 @@ jQuery.extend({
|
||||
r = jQuery.classFilter(r, m[2], not);
|
||||
|
||||
else if ( m[1] == "[" ) {
|
||||
var tmp = [], type = m[3];
|
||||
var type = m[3];
|
||||
|
||||
for ( var i = 0, rl = r.length; i < rl; i++ ) {
|
||||
// special case, filter by exact name
|
||||
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] ];
|
||||
|
||||
if ( z == null || /href|src|selected/.test(m[2]) )
|
||||
@ -347,8 +353,8 @@ jQuery.extend({
|
||||
(type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
|
||||
tmp.push( a );
|
||||
}
|
||||
|
||||
r = tmp;
|
||||
}
|
||||
|
||||
// We can get a speed boost by handling nth-child here
|
||||
} else if ( m[1] == ":" && m[2] == "nth-child" ) {
|
||||
|
Loading…
Reference in New Issue
Block a user