javascript alert are not modal when input element exists

RESOLVED DUPLICATE of bug 290862

Status

()

RESOLVED DUPLICATE of bug 290862
14 years ago
10 years ago

People

(Reporter: nian.liu, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

14 years ago
1.open test case
2.input in textbox and alert will pop up
3.focus on textbox and continue input, alert can still pop up

expect result: user should have no chance to input in textbox when javascript
alert pops up
(Reporter)

Comment 1

14 years ago
Created attachment 173240 [details]
test case
This worksforme in a 2005-01-25-06 build -- once the alert comes up, I can't
type anymore.

Reporter, what build are you using?
(Reporter)

Comment 3

14 years ago
I use Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050204. This is
for Linux only. And to reprocude it, the key step is that use mouse click to
focus on textbox after alert pops up, then use keyboard to input in textbox
Well, I'm testing this in a Linux GTK1 2005-02-09-05 nightly build, and I'm
definitely clicking in the textbox.  I can't reproduce the bug.

Are you using a GTK2 build, or GTK1 build?
(Reporter)

Comment 5

14 years ago
GTK2 build. Thanks.
Hmm.... I just tested a GTK2 Firefox build, and it works there too....
(Reporter)

Comment 7

14 years ago
my config switch

--enable-optimize --enable-xft --disable-freetype2 --disable-tests
--enable-debug --with-xprint --enable-xinerama --enable-ldap --enable-crypto
--enable-x11-shm --disable-gtktest --disable-glibtest --disable-libIDLtest
--disable-auto-deps --enable-ctl --enable-default-toolkit=gtk2
--enable-ldap-experimental --enable-extensions=default,sroaming
--enable-application=suite 
(Reporter)

Comment 8

14 years ago
And I can reproduce it on my firefox based on GTK2 which is checked out on Tue
Jan 18 17:42:58 CST 2005
(Reporter)

Comment 10

14 years ago
I use GTK2.4.9 
(Reporter)

Updated

14 years ago
Attachment #174560 - Flags: review?(bzbarsky)
Comment on attachment 174560 [details] [diff] [review]
patch

I'm sorry, but I can't review this.  I'm not a module owner for this code, and
I don't even know what it's doing...

Please request review from the module owner or peer.
Attachment #174560 - Flags: review?(bzbarsky)
(Reporter)

Updated

14 years ago
Attachment #174560 - Flags: review?(blizzard)
This is pretty sensitive code.  Focus handling is pretty fragile.  I suspect
that this needs to walk up the widget chain and make sure that it's a child of
the grab widget, not just the grab widget.

Bryner, any ideas since you've looked at focus code too?
(Reporter)

Comment 13

14 years ago
Blizzard, do you think it's really a Mozilla bug or a potential GTK bug?
Probably a mozilla bug.
(Reporter)

Comment 15

14 years ago
Created attachment 175274 [details] [diff] [review]
patchv2

How about this one? make sure widget not in the child chain of grabWidget
Attachment #174560 - Attachment is obsolete: true
Attachment #175274 - Flags: review?(blizzard)
(Reporter)

Comment 16

14 years ago
Blizzard, please...
(Reporter)

Updated

14 years ago
Attachment #175274 - Flags: superreview?(blizzard)
(Reporter)

Updated

14 years ago
Attachment #175274 - Attachment is obsolete: true
Attachment #175274 - Flags: superreview?(blizzard)
Attachment #175274 - Flags: superreview?
Attachment #175274 - Flags: review?(blizzard)
Attachment #175274 - Flags: review?
(Reporter)

Updated

14 years ago
Summary: javascript alert are not modal when textbox exists → javascript alert are not modal when input element exists
(Reporter)

Updated

14 years ago
Component: General → General
Flags: review?(blizzard)
Product: Mozilla Application Suite → Firefox
(Reporter)

Updated

14 years ago
Component: General → Widget: Gtk
Product: Firefox → Core
(Reporter)

Comment 17

14 years ago
both GTK2 and Mozilla needs to modify the code to fix this bug.

For GTK2, grab with group should be implemented

For Mozilla, grab condition judge should be done in OnContainerFocusInEvent
(Reporter)

Updated

14 years ago
Attachment #183135 - Flags: review?(bryner)

Comment 19

14 years ago
Isn't the problem simply that the alert dialog isn't being placed into
the grab group of the parent browser window? 

(The patch seems to try to emulate modality by ignoring focus in
when there is a grab in effect, but this isn't right.)

This may be related to:

 http://bugzilla.gnome.org/show_bug.cgi?id=69934

which is a request for global grabs that span the whole application.

It should be simple to get things right when there is only one browser
window, which is the normal case.

In the multiple browser window case, it's going to be harder... 
Mozilla *could* emulate global grabs by grabbing in each separate
grab group.
(Reporter)

Comment 20

14 years ago
(In reply to comment #19)
> Isn't the problem simply that the alert dialog isn't being placed into
> the grab group of the parent browser window? 
> 
from nsWindow::NativeCreate, popop is added into same window group of browser window

             if (parentArea) {
                nsWindow *parentnsWindow =
                    get_window_for_gdk_window(parentArea->inner_window);
                NS_ASSERTION(parentnsWindow,
                             "no nsWindow for parentArea!");
                if (parentnsWindow && parentnsWindow->mWindowGroup) {
                    gtk_window_group_add_window(parentnsWindow->mWindowGroup,
                                                GTK_WINDOW(mShell));
                    // store this in case any children are created
                    mWindowGroup = parentnsWindow->mWindowGroup;
                    LOG(("adding window %p to group %p\n",
                         (void *)mShell, (void *)mWindowGroup));
                }
            }

For the gtk_grab_get_current error, it shows in nsWindow::SetModal if you add a
gtk_grab_get_current just after gtk_grab_add. Once gtk_grab_add is called,
gtk_grab_get_current returns null.
(Reporter)

Comment 21

13 years ago
owen, any more comments?
Comment on attachment 183135 [details] [diff] [review]
patch

This user does not exist anymore in Bugzilla. bryner's current bugmail is bryner@b (just enter it in the review field). Make sure the patch is against trunk so, this patch looks like it was diffed against Mozilla 1.7.
Attachment #183135 - Flags: review?(deleteduser189766)
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 290862
Attachment #175274 - Flags: superreview?
Attachment #175274 - Flags: review?
You need to log in before you can comment on or make changes to this bug.