aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-12-06 21:17:27 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-12-06 21:17:27 -0500
commit282c044d64e366d1bcb76d7d4f49c54098c6547f (patch)
treec402803239e35f09573abab598ae8a141c1cc558 /src/manipulation.js
parent747600b157a831422a7c5acd8b768c348b673495 (diff)
downloadjquery-282c044d64e366d1bcb76d7d4f49c54098c6547f.tar.gz
jquery-282c044d64e366d1bcb76d7d4f49c54098c6547f.zip
Fix #13013. Move jQuery.buildFragment() to compat plugin.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index f07d6bbfb..e3026426d 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -292,7 +292,7 @@ jQuery.fn.extend({
// Flatten any nested arrays
args = core_concat.apply( [], args );
- var fragment, first, results, scripts, hasScripts, iNoClone, node, doc,
+ var fragment, first, scripts, hasScripts, iNoClone, node, doc,
i = 0,
l = this.length,
value = args[0],
@@ -310,8 +310,9 @@ jQuery.fn.extend({
}
if ( this[0] ) {
- results = jQuery.buildFragment( args, this );
- fragment = results;
+ doc = this[0].ownerDocument;
+ fragment = doc.createDocumentFragment();
+ jQuery.clean( args, doc, fragment );
first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
@@ -512,22 +513,6 @@ function cloneFixAttributes( src, dest ) {
dest.removeAttribute( jQuery.expando );
}
-jQuery.buildFragment = function( args, context, scripts ) {
- var fragment;
-
- // Set context from what may come in as undefined or a jQuery collection or a node
- // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
- // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
- context = context || document;
- context = !context.nodeType && context[0] || context;
- context = context.ownerDocument || context;
-
- fragment = context.createDocumentFragment();
- jQuery.clean( args, context, fragment, scripts );
-
- return fragment;
-};
-
jQuery.each({
appendTo: "append",
prependTo: "prepend",