Commit Graph

2 Commits

Author SHA1 Message Date
Daniel Holbert
8bf32ef63b Bug 1110039 followup: Add 'override' keyword to Name() decl in AccessibleCaretEventHub's macro NS_IMPL_STATE_UTILITIES. rs=ehsan 2015-05-12 10:00:10 -07:00
Ting-Yu Lin
27e0c9e194 Bug 1110039 - Part 2.4 - Add AccessibleCaretEventHub. r=roc
See AccessibleCaretEventHub.h for the class description.

Both TouchCaret and SelectionCarets have their event handling mechanism,
which lead to a lot of code duplication. Now AccessibleCaretEventHub
serves as the single entry point for all events and callbacks.

We also encountered performance issues in SelectionCarets because many
unnecessary events might be dispatched to Gaia driven by the selection
changed events. SelectionCarets did not have clear internal states to
avoid this. To solve it, AccessibleCaretEventHub implements state
classes, and rely on the current states to call the CopyPasteManager's
handler only when it's needed.

For example, when dragging a caret, we do not interest in
NotifySelectionChanged() for updating the carets. Since we've known a
caret is being dragging, we can call UpdateCarets() directly. Hence
DragCaretState does not override OnSelectionChanged().
2015-05-03 23:37:00 +02:00