Closed
Bug 12432
Opened 25 years ago
Closed 25 years ago
OnLoad fired before document load completes / not fired
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Core
DOM: UI Events & Focus Handling
Tracking
()
People
(Reporter: morse, Assigned: joki)
Details
Attachments
(2 files)
Copy the content below into the two files called x.html and x.js. Bring up x.html in the browser window. Click on the test that says "Click here". You get an assertion failure (debug builds only) but we already know about that (see bug 10441). Continue execution from the failure. You will see the word "Thanks" appear. So far all is well. Now reload the x.html page again. The frames are blank. This is bad! Here are the files: 1. x.html: <html> <script src="x.js"> </script> <frameset rows = "20,10" onload="load1();"> <frame src="about:blank"> <frame src="about:blank"> </frameset> </html> 2. x.js: function load1(){ top.frames[0].document.open(); top.frames[0].document.write( "<a onclick='top.load2();' href=''>Click here</a>" ); top.frames[0].document.close(); } function load2(){ top.frames[0].document.open(); top.frames[0].document.write( "Thanks" ); top.frames[0].document.close(); }
Updated•25 years ago
|
Assignee: nisheeth → joki
Comment 1•25 years ago
|
||
This is something else that Tom should look at. Tom, I'm sorry that I can't do more snooping on this one because I need to get my document state storage stuff done before I leave for vacation. Hopefully, my comments in bug 12433 will give you some context for this bug. This uses the same kind of test case as that bug.
Updated•25 years ago
|
Component: Layout → Event Handling
OS: Windows NT → All
Hardware: PC → All
Summary: Javascript OnClick handler is not re-usable → OnLoad fired before document load completes
Comment 2•25 years ago
|
||
I got to this bug because it was the only remaining wallet blocker/blockee after I closed out 8920. To remove framesets from the equation, I rewrote the test case. In doing so, the bug is still present, but I found that it is not the onclick handler that is failing, but the onload handler. Also notice that this is because the onload is fired before the document load completes. Attaching the improved test case...
Comment 3•25 years ago
|
||
Comment 4•25 years ago
|
||
Reporter | ||
Comment 5•25 years ago
|
||
I appreciate your looking out for wallet. Although this is a real bug, it is no longer blocking wallet. We did a work-around for it a long time ago. I guess bug report 7530 is no longer being maintained. Sorry.
Updated•25 years ago
|
Summary: OnLoad fired before document load completes → OnLoad fired before document load completes / not fired
Comment 6•25 years ago
|
||
Cool... Well I guess that lowers the priority, thanks! :) At any rate, and rather unfortunately, the bug is not reproducible from the test case I just attached, you have to download the files to your local machine to reproduce it. :S (Apparently this is an issue of the web server performance because it is reproducible internally on my machine at http://blueviper.mcom.com/forms/x.html ) x.html: <html> <script src="x.js"> </script> <body onload="dump('********** About to execute load1!\n');load1();"> Load1 was NOT executed successfully </body> </html> x.js: dump("********** x.js is being loaded!\n") function load1(){ dump("********** load1 is being executed!\n") document.open() document.write("Load 1 was executed successfully") document.close() } When I first loaded this test case I got the following messages to the console, as expected: Opening file signon.tbl failed FindShortcut: in='blueviper/forms/x.html' out='null' ********** x.js is being loaded! title string = [Mozilla] failed to set the page title. ********** About to execute load1! ********** load1 is being executed! title string = [Mozilla] Document http://blueviper/forms/x.html loaded successfully Document: Done (2.315 secs) Then I click Reload and see this: Going to reload failed to set the page title. ********** About to execute load1! ********** load1 is being executed! title string = [Mozilla] Document http://blueviper/forms/x.html loaded successfully Document: Done (1.056 secs) ********** x.js is being loaded! title string = [Mozilla] Notice that load1 tries to execute before x.js is loaded. The document.written text never appears. (Or maybe it does but then is overwritten by the actual document text right away) If I visit a few pages, then type in the url again, I get this: FindShortcut: in='blueviper/forms/x.html' out='null' failed to set the page title. Document http://blueviper/forms/x.html loaded successfully Document: Done (0.752 secs) ********** x.js is being loaded! title string = [Mozilla] This time load1 didn't even attempt to execute, indicating that the onload handler never fired. Looks like the <script src=x.js> tag may not be blocking in the reload (second) case and onload handler may not be firing in the last case. Hope this helps!
Assignee | ||
Comment 8•25 years ago
|
||
Marking as dupe but this test should be used for 17088, its simpler. *** This bug has been marked as a duplicate of 17088 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•