Closes #741: Remove $("body") case in favor of $(document.body).

This commit is contained in:
Dave Methvin
2012-04-18 12:47:20 -04:00
committed by Rick Waldron waldron.rick@gmail.com
parent 376e0d9fa8
commit 532ba250a9
30 changed files with 757 additions and 627 deletions

View File

@@ -90,15 +90,6 @@ jQuery.fn = jQuery.prototype = {
return this;
}
// The body element only exists once, optimize finding it
if ( selector === "body" && !context && document.body ) {
this.context = document;
this[0] = document.body;
this.selector = selector;
this.length = 1;
return this;
}
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
@@ -132,7 +123,7 @@ jQuery.fn = jQuery.prototype = {
}
} else {
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
ret = jQuery.buildFragment( [ match[1] ], doc );
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
}
@@ -200,7 +191,7 @@ jQuery.fn = jQuery.prototype = {
},
toArray: function() {
return slice.call( this, 0 );
return slice.call( this );
},
// Get the Nth element in the matched element set OR