Open Bug 726034 Opened 13 years ago Updated 2 years ago

[10.7] Weirdness selecting text in the location bar using three-finger drag

Categories

(Core :: Widget: Cocoa, defect)

10 Branch
x86
macOS
defect

Tracking

()

People

(Reporter: chris.chilton, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0) Gecko/20100101 Firefox/10.0
Build ID: 20120129021758

Steps to reproduce:

Selected a portion of the text in the address bar using the three-finger swipe on OS X Lion, then started typing to overwrite it.


Actual results:

The first few characters typed overwrite the selected text as expected, but then all of the text in the address bar becomes selected, afterwhich any further typing overwrites everything. This only happens when the typing is performed very quickly after the selection.


Expected results:

The entire address bar field should not become selected during the typing of the text.
Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
QA Contact: untriaged → cocoa
> Selected a portion of the text in the address bar using the
> three-finger swipe on OS X Lion

I don't understand this.

By default the three-finger swipe switches between what used to be
called "spaces" (what's now controlled by the Mission Control pref
panel).  Have you bound the three-finger swipe to some other gesture?
If so which one?

Stefan, do you understand this?  Can you reproduce it?
(In reply to Steven Michaud from comment #1)
> > Selected a portion of the text in the address bar using the
> > three-finger swipe on OS X Lion
> 
> I don't understand this.
> 
> By default the three-finger swipe switches between what used to be
> called "spaces" (what's now controlled by the Mission Control pref
> panel).  Have you bound the three-finger swipe to some other gesture?
> If so which one?
> 
> Stefan, do you understand this?  Can you reproduce it?

Unfortunately, I don't have a trackpad so I'm a bit lost when it comes to swipes :-/.
My mistake, it's called three finger drag, and it works equally well for selecting text. You can see it in action here: http://www.apple.com/macosx/whats-new/gestures.html
> My mistake, it's called three finger drag, and it works equally well
> for selecting text.

Besides selecting text, it also drags any "object" in a web page that
the mouse is over, including text that's already been selected.

How bizarre! :-(

Three-finger drag isn't on be default.  But you can turn it on in the
Trackpad pref panel, under "Point & Click".

And yes, I've now managed to reproduce your bug.  I'll see if I can
find a regression range.

I'll also see if it happens in other browsers.  I've already found
that it doesn't happen in Safari.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Overwriting selected text in address bar → [10.7] Weirdness selecting text in the location bar using three-finger drag
Still no regression range.  But I've now found out that this bug is
caused by a bad interaction between three-finger-drag text selection
and the following Firefox functionality:

When you type something in the address bar and press Enter, you visit
a page and the address bar loses focus.	 Then if you click again in
the address bar the entire contents gets highlighted.  I don't know
what this is called, but for the moment let's call it "click
highlighting".

1) Make sure the address bar has text content and doesn't have focus.

   You might do this by visiting a new page, or by typing something in
   the address bar and clicking somewhere else on the page.

2) Use the three-finger drag to select text in the address bar, and
   then quickly type *exactly one letter*.

   The text you've selected will disappear, and be replaced by that
   single letter.  Then a fraction of a second later the entire
   contents of the address bar will get highlighted.

3) After a delay of any length, type one additional letter.

   The selected contents of the address bar will disappear (as it
   should) and be replaced by the additional letter.

So the bug is that, under certain circumstances (easily triggered
using the three-finger drag), the entire contents of the address bar
will get highlighted *after* you've started typing text into it.
This bug exists at least as far back as FF 3.5.19, which also has "click highlighting".
(In reply to Steven Michaud from comment #6)
> This bug exists at least as far back as FF 3.5.19, which also has "click
> highlighting".

It probably exists as far back as Firefox 3.0, which IIRC is where the click-selects-the-entire-address-bar Windows-centric behaviour was made a default across all Firefoxen.

At one time, there was a pref to disable this behaviour, but I have no idea whether it still exists or has any effect.
This bug doesn't happen in Chrome or Opera.  Both of these also have "click highlighting" but implement it differently.  Notably, in these two browsers the contents of the address bar gets highlighted almost instantaneously, after you've clicked once in it.  In Firefox the highlighting happens a noticeable fraction of a second after you've clicked.

At this point I'm really not sure what, if anything, we can do about this bug.  It would probably require a redesign of click highlighting, which would be quite tricky.

I'll try to find someone to comment here who's familiar with the code that implements click highlighting.  Chris, might that be you? :-)
Hah, no, definitely not.
I think the prefs you want are these:
browser.urlbar.clickSelectsAll
browser.urlbar.doubleClickSelectsAll

http://mxr.mozilla.org/mozilla-central/search?string=ClickSelectsAll gives me a bunch of files refering to these prefs (browser/base/content/urlbarBindings.xml is one of them).
Here's a different way to reproduce which doesn't need the three-finger-drag touchpad functionality:
1. Move the mouse over a letter in the unfocused URL bar.
2. Start pressing the left mouse button.
3. Drag to select a few letters, but don't let go of the mouse button.
4. Press any key to overwrite the selected letters with a new letter.
5. Release the mouse button.

This is probably what the three-finger-drag simulates. Mac OS X only sends the mouse up event after a short delay, which is why it's possible to sneak in a key press in between lifting the fingers off the touchpad and the event.
> Mac OS X only sends the mouse up event after a short delay

Interesting.  We should do some logging to pin this down.

Are you sure we aren't somehow responsible for this delay? :-)
Yes, pretty sure; for example, when I drag an icon in the dock to a different position, there's a short delay before it does the drop animation.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.