Closed Bug 1130258 Opened 6 years ago Closed 6 years ago

Avoid closing wrong Text Selection

Categories

(Firefox for Android :: Text Selection, defect)

ARM
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 39
Tracking Status
firefox39 --- fixed

People

(Reporter: capella, Assigned: capella)

Details

Attachments

(1 file)

The TextSelection.java actionbar always sends a "TextSelection:End" message to SelectionHandler.js when it closes, even when triggered to close by a "TextSelection:HideHandles" message from SelectionHandler.js in the first place.

(vs. user clicking the checkMark in the actionbar, for example).

It's possible that SelectionHandler.js can close a selection then quickly open a new one, and when it finally hears the initial "TextSelection:End" message loop back, it closes its new selection.

STR: Close FF and open clean.
Navigate to http://en.m.wikipedia.org/wiki/Mozilla
Long press "community" in the first paragraph to selectWord and open actionbar
Tap the selectAll icon in the actionBar
Observe that the entire page is selected, then actionbar closes and
   selection is lost.
Attached patch bug1130258.diffSplinter Review
Simple fix, but test-infra needs mostly cut/paste updates.
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Attachment #8560235 - Flags: review?(wjohnston)
Review ping? Or, quick feedback?
Comment on attachment 8560235 [details] [diff] [review]
bug1130258.diff

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

Hmm... Not my favorite way to do this, but I think it will work. Lets try.

::: mobile/android/chrome/content/SelectionHandler.js
@@ +788,5 @@
>        // Ensure targetElement is now focused normally
>        aElement.focus();
>      }
>  
> +    this._selectionID++;

I sorta prefer using GUID's to these counters, but I have no good reason for it (maybe someday we have two windows open and these ID's would interfere, but that's a long ways off...). Lets try this.
Attachment #8560235 - Flags: review?(wjohnston) → review+
https://hg.mozilla.org/mozilla-central/rev/dab5ffb04992
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
You need to log in before you can comment on or make changes to this bug.