Javascript debugger

Koos Vriezen koos.vriezen at xs4all.nl
Sun Feb 16 12:38:17 GMT 2003


On Sun, 16 Feb 2003, Koos Vriezen wrote:

> Well, I'm looking at a deadlocked situation now, an error dialog asks if I
> want to debug and behind that a confirmation if I allow js to open a new
> window, I pressed 'Debug' and can't do anything anymore. Confirmation
> dialog keeps the focus, but Yes/No buttons don't work.
> I think trouble with timer/onload events, while in session...

Interesting, I now see why this page always fails when setting
confirmation on new windows to 'ask'. This is what happens:
A subframe is finished and
  void KHTMLPart::checkEmitLoadEvent()
    if ( d->m_bLoadEventEmitted || ...) return;
    .....
    d->m_bLoadEventEmitted = true;
    if (d->m_doc)
       d->m_doc->close();
  }
causes a onload event which want to open a new window ->Confirmation dialog.
In the dialog's event loop other frames get finished and causes an onload
event of the parent frame. This is too early!!!, because a child frame is
still inside the onLoad js function waiting for the Confirmation dialog.
The cause is 'd->m_bLoadEventEmitted = true;' before emiting the event.
Unfortunately, this bool is also used for the reentrance check here
(because DocumentImpl::close() also calls checkEmitLoadEvent().

Koos





More information about the kfm-devel mailing list