Closed Bug 312744 Opened 19 years ago Closed 1 month ago

Modal windows aren't cleaned up when their parent windows close/hide

Categories

(Core Graveyard :: Widget: Mac, defect)

1.8 Branch
PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mark, Unassigned)

Details

(Keywords: helpwanted)

On the Mac, when there are sheets displayed, nothing prevents the sheet's parent
from closing without dismissing the sheets.  This can result in "disembodied"
sheets, or more seriously, in sheets appearing to be associated with a window or
tab that did not generate the sheet.

This same behavior is present across other platforms, although it occurs with
window-modal dialogs instead of OS X-style window-modal sheets.

This bug is more serious when dom.allow_scripts_to_close_windows is true, but
this is not the default.  In that case,
javascript:window.setTimeout("window.close()",0);alert("alert"); causes a modal
alert to open and its parent to close.  This can make it appear as though a the
alert was presented by a page other than the true originator.
Not really a DOM issue... This is something that the widgetry needs to deal with, it seems to me.
Assignee: general → joshmoz
Component: DOM → Widget: Mac
Keywords: helpwanted
QA Contact: ian → mac
The window.close() will ultimately express itself by sending ::Show(PR_FALSE) to the nsWindow instance for the top-level window that is closing. Maybe we should just return failure if that is called on a window with a sheet or some other window-modal dialog open.
Bug 334891 made it so calling close on a window that has a modal dialog open from it has no effect which I presume effectively fixes this?
If this is not an issue for user-closed windows, then probably yes...
Assignee: joshmoz → nobody
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.