summaryrefslogtreecommitdiffstats
path: root/layout/docs/AccessibleCaret.rst
blob: 8644e4327b15b1b0711c6d94d4dfed029157b269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
***************
AccessibleCaret
***************

AccessibleCaret is a pair of raindrop shape handles at both ends of selection
highlight, or it is a single handle at the blinking caret in a text area. It
assists the user to change the range of the selection highlight or the position
of the blinking caret on platforms with touch-event support.


Meta Bug
========

`Bug 1124074 <https://bugzilla.mozilla.org/show_bug.cgi?id=1124074>`__ tracks all the open issues.


Gecko implementation details
============================

Preferences
-----------
* ``layout.accessiblecaret.enabled_on_touch`` (Enabled on Firefox with touch-event support since 51.)
* ``layout.accessiblecaret.enabled`` (Defaults off, but it can be turn on to force enable AccessibleCaret.)
* ``layout.accessiblecaret.hide_carets_for_mouse_input`` (Defaults on. Turn
  this on to debug AccessibleCaret on desktop browser with mouse events.)

AccessibleCaretEventHub State Transition Diagram
------------------------------------------------

This diagram depicts the state transition of the state machine in
AccessibleCaretEventHub, which handles external events and callbacks.

Note that the diagram omits some callbacks which do not cause a state transition
such as ``NotifySelectionChanged`` or ``Reflow``.

This table is a mapping of the real events and callback to the actions described
on the edge of the diagram:

+---------------------------------------------------+--------------+
| Real events or callbacks                          | Actions      |
+===================================================+==============+
| ``eMouseDown`` or ``eTouchStart``                 | Press        |
+---------------------------------------------------+--------------+
| ``eMouseMove`` or ``eTouchMove``                  | Move         |
+---------------------------------------------------+--------------+
| ``eMouseUp`` or ``eTouchEnd`` or ``eTouchCancel`` | Release      |
+---------------------------------------------------+--------------+
| ``eMouseLongTap``                                 | Long tap     |
+---------------------------------------------------+--------------+
| ``AsyncPanZoomStarted()``                         | Scroll start |
+---------------------------------------------------+--------------+
| ``AsyncPanZoomStopped()``                         | Scroll end   |
+---------------------------------------------------+--------------+
| ``NotifyBlur()``                                  | Blur         |
+---------------------------------------------------+--------------+

.. image:: AccessibleCaretEventHubStates.png

Debug Tips
----------

* Dump AccessibleCaret log from command line: run ``MOZ_LOG=AccessibleCaret:5 ./mach run``.
* Dump AccessibleCaret log by using a preference: Open ``about:config`` and add a pref ``logging.AccessibleCaret`` with value ``debug`` or ``verbose`` (case matters).
* ``AC_LOG()`` is useful to add new logs.


Developers
==========

Current maintainer
------------------

* Ting-Yu Lin <aethanyc@gmail.com>

Developers Emeritus
-------------------

* Morris Tseng <mtseng@mozilla.com>
* Jeremy Chen <jeremychen@mozilla.com>
* Boris Chiou <boris@mozilla.com>*