Alternative fix for <frame onload>
David Faure
faure at kde.org
Tue Oct 5 15:27:22 CEST 2004
On Tuesday 05 October 2004 11:16, David Faure wrote:
> Can I convince you to apply my fix for the problem instead of the
> dispatchWindowEvent hack?
In fact I can't :) Dirk pointed out that my patch might do a few things wrong,
and indeed it does, compared to Mozilla.
It appears that setting the listener on the frame's document is wrong, at least
compared to Mozilla, since the following testcase doesn't trigger the frame's
"document.onload".
==> frame_onload.html <==
<script>
function frameOnload() {
alert("OK, frame onload");
}
</script>
<frameset rows="*,*,*">
<frame name="one" src="onload_helper.html" onload="top.frameOnload()">
</frameset>
==> onload_helper.html <==
<html>
<body>
<script>
function foo() { alert('document.onload was called!') };
document.onload=foo;
function bod() { alert('document.body.onload was called!') };
document.body.onload=bod;
</script>
You should see this text...
</body>
</html>
So I withdraw my patch, and will work on a better one, based on your patch (but
sending the load event from documentimpl::close instead of dispatchWindowEvent itself,
if possible).
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the Khtml-devel
mailing list