Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -422,16 +422,12 @@ jQuery.extend({ | ||
}, | ||
|
||
buildFragment: function( elems, context, scripts, selection ) { | ||
var elem, tmp, tag, wrap, j, ll, contains, | ||
fragment = context.createDocumentFragment(), | ||
var elem, tmp, tag, wrap, contains, j, | ||
i = 0, | ||
l = elems.length, | ||
fragment = context.createDocumentFragment(), | ||
nodes = []; | ||
|
||
for ( ; i < l; i++ ) { | ||
elem = elems[ i ]; | ||
|
||
if ( elem || elem === 0 ) { | ||
while ( ( elem = elems[ i++ ] ) || elem === 0 ) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
markelog
Author
Member
|
||
|
||
// Add nodes directly | ||
if ( jQuery.type( elem ) === "object" ) { | ||
@@ -465,14 +461,13 @@ jQuery.extend({ | ||
// Support: Webkit, IE | ||
tmp.textContent = ""; | ||
} | ||
} | ||
} | ||
|
||
// Remove wrapper from fragment | ||
fragment.textContent = ""; | ||
|
||
for ( i = 0, l = nodes.length; i < l; i++ ) { | ||
elem = nodes[ i ]; | ||
i = 0; | ||
while ( (elem = nodes[ i++ ]) ) { | ||
contains = jQuery.contains( elem.ownerDocument, elem ); | ||
|
||
// #4087 - If origin and destination elements are the same, and this is | ||
@@ -491,9 +486,9 @@ jQuery.extend({ | ||
|
||
// Capture executables | ||
if ( scripts ) { | ||
for ( j = 0, ll = tmp.length; j < ll; j++ ) { | ||
elem = tmp[ j ]; | ||
|
||
j = 0; | ||
while ( (elem = tmp[ j++ ]) ) { | ||
if ( rscriptType.test( elem.type || "" ) ) { | ||
core_push.call( scripts, elem ); | ||
} | ||
On second thought, this one is a functional change (e.g.,
jQuery.buildFragment( [ "<li>first</li>", false, "<li>last</li>" ], document )
), and should probably be reverted.