Skip to content

macOS engine: an element click on a background web text field keeps main's AXPress route, where the vendor posts a click #537

Backlog

Description

@SSFSKIM

Problem

#258 (ruling 1170) makes an element click on a web text field post a real click only when the target app is frontmost. Behind another app, a web text field whose hit-test at its point answers the field itself (or an ancestor, or nothing) keeps main's route. The vendor posts a click there (F §18: inside a web view, a hit on the element itself or a descendant posts).

What cua does today in that case (main f2e179b, unchanged by #258)

  • Plan: .action("AXPress"), reason advertised (Routes.swift:32, Input.swift:487). textEntryClickRoute (WebAreaFocus.swift:639) chooses pressConfirmingFocus. carryActionClick (:715) presses through elementActionClick (ElementInput.swift:779), on route 3's held activation when the process doesn't believe it has focus, then reads AXFocused back for up to 300 ms.
  • Chromium/Electron and Gecko: focus comes only from the AX action. Nothing writes AXFocused, the caret or the selection.
  • WebKit: the same press and read-back. If the press focuses the field, the selection is kept. If it doesn't, the caret fallback writes AXSelectedTextRange {offset at the point, 0}, which collapses the selection, and the note says the field was focused by placing its caret with no mouse event sent.
  • The record is elementClick {plan: action, reason: advertised, focusStep: press|selection, …}.

The gap

A model that clicks a background web text field and then types can overwrite a selection it didn't make on Chromium, Electron and Gecko, and on WebKit when the press focuses. Where the vendor posts its click, the selection collapses to a caret at the point.

Why it isn't fixed in #258

Posting in the background means going through #200's delivery guard. #258's review found that the guard's early exit (another app frontmost, the target holding key focus) posts with no hold, order repair or watch (P1). Fixing that is a change to the delivery logic.

Fix direction (design)

Either collapse the selection without a pointer (a caret write at the point, as WebKit's fallback and #283 do, for Chromium and Gecko), or make the background post go through a guarded delivery that has no unguarded exit. Measure first: a background cell for the Electron/Chrome text field with a selection.

Declared by #258 (ruling 1170).

Activity

  1. added
    enhancement
    status:ready-for-architect
    priority:P2
    on Nov 23, 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

    enhancementpriority:P2status:ready-for-architect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions