aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation/buildFragment.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/manipulation/buildFragment.js')
-rw-r--r--src/manipulation/buildFragment.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/manipulation/buildFragment.js b/src/manipulation/buildFragment.js
index 782de0c61..34bcc70c2 100644
--- a/src/manipulation/buildFragment.js
+++ b/src/manipulation/buildFragment.js
@@ -1,19 +1,20 @@
define( [
"../core",
"../core/toType",
+ "../var/isAttached",
"./var/rtagName",
"./var/rscriptType",
"./wrapMap",
"./getAll",
"./setGlobalEval"
-], function( jQuery, toType, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
+], function( jQuery, toType, isAttached, rtagName, rscriptType, wrapMap, getAll, setGlobalEval ) {
"use strict";
var rhtml = /<|&#?\w+;/;
function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, contains, j,
+ var elem, tmp, tag, wrap, attached, j,
fragment = context.createDocumentFragment(),
nodes = [],
i = 0,
@@ -77,13 +78,13 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
continue;
}
- contains = jQuery.contains( elem.ownerDocument, elem );
+ attached = isAttached( elem );
// Append to fragment
tmp = getAll( fragment.appendChild( elem ), "script" );
// Preserve script evaluation history
- if ( contains ) {
+ if ( attached ) {
setGlobalEval( tmp );
}