From 13449a99b2b279a7ae6401b8373d20504362213d Mon Sep 17 00:00:00 2001 From: Paul Ramos Date: Tue, 4 Dec 2012 21:30:37 -0500 Subject: Fix #11989. Remove fragment cache, moving to jquery-compat. Close gh-1052. --- src/core.js | 3 +-- src/manipulation.js | 43 ++++++++----------------------------------- 2 files changed, 9 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/core.js b/src/core.js index eee810070..22b56ce5d 100644 --- a/src/core.js +++ b/src/core.js @@ -497,8 +497,7 @@ jQuery.extend({ if ( scripts ) { jQuery( scripts ).remove(); } - return jQuery.merge( [], - ( parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment ).childNodes ); + return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { diff --git a/src/manipulation.js b/src/manipulation.js index f215d5a8c..6cde99404 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -22,7 +22,6 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca rtbody = / or elements in a fragment - // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache - // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 - if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document && - first.charAt(0) === "<" && !rnocache.test( first ) && - (jQuery.support.checkClone || !rchecked.test( first )) && - (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { - - // Mark cacheable and look for a hit - cacheable = true; - fragment = jQuery.fragments[ first ]; - cachehit = fragment !== undefined; - } - - if ( !fragment ) { - fragment = context.createDocumentFragment(); - jQuery.clean( args, context, fragment, scripts ); + fragment = context.createDocumentFragment(); + jQuery.clean( args, context, fragment, scripts ); - // Update the cache, but only store false - // unless this is a second parsing of the same content - if ( cacheable ) { - jQuery.fragments[ first ] = cachehit && fragment; - } - } - - return { fragment: fragment, cacheable: cacheable }; + return fragment; }; -jQuery.fragments = {}; - jQuery.each({ appendTo: "append", prependTo: "prepend", -- cgit v1.2.3