HomePhabricator

Insertions: heed cursor position relative to annotations

Authored by dchan.

Description

Insertions: heed cursor position relative to annotations

Previously, insertions at an annotation boundary were assumed to take annotations from the
preceding text. This did not always match the CE behaviour: in Firefox, the cursor can lie
before or after annotation boundaries. Now we detect whether the cursor lies after annotation
boundaries at keydown, and if so, the DM simple insertion will use annotations from the
following text.

ve.ce.isAfterAnnotationBoundaries:

  • Test whether a DOM position lies straight after annotation boundaries

ve.dm.ModelRegistry#isAnnotation:

  • Test whether a DOM node will be modelled as an annotation in the DM

ve.ce.Surface#onSurfaceObserverContentChange:

  • Simple insertions after annotation boundaries use annotations from the following text

Bug: T94062
Change-Id: I3011b66e57c6e5858301987d5e28ec3d5c45069e

Details