Patch: Crash: blocking JS alert and deleting a window

Koos Vriezen koos.vriezen at xs4all.nl
Mon Oct 28 23:03:46 GMT 2002


On Mon, 28 Oct 2002, David Faure wrote:

> > > This is why I was thinking of something slightly different:
> > > a new kind of event, which we'd define ourselves (like those defined
> > > in kparts/event.h). This event would be sent to konqueror's
> > > parts before destroying them.
> > > Hmm, I guess we could also simply send a CloseEvent, if Qt
> > > doesn't do it for non-toplevel-widgets?
> > > The point is that we could then simply write KHTMLView::closeEvent()
> > > instead of having to create an event filterer.
> >
> > Maybe, but is konqueror active closing the mainwindow or just responding
> > to a X/WM close event.
> ? Not sure what you mean here.

Not important anymore I think (konq's main window is closed by a
CloseEvent and unable to reschedule a close of it's part)

> > If so, the EventFilterer should be moved to
> > konqueror to get something like KHTMLView::closeEvent() working, which
> > doesn't reduce complexity than.
>
> ? KonqMainWindow has a closeEvent() already. No need for an event filter,
> the toplevel widget gets a close event, it can simply implement closeEvent().

And rejecting means it will not be closed immediately? (so KHTMLView can
post a CloseEvent next, should work I think)

> > Not to mention other hosts for KHTML...
>
> We should put the code in KParts::MainWindow::closeEvent, indeed.

Other kparts could benifit from this, great!

> > Btw. if this is the only solution we can think of, we are still not done.
> > What about scripts like: 'alert(foo);alert(bar)' or
> > 'eval("alert(foo)");alert(bar)'? KJS::Window should also be informed
> > not to spawn another message box.
>
> (saw your next msg). Hmm, strange indeed. Will check tomorrow (I'll also try
> to come up with a patch for my CloseEvent idea).

If you can produce one, I think between closeChildDialogs() and clear() of
KHTMLView, there shouldn't be any child popups allowed. (already made a
patch for it, but then couldn't find a testcase for it, yes the otherway
around, mind crashing :-) )

Koos





More information about the kfm-devel mailing list