Skip to content

Engine: a click in a scrolled Chromium textarea places the caret on the line as if the field were scrolled to the top (focus scrolls it first) #341

Closed

Description

@SSFSKIM

Problem

Clicking inside a scrolled Chromium textarea in the background puts the caret on the wrong line, and the engine answers success. The column is right; the line is the one under the point as if the field were scrolled to the top.

Measured in #290's hosted A/B (run https://github.com/SSFSKIM/cua/actions/runs/42560301611), on both main and the #290 branch:

The cause is in focusPlacingCaret (WebAreaFocus.swift). By #283's design it reads the character boxes only after setting AXFocused, so that the boxes exist. But focusing a Chromium textarea scrolls it to its existing caret, offset 0. The boxes are then read in the scrolled-to-top layout, and the clicked point maps to a different line.

Impact: every scrolled textarea in background Chrome. Text typed after the click goes to the wrong place, with no error.

Intent

The caret lands at the clicked character in a scrolled field. Candidates:

  • read the boxes before focusing, where they exist;
  • after focus, re-derive the point from the field's scroll change, using the before and after frames of a reference character box;
  • restore the field's scroll before reading.

Keep #283's rules: never a guessed offset, a line end only where established, no inference across empty boxes, and secure fields never scanned. Measure first. The #290 kit (probe/290-measure, the long textarea cells) reproduces it.

Constraints

Success criteria

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 9, 2026
  2. added a commit that references this issue on Nov 9, 2026
  3. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 9, 2026
  4. added 5 commits that reference this issue on Nov 9, 2026
  5. added 5 commits that reference this issue on Nov 9, 2026
  6. added
    status:in-review
    and removed
    status:in-progress
    on Nov 9, 2026
  7. SSFSKIM commented on Nov 9, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #349: caret written before any focus, placed only with the reference-box proof; A/B 42578081142 (main 59 of 72 placed claims false, branch 0 of 63); reviewer-high 3 rounds clean; ci-gate GREEN 42592550254 at 0.27.22

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

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #349 (0.27.22)

  10. added a commit that references this issue on Nov 9, 2026
  11. 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:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions