Bug Tracker

Ticket #3163: jquery-iefix.diff

File jquery-iefix.diff, 1.7 kB (added by henric, 6 months ago)

patch against 1.2.6

  • .js

    old new  
    935935 
    936936        return ret; 
    937937    }, 
     938     
     939    discardElement: function( element ) { 
     940        var garbageBin = document.getElementById('IELeakGarbageBin'); 
     941        if (!garbageBin) { 
     942            garbageBin = document.createElement('DIV'); 
     943            garbageBin.id = 'IELeakGarbageBin'; 
     944            garbageBin.style.display = 'none'; 
     945            document.body.appendChild(garbageBin); 
     946        } 
    938947 
     948        // move the element to the garbage bin 
     949        garbageBin.appendChild(element); 
     950        garbageBin.innerHTML = ''; 
     951        if (element.__listener) 
     952            element.__listener = null; 
     953    }, 
     954     
    939955    clean: function( elems, context ) { 
    940956        var ret = []; 
    941957        context = context || document; 
     
    9931009                div.innerHTML = wrap[1] + elem + wrap[2]; 
    9941010 
    9951011                // Move to the right depth 
    996                 while ( wrap[0]-- ) 
     1012                while ( wrap[0]-- ) { 
     1013                    var oldDiv = div; 
    9971014                    div = div.lastChild; 
    998  
     1015                    oldDiv.removeChild(div); 
     1016                    jQuery.discardElement(oldDiv); 
     1017                    oldDiv = null; 
     1018                } 
     1019                 
    9991020                // Remove IE's autoinserted <tbody> from table fragments 
    10001021                if ( jQuery.browser.msie ) { 
    10011022 
     
    10191040                } 
    10201041 
    10211042                elem = jQuery.makeArray( div.childNodes ); 
     1043                 
     1044                while (div.firstChild) { 
     1045                    var child = div.firstChild; 
     1046                    div.removeChild( child ); 
     1047                } 
     1048                 
     1049                jQuery.discardElement(div); 
    10221050            } 
    10231051 
    10241052            if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) ) 
     
    13151343            }); 
    13161344            if (this.parentNode) 
    13171345                this.parentNode.removeChild( this ); 
     1346            jQuery.discardElement(this); 
    13181347        } 
    13191348    }, 
    13201349