Closed Bug 683186 Opened 13 years ago Closed 13 years ago

When selecting a text field by tapping, place the caret based on the tap location instead of always at the beginning of the text

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 681640

People

(Reporter: mounir, Assigned: mbrubeck)

Details

(Keywords: polish, regression, Whiteboard: [has wip])

Attachments

(1 file)

When I want to edit a text field, it seems that Firefox sometimes doesn't recognize where I'm clicking. When that happens, the caret is automatically moved to the beginning of the text field. I think it would be more interesting to make it move to the end of the text field instead.
Yeah, it's the way Firefox works now. Duping to bug 669184.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
What do you mean? It's the way Firefox Mobile works now. It's not the way Firefox desktop works.
(In reply to Martijn Wargers [:mw22] (QA - IRC nick: mw22) from comment #3)
> What do you mean? It's the way Firefox Mobile works now. It's not the way
> Firefox desktop works.

I thought this comment said it was the way desktop works: https://bugzilla.mozilla.org/show_bug.cgi?id=669184#c8
I don't know why Ehsan made that comment in bug 669184, comment 8. Maybe he meant something else?
The reasons why bug 669184 has been RESOLVED WONTFIX do not apply to this bug so I'm reopening.
bug 669184 was describing a behavior where the chrome was calling .focus() but this bug is about the user is clicking in a text field. The former case involves a web compatible behavior but the later doesn't (but only the browser UI).
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
When a field is focused by tapping in Fennec, I think it should react like a field focused by clicking in desktop Firefox: place the caret based on the location of the click.  The current behavior (always place the caret at the beginning) is annoying, and inconsistent with other apps and platforms. I agree that we should change it.

Tentatively changing the description to say we should place the cursor based on where the user taps the field (not necessarily the end).  Mounir, do you agree?
Assignee: nobody → mbrubeck
Status: REOPENED → NEW
Keywords: polish, regression
Summary: When selecting a text field, default to move the caret to the end instead of the beginning → When selecting a text field by tapping, place the caret based on the tap location instead of always at the beginning of the text
That would be perfect.
this makes sense to me, but I wonder why it does not happen automatically. does fennec not use the hittesting code implemented in layout based on the frame tree? does it do something like elementFromPoint?
(In reply to Ehsan Akhgari [:ehsan] from comment #9)
> this makes sense to me, but I wonder why it does not happen automatically.
> does fennec not use the hittesting code implemented in layout based on the
> frame tree? does it do something like elementFromPoint?

Fennec uses an "elementFromPoint" like solution. We don't just pass all mouse events to the child process.
Attached patch patchSplinter Review
This patch seems to fix the problem, but I still need to make sure it is correct and doesn't regress anything.
Whiteboard: [has wip]
The patch looks very similar to bug 681640.
(In reply to Martijn Wargers [:mw22] (QA - IRC nick: mw22) from comment #12)
> The patch looks very similar to bug 681640.

Hahahaha... I guess I can't even remember patches that I reviewed two days ago.
Status: NEW → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → DUPLICATE
(In reply to Mark Finkle (:mfinkle) from comment #10)
> (In reply to Ehsan Akhgari [:ehsan] from comment #9)
> > this makes sense to me, but I wonder why it does not happen automatically.
> > does fennec not use the hittesting code implemented in layout based on the
> > frame tree? does it do something like elementFromPoint?
> 
> Fennec uses an "elementFromPoint" like solution. We don't just pass all
> mouse events to the child process.

Hmm, it is possible that this would break a bunch of stuff having to do with selection and caret movement in editable documents.  Can you please point me to the place in the code where this decision is being made, so that I can familiarize myself with the logic that Fennec uses here?  Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: