Re: [Ieleak-devel] problem in drip with clone of clone
Brought to you by:
matthiasmiller
From: Johan R. <jr...@co...> - 2006-08-15 09:39:28
|
Hi Matthias, Thanks for your efforts on this issue so far. Your proposed solution looks like valid. However there were 2 small problems in the implementation: I did a review and saw that you (by accident) forgot to change the undefined variable 'name' into 'functionName'. Due to that the override functions were not executed anymore. However this was not causing any error at runtime and therefore it seems that the provided testcase for the clone of the clone succeeded. I fixed the 'functionName' problem so that the overrides were executed properly but then again the cloneOfCloneTestCase failed. I did some deeper analysis of the problem and found out that the restore of the overridden function was too early. I moved the restore to the end of the function (after the native function call) and then it seems that this solution works. Please review my changes in __drip_createOverrideFunction in drip.js.=20 Regards, Johan. -----Original Message----- From: iel...@li... [mailto:iel...@li...] On Behalf Of Matthias Miller Sent: Tuesday, August 15, 2006 5:19 AM To: iel...@li... Subject: Re: [Ieleak-devel] problem in drip with clone of clone Johan Rosman wrote: > > Hi Matthias, > > It happened that I found some weird issue in Drip/Sieve. In one of our > web applications we have a construction where we make a clone of a clone. > > Let me try to explain the problem step by step: > > - we have some DOM node having a property called 'myid' with the value > "the original" > > - we make a clone of that object and named it 'clone' > > - we set some property 'myid' on 'clone' with clone.myid =3D "the clone" > > - then we make a clone of the clone with cloneOfClone =3D=20 > clone.cloneNode(true); > > - then we observe the value of cloneOfClone.myid. The value of that=20 > property should be "the clone" but when running in Drip it shows the=20 > value "the orginal" > > I have attached a test page, when you run this page inside 'Drip0.5'=20 > it will show you the error. However when you run this page in 'IE' it=20 > goes fine. In 'sIEve' I had the same problem. I analyzed the problem=20 > and the problem is caused by the cloneNode method overriding. I have=20 > attached a 2^nd page where you can simulate the error when running=20 > without Drip but straight in the IE browser. > > For my sIEve project I made straight forward work around in the=20 > javascript hook code. Please look at the change in sIEveHooks.js. I=20 > also looked at your javascript '__drip_createOverrideFunction'. There=20 > you are talking about 'preserving the this pointer'. Did you encounter > similar problems? May be you can explain more in detail what you are=20 > trying to solve in that particular function. > Thanks for the test case. If I recall correctly, after certain of the overridden functions are=20 executed (I believe it was cloneNode), "this" will point to a different=20 node. That's why I'm using the "self" parameter. This is unrelated to=20 the problem that you're seeing. The reason for this problem is that when you clone a node, the cloneNode override is copied from the original node to the cloned node. Since this override contains a reference to the native function for the original=20 node, it clones the wrong node. I've changed drip.js to dynamically=20 retrieve the native function to prevent this problem. You can see how I=20 implemented this in __drip_createOverrideFunction in drip.js. -Matthias Miller ------------------------------------------------------------------------ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1= 21642 _______________________________________________ Ieleak-devel mailing list Iel...@li... https://lists.sourceforge.net/lists/listinfo/ieleak-devel ***************************************************************************= ************************ The information in this message is confidential and may be legally privile= ged.=20 It is intended solely for the addressee. Access to this message by anyone e= lse is=20 unauthorized. If you are not the intended recipient, any disclosure, copyin= g, or=20 distribution of the message, or any action or omission taken by you in reli= ance=20 on it is prohibited and may be unlawful. Please immediately contact the sen= der if=20 you have received this message in error. This email does not constitute any= =20 commitment from Cordys Holding BV or any of its subsidiaries except when= =20 expressly agreed in a written agreement between the intended recipient and= =20 Cordys Holding BV or its subsidiaries. **************************************************************************= ************************* |