Skip to content

Commit

Permalink
Backing out cec68e2, was causing serialize tests to fail. Un-fixes jq…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Dec 9, 2010
1 parent b4bb6e1 commit 29616e6
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 92 deletions.
32 changes: 16 additions & 16 deletions src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++ ) {
Expand All @@ -166,7 +166,7 @@ jQuery.fn.extend({
}
}
}

return this;
},

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

return this;
},

Expand Down Expand Up @@ -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 {
Expand All @@ -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
);
}
Expand Down Expand Up @@ -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 );
}
};
Expand Down Expand Up @@ -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"))) );
Expand All @@ -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 ] ) {
Expand All @@ -581,14 +581,14 @@ jQuery.extend({
}
}
}

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

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

delete cache[ id ];
}
}
Expand Down
Loading

0 comments on commit 29616e6

Please sign in to comment.