]> source.dussan.org Git - jquery.git/commitdiff
Revert the changes from 65ebf57c1e5d7fa96536b66d4fcacbafad8dc1e5, they were ineffectu...
authorjeresig <jeresig@gmail.com>
Thu, 17 Dec 2009 19:17:05 +0000 (14:17 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 17 Dec 2009 19:17:05 +0000 (14:17 -0500)
src/core.js
src/traversing.js

index 8f81c520ecba388156ae8f7f9a9a007a255b1286..1edf98edcaceeb5c80c68d4c69a643628fea3404 100644 (file)
@@ -53,7 +53,7 @@ var jQuery = function( selector, context ) {
 
 jQuery.fn = jQuery.prototype = {
        init: function( selector, context ) {
-               var match, elem, ret, doc, parent;
+               var match, elem, ret, doc;
 
                // Handle $(""), $(null), or $(undefined)
                if ( !selector ) {
@@ -88,12 +88,7 @@ jQuery.fn = jQuery.prototype = {
 
                                        } else {
                                                ret = buildFragment( [ match[1] ], [ doc ] );
-                                               parent = ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment;
-                                               selector = [];
-
-                                               while ( parent.firstChild ) {
-                                                       selector.push( parent.removeChild( parent.firstChild ) );
-                                               }
+                                               selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
                                        }
 
                                // HANDLE: $("#id")
index 6375d9d1f3f6e29c25161d8cb53911710793d026..d30e4e6da1c57da2874d46c1279ed28289ecd995 100644 (file)
@@ -161,7 +161,7 @@ jQuery.fn.extend({
 });
 
 jQuery.each({
-       parent: function(elem){return elem.parentNode;},
+       parent: function(elem){var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null;},
        parents: function(elem){return jQuery.dir(elem,"parentNode");},
        parentsUntil: function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},
        next: function(elem){return jQuery.nth(elem,2,"nextSibling");},