[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Event frameset.onUnload too late?
From:       Koos Vriezen <koos.vriezen () xs4all ! nl>
Date:       2002-01-29 22:28:52
[Download RAW message or body]

Hi,

This simple patch fixes both crash and onUnload sequence:

--- html/html_baseimpl.cpp      2002/01/23 15:48:12     1.149
+++ html/html_baseimpl.cpp      2002/01/29 22:19:39
@@ -525,9 +525,9 @@ khtml::FindSelectionResult HTMLFrameSetE

 void HTMLFrameSetElementImpl::detach()
 {
+    dispatchHTMLEvent(EventImpl::UNLOAD_EVENT,false,false);
     HTMLElementImpl::detach();
     // ### send the event when we actually get removed from the doc
instead of here
-    dispatchHTMLEvent(EventImpl::UNLOAD_EVENT,false,false);
 }

Seems to me, that the order of onLoad is:
 - body of frame
 - frameset
and of onUnload
 - frameset
 - body of frame

Koos


On Tue, 29 Jan 2002, Koos Vriezen wrote:

> Hi,
>
> Now konqueror crashes when closing second window of example below.
> On Fri, 25 Jan 2002, Koos Vriezen wrote:
> > Hi,
> >
> > Consider this test case:
> >
> > <html><body><script>
> > window.open("frameset.html", "Window2", "width=200,height=600");
> > </script>
> > Window1
> > </body></html>
> >
> > where frameset.html is:
> >
> > <html>
> > <frameset onLoad='alert(top.myframe.document.b)'
> > onUnload='alert(top.myframe.document.b)'>
> >   <frame name="myframe" src="frame.html">
> > </frameset></html>
> >
> > where frame.html is:
> >
> > <html><body id="b">Window2</body></html>
> >
> > The onLoad event is correct, but the onUnload event seems to lost its
> > frame. Changing the events to
> > top.myframe.document.firstChild.innerHTML shows with onLoad
> > <body id="b">Window2</body> and with onUnload the contents of
> > frameset.html (<frameset ...</frameset>).
> >
> > BTW. the title of the opened window should be "Window2" and not
> > "file://.."
>
> Regards,
>
> Koos Vriezen
>
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic