Closed Bug 101492 Opened 24 years ago Closed 24 years ago

Mozilla silently terminates at this site - prevent window.close() on frames in framesets

Categories

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

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla0.9.6

People

(Reporter: kleist, Assigned: jst)

References

()

Details

(Whiteboard: [HAVE FIX])

Attachments

(1 file)

Build ID: 2001092403 If this page is visited with Javascript enabled, the browser is silently terminated.
Caused, I believe, by this frame: http://www.ving.se/vvload.asp When I load this in IE4.7 or NN4.7, I get an alertbox saying something like, "The Web page you are viewing is trying to close the window. Close the window? <OK> <Cancel>" When I load this URL in Mozilla, the page just loads and closes. No alertbox comes up to ask.
Note: the HTML in the frame uses non-W3C-compliant MacroMedia DreamWeaver JS template code: function MM_findObj(n, d) { //v3.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0 && parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(x=d[n]) && d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length; i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x; } (The secret to this function is the continuing test for !x) Do not know if this is relevant yet, but thought I'd point it out. Because Mozillla doesn't support document.all or document.layers, this function returns null - so this may break other things. For a W3C-compliant version of MM_FindObject(), see bug 73331.
OK, the Macromedia functions have nothing to do with this bug Here is the cause: the frame http://www.ving.se/vvload.asp has this as a <BODY> tag: <body etc. etc. onLoad="MM_timelinePlay('Timeline1'); MM_preloadImages('ombropopup/img/se/text.gif'); window.close();" > Note the window.close()!!! Test this by saving the frame HTML locally as 'vvload.asp' and include it in a parent document, like this: <HTML> <HEAD> <TITLE>Bug 101492</TITLE> </HEAD> <frameset rows="*,42"> <frame src="vvload.asp"> </frameset> </HTML> You will see that NN4.7, IE4.7 load this without a problem, but Mozilla loads it and terminates. Now comment out the window.close() in the frame's <BODY onLoad>, and Moz loads the parent page fine.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Browser, not engine. Do not know if the HTML here is invalid or not. Reassigning to Embedding:Docshell for further triage -
Assignee: rogerl → adamlock
Component: Javascript Engine → Embedding: Docshell
OS: Windows 2000 → All
QA Contact: pschwartau → adamlock
Summary: Browser is silently terminated if Javascript enabled → Mozilla silently terminates at this site
Reassigning to DOM folks. Is window.close in a frame meant to close the frame or the containing window? If the latter then Moz is working as designed.
Assignee: adamlock → jst
Component: Embedding: Docshell → DOM HTML
QA Contact: adamlock → stummala
One of the frames in the frameset in the testcase has an onload handler that calls window.close() (don't ask me why) which closes the whole window in mozilla. From what I can tell IE and NS4x completely ignores calls to close() on frames in framesets. Brendan, is that what 4x did, or did I overlook something? If that's what 4x did, would you sr? :-)
Status: NEW → ASSIGNED
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.6
Comment on attachment 53726 [details] [diff] [review] Ignore window.close() calls on frames in framesets. r=peterv
Attachment #53726 - Flags: review+
Comment on attachment 53726 [details] [diff] [review] Ignore window.close() calls on frames in framesets. Yes, self.close in a frame does nothing. See http://lxr.mozilla.org/classic/source/lib/libmocha/lm_win.c#1387 sr=brendan@mozilla.org /be
Attachment #53726 - Flags: superreview+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified fixed, win2000 build 12-07-08
Status: RESOLVED → VERIFIED
Adding "prevent window.close() on frames in framesets" to summary for future queries
Summary: Mozilla silently terminates at this site → Mozilla silently terminates at this site - prevent window.close() on frames in framesets
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: