Open
Bug 477533
Opened 17 years ago
Updated 4 years ago
Form input text completion interferes with selection and dragging
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
NEW
People
(Reporter: karlt, Assigned: karlt)
References
Details
(Keywords: regression, testcase, Whiteboard: tpi:+)
Attachments
(1 file)
|
80 bytes,
text/html
|
Details |
1) Load attached testcase.
2) Click on the text input box, type "long" into the form control,
and press Enter.
3) Click on the text input box, type "longer" into the form control,
and press Enter.
4) Click on the text input box, type "long" into the form control
(but do not press Enter).
As expected, at least two completions are shown.
5) Click elsewhere to shift focus away.
As expected, the completions are no longer shown.
6) Drag the mouse across "long" to select the text.
As expected, "long" is selected.
7) Mouse down on the selected text and try to drag
Expected result:
Text is dragged.
Actual UNEXPECTED result:
The completions are shown again, text is not dragged.
"Gtk-CRITICAL **: gtk_drag_set_icon_pixbuf: assertion `GDK_IS_DRAG_CONTEXT
(context)' failed"
8) Drag the mouse across "long" to select the text (again).
9) Click elsewhere to shift focus away.
The text is no longer marked as selected.
(This might be unexpected but seems a reasonable behaviour.)
10) Mouse down between "o" and "g" in an attempt to select "ng".
UNEXPECTEDLY, the text is marked as selected.
11) Move the mouse (with the button still down) in an attempt to finish
selecting "ng".
Expected result:
"ng" becomes selected.
Actual UNEXPECTED result:
"long" is dragged.
This is a regression from Firefox 2.
| Assignee | ||
Comment 1•17 years ago
|
||
(Use the back button before each of steps 3 and 4.)
Comment 2•17 years ago
|
||
I seriously doubt this has anything to do with form controls, since none of the autocomplete code lives there (nor does the drag code).
Want to figure out the regression range and reassign accordingly?
| Assignee | ||
Comment 3•17 years ago
|
||
FWIW, the bug does not exist in Firefox's location bar, search bar, or Preferences -> Main -> Home Page field.
Comment 4•17 years ago
|
||
Yeah, those use a somewhat different autocomplete, last I checked... Note that all those fields in fact use an <html:input> for the textfield.
Again, if we have a regression range it'll be easier to tell what might have caused this and hence where it should be assigned.
Comment 5•17 years ago
|
||
(In reply to comment #0)
> 7) Mouse down on the selected text and try to drag
>
> Expected result:
>
> Text is dragged.
>
> Actual UNEXPECTED result:
>
> The completions are shown again, text is not dragged.
>
> "Gtk-CRITICAL **: gtk_drag_set_icon_pixbuf: assertion `GDK_IS_DRAG_CONTEXT
> (context)' failed"
I think that the completions are shown again started happening because bug 256856 was fixed, which made the autocomplete popup show on mousedown instead of click. The same happens in IE, so I'm not sure if you could call that a bug.
But it's strange that the text is not dragged, that seems like a bug under linux, because that works fine here on windows.
> 8) Drag the mouse across "long" to select the text (again).
>
> 9) Click elsewhere to shift focus away.
>
> The text is no longer marked as selected.
> (This might be unexpected but seems a reasonable behaviour.)
>
> 10) Mouse down between "o" and "g" in an attempt to select "ng".
>
> UNEXPECTEDLY, the text is marked as selected.
>
> 11) Move the mouse (with the button still down) in an attempt to finish
> selecting "ng".
>
> Expected result:
>
> "ng" becomes selected.
>
> Actual UNEXPECTED result:
>
> "long" is dragged.
>
> This is a regression from Firefox 2.
I believe what you're describing here is basically bug 128953, but I'm surprised you say this is a regression from Firefox 2, because I see the same issue there as well.
| Assignee | ||
Comment 6•17 years ago
|
||
> > 8) Drag the mouse across "long" to select the text (again).
> >
> > 9) Click elsewhere to shift focus away.
> >
> > The text is no longer marked as selected.
> > (This might be unexpected but seems a reasonable behaviour.)
> >
> > 10) Mouse down between "o" and "g" in an attempt to select "ng".
> >
> > UNEXPECTEDLY, the text is marked as selected.
> >
> > 11) Move the mouse (with the button still down) in an attempt to finish
> > selecting "ng".
> >
> > Expected result:
> >
> > "ng" becomes selected.
> >
> > Actual UNEXPECTED result:
> >
> > "long" is dragged.
> >
> > This is a regression from Firefox 2.
>
> I believe what you're describing here is basically bug 128953, but I'm
> surprised you say this is a regression from Firefox 2, because I see the same
> issue there as well.
With this particular set of steps, Firefox 2 on Linux leaves the text marked as selected after step 9, so it is not surprising to the user that the text is dragged. However, Firefox 2 had its own set of quirks, sometimes having to try to select text twice, or sometimes having to try to drag text twice, or text only left marked as selected when autocomplete was visible before moving focus away.
But yes, when the selection did become invisible in FF 2 (with two clicks to shift focus), it did display this problem of reactivating the selection.
Invisible selections (Bug 128953 comment 4) seem involved here though this resulting problem is different to Bug 128953 comment 0.
(The problem of not being able to drag text until focus is shifted away is a regression since Firefox 2.)
| Assignee | ||
Comment 7•17 years ago
|
||
(In reply to comment #5)
> (In reply to comment #0)
> > 7) Mouse down on the selected text and try to drag
> >
> > Expected result:
> >
> > Text is dragged.
> >
> > Actual UNEXPECTED result:
> >
> > The completions are shown again, text is not dragged.
> >
> > "Gtk-CRITICAL **: gtk_drag_set_icon_pixbuf: assertion `GDK_IS_DRAG_CONTEXT
> > (context)' failed"
>
> I think that the completions are shown again started happening because bug
> 256856 was fixed, which made the autocomplete popup show on mousedown instead
> of click. The same happens in IE, so I'm not sure if you could call that a
> bug. But it's strange that the text is not dragged, that seems like a bug
> under linux, because that works fine here on windows.
Thanks for the info. Windows behavior is definitely better. Mac doesn't show this exact behavior, but ISTR Mac having its own set of quirks, trying to drag after double clicking IIRC.
Do you think it is important that the autocomplete popup shows on mousedown instead of click, or was that only to find a solution for bug 256856.
i.e. if bug 256856 could be fixed with the autocomplete popup only showing on click (or mouseup even), would that seem like reasonable behavior?
Showing the popup while the user is trying to drag can make it impossible to drag to the desired destination (bug 344822 comment 11).
Comment 8•17 years ago
|
||
(In reply to comment #7)
> Do you think it is important that the autocomplete popup shows on mousedown
> instead of click, or was that only to find a solution for bug 256856.
> i.e. if bug 256856 could be fixed with the autocomplete popup only showing on
> click (or mouseup even), would that seem like reasonable behavior?
Yeah, I guess that might be a better solution.
| Assignee | ||
Comment 9•17 years ago
|
||
The behavior changed between firefox-3.0a9pre of 2007-09-30-04 and 2007-10-01-04, during which the changes for bug 256856 landed.
Guessing that Toolkit / Form Manager might be a suitable component for changes to toolkit/components/satchel/src/nsFormFillController.cpp.
But those changes shouldn't be expected to cause Gtk-CRITICAL assertions, so perhaps there is (possibly also) a bug in Core / Widget: Gtk.
Blocks: 256856
Component: Layout: Form Controls → Form Manager
Product: Core → Toolkit
QA Contact: layout.form-controls → form.manager
| Assignee | ||
Comment 10•17 years ago
|
||
(In reply to comment #9)
> those changes shouldn't be expected to cause Gtk-CRITICAL assertions, so
> perhaps there is (possibly also) a bug in Core / Widget: Gtk.
Filed bug 478816 on these assertions.
But what is happening is that the autocomplete popup grabs the pointer, for which nsWindow::GrabPointer uses GDK_CURRENT_TIME, which is much later than the event time. Then nsDragService::InvokeDragSession tries to steal the grab using the time of the last button event, which fails because that time is before the time used for the first grab.
I have a few questions in my mind:
1) Should widgets be stealing grabs from other widgets?
If so, we need a better solution for providing times.
2) Why is a second widget getting events when the pointer has been grabbed by
the first widget?
It seems that the grab (the first one at least) is only really a partial
grab, as the main document+chrome window and the popup get events, but
other windows do not. GTK menus and other popup widgets that grab normally
keep events to the popup.
3) Why is a popup that was not explicitly opened grabbing the pointer?
The location bar only grabs the pointer when explicitly opened through the
drop-down button on its right. The search bar, like the form autocomplete
does this grab-to-main-window thing.
| Assignee | ||
Comment 11•17 years ago
|
||
(In reply to comment #10)
> 1) Should widgets be stealing grabs from other widgets?
I think this would be acceptable, provided that the first grab is cleaned up
appropriately by rolling up the popup, which would also fix the issue where
the destination is obscured by the popup. This is probably the simplest
solution to this bug, and could be resolved entirely within Widget:Gtk.
GDK (not X11) provides GDK_GRAB_BROKEN events for this purpose.
> If so, we need a better solution for providing times.
gdk_x11_display_get_user_time() provides the time of the last user input event
processed, which seems appropriate here. Do we ever expect popups that don't
result from user input events? (Grabbing the pointer through anything other
than a user input event would be nasty anyway.)
> 2) Why is a second widget getting events when the pointer has been grabbed by
> the first widget?
>
> It seems that the grab (the first one at least) is only really a partial
> grab, as the main document+chrome window and the popup get events, but
> other windows do not. GTK menus and other popup widgets that grab normally
> keep events to the popup.
>
> 3) Why is a popup that was not explicitly opened grabbing the pointer?
CaptureRollupEvents is called with aConsumeRollupEvent == FALSE which should
tell Widget to forward the events as normal. (On MS Windows, these events are
forwarded to all windows.)
The GTK widget implementation needs to receive events that should cause
roll-up, and chooses to implement this by grabbing the pointer (and the
keyboard for some reason) so that it can detect button presses that would
normally go to another app.
When the pointer is grabbed, events that would normally go to another
app are received, but not resent after roll-up and grab release.
Qt apps seem to grab the pointer then resend clicks after roll-up, but this doesn't work so well because mouse motion events are not sent to other apps while the pointer is grabbed, so buttons in other apps look inactive even though they are actually active.
In addition, events seem to be restricted to the window group associated with
the popup's main toplevel window (i.e. other main toplevel windows in the same
app don't get events), but I don't yet know the mechanism here.
It may be possible to have a different implementation that didn't use grabs
but instead used FocusChange events to roll up when focus passes to another
application, but that would be a bigger change.
> The location bar only grabs the pointer when explicitly opened through the
> drop-down button on its right.
It seems that the failure to grab the pointer only happens sometimes and is
unintentional, with some undesirable symptoms - bug 479935.
| Assignee | ||
Updated•17 years ago
|
Assignee: nobody → mozbugz
| Assignee | ||
Updated•17 years ago
|
Component: Form Manager → Widget: Gtk
Product: Toolkit → Core
QA Contact: form.manager → gtk
Comment 12•10 years ago
|
||
Hi,
User Agent Mozilla/5.0 (X11; Linux i686; rv:49.0) Gecko/20100101 Firefox/49.0
The issue is still reproducible on the latest Firefox Release (46.0, Build ID 20160421124000) and the latest Nightly (49.0a1, Build ID 20160428030218).
Updated•10 years ago
|
Priority: -- → P3
Whiteboard: tpi:+
Updated•4 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•