Alternative fix for <frame onload>

David Faure faure at kde.org
Tue Oct 5 11:16:37 CEST 2004


This simple testcase was still broken in Konqueror - the onload event listener
for frames was put in the main <body>, so only one was fired.

<html>
<frameset rows="*,*,*">
<frame name="main" src="blank.html" onload="alert('loaded main')">
<frame name="blank" src="blank.html" onload="alert('loaded blank')">
</frameset>
</html>

(Same thing happens with <iframe>, and this broke gmail)

I fixed that with the attached patch, by delaying the creation of 
the event listener until the frame's document actually exists.

Then someone pointed me to the safari fix for this bug, which includes
DocumentImpl::ownerElement() and a hack to dispatchWindowEvent itself
(with some code duplication), to send the frame's onload event from there.
Can I convince you to apply my fix for the problem instead of the
dispatchWindowEvent hack? The code in DocumentImpl::close() looks much
cleaner now, and all load events are emitted from a single place 
(instead of three in safari).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: text/x-diff
Size: 8290 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/khtml-devel/attachments/20041005/efa2921a/diff.bin


More information about the Khtml-devel mailing list