Provide a graceful failover for [name=foo] queries that are looking for non-input/iframe/form elements. Fixes jQuery bug #4081.
This commit is contained in:
parent
782b4af76e
commit
21dde30348
3 changed files with 8 additions and 5 deletions
|
@ -333,8 +333,9 @@ var Expr = Sizzle.selectors = {
|
|||
}
|
||||
},
|
||||
NAME: function(match, context, isXML){
|
||||
if ( typeof context.getElementsByName !== "undefined" && !isXML ) {
|
||||
return context.getElementsByName(match[1]);
|
||||
if ( typeof context.getElementsByName !== "undefined" ) {
|
||||
var ret = context.getElementsByName(match[1]);
|
||||
return ret.length === 0 ? null : ret;
|
||||
}
|
||||
},
|
||||
TAG: function(match, context){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue