@@ 4359-4388 (lines=30) @@ | ||
4356 | fragment.textContent = ""; |
|
4357 | ||
4358 | i = 0; |
|
4359 | while ( ( elem = nodes[ i++ ] ) ) { |
|
4360 | ||
4361 | // Skip elements already in the context collection (trac-4087) |
|
4362 | if ( selection && jQuery.inArray( elem, selection ) > -1 ) { |
|
4363 | if ( ignored ) { |
|
4364 | ignored.push( elem ); |
|
4365 | } |
|
4366 | continue; |
|
4367 | } |
|
4368 | ||
4369 | contains = jQuery.contains( elem.ownerDocument, elem ); |
|
4370 | ||
4371 | // Append to fragment |
|
4372 | tmp = getAll( fragment.appendChild( elem ), "script" ); |
|
4373 | ||
4374 | // Preserve script evaluation history |
|
4375 | if ( contains ) { |
|
4376 | setGlobalEval( tmp ); |
|
4377 | } |
|
4378 | ||
4379 | // Capture executables |
|
4380 | if ( scripts ) { |
|
4381 | j = 0; |
|
4382 | while ( ( elem = tmp[ j++ ] ) ) { |
|
4383 | if ( rscriptType.test( elem.type || "" ) ) { |
|
4384 | scripts.push( elem ); |
|
4385 | } |
|
4386 | } |
|
4387 | } |
|
4388 | } |
|
4389 | ||
4390 | return fragment; |
|
4391 | } |
@@ 5115-5142 (lines=28) @@ | ||
5112 | fragment.textContent = ""; |
|
5113 | ||
5114 | i = 0; |
|
5115 | while ( (elem = nodes[ i++ ]) ) { |
|
5116 | ||
5117 | // #4087 - If origin and destination elements are the same, and this is |
|
5118 | // that element, do not do anything |
|
5119 | if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { |
|
5120 | continue; |
|
5121 | } |
|
5122 | ||
5123 | contains = jQuery.contains( elem.ownerDocument, elem ); |
|
5124 | ||
5125 | // Append to fragment |
|
5126 | tmp = getAll( fragment.appendChild( elem ), "script" ); |
|
5127 | ||
5128 | // Preserve script evaluation history |
|
5129 | if ( contains ) { |
|
5130 | setGlobalEval( tmp ); |
|
5131 | } |
|
5132 | ||
5133 | // Capture executables |
|
5134 | if ( scripts ) { |
|
5135 | j = 0; |
|
5136 | while ( (elem = tmp[ j++ ]) ) { |
|
5137 | if ( rscriptType.test( elem.type || "" ) ) { |
|
5138 | scripts.push( elem ); |
|
5139 | } |
|
5140 | } |
|
5141 | } |
|
5142 | } |
|
5143 | ||
5144 | return fragment; |
|
5145 | }, |