Repository navigation
Description
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"), reasonadvertised(Routes.swift:32, Input.swift:487).textEntryClickRoute(WebAreaFocus.swift:639) choosespressConfirmingFocus.carryActionClick(:715) presses throughelementActionClick(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.
- If the field reads focused, the click succeeds and the selection stays where the app's AXPress leaves it. Fix Chrome background paste clipboard-read timeouts in composing@textedit rows #187 measured it kept, 20+7, on frontmost Electron. Nobody has measured it in the background.
- Otherwise the click fails
clickUnconfirmed(:742).
- 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