Closed Bug 294440 Opened 19 years ago Closed 18 years ago

Modal dialogs/JavaScript alerts are resizable when dom.disable_window_open_feature.resizable is true

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: tkh212+bugzilla, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050513 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050513 Firefox/1.0+

Modal dialogs, spawned either by Firefox itself (such as SSL warnings) or by
JavaScript in web pages calling window.alert(), are resizable by grabbing the
grippy (in Mac OS X) or the window edges (in Windows) and dragging.  These types
of dialog boxes should not be resizable, but they are when
dom.disable_window_open_feature.resizable is set to true.

Reproducible: Always

Steps to Reproduce:
1. Set security.warn_entering_secure to true
2. Set dom.disable_window_open_feature.resizable to true
3. Open a new tab and go to https://bugzilla.mozilla.org
4. Grab the bottom right corner of the security warning and attempt to resize it

Actual Results:  
The dialog box is able to be resized, allowing you to make it really big, or so
small that the OK button is no longer visible.

Expected Results:  
The dialog box should not be resizable, regardless of the value of
dom.disable_window_open_feature.resizable.

I verified this bug in both Firefox and Seamonkey (both Classic and Modern), on
the trunk and the latest release versions (1.0.4 and 1.7.8 respectively), on
both Mac OS X and Windows.  This bug is more obvious on Mac OS X since it places
a grippy on the bottom right corner.  The dialogs are only resizable when
dom.disable_window_open_feature.resizable is set to true; when it is false they
behave as they should.

The above steps reproduce this bug using a dialog box spawned by Firefox.  I
will attach a testcase which uses a JavaScript alert() windnow.

I apologize if this bug was filed under the wrong component, but it was unclear
whether it should be filed as a JavaScript bug, a DOM bug, or something else...
Attached file JavaScript testcase (deleted) —
This testcase uses JavaScript's window.alert() function to open a modal dialog
box.  Click the button to spawn the dialog box, and if
dom.disable_window_open_feature.resizable is true then it will be resizable.
Not a js engine issue. Over to XP Toolkit/Widgets?
Assignee: general → jag
Component: JavaScript Engine → XP Toolkit/Widgets
QA Contact: general → jrgmorrison
Mozilla doesn't recognise these alerts as chrome because a) content script is on
the JS stack and b) their parent is the content window. We could tweak nsIPrompt
to parent them on the chrome window (while still dispatching
DOMWillOpenModalDialog etc), or we could find some other way of identifying
windows opened by nsIPrompt as chrome.
Assignee: jag → adamlock
Component: XP Toolkit/Widgets → Embedding: APIs
QA Contact: jrgmorrison
We could push a null nsJSContext on the stack while opening the alert...  jst,
what do you think?

Over to a component where it might get noticed.
Assignee: adamlock → general
Status: UNCONFIRMED → NEW
Component: Embedding: APIs → DOM
Ever confirmed: true
QA Contact: ian
I tried the steps to reproduce and the testcase and I got the expected results
in both instances and for both Seamonkey 1.1a rv: 1.9a1 build 2005100105 and
Firefox 1.4.1 rv: 1.8b5 build 20051001 under XP Pro SP2 here.

WFM
I re-tested my testcases, on both Mac OS X and Windows XP SP2, using Firefox
1.4.1 rv: 1.8b5 build 20051001, and this bug still exists.  I was still able to
resize the alert boxes.
Tom, is the bug still happening? With steps to reproduce? With provided testcase? Just asking..
Yes, I can still reproduce this bug using both the "Steps to Reproduce" and the provided testcase, using Firefox 2.0 RC2 (2006-10-03) on Mac OS X and Windows 2000, as well as Firefox 1.5.0.7 and today's trunk build (Minefield) on Windows 2000.  It still works exactly as I described...it's possible to grab the edges of the dialog on Windows or the grippy in the bottom right on Mac OS X and resize these dialog windows when dom.disable_window_open_feature.resizable is set to true.
So the problem is basically that the DOM prefs apply unless the URI being opened is chrome _and_ the parent is chrome.

In this case, the parent is, of course, the web page.

I think the right fix is to either remove the aHasChromeParent check or to allow non-chrome parents posing a dialog to use whatever features they want, since normal web pages cannot pose arbitrary dialogs.
Attached patch Like so (deleted) — Splinter Review
Attachment #242417 - Flags: superreview?(jst)
Attachment #242417 - Flags: review?(benjamin)
Assignee: general → bzbarsky
Priority: -- → P2
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 242417 [details] [diff] [review]
Like so

I suppose... though if we ever implement content opening modal dialogs, we may have to revisit this.
Attachment #242417 - Flags: review?(benjamin) → review+
Comment on attachment 242417 [details] [diff] [review]
Like so

sr=jst
Attachment #242417 - Flags: superreview?(jst) → superreview+
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
I can confirm that this bug seems to be fixed using the 2006-10-30 trunk build on Windows 2000, using my testcases.  Haven't tried Mac OS X yet...
Did this regress? I can resize alerts with the latest trunk nightly on Win XP with dom.disable_window_open_feature.resizable set to true.
See comment 11.  Looks like we did just that, and regressed this with bug 393900.  Can you get a bug filed on that?
Depends on: 402866
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: