| 260 | // Implement the identical functionality for filter and not |
| 261 | |
| 262 | function winnow(elements, qualifier, not) { |
| 263 | if (jQuery.isFunction(qualifier)) { |
| 264 | return jQuery.grep(elements, function(elem, i) { |
| 265 | /* jshint -W018 */ |
| 266 | return !!qualifier.call(elem, i, elem) !== not; |
| 267 | }); |
| 268 | |
| 269 | } |
| 270 | |
| 271 | if (qualifier.nodeType) { |
| 272 | return jQuery.grep(elements, function(elem) { |
| 273 | return (elem === qualifier) !== not; |
| 274 | }); |
| 275 | |
| 276 | } |
| 277 | |
| 278 | if (typeof qualifier === "string") { |
| 279 | if (isSimple.test(qualifier)) { |
| 280 | return jQuery.filter(qualifier, elements, not); |
| 281 | } |
| 282 | |
| 283 | qualifier = jQuery.filter(qualifier, elements); |
| 284 | } |
| 285 | |
| 286 | return jQuery.grep(elements, function(elem) { |
| 287 | return (core_indexOf.call(qualifier, elem) >= 0) !== not; |
| 288 | }); |
| 289 | } |
| 290 | |
| 291 | var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, |
| 292 | rtagName = /<([\w:]+)/, |