Skip to content

Explainer for Caret Movement Spec #529

@johanneswilm

Description

@johanneswilm

Proposal by @michael and me:

The W3C Caret Movement Specification establishes a standardized model for caret navigation across complex web-based text editing environments including those leveraging the EditContext API and traditional contenteditable elements. It resolves longstanding browser inconsistencies by defining precise, accessibility-aware algorithms for several critical scenarios:

  • navigating bidirectional (bidi) text sequences where visual order diverges from logical DOM order, ensuring arrow keys follow user-perceived directionality across mixed left-to-right and right-to-left scripts;
  • traversing absolutely positioned editable elements that disrupt normal document flow, specifying how the caret should logically progress between visually adjacent regions irrespective of DOM hierarchy or CSS layout;
  • enabling seamless transitions of the caret between discrete editing hosts (e.g., separate contenteditable containers or EditContext instances), with clear rules for focus movement across editable boundaries;
  • defining consistent behavior when moving around non-editable inline elements such as images, SVGs, or form controls, treating them as atomic units that the caret can navigate before and after, but not into, while preserving screen reader compatibility and keyboard operability.
  • specify which markup should be used to achieve "empty elements" being addressable with the caret (e.g. <div></br></div> should be reachable while <div></div> should be ignored?)
  • standardize the behavior and display of placeholder labels (many inconsistencies atm)

We especially need feedback from Microsoft/@ragoulik on this as @ragoulik has volunteered to be the maintainer of this spec.

See also discussion in w3c/strategy#522 and #528

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions