Scope in event handlers

Darin Adler darin at apple.com
Fri Mar 11 19:17:05 CET 2005


On Mar 11, 2005, at 8:07 AM, David Faure wrote:

> Please consider the patch below for Safari, which simply moves the  
> code down to the right class.
>
> There is another way of fixing that problem, if we can assume that  
> an HTML event listener
> will always only be used for the same node, which I think is the  
> case. Then we could set the scope
> when defining the function (i.e. in parseCode()) instead of doing  
> it for each event.
> But this would require passing the Node via many methods  
> (khtml_part, kjs_proxy, html_doc etc.)
> so it would be a much bigger patch - but if we agree that it would  
> be correct we could do it
> in both KHTML and Safari. What do you think?

If I understand this correctly, Maciej just recently (days ago) did  
this very fix, including passing the node in lots of additional  
places. We're trying to get out a new WebCore tarball soon which will  
have this fix in it.

     -- Darin



More information about the Khtml-devel mailing list