| 5498 | |
| 5499 | // Implement the identical functionality for filter and not |
| 5500 | function winnow( elements, qualifier, not ) { |
| 5501 | if ( jQuery.isFunction( qualifier ) ) { |
| 5502 | return jQuery.grep( elements, function( elem, i ) { |
| 5503 | /* jshint -W018 */ |
| 5504 | return !!qualifier.call( elem, i, elem ) !== not; |
| 5505 | }); |
| 5506 | |
| 5507 | } |
| 5508 | |
| 5509 | if ( qualifier.nodeType ) { |
| 5510 | return jQuery.grep( elements, function( elem ) { |
| 5511 | return ( elem === qualifier ) !== not; |
| 5512 | }); |
| 5513 | |
| 5514 | } |
| 5515 | |
| 5516 | if ( typeof qualifier === "string" ) { |
| 5517 | if ( isSimple.test( qualifier ) ) { |
| 5518 | return jQuery.filter( qualifier, elements, not ); |
| 5519 | } |
| 5520 | |
| 5521 | qualifier = jQuery.filter( qualifier, elements ); |
| 5522 | } |
| 5523 | |
| 5524 | return jQuery.grep( elements, function( elem ) { |
| 5525 | return ( core_indexOf.call( qualifier, elem ) >= 0 ) !== not; |
| 5526 | }); |
| 5527 | } |
| 5528 | |
| 5529 | var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, |
| 5530 | rtagName = /<([\w:]+)/, |