Element Prototype Extension - Known Issues
Known issues which are so time consuming to solve that they should be mentioned
-
Element.cloneNode
Replacing Element.cloneNode is difficult for the following reason:
Cloning a node implies copying all the properties of the node. A node which have been EPE extended has a property called _appendChild which is a reference to the original appendChild method of that particular node.
When the node is cloned the reference is copied to the new node. IE thinks of _appendChild as a normal property so the reference is copied.d1._appendChild -> d1.appendChild
d1.appendChild -> EPE.appendChildd2 = d1.clone(false) will produce
d2._appendChild -> d1.appendChild d2.appendChild -> EPE.appendChildWhen d2 is calling appendChild the EPE.appendChild is executing and when d2._appendChild is called the original d1.appendChild is executed.
The original d1.appendChild is an instance function coupled to d1 so 'this' can not take on the value of d2.
So we need to replace the d2._appendChild with the original d2.appendChild but this is overwritten by EPE.appendChild.
Looks like we have to rewrite cloneNode from scratch :( -
APPLET and OBJECT tags
APPLET and OBJECT tags can not be prototype extended at the moment as IE does not allow to override the built-in methods. This is considered low priority as the APPLET tag is deprecated and the OBJECT tag is not heavily used in scripting contexts.
