Bug 3609

Summary: onload event never called for iframe element with empty or about:blank src
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal CC: ap, darin, gavin.sharp
Priority: P2    
Version: 412   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Test case
none
Handy in-browser test case
none
patch for an existing test case
darin: review+
Handy in-browser test case (no race condition) none

David Kilzer (:ddkilzer)
Reported 2005-06-18 21:24:38 PDT
Summary: The onload event of an iframe element is never called, even after the content of the iframe element has been loaded. Steps to Reproduce: See attached test case. Expected Results: The onload event of the iframe element is called if it exists. Actual Results: The onload event of the iframe element is never called. Regression: N/A Notes: N/A
Attachments
Test case (2.00 KB, patch)
2005-06-18 21:41 PDT, David Kilzer (:ddkilzer)
no flags
Handy in-browser test case (376 bytes, text/html)
2005-06-18 21:47 PDT, David Kilzer (:ddkilzer)
no flags
patch for an existing test case (969 bytes, patch)
2006-02-11 11:18 PST, Alexey Proskuryakov
darin: review+
Handy in-browser test case (no race condition) (376 bytes, text/html)
2006-02-25 05:30 PST, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2005-06-18 21:26:46 PDT
As originally noted in this message to webkit-dev: http://www.opendarwin.org/pipermail/webkit-dev/2005-June/000125.html I also found this bug on W3C's Bugzilla site that provides a work-around: http://www.w3.org/Bugs/Public/show_bug.cgi?id=228
David Kilzer (:ddkilzer)
Comment 2 2005-06-18 21:41:28 PDT
Created attachment 2469 [details] Test case Test case which currently breaks (as it should since this issue hasn't been fixed).
David Kilzer (:ddkilzer)
Comment 3 2005-06-18 21:45:17 PDT
Regarding Comment 1, the W3C Bugzilla bug provides a workaround in their JavaScript (ECMAScript) test suite, which uses JSUnit. Fixing this bug may also make JSUnit work better with Safari. http://www.edwardh.com/jsunit/
David Kilzer (:ddkilzer)
Comment 4 2005-06-18 21:47:10 PDT
Created attachment 2470 [details] Handy in-browser test case The text on the screen should change to "IFrame OnLoad Event Called" when the test page is loaded, but doesn't.
Eric Seidel (no email)
Comment 5 2005-12-28 22:21:07 PST
I just ran into this today. This is really annoying... :(
Eric Seidel (no email)
Comment 6 2005-12-28 22:32:03 PST
Part of what might make this hard, is that currently sometimes the RenderTree does the loading, and sometimes the DOMTree does the loading for <object> tags. Although I'm still not familiar enough with how onload events work to know. HTMLObjectElementImpl::parseMappedAttribute() definitely creates an onload event listener if specified. I'm not sure how that onload event listener is supposed to be fired however. It looks like Image onload events are special cased. Those seem to be the only ones we support other than <body> onload event listeners. SVG will need generic onload handing as well.
Geoffrey Garen
Comment 7 2005-12-31 10:18:57 PST
I suspect the same bug applies to onunload, onbeforeunload, etc.
Alexey Proskuryakov
Comment 8 2006-02-09 14:13:29 PST
This problem has been fixed very recently (between revisions r12598 and r12724). I'm not closing this bug yet, because: 1) according to comment 7, investigation of onunload/onbeforeunload/etc behavior may be needed; 2) if the fix was an unintentional side effect, landing an additional test case for this would be highly desirable. Please note that the attached test case still fails because of bug 7161 - but the onload handler now gets actually called (you can add an alert() to verify).
Alexey Proskuryakov
Comment 9 2006-02-11 11:18:48 PST
Created attachment 6414 [details] patch for an existing test case This was fixed intentionally in r12638 - this bug was mentioned in the log entry, and a test was included. There is a small typo in the test; the attached patch fixes it. Apparently, onunload and onbeforeunload are not supposed to work (they don't in WinIE, Firefox and Opera).
Darin Adler
Comment 10 2006-02-11 15:20:33 PST
Comment on attachment 6414 [details] patch for an existing test case Oops! r=me
David Kilzer (:ddkilzer)
Comment 11 2006-02-25 05:30:18 PST
Created attachment 6728 [details] Handy in-browser test case (no race condition)
David Kilzer (:ddkilzer)
Comment 12 2006-02-25 05:30:58 PST
Verified bug is fixed.
Note You need to log in before you can comment on or make changes to this bug.