Bug 15484 - Safari (and opera) fire two onload events while FireFox fires only one
Summary: Safari (and opera) fire two onload events while FireFox fires only one
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, NeedsReduction
Depends on:
Blocks:
 
Reported: 2007-10-12 18:30 PDT by Eric Seidel (no email)
Modified: 2022-09-20 13:46 PDT (History)
9 users (show)

See Also:


Attachments
test case (3.65 KB, text/html)
2007-10-12 18:31 PDT, Eric Seidel (no email)
no flags Details
test case (1.55 KB, text/html)
2007-10-12 18:34 PDT, Eric Seidel (no email)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-10-12 18:30:58 PDT
Safari (and opera) fire two onload events while FireFox fires only one

I'm not sure who's correct, but I'm going to lean towards the browser with the larger market share.

The "bug" here is exposed by the ordering of the insertion of the iframe into the document and the setting of the url.

FireFox only fires the onload event once, after the final URL has been set.  Opera and Safari fire the onload handler right when the iframe is inserted, and then again after the src value has been changed.  I tried at least once to reduce this and seen the bug go away.  I expect it's partially timing related.
Comment 1 Eric Seidel (no email) 2007-10-12 18:31:16 PDT
Created attachment 16647 [details]
test case
Comment 2 Eric Seidel (no email) 2007-10-12 18:34:19 PDT
Created attachment 16648 [details]
test case
Comment 3 Andrew Wellington 2007-10-12 18:43:43 PDT
The output in IE6 and IE7 is:

about to set URL: resources/viewspec-parser.svg
Starting: resources/viewspec-parser.svg


Only one iframe is loaded. Seems the test needs to be modified to work properly in IE.
Comment 4 Michael Bolin 2010-12-06 18:40:01 PST
Test page:

http://bolinfest.com/webkit/iframe_onload.html

I would argue that the first onload event fired by Webkit is the problematic one: the body.onload in the iframe should fire first, then the iframe.onload (as it does in Firefox).
Comment 5 Ahmad Saleem 2022-05-29 17:02:46 PDT
I am still able to reproduce the following bug in Safari 15.5 on macOS 12.4. Chrome Canary 104 and Firefox Nightly 102 both - fires "iframe loaded" dialog just once after "Hello World".

Test case - http://bolinfest.com/webkit/iframe_onload.html
Comment 6 Radar WebKit Bug Importer 2022-05-31 09:53:52 PDT
<rdar://problem/94158603>
Comment 7 Ahmad Saleem 2022-09-20 13:46:20 PDT
Unable to reproduce this in Safari Technology Preview 153 and it just fire "Hello World" and after it, it just load "iframe loaded" dialog once similar to other browsers.

I am marking this as "RESOLVED CONFIGURATION CHANGED". Please reopen, if it is reproducible. Thanks!

Appreciate if someone can add related Commit details for future reference.