Caret move event after text delete without actually moving caret

RESOLVED FIXED

Status

()

Core
Disability Access APIs
--
minor
RESOLVED FIXED
12 years ago
11 years ago

People

(Reporter: parente, Assigned: Aaron Leventhal)

Tracking

(Blocks: 1 bug, {access})

Trunk
x86
Linux
access
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

12 years ago
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060911 Minefield/3.0a1

The sequence of events for pressing "Backspace" in a gtk text field is the following:

object:text-changed:deleted (character is removed)
object:text-caret-moved (caret moves back one position)

The sequence of events for pressing "Delete" in a gtk text field is the following:

object:text-changed:deleted (character is removed)
(no other event, caret remains where it is)

Firefox mimicks the gtk event sequence for "Backspace" but not for "Delete." For "Delete," FF inserts an extra move event:

object:text-changed:deleted (character is removed)
object:text-caret-moved (caret doesn't actually move, event has same offset as where the caret was previously)

For consistency, FF should probably mimick gtk if possible. No move event should be fired since the caret doesn't actually move in the "Delete" case.
(Assignee)

Comment 1

12 years ago
Hmm, we might need to have an extra member variable for that. Either a "swallow next caret move event" or a "mLastCaretPosition" to compare with.
Blocks: 333492
Severity: normal → minor
(Assignee)

Updated

12 years ago
Assignee: aaronleventhal → nobody
Blocks: 342901
No longer blocks: 333492
(Assignee)

Updated

12 years ago
Blocks: 368895
No longer blocks: 342901
(Reporter)

Updated

11 years ago
Blocks: 374115
(Assignee)

Comment 2

11 years ago
We could store the last caret position and hypertext accessible in nsCaretAccessible, and suppress the caret-move event when it doesn't change.
(Assignee)

Comment 3

11 years ago
Note: that would prevent 2 caret move events if the user did something like press Home or End twice in a row.

Perhaps that's desirable? It's what I see in gedit.
(Assignee)

Comment 4

11 years ago
Created attachment 261831 [details] [diff] [review]
Keep track of last node and offset where caret move occured, and don't fire caret move if it hasn't changed (unless there's a selection). Renamed mCurrentDOMNode to mSelectionControllerNode.
Assignee: nobody → aaronleventhal
Status: NEW → ASSIGNED
Attachment #261831 - Flags: review?(ginn.chen)
(Assignee)

Comment 5

11 years ago
Created attachment 261835 [details] [diff] [review]
Minor correction, same idea
Attachment #261831 - Attachment is obsolete: true
Attachment #261835 - Flags: review?(ginn.chen)
Attachment #261831 - Flags: review?(ginn.chen)
(Assignee)

Comment 6

11 years ago
Created attachment 261837 [details] [diff] [review]
Perf tweak
Attachment #261835 - Attachment is obsolete: true
Attachment #261837 - Flags: review?(ginn.chen)
Attachment #261835 - Flags: review?(ginn.chen)

Updated

11 years ago
Attachment #261837 - Flags: review?(ginn.chen) → review+
(Assignee)

Updated

11 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.