Skip to content
Permalink
Browse files

Backing out cec68e2, was causing serialize tests to fail. Un-fixes #5…

…566.
  • Loading branch information...
jeresig committed Dec 9, 2010
1 parent b4bb6e1 commit 29616e60c88bf300f4b2ee4ad1a89a8ac6481027
Showing with 72 additions and 92 deletions.
  1. +16 −16 src/manipulation.js
  2. +56 −76 test/unit/manipulation.js
@@ -151,7 +151,7 @@ jQuery.fn.extend({
return set;
}
},

// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
@@ -166,7 +166,7 @@ jQuery.fn.extend({
}
}
}

return this;
},

@@ -182,7 +182,7 @@ jQuery.fn.extend({
elem.removeChild( elem.firstChild );
}
}

return this;
},

@@ -334,9 +334,9 @@ jQuery.fn.extend({
} else {
results = jQuery.buildFragment( args, this, scripts );
}

fragment = results.fragment;

if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
@@ -352,7 +352,7 @@ jQuery.fn.extend({
root(this[i], first) :
this[i],
i > 0 || results.cacheable || this.length > 1 ?
jQuery(fragment).clone(true)[0] :
fragment.cloneNode(true) :
fragment
);
}
@@ -444,18 +444,18 @@ jQuery.each({
var ret = [],
insert = jQuery( selector ),
parent = this.length === 1 && this[0].parentNode;

if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
return this;

} else {
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}

return this.pushStack( ret, name, insert.selector );
}
};
@@ -543,7 +543,7 @@ jQuery.extend({
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );

} else {
if ( ret[i].nodeType === 1 ) {
ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
@@ -555,22 +555,22 @@ jQuery.extend({

return ret;
},

cleanData: function( elems ) {
var data, id, cache = jQuery.cache,
special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;

for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
continue;
}

id = elem[ jQuery.expando ];

if ( id ) {
data = cache[ id ];

if ( data && data.events ) {
for ( var type in data.events ) {
if ( special[ type ] ) {
@@ -581,14 +581,14 @@ jQuery.extend({
}
}
}

if ( deleteExpando ) {
delete elem[ jQuery.expando ];

} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}

delete cache[ id ];
}
}
Oops, something went wrong.

0 comments on commit 29616e6

Please sign in to comment.
You can’t perform that action at this time.