Closed Bug 908861 Opened 11 years ago Closed 11 years ago

Prevent dismissal of text selection handles during drag

Categories

(Firefox for Android Graveyard :: Text Selection, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: capella, Assigned: capella)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch bugTextSelection (obsolete) — Splinter Review
"TextSelection:Move" and "TextSelection:Position" logic causes on the fly / transient selectionChanged messages ... causing notifySelectionChanged() to believe selected text no longer exists.

1) Visit a text based page
2) Long Tap text to make highlight selection / display handles
3) Drag left handle to right past right handle
4) Handles dissappear


This patch corrects by ignoring selectionChanged messages while handles are moving / selection is in a transient state.

I considered dynamically removing and re-adding the selectionListener() in the appropriate places ... but lean towards this solution as tighter / fast (?)
Attachment #794840 - Flags: feedback?(margaret.leibovic)
So is this a regression from bug 864589? We should make sure to fix this before shipping 26 (we still have plenty of time, but we should track this).
tracking-fennec: --- → ?
Comment on attachment 794840 [details] [diff] [review]
bugTextSelection

Review of attachment 794840 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, I tested with this and can confirm it fixes the problem.

::: mobile/android/chrome/content/SelectionHandler.js
@@ +15,5 @@
>    // Keeps track of data about the dimensions of the selection. Coordinates
>    // stored here are relative to the _contentWindow window.
>    _cache: null,
>    _activeType: 0, // TYPE_NONE
> +  _isSelectionTransient: false, // True while user drags text selection handles

I would prefer to name this something like _ignoreSelectionChanges, since that makes it clearer what this flag is all about.
Attachment #794840 - Flags: feedback?(margaret.leibovic) → feedback+
I know I've worked on several of these lately, so I had to check. This patch fell out of bug 903316 ...

_ignoreSelectionChanges is good ... I wrestled over something appropriate and just settled on _isSelectionTransient for lack of a better idea.
Attached patch bug908861Splinter Review
So this would be the final ...
Attachment #794840 - Attachment is obsolete: true
Attachment #796383 - Flags: review?(margaret.leibovic)
Comment on attachment 796383 [details] [diff] [review]
bug908861

Review of attachment 796383 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks.
Attachment #796383 - Flags: review?(margaret.leibovic) → review+
https://hg.mozilla.org/mozilla-central/rev/b69456879f40
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
tracking-fennec: ? → ---
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: