AccessibleCaret

From MozillaWiki
Jump to: navigation, search

AccessiblCaret (aka Copy & Paste)

The AccessibleCaret feature includes selection manipulation by the carets implemented in gecko, and UI buttons (select-all, cut, copy, paste) implemented in Gaia.

Developer

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

Developers Emeritus

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

UX Specification

Current gecko implementation

Open question/Known issues

  • Support vertical text
    • bug 1217757 - Update text selection spec for vertical writing mode
    • bug 1217841 - Text-selection indicators (carets) should be oriented sideways when the text has vertical writing-mode

Feature Preferences

  • layout.accessiblecaret.enabled (Enabled on Fennec since 48 and B2G)
  • layout.accessiblecaret.enabled_on_touch (Enabled on Firefox with touch support since 51)

Tracking Bugs

  • bug 1124074 - Bug 1124074 - (AccessibleCaret) [META] Implement AccessibleCaret on devices with touch-event support

AccessibleCaretEventHub State Transition Diagram

  • This graph depicts only the events and callbacks which involves state transitions. Callbacks such as NotifySelectionChanged or Reflow which does not cause a state transition are omitted.
  • Mapping from real events or callback to actions which depict 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

AccessibleCaretEventHubStates.png

Debug Tips

  • Gecko
    • To dump AccessibleCaret log, export MOZ_LOG=AccessibleCaret:5. Or open about:config and add a pref "logging.AccessibleCaret" with value "debug" or "verbose" (case matters).
    • To print log, use AC_LOG() macro.
  • Gaia
    • To dump text selection dialog log, change the variable DEBUG=true in apps/system/js/app_text_selection_dialog.js.
    • To print log, use this.debug()

Legacy gecko implementation on B2G branch v2.2

TouchCaret and SelectionCarets are currently being deployed on B2G v2.2.

Tracking Bugs

  • bug 1023688 - (CopyPasteLegacy) [META] TouchCaret & SelectionCarets, and text selection/copy/paste support on B2G v2.2

Feature preferences

  • For displaying one caret when selection is collapsed: touchcaret.enabled
  • For displaying two carets when selection is non-collapsed: selectioncaret.enabled