[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: onload event listeners attached to NodeImpls which fail to be
From: David Faure <faure () kde ! org>
Date: 2005-05-26 14:54:10
Message-ID: 200505261654.11145.faure () kde ! org
[Download RAW message or body]
On Thursday 26 May 2005 16:15, Andrew Coles wrote:
> I've looked through the Webcore source to see how they deal with this problem.
> It appears that they don't store or use a pointer to the original nodeimpl in
> JSLazyEventListener; the important difference is that in parseCode() the
> following chunk of code is omitted:
>
> if (originalNode)
> {
> // Add the event's home element to the scope
> // (and the document, and the form - see KJS::HTMLElement::eventHandlerScope)
> ScopeChain scope = listener.scope();
> Object thisObj = Object::dynamicCast(getDOMNode(exec, originalNode));
> if (thisObj.isValid()) {
> static_cast<DOMNode*>(thisObj.imp())->pushEventHandlerScope(exec, scope);
> listener.setScope(scope);
> }
> }
>
> Removing it causes http://cis.strath.ac.uk/~ac/remangle2.html to no longer
> crash Konqueror. But, the code is obviously there for a reason; any offers?
Hmm, this comes from a Safari merge in the first place :)
(Well, more precisely a discussion with Maciej about scope in event handlers,
on which we agreed)
I moved that code as part of revision 406282, and Webcore-315 definitely has
the storage of the originalNode in JSLazyEventListener.
Are you looking at an older webcore? Or an even-more-recent one than 315?
--
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic