Closed Bug 28572 Opened 25 years ago Closed 24 years ago

On unload fires when link opens in different frame or window

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: aarons, Assigned: jst)

Details

(Keywords: testcase, Whiteboard: [nsbeta2+] [NEED INFO][ETA 7/27])

Attachments

(3 files)

on pages with the following code
if (clicked==0)
Refering to any object on the page the action actually performed by the browser 
is equal to the value true of that statement. for example if it would be 
follwed by window.open the window would always open regardles what was actually 
done by the user.
This bug exists in version 2000021908.
I have been unable to verify whether this is a problem with a return value or 
the engine possibly ignoring the if part of the statement.
Do you have a testcase?  Example URL?
After email from aarons@netreliable.com, I think I understand now.  The problem
is that an unload event is triggered whenever a link is followed, even if the
page or frame itself is not unloaded (as when the link loads a page into a
different frame).  

Attaching a testcase.  Setting component to DOM0, reassign to vidur, cc: karnaze
for the frames angle.  Works as expected in NS 4.7.

To reproduce: 
1. Open frameset.html.  This loads click.html into right frame.  
2. Click on the link.  

Actual result: loads mozilla.org into the left frame, does not unload the right
frame.  Still, unload fires.
Expected result: no unload event, since frame is not unloaded.

Similarly, if you open just click.html and select the link, mozilla.org will
open in a new window, the old window does not unload, but unload event fires
nevertheless.
Assignee: rogerl → vidur
Severity: major → normal
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM Level 0
Ever confirmed: true
Keywords: 4xp, testcase
OS: Windows 98 → All
QA Contact: rginda → desale
Hardware: PC → All
Summary: variable returns incorrect value → unload fires when link opens in different frame or window
Passing along to Travis since the link handling code and onunload firing is 
currently in his neck of the woods. Travis, consult with Tom Pixley or me if you 
have questions about when onunload should fire for compatibility with 4.x.
Assignee: vidur → travis
Nominating nsbeta2. We have to start drawing a line on DOM0 backward 
compatibility; these bugs are supposed to be a high priority for nsbeta2 per the 
beta2 criteria.
Keywords: nsbeta2
Summary: unload fires when link opens in different frame or window → onunload fires when link opens in different frame or window
ekrock - do you have a top 100 site that this occurs on?
Assignee: travis → valeski
Summary: onunload fires when link opens in different frame or window → On unload fires when link opens in different frame or window
Whiteboard: [NEED INFO]
[nsbeta2+]
Whiteboard: [NEED INFO] → [nsbeta2+] [NEED INFO]
I think the basic problem is as explianed by Richard Zach. Unload Event fires 
even if Unload of window does not occur.
You can see just by loading second attachment provided by Richard. Even if we 
just click on link, still ubload event takes place. [Which is wrong]
We are not even closing window.
seems like pretty important to be fixed for beta2.
-> m16?
Target Milestone: --- → M16
Attached patch proposed fixSplinter Review
M16 has been out for a while now, these bugs target milestones need to be 
updated.
-> potts
Assignee: valeski → rpotts
-> jst

Johnny has agreed to look at my onLoad/onUnload bugs while I'm gone...
Assignee: rpotts → jst
Accepting bug, Valeski, any particular reason as to why the proposed fix hasn't
been checked in?
Status: NEW → ASSIGNED
Whiteboard: [nsbeta2+] [NEED INFO] → [nsbeta2+] [NEED INFO][ETA 7/27]
cc'ing vidur who I initially talked to about this. Potts was going to overhaul 
all of this and hasn't gotten around to it. I suspect my change is a hacky 
workaround.
I just checked in a fix for this problem, the fix is only a modified version of
the attached patch, I'll leave the big overhaul to rpotts, but the immediate
problem with the unload event is fixed. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I just tested this one with 08-01-04, and it is working perfect. Unload is not 
firing on following the link.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: