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

List:       kfm-devel
Subject:    Re: gmail problem investigated: frame onload
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-10-04 14:58:27
Message-ID: 200410041658.31320.bastian () kde ! org
[Download RAW message or body]


On Monday 04 October 2004 16:41, David Faure wrote:
> 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 <==
> <html>
> <frameset rows="*,*,*">
> <frame name="main" src="blank.html" onload="alert('loaded main')">
> <frame name="blank" src="blank.html" onload="alert('loaded blank')">
> </frameset>
> </html>
>
> The problem is HTMLFrameElementImpl::parseAttribute (for ATTR_ONLOAD).
> The code says:
>         static_cast<HTMLDocumentImpl*>( getDocument() )->body()->
>               setHTMLEventListener(EventImpl::LOAD_EVENT,
>            
> getDocument()->createHTMLEventListener(attr->value().string(),"onload"));
> And this obviously finds the main <body> 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.

See also the last (reverted) patch to html_baseimpl.cpp Same issue.
http://bugs.kde.org/show_bug.cgi?id=72440 has the full discussion.

Cheers,
Waldo
-- 
bastian@kde.org  |  Wanted: Talented KDE developer  |  bastian@suse.com
  http://www.suse.de/de/company/suse/jobs/suse_pbu/developer_kde.html

[Attachment #3 (application/pgp-signature)]

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

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