From kfm-devel Mon Oct 04 14:41:41 2004 From: David Faure Date: Mon, 04 Oct 2004 14:41:41 +0000 To: kfm-devel Subject: gmail problem investigated: frame onload Message-Id: <200410041641.44088.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kfm-devel&m=109690082612439 With Rainder Endres' help, I managed to track down the reason gmail won't load. The onload event listener for frames and iframes is registered on the wrong body: the main body instead of the frame's body. Which means only one gets executed, and the JS code waits for ever. Testcase [gmail uses iframes, but it's the same with frames] : ==> blank.html <== Hello world ==> frameset.html <== The problem is HTMLFrameElementImpl::parseAttribute (for ATTR_ONLOAD). The code says: static_cast( getDocument() )->body()-> setHTMLEventListener(EventImpl::LOAD_EVENT, getDocument()->createHTMLEventListener(attr->value().string(),"onload")); And this obviously finds the main element, since getDocument() for the frame element finds the main document. Did this ever work in KHTML? I thought it did, but looking at the code, I fail to see how. Since the attributes are parsed before the frame is "attached", so there is no KHTMLPart for the frame yet... i.e. no way to find the right document (or body) from that code. So do we need to store the value of the load and unload listeners until attach? We would then need to have some code somewhere that sets the listener on the frame's body when creating it..... I'm working now on a patch that attempts to do that. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).