Closed Bug 801421 Opened 13 years ago Closed 11 years ago

Selection's end point is not updated after the range is changed

Categories

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

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: zer0, Unassigned)

References

Details

Attachments

(2 files)

I'm working on makes our selection's module in Add-on SDK (jetpack) working on Fennec. I found that when we replace the current selection's text, the end point of the selection is not updated on Fennec, even if text is selected properly. See the screenshot for more information, and the simple HTML page attached to reproduce the behavior. Tested on Samsung Galaxy Tab.
The end point of selection in the screenshot, is still pointing to the previous selection area.
Which build are you using?
Component: General → Text Selection
OS: Mac OS X → Android
Product: Fennec → Firefox for Android
Hardware: x86 → ARM
Version: Trunk → unspecified
Firefox release (16.0) and Nightly (19.0.1), but this one is not the latest one, because the latest one constantly crashes.
I wipe out the profile and tested with the latest Nightly, the issue is still there.
Blocks: 803031
No longer blocks: 803031
It looks like we need to add some code to update the handle positions if the selection changes. We're already listening for selection changes to check to see if the selection is collapsed, so we can stick logic to fix this issue in there: http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#1727 I think a call to updateCacheForSelection() and positionHandles() in there should do the job. However, we need to check to see if notifySelectionChanged() is called when we change the selection ourselves in moveSelection, because the Java side of things we already be handling repositioning the handles. I'm marking this a mentor bug, but I don't know that it would make a good first bug, because this could be tricky.
Whiteboard: [mentor=margaret][lang=js]
This code has changed with bug 667243, so my last comment is no longer valid. This could probably be fixed as part of bug 864589.
Depends on: 864589
Whiteboard: [mentor=margaret][lang=js]
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Hmmmm ... range level changes (range.deleteContents(); range.insertNode(node); range.selectNode(node);) don't trigger parent level selectionListener notifications that we can intercept and act on. Modifying the example code like: http://jsfiddle.net/nxAtn/2/ produces a cleaner result as a workaround ...
meh ... my mistake, that removes the selection entirely, in addition to the handles
Assignee: markcapella → nobody
Status: ASSIGNED → NEW
I've had this bug in mind as possibly being solved using work that bug 1060579 may provide (enhanced selectionListeners) However, on re-testing the original issue to verify, it appears to me that our work on Bug 895463 has already fixed it! If I can have Q/A verify it, I think we can close this.
meh ... should've just ni'd in the first place
Flags: needinfo?(aaron.train)
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(aaron.train)
Resolution: --- → WORKSFORME
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: