Closed
Bug 859865
Opened 13 years ago
Closed 12 years ago
Investigate using caretPositionFromPoint as a replacement for some uses of selectAtPoint in SelectionHandler
Categories
(Firefox for Metro Graveyard :: Input, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: jimm, Unassigned)
Details
(Whiteboard: [selection])
Now that we have a working version of caretPositionFromPoint in the tree, I think we might be able to simplify some areas of SelectionHandler related to selecting text in content.
selectAtPoint is useful in selecting words, characters, or paragraphs based on user input, but it's not well suited to do some of the selection behavior we have when moving selection markers around. Currently, which a user drags a marker we:
- collapse selection down to the opposite node
- use selectAtPoint to select a character at the drag point
- smooth the range out to select text.
This probably isn't the most performance way to do this. Possibly caretPositionFromPoint could be used as so:
- calculate the offsets for each marker (we have to be careful here about respecting document boundaries) using caretPositionFromPoint
- clear ranges from the document
- construct a range and add it to the document
This might be faster as it might involve less work in js.
| Reporter | ||
Comment 1•12 years ago
|
||
This has happened over time in various bugs.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
| Assignee | ||
Updated•12 years ago
|
OS: Windows 8 Metro → Windows 8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•