Closed Bug 854605 Opened 13 years ago Closed 13 years ago

Use selectAtPoint to start a selection

Categories

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

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(3 files)

I'm going to try to work on bug 667243 in smaller bugs. This one just gets rid of the mouse event hack in startSelection. I started by doing some more refactoring to get this to look more like metro's SelectionHandler, so that we can follow the same logic (and hopefully eventually share some utility functions). This first patch does some renaming, but it also keeps _targetElement and _contentWindow as separate things, instead of the way we were just setting _target = _view in the selection case, which avoids some confusion.
Attachment #729250 - Flags: review?(bnicholson)
Some more renaming to match metro (and make me less confused).
Attachment #729251 - Flags: review?(bnicholson)
Here's the real patch. I suppose there was a bit of scope creep to refactor showThumb here, but I just went for it while I was creating _initTargetInfo. Text selection still works with our mouse event hacks, but this removes the first hack to start the selection! Modeled after _onSelectionStart and _onCaretAttach: http://mxr.mozilla.org/mozilla-central/source/browser/metro/base/content/contenthandlers/SelectionHandler.js#108 http://mxr.mozilla.org/mozilla-central/source/browser/metro/base/content/contenthandlers/SelectionHandler.js#260
Attachment #729256 - Flags: review?(bnicholson)
Attachment #729250 - Flags: review?(bnicholson) → review+
Comment on attachment 729251 [details] [diff] [review] (Part 2) Make private SelectionHanlder functions look private Review of attachment 729251 [details] [diff] [review]: ----------------------------------------------------------------- nit: s/SelectionHanlder/SelectionHandler/ in commit message
Attachment #729251 - Flags: review?(bnicholson) → review+
Comment on attachment 729256 [details] [diff] [review] (Part 3) Use selectAtPoint to start a selection Review of attachment 729256 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me with the event type fixed. ::: mobile/android/chrome/content/SelectionHandler.js @@ +236,5 @@ > + */ > + attachCaret: function sh_attachCaret(aElement) { > + this._initTargetInfo(aElement); > + > + this._contentWindow.addEventListener("pagehide", this, false); A "pagehide" listener is already added in _initTargetInfo -- I assume this should be "blur"?
Attachment #729256 - Flags: review?(bnicholson) → review+
(In reply to Brian Nicholson (:bnicholson) from comment #4) > Comment on attachment 729256 [details] [diff] [review] > (Part 3) Use selectAtPoint to start a selection > > Review of attachment 729256 [details] [diff] [review]: > ----------------------------------------------------------------- > > Looks good to me with the event type fixed. > > ::: mobile/android/chrome/content/SelectionHandler.js > @@ +236,5 @@ > > + */ > > + attachCaret: function sh_attachCaret(aElement) { > > + this._initTargetInfo(aElement); > > + > > + this._contentWindow.addEventListener("pagehide", this, false); > > A "pagehide" listener is already added in _initTargetInfo -- I assume this > should be "blur"? Nice catch, thanks.
Depends on: 858323
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: