X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=493082212d8410d0ffe4c2d19e407139f18e4e54;hb=fcf623786aeae20485e5253bd2b66c8758053646;hp=5f4b15dd946168211586820da2a1c00debf999bb;hpb=82ac384b494258e17e2856ee2259475ecb0174ca;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 5f4b15d..4930822 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -440,12 +440,12 @@ jQuery.buildFragment = function( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); - // Only cache "small" (1/2 KB) strings that are associated with the main document + // Only cache "small" (1/2 KB) HTML strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put or elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && - !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { + args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { cacheable = true; cacheresults = jQuery.fragments[ args[0] ]; @@ -617,6 +617,11 @@ jQuery.extend({ jQuery.removeEvent( elem, type, data.handle ); } } + + // Null the DOM reference to avoid IE6/7/8 leak (#7054) + if ( data.handle ) { + data.handle.elem = null; + } } if ( deleteExpando ) {