Skip to content

Engine: in background Firefox, Left and Option+Left in a contenteditable have no effect, yet keypress answers success #360

Closed

Description

@SSFSKIM

Problem

In background Firefox, Left and Option+Left in a contenteditable or a compose editor have no effect, yet keypress answers success. Typing that follows then lands at the unmoved caret.

It was measured in #354's spike (kit probe/354-measure, run https://github.com/SSFSKIM/cua/actions/runs/42810035238, main 3c66931; evidence ~/.local/share/probe-354/firefox-no-effect-controls-compact.json on the MacBook):

  • Contenteditable and compose, Left and Option+Left: 20 of 20 wrong each. All 80 keypress calls answered error:null, on input route 2′.
  • In the key-only controls (3 per editor and key), the caret stays at [29,0]. A foreground reference moves it to [28,0] for Left and [24,0] for Option+Left.
  • Firefox's textarea and input move correctly. So do Cmd+Left and Cmd+Shift+Left in every editor.

Intent

A key that has no effect never answers plain success. Measure first:

Constraints

Success criteria

  • In background Firefox contenteditable and compose editors, Left and Option+Left move the caret (20 of 20), or answer something other than plain success with the limit stated.
  • No regression on the editors that already work.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P1
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 10, 2026
  2. SSFSKIM commented on Nov 15, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Spike kit offline (Actions locked), by cursor235

  3. added 2 commits that reference this issue on Nov 17, 2026
  4. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    [findings] Spike complete. Full hosted run 44024467862: kit probe/360-measure 14311fa, engine b99232d, Firefox 159.0. 2,560/2,560 attempts scorable, judged by the fixture's DOM text and selection 1 s after the key, not by AX.

    Result. In a background Firefox window, caret-collapse keys (Left, Option+Left, Cmd+Left) do nothing in rich editors (contenteditable, compose): 0/120. Selection extension (Cmd+Shift+Left) works 40/40, and plain textarea/input fields work 120/120. A focus prelude before the unchanged key fixes it: 120/120, as does the foreground (120/120).

    Ruled out (all 0/20 in every rich cell): window fields, the NSEvent window constructor, numeric-pad and function flags, private and combined-session event sources. The key reaches DOM keydown, and Gecko decodes the right command (cmd_charPrevious, cmd_wordPrevious, cmd_moveLeft3) in 320/320 attempts. The cause is the editor's logical focus state, not key delivery.

    Mechanism (source-supported, not instrumented). Firefox 159's window collapse commands check whether the caret is enabled and scroll otherwise. Extension commands bypass that check. Focus initializes the editor's caret and blur disables it. The prelude produced a page focusin before keydown in 320/320 attempts (baseline 0/320), median 4 ms ahead.

    Price of the prelude. Action call p50/p95 is 4/8 ms, against 4/6 ms for plain posting. There were zero observed foreground activations or raises during measurement. The watch sampled at a median 36 ms, so this means "none observed", not a guarantee of no flash. This measures the probe's bare prelude, not the production held-focus/guard path.

    AX caret is not fresh in Firefox (#394).

    • Background plain-text moves: AXSelectedTextRange matched the DOM 0/80.
    • With the prelude: rich 63/80, plain text 59/80.
    • After AX range writes that moved the DOM: 0/158.

    Don't use it to confirm, retry or detect until #394 shows a fresh read.

    Recommendation. Route Firefox caret navigation through the existing protected focus-establishing machinery (already used for Command chords). Then qualify the complete guarded path live. No AX-caret fallback.

    Evidence (local): /Users/new/.local/share/probe-360/run-44024467862/scored/ (score.json, variants.tsv, motions.tsv).

    Sminos-Session: cursor235#b93055dd (cua on macbook)

  5. added 8 commits that reference this issue on Nov 17, 2026
  6. added
    status:in-review
    and removed
    status:in-progress
    on Nov 17, 2026
  7. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #397 (8ad0df3, ci-gate GREEN)

  8. removed
    status:in-review
    on Nov 17, 2026
  9. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #397 (cua 0.28.5)

  10. added 2 commits that reference this issue on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions