X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=98cbf372e7f6212530a026dd6fa04765e444ddab;hb=24db022ba06523f92e94ac5fa791fc4865b55ba7;hp=94f099be8958c8a2fa544005f99217daaafb7f86;hpb=760a244dbdca7b5a93d147c62ac37ff6eeb9573b;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 94f099b..98cbf37 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1509,7 +1509,7 @@ jQuery.extend({ // then some display: none elements are involved else { // Locate all of the parent display: none elements - for ( var a = elem; color(a); a = a.parentNode ) + for ( var a = elem; a && color(a); a = a.parentNode ) stack.unshift(a); // Go through and make them visible, but in reverse @@ -1725,8 +1725,17 @@ jQuery.extend({ merge: function(first, second) { // We have to loop this way because IE & Opera overwrite the length // expando of getElementsByTagName - for ( var i = 0; second[i]; i++ ) - first.push(second[i]); + + // Also, we need to make sure that the correct elements are being returned + // (IE returns comment nodes in a '*' query) + if ( jQuery.browser.msie ) { + for ( var i = 0; second[i]; i++ ) + if ( second[i].nodeType != 8 ) + first.push(second[i]); + } else + for ( var i = 0; second[i]; i++ ) + first.push(second[i]); + return first; }, @@ -2073,7 +2082,7 @@ jQuery.each({ var ret = jQuery.map(this,n); if ( a && typeof a == "string" ) ret = jQuery.multiFilter(a,ret); - return this.pushStack( ret ); + return this.pushStack( jQuery.unique(ret) ); }; });