Bug 21233 - REGRESSION: window.onload event is not fired when page is revisited in the same session
Summary: REGRESSION: window.onload event is not fired when page is revisited in the sa...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P1 Major
Assignee: Nobody
URL: http://www.hueber.de/tell-me-more/
Keywords: InRadar, NeedsReduction, Regression
Depends on:
Blocks:
 
Reported: 2008-09-30 00:59 PDT by Holger Latzel
Modified: 2008-11-25 12:54 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Latzel 2008-09-30 00:59:12 PDT
I created some Prototype/Scriptaculous intro animations (elements appearing using the window.onload event) for the webpage http://www.hueber.de/tell-me-more/ which work perfectly with Safari 3.1/Firefox 2, 3/IE6, 7 but not with WebKit nightly builds (Mac 36882-37056/Win 36882).

To trigger the bug,
1. Visit http://www.hueber.de/tell-me-more/. The intro animations should work fine this time.
2. Click on a link (e.g. on the product packshot or on the "Schule & Hochschule" slider link at the top of the page).
3. Now click on the "Privatkunden" link at the top of the page (slider link again) to return to the previous page (do not use the history back button).
4. The intro animations don't show up at all because the window onload event is not fired when the page has finished loading. (In fact, the window.onload event gets fired when you click on a link again to get to another page. The animation works fine again when you hit the reload button.)

Though I use the Prototype event listener functions in this Javascript, I successfully reproduced the bug using the window.onload = function() { ... } construct.
Comment 1 Alexey Proskuryakov 2008-09-30 07:42:04 PDT
Why is this a bug? Going back to a page does not normally reload it, but returns one to a suspended version of it. Firing onload for a second time would be wrong.
Comment 2 Holger Latzel 2008-10-01 02:36:21 PDT
If one returns to a page by clicking on links that don't use history functions but contain URIs, then it is a bug.

I now had some time to spend on further testing this by creating two small test pages under
http://www.hlm.de/webkit/ that do the exact same thing. A first page with a small intro animation and a second page for linking back and forth.

Surprisingly, these two pages don't replicate the bug at the moment, at least not for me. The onload event is fired correctly every time I return to the first page by clicking on the link on the second page.

Since these two dummy pages contain nothing more than simple text in div boxes I will continue to do some more testing with added complexity (graphics, more javascripts). Hope to get back with the results later today or tomorrow.
Comment 3 Alexey Proskuryakov 2008-10-01 03:46:03 PDT
Sorry, my mistake - I somehow thought this was about using Back button, event though you specifically wrote it was not.
Comment 4 Holger Latzel 2008-10-01 07:25:45 PDT
No problem.

I now have made html copies of two pages from the Tell Me More infoservice and saved them under
http://www.hlm.de/webkit3/
to isolate them from the content management system on Hueber.de. There, the bug is not reproducible any longer by simply clicking twice ... it definitely needs a lot more clicking before it occurs.

I try to be more specific the next time but it may take some time because I have to return to my regular work for the next several days ;) Feel free to add any comment or contact me directly if there are any questions in the meantime.
Comment 5 Holger Latzel 2008-10-01 07:29:41 PDT
And, for the time being, the page at http://www.hueber.de/tell-me-more/ will remain unchanged and there the bug is still reproducable.
Comment 6 Alexey Proskuryakov 2008-11-20 05:49:21 PST
<rdar://problem/6388380>
Comment 7 Holger Latzel 2008-11-25 12:54:10 PST
Bug is not reproducible in Mac Webkit 38707 any longer. Loading of the page and event firing working perfectly. Thanks for this marvelous browser, folks!!