Bug report for ExtJS 3.2.2

if Ext.EventManager.purgeElement (recursive param set to true) is passed a DOM element that contains a DOM element childNode of nodeType 3 (textNode), the result is IE hanging forever, or an "Object method or property not found" exception.

line numbers may be off

Stack trace:
Code:
Ext.EventManager.purgeElement
......var id = getId(el) //line 2323 of ext-all-debug.js
............Ext.EventManager.getId(el)
.................id = Ext.id(el); //line 1950 of ext-all-debug.js
......................el.id = (prefix || "ext-gen") + (++idSeed);   //line 111 of ext-base-debug.js


Instead of calling purgeElement directly with a DOM element (which may only be intended to receive Ext.Element as param), the other way this is triggered is via a call to removeNode when enableNestedListenerRemoval is true.

Code:
Ext.enableNestedListenerRemoval = true;
Ext.removeNode(domNode); //where domNode has at least one textNode child
If formDiv contains a textNode element, the error is triggered.


in Ext.removeNode, line 346 of ext-base-debug.js appears to indicate a DOM element CAN be passed to Ext.EventManager.purgeElement. The ExtJS docs specify the node param as type: HTMLElement.
Code:
           
if(n && n.parentNode && n.tagName != 'BODY'){
             (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n);
                n.parentNode.removeChild(n);
                delete Ext.elCache[n.id];
            }

PROPOSED FIX:

Either avoid passing DOM nodes to Ext.EventManager.purgeElement or avoid trying to illegally set the id of a textNode by adding this code to the Ext.id method.


Code:
   id : function(el, prefix){
            el = Ext.getDom(el, true) || {};
            
            //begin new code
            //Ensure this node isn't a textnode
            if(el.nodeName && el.nodeType === 3)
            {
            	return;
            }
            //end new code
            
            if (!el.id) {
                el.id = (prefix || "ext-gen") + (++idSeed);
            }
            return el.id;
        },