[a11y] Only request text cursor on screen for caret moves [chromium/src : main]

0 views
Skip to first unread message

Aaron Moss (Gerrit)

unread,
Nov 10, 2025, 2:24:44 PM (4 days ago) Nov 10
to chromium...@chromium.org, Daniel Cheng, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org

Message from Aaron Moss

Set Ready For Review

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
Gerrit-Change-Number: 7128421
Gerrit-PatchSet: 5
Gerrit-Owner: Aaron Moss <aaro...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Mon, 10 Nov 2025 19:24:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Aaron Moss (Gerrit)

unread,
Nov 10, 2025, 4:08:19 PM (4 days ago) Nov 10
to Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Bo Liu and Ziad Youssef

Aaron Moss added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Aaron Moss . resolved

Here's my re-land of Magnification-follows-text-cursor, I thought I'd run the changes by you two before asking for owner review.

I have successfully run it through CL Dry-Run and some quick tests on my dev phone -- In both Chromium and WebView-in-Gmail, this does implement the desired Magnification-follows-Cursor behaviour, but does not re-introduce the "caret locks scrolling" bug.

One thing I wasn't quite clear on consensus on from our email thread was whether I should be doing Finch *and* per-embedder flags, or only one. I figured having a Finch experiment gave enough of a safety net for the wider Android version rollout, and that if I got my Finch config correct it should only roll out for Chrome and WebView, but glad to change any of those details if either of you have feedback.

Open in Gerrit

Related details

Attention is currently required from:
  • Bo Liu
  • Ziad Youssef
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
Gerrit-Change-Number: 7128421
Gerrit-PatchSet: 5
Gerrit-Owner: Aaron Moss <aaro...@google.com>
Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
Gerrit-Reviewer: Ziad Youssef <ziady...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Ziad Youssef <ziady...@chromium.org>
Gerrit-Attention: Bo Liu <bo...@chromium.org>
Gerrit-Comment-Date: Mon, 10 Nov 2025 21:08:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Bo Liu (Gerrit)

unread,
Nov 10, 2025, 10:25:39 PM (4 days ago) Nov 10
to Aaron Moss, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
Attention needed from Aaron Moss and Ziad Youssef

Bo Liu added 4 comments

File base/android/java/src/org/chromium/base/AconfigFlaggedApiDelegate.java
Line 204, Patchset 5 (Latest): view.requestRectangleOnScreen(boundsInView, /* immediate= */ false);
Bo Liu . unresolved

keep this empty

there should be no logic in this class except to call through to the new method (if it exists)

File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
Line 1608, Patchset 5 (Latest): private Rect fromDipToScreenBounds(float left, float top, float right, float bottom) {
Bo Liu . unresolved

uhh.. does it also account for split or floating windows?

Line 1644, Patchset 5 (Latest): if (delegate != null) {
Bo Liu . unresolved

this isn't a check for 36.1 though, it's a check for if we are built with the Delegate impl class, and there's no way to distinguish between 36 and 36.1, so if you do want to do the check, you have to make it part of the delegate

Line 1647, Patchset 5 (Latest): containerView.requestRectangleOnScreen(caretScreen);
Bo Liu . unresolved

this takes view space, not screen space, and I guess the 36.1 method is the same? in which case it answer the comment above

Open in Gerrit

Related details

Attention is currently required from:
  • Aaron Moss
  • Ziad Youssef
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
    Gerrit-Change-Number: 7128421
    Gerrit-PatchSet: 5
    Gerrit-Owner: Aaron Moss <aaro...@google.com>
    Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
    Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
    Gerrit-Reviewer: Ziad Youssef <ziady...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Ziad Youssef <ziady...@chromium.org>
    Gerrit-Attention: Aaron Moss <aaro...@google.com>
    Gerrit-Comment-Date: Tue, 11 Nov 2025 03:25:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ziad Youssef (Gerrit)

    unread,
    Nov 11, 2025, 8:52:34 AM (4 days ago) Nov 11
    to Aaron Moss, Bo Liu, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
    Attention needed from Aaron Moss

    Ziad Youssef added 1 comment

    Patchset-level comments
    Ziad Youssef . resolved

    Thanks Aaron, I am not really familiar with this code. I will defer to Bo.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aaron Moss
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
    Gerrit-Change-Number: 7128421
    Gerrit-PatchSet: 5
    Gerrit-Owner: Aaron Moss <aaro...@google.com>
    Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
    Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
    Gerrit-Attention: Aaron Moss <aaro...@google.com>
    Gerrit-Comment-Date: Tue, 11 Nov 2025 13:52:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aaron Moss (Gerrit)

    unread,
    Nov 11, 2025, 4:58:37 PM (3 days ago) Nov 11
    to Ziad Youssef, Bo Liu, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
    Attention needed from Bo Liu

    Aaron Moss added 4 comments

    File base/android/java/src/org/chromium/base/AconfigFlaggedApiDelegate.java
    Line 204, Patchset 5: view.requestRectangleOnScreen(boundsInView, /* immediate= */ false);
    Bo Liu . resolved

    keep this empty

    there should be no logic in this class except to call through to the new method (if it exists)

    Aaron Moss

    Can do, I'll put the fallback code at the callsite only.

    For what it's worth, I thought this would be a reasonable default behaviour because the only new behaviour added in API level 36.1 is to add a [new overload with a source parameter](https://developer.android.com/reference/android/view/View#requestRectangleOnScreen(android.graphics.Rect,%20boolean,%20int)), which allows the system to ignore some `requestRectangleOnScreen()` calls based on user preferences.

    File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
    Line 1608, Patchset 5: private Rect fromDipToScreenBounds(float left, float top, float right, float bottom) {
    Bo Liu . resolved

    uhh.. does it also account for split or floating windows?

    Aaron Moss

    As I understand it, these are view-relative coordinates in physical pixel dimensions, but I did double-check that this worked properly with split screen on my dev phone (both vertical and horizontal split), and clarified the documentation.

    Line 1644, Patchset 5: if (delegate != null) {
    Bo Liu . resolved

    this isn't a check for 36.1 though, it's a check for if we are built with the Delegate impl class, and there's no way to distinguish between 36 and 36.1, so if you do want to do the check, you have to make it part of the delegate

    Aaron Moss

    The [companion internal CL](https://chrome-internal-review.googlesource.com/c/clank/internal/apps/+/8754236) checks `Build.VERSION.SDK_INT_FULL >= Build.VERSION_CODES_FULL.BAKLAVA_1` in the delegate.

    It's slightly awkward right now in that the 36.1 API has been finalized and is in public beta (and is the Android SDK available for internal code), but I don't _think_ public Chromium rolls to that Android SDK until the stable release, at which point I'll follow up with crbug.com/450540343 to move that version check out of the delegate into public code.

    Line 1647, Patchset 5: containerView.requestRectangleOnScreen(caretScreen);
    Bo Liu . resolved

    this takes view space, not screen space, and I guess the 36.1 method is the same? in which case it answer the comment above

    Aaron Moss

    Thanks, I'll clarify the naming.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Bo Liu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
      Gerrit-Change-Number: 7128421
      Gerrit-PatchSet: 6
      Gerrit-Owner: Aaron Moss <aaro...@google.com>
      Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
      Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
      Gerrit-Attention: Bo Liu <bo...@chromium.org>
      Gerrit-Comment-Date: Tue, 11 Nov 2025 21:58:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Bo Liu <bo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Bo Liu (Gerrit)

      unread,
      Nov 11, 2025, 9:54:13 PM (3 days ago) Nov 11
      to Aaron Moss, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
      Attention needed from Aaron Moss

      Bo Liu voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Moss
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
        Gerrit-Change-Number: 7128421
        Gerrit-PatchSet: 6
        Gerrit-Owner: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
        Gerrit-Attention: Aaron Moss <aaro...@google.com>
        Gerrit-Comment-Date: Wed, 12 Nov 2025 02:54:04 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Moss (Gerrit)

        unread,
        Nov 12, 2025, 9:11:51 AM (3 days ago) Nov 12
        to Nico Weber, Arthur Sonzogni, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Arthur Sonzogni and Nico Weber

        Aaron Moss added 1 comment

        Patchset-level comments
        File-level comment, Patchset 6 (Latest):
        Aaron Moss . resolved

        Hi, looking for owner review on this fix to move code from `updateFrameInfo()` (called on every rendered frame) to `updateCursorAnchorInfo()` (called on every caret move).

        I did need to add the caret information to the [`InputCursorAnchorInfo`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/ime_host.mojom;drc=c192edeace2afd28cd0b1383c526ab8e4a13ae24;l=29) Mojo struct, but per the linked docs it summarizes [Android's `CursorAnchorInfo`](https://developer.android.com/reference/android/view/inputmethod/CursorAnchorInfo), which does include an "insertion marker" field not previously represented in the Mojo struct.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Arthur Sonzogni
        • Nico Weber
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
        Gerrit-Change-Number: 7128421
        Gerrit-PatchSet: 6
        Gerrit-Owner: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
        Gerrit-Attention: Nico Weber <tha...@chromium.org>
        Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Comment-Date: Wed, 12 Nov 2025 14:11:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Nico Weber (Gerrit)

        unread,
        Nov 12, 2025, 9:53:42 AM (3 days ago) Nov 12
        to Aaron Moss, Aaron Leventhal, Nico Weber, Arthur Sonzogni, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Aaron Leventhal, Aaron Moss and Arthur Sonzogni

        Nico Weber added 1 comment

        Patchset-level comments
        Nico Weber . resolved

        aleventhal, could you take a look at the blink change from an a11y point of view, please :)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aaron Leventhal
        • Aaron Moss
        • Arthur Sonzogni
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
        Gerrit-Change-Number: 7128421
        Gerrit-PatchSet: 6
        Gerrit-Owner: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
        Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
        Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Attention: Aaron Moss <aaro...@google.com>
        Gerrit-Comment-Date: Wed, 12 Nov 2025 14:53:33 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Arthur Sonzogni (Gerrit)

        unread,
        Nov 12, 2025, 10:03:59 AM (3 days ago) Nov 12
        to Aaron Moss, Aaron Leventhal, Nico Weber, Arthur Sonzogni, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Aaron Leventhal, Aaron Moss and Arthur Sonzogni

        Arthur Sonzogni added 1 comment

        Patchset-level comments
        Aaron Moss . resolved

        Hi, looking for owner review on this fix to move code from `updateFrameInfo()` (called on every rendered frame) to `updateCursorAnchorInfo()` (called on every caret move).

        I did need to add the caret information to the [`InputCursorAnchorInfo`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/ime_host.mojom;drc=c192edeace2afd28cd0b1383c526ab8e4a13ae24;l=29) Mojo struct, but per the linked docs it summarizes [Android's `CursorAnchorInfo`](https://developer.android.com/reference/android/view/inputmethod/CursorAnchorInfo), which does include an "insertion marker" field not previously represented in the Mojo struct.

        Arthur Sonzogni

        Assuming you found aleve...@google.com, I am removing myself. Feel free to reassign to me.

        Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
        Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
        Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
        Gerrit-Attention: Aaron Moss <aaro...@google.com>
        Gerrit-Comment-Date: Wed, 12 Nov 2025 15:03:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Aaron Moss <aaro...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Moss (Gerrit)

        unread,
        Nov 12, 2025, 10:05:55 AM (3 days ago) Nov 12
        to Arthur Sonzogni, Aaron Leventhal, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Aaron Leventhal

        Aaron Moss added 1 comment

        Patchset-level comments
        Nico Weber . resolved

        aleventhal, could you take a look at the blink change from an a11y point of view, please :)

        Aaron Moss

        One possibly relevant note here is that the Android Magnification service doesn't use the accessibility tree, and, as such, doesn't expose itself on a technical level as an AT, which is why this change is routed through the IME code rather than some more-explicitly accessibility path.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aaron Leventhal
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
        Gerrit-Change-Number: 7128421
        Gerrit-PatchSet: 6
        Gerrit-Owner: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
        Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
        Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
        Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
        Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
        Gerrit-Comment-Date: Wed, 12 Nov 2025 15:05:47 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Nico Weber <tha...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Moss (Gerrit)

        unread,
        Nov 13, 2025, 1:16:25 PM (yesterday) Nov 13
        to David Tseng, Arthur Sonzogni, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, android-web...@chromium.org, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
        Attention needed from Bo Liu and David Tseng

        Aaron Moss added 1 comment

        Patchset-level comments
        File-level comment, Patchset 11 (Latest):
        Aaron Moss . resolved

        Hi David, Nico wanted an Accessibility review on this PR (a re-land of my Magnification-follows-text-cursor), but tagged in Aaron Leventhal, who's no longer on the team; would you mind taking a look?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Bo Liu
        • David Tseng
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
          Gerrit-Change-Number: 7128421
          Gerrit-PatchSet: 11
          Gerrit-Owner: Aaron Moss <aaro...@google.com>
          Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
          Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
          Gerrit-Reviewer: David Tseng <dts...@chromium.org>
          Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
          Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Daniel Cheng <dch...@chromium.org>
          Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
          Gerrit-Attention: Bo Liu <bo...@chromium.org>
          Gerrit-Attention: David Tseng <dts...@chromium.org>
          Gerrit-Comment-Date: Thu, 13 Nov 2025 18:16:19 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          David Tseng (Gerrit)

          unread,
          Nov 13, 2025, 4:31:23 PM (yesterday) Nov 13
          to Aaron Moss, Arthur Sonzogni, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, android-web...@chromium.org, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
          Attention needed from Aaron Moss and Bo Liu

          David Tseng added 8 comments

          File base/android/java/src/org/chromium/base/AconfigFlaggedApiDelegate.java
          Line 198, Patchset 11 (Latest): * @param boundsInView the rect to request on screen, in coordinates relative to {@code view}
          David Tseng . unresolved

          Good catch on the param mismatch. I would have expected some of this be caught be a linter?

          File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
          Line 1599, Patchset 11 (Latest): * and content Y offset.
          David Tseng . unresolved

          Would there ever be a content x offset?

          Line 1604, Patchset 11 (Latest): * @param bottmo bottom Y coordinate in CSS pixels
          David Tseng . unresolved

          nit: bottom

          Line 1628, Patchset 11 (Latest): // Request view system keep caret on screen when moved
          David Tseng . unresolved

          supernit: add period at end.

          Line 1642, Patchset 11 (Latest): AconfigFlaggedApiDelegate delegate =
          David Tseng . unresolved
          In AconfigFlaggedApiDelegate.java, they recommend calling AconfigFlaggedApiDelegate.getInstance. Did you try that before?
          " * Prefer to use this to get a instance instead of calling ServiceLoaderUtil. If possible, avoid
          * caching the return value in member or global variables as it allows more compile time"
          (written regarding getInstance)
          Line 1647, Patchset 11 (Latest): containerView.requestRectangleOnScreen(caretPix);
          David Tseng . unresolved

          It may be worth pointing out that this is the fallback. That is, the original request api that does not contain a focus source.

          Was this path requested by the magnifier proposal?

          File third_party/blink/public/mojom/input/ime_host.mojom
          Line 49, Patchset 11 (Latest): gfx.mojom.Rect? insertion_marker;
          David Tseng . unresolved

          Should this be called caret_bounds?

          File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
          Line 4235, Patchset 11 (Latest): insertion_marker_info = std::move(focus_rect);
          David Tseng . unresolved

          Are you sure `focus_rect` is the right choice here?

          What is `bounding_box_rect`? What happens if anchor is first? Should we use `anchor_rect` then? If you have a good understanding of
          GetSelectionBoundsInWindow
          then that works for me, but we want to get this part nailed down.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Aaron Moss
          • Bo Liu
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
            Gerrit-Change-Number: 7128421
            Gerrit-PatchSet: 11
            Gerrit-Owner: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
            Gerrit-Reviewer: David Tseng <dts...@chromium.org>
            Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
            Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Daniel Cheng <dch...@chromium.org>
            Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
            Gerrit-Attention: Bo Liu <bo...@chromium.org>
            Gerrit-Attention: Aaron Moss <aaro...@google.com>
            Gerrit-Comment-Date: Thu, 13 Nov 2025 21:31:11 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Aaron Moss (Gerrit)

            unread,
            Nov 13, 2025, 5:31:37 PM (yesterday) Nov 13
            to Amanda Lin Dietz, David Tseng, Arthur Sonzogni, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, android-web...@chromium.org, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
            Attention needed from Amanda Lin Dietz, Bo Liu and David Tseng

            Aaron Moss added 8 comments

            File base/android/java/src/org/chromium/base/AconfigFlaggedApiDelegate.java
            Line 198, Patchset 11: * @param boundsInView the rect to request on screen, in coordinates relative to {@code view}
            David Tseng . resolved

            Good catch on the param mismatch. I would have expected some of this be caught be a linter?

            Aaron Moss

            Yeah, who knows; I think there's a Javadoc linter that ships with the Java SDK, but it's wildly over-picky (it will insist on `@param` and and `@return` tags for every method, even when they diminish clarity), best guess without looking it up our Javadoc linters are a bit over-permissive on this case instead.

            File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
            Line 1599, Patchset 11: * and content Y offset.
            David Tseng . resolved

            Would there ever be a content x offset?

            Aaron Moss

            I don't expect so.

            With more context, there certainly isn't a getter for an X offset in the `RenderCoordinates` type. As best I understand it, one isn't necessary, because the Y-axis content offset is mostly (entirely?) there to support the address bar chrome, which (presumably because of some non-trivial animations and/or interaction with layout) is part of the same `View` as the WebView. Because these are view-local coordinates, any X (or Y) offset coming from other views is already accounted for.

            Line 1604, Patchset 11: * @param bottmo bottom Y coordinate in CSS pixels
            David Tseng . resolved

            nit: bottom

            Aaron Moss

            Fixed

            Line 1628, Patchset 11: // Request view system keep caret on screen when moved
            David Tseng . resolved

            supernit: add period at end.

            Aaron Moss

            Fixed

            Line 1642, Patchset 11: AconfigFlaggedApiDelegate delegate =
            David Tseng . resolved
            In AconfigFlaggedApiDelegate.java, they recommend calling AconfigFlaggedApiDelegate.getInstance. Did you try that before?
            " * Prefer to use this to get a instance instead of calling ServiceLoaderUtil. If possible, avoid
            * caching the return value in member or global variables as it allows more compile time"
            (written regarding getInstance)
            Aaron Moss

            Fixed, thanks!

            Line 1647, Patchset 11: containerView.requestRectangleOnScreen(caretPix);
            David Tseng . unresolved

            It may be worth pointing out that this is the fallback. That is, the original request api that does not contain a focus source.

            Was this path requested by the magnifier proposal?

            Aaron Moss

            I've added a comment clarifying that this is a fallback.

            As for whether the fallback should be applied, I think "yes" for text-cursor following, and "maybe" for input-focus following (out of scope for this CL, but I've got a follow-up tech clean-up on that feature coming).

            I didn't find an answer to this question explicitly in the proposal, and would like @ald...@google.com to weigh in, but the code examples for [TextView](https://docs.google.com/document/d/1WuE6b46k7mltgCVIeqHGR93wumEQFI1EhtRujacLPHE/edit?tab=t.0#heading=h.dy512rmzmes4) and [FullscreenMagnificationController](https://docs.google.com/document/d/1WuE6b46k7mltgCVIeqHGR93wumEQFI1EhtRujacLPHE/edit?tab=t.0#heading=h.se2dji6116wp) imply that the fallback path should be treated equivalently to a text cursor move.

            When I follow up with Input Focus following, which of the following options should I take?
            1. Status-quo: input-focus following is Chrome-only, new 36.1 request API always used if available, fallback path guarded behind default-disable flag.
            2. Similar to this: input-focus following is in all embedders guarded by a Finch flag, 36.1 API is used if available, fallback path used if not.
            3. Similar to proposal: same as option 2, but no requestRectangleOnScreen call made for input focus if the 36.1 source parameter API is not available.
            4. Hybrid: Use the same Finch flag to guard both text-cursor and input-focus following, with a separate flag for using the fallback API for input-focus.

            I think any of options 2 through 4 are an improvement on my initially-implemented option 1, so I should do one of them in the follow-up, and which one chosen has small impacts on this CL (basically, "what should I name the Finch flag"). Personally, I lean to option 3 (closest to the proposal, text-cursor uses the fallback API, input-focus does not), but given the timeline constraints it might be best to put both input-focus and text-cursor under the same Finch experiment rather than their current separate flags.

            File third_party/blink/public/mojom/input/ime_host.mojom
            Line 49, Patchset 11: gfx.mojom.Rect? insertion_marker;
            David Tseng . unresolved

            Should this be called caret_bounds?

            Aaron Moss

            I opted to match the Android `CursorAnchorInfo` name here, since the Mojo struct explicitly documents itself as a representation of that object.

            File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
            Line 4235, Patchset 11: insertion_marker_info = std::move(focus_rect);
            David Tseng . unresolved

            Are you sure `focus_rect` is the right choice here?

            What is `bounding_box_rect`? What happens if anchor is first? Should we use `anchor_rect` then? If you have a good understanding of
            GetSelectionBoundsInWindow
            then that works for me, but we want to get this part nailed down.

            Aaron Moss

            When I wrote this code, what I found out was that if you don't have a selection (e.g. blinking caret), `focus_rect` and `anchor_rect` are the same rectangle, the caret. If you are selecting text, `anchor_rect` is the fixed point where the text-selection process started, while `focus_rect` is the movable point where the text-selection grows or shrinks (and thus the one I'd expect users would want to be able to see as it moves). In both cases, `bounding_box_rect` is the rectangle surrounding the entire selection.

            That said, running this build on my dev phone, Magnification doesn't actually follow the focus rect, and I'm not sure if that's because I somehow got the definitions swapped or because the event is "cursor anchor moved" and doesn't fire for selection changes. I'll look into that more tomorrow.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Amanda Lin Dietz
            • Bo Liu
            • David Tseng
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
            Gerrit-Change-Number: 7128421
            Gerrit-PatchSet: 12
            Gerrit-Owner: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
            Gerrit-Reviewer: David Tseng <dts...@chromium.org>
            Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
            Gerrit-CC: Amanda Lin Dietz <ald...@google.com>
            Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Daniel Cheng <dch...@chromium.org>
            Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
            Gerrit-Attention: Bo Liu <bo...@chromium.org>
            Gerrit-Attention: Amanda Lin Dietz <ald...@google.com>
            Gerrit-Attention: David Tseng <dts...@chromium.org>
            Gerrit-Comment-Date: Thu, 13 Nov 2025 22:31:27 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: David Tseng <dts...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            David Tseng (Gerrit)

            unread,
            3:09 PM (8 hours ago) 3:09 PM
            to Aaron Moss, Amanda Lin Dietz, Arthur Sonzogni, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, android-web...@chromium.org, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
            Attention needed from Aaron Moss, Amanda Lin Dietz and Bo Liu

            David Tseng added 3 comments

            File content/public/android/java/src/org/chromium/content/browser/input/ImeAdapterImpl.java
            Line 1647, Patchset 11: containerView.requestRectangleOnScreen(caretPix);
            David Tseng . unresolved

            It may be worth pointing out that this is the fallback. That is, the original request api that does not contain a focus source.

            Was this path requested by the magnifier proposal?

            Aaron Moss

            I've added a comment clarifying that this is a fallback.

            As for whether the fallback should be applied, I think "yes" for text-cursor following, and "maybe" for input-focus following (out of scope for this CL, but I've got a follow-up tech clean-up on that feature coming).

            I didn't find an answer to this question explicitly in the proposal, and would like @ald...@google.com to weigh in, but the code examples for [TextView](https://docs.google.com/document/d/1WuE6b46k7mltgCVIeqHGR93wumEQFI1EhtRujacLPHE/edit?tab=t.0#heading=h.dy512rmzmes4) and [FullscreenMagnificationController](https://docs.google.com/document/d/1WuE6b46k7mltgCVIeqHGR93wumEQFI1EhtRujacLPHE/edit?tab=t.0#heading=h.se2dji6116wp) imply that the fallback path should be treated equivalently to a text cursor move.

            When I follow up with Input Focus following, which of the following options should I take?
            1. Status-quo: input-focus following is Chrome-only, new 36.1 request API always used if available, fallback path guarded behind default-disable flag.
            2. Similar to this: input-focus following is in all embedders guarded by a Finch flag, 36.1 API is used if available, fallback path used if not.
            3. Similar to proposal: same as option 2, but no requestRectangleOnScreen call made for input focus if the 36.1 source parameter API is not available.
            4. Hybrid: Use the same Finch flag to guard both text-cursor and input-focus following, with a separate flag for using the fallback API for input-focus.

            I think any of options 2 through 4 are an improvement on my initially-implemented option 1, so I should do one of them in the follow-up, and which one chosen has small impacts on this CL (basically, "what should I name the Finch flag"). Personally, I lean to option 3 (closest to the proposal, text-cursor uses the fallback API, input-focus does not), but given the timeline constraints it might be best to put both input-focus and text-cursor under the same Finch experiment rather than their current separate flags.

            David Tseng

            Got it; yup, aldietz should probably weigh in here as I'm not sure what's expected on the magnifier side of things currently.

            File third_party/blink/public/mojom/input/ime_host.mojom
            Line 49, Patchset 11: gfx.mojom.Rect? insertion_marker;
            David Tseng . unresolved

            Should this be called caret_bounds?

            Aaron Moss

            I opted to match the Android `CursorAnchorInfo` name here, since the Mojo struct explicitly documents itself as a representation of that object.

            David Tseng

            I only pointed it out because the naming is not clear but if that's borrowed from Android, then, I'l assume that's on me.

            File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
            Line 4235, Patchset 11: insertion_marker_info = std::move(focus_rect);
            David Tseng . unresolved

            Are you sure `focus_rect` is the right choice here?

            What is `bounding_box_rect`? What happens if anchor is first? Should we use `anchor_rect` then? If you have a good understanding of
            GetSelectionBoundsInWindow
            then that works for me, but we want to get this part nailed down.

            Aaron Moss

            When I wrote this code, what I found out was that if you don't have a selection (e.g. blinking caret), `focus_rect` and `anchor_rect` are the same rectangle, the caret. If you are selecting text, `anchor_rect` is the fixed point where the text-selection process started, while `focus_rect` is the movable point where the text-selection grows or shrinks (and thus the one I'd expect users would want to be able to see as it moves). In both cases, `bounding_box_rect` is the rectangle surrounding the entire selection.

            That said, running this build on my dev phone, Magnification doesn't actually follow the focus rect, and I'm not sure if that's because I somehow got the definitions swapped or because the event is "cursor anchor moved" and doesn't fire for selection changes. I'll look into that more tomorrow.

            David Tseng

            Yeah, I think the boolean is interesting. In DOM terms, anchor and focus do behave as you state above, but when the selection is reversed or programmatically set, we may hit strange cases. e.g. after a select all, line, word, do we want to move to the focus or anchor? It's not clear in those cases that focus is expected.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Aaron Moss
            • Amanda Lin Dietz
            • Bo Liu
            Gerrit-Attention: Aaron Moss <aaro...@google.com>
            Gerrit-Attention: Amanda Lin Dietz <ald...@google.com>
            Gerrit-Comment-Date: Fri, 14 Nov 2025 20:09:24 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Aaron Moss <aaro...@google.com>
            Comment-In-Reply-To: David Tseng <dts...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Aaron Moss (Gerrit)

            unread,
            4:14 PM (7 hours ago) 4:14 PM
            to Amanda Lin Dietz, David Tseng, Arthur Sonzogni, Nico Weber, Bo Liu, Ziad Youssef, Chromium LUCI CQ, Chromium Metrics Reviews, AyeAye, chromium...@chromium.org, Daniel Cheng, android-web...@chromium.org, lizeb...@chromium.org, torne...@chromium.org, pasko...@chromium.org, asvitkine...@chromium.org, yfriedm...@chromium.org, nyquis...@chromium.org, agriev...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org
            Attention needed from Amanda Lin Dietz, Bo Liu and David Tseng

            Aaron Moss added 3 comments

            File third_party/blink/public/mojom/input/ime_host.mojom
            Line 49, Patchset 11: gfx.mojom.Rect? insertion_marker;
            David Tseng . unresolved

            Should this be called caret_bounds?

            Aaron Moss

            I opted to match the Android `CursorAnchorInfo` name here, since the Mojo struct explicitly documents itself as a representation of that object.

            David Tseng

            I only pointed it out because the naming is not clear but if that's borrowed from Android, then, I'l assume that's on me.

            Aaron Moss

            One relevant note is that Android keeps individual fields rather than a `Rect`, but the Builder class does name its setter [setInsertionMarkerLocation](https://developer.android.com/reference/android/view/inputmethod/CursorAnchorInfo.Builder#setInsertionMarkerLocation(float,%20float,%20float,%20float,%20int)) -- would you prefer `insertion_marker_location` for this field? I thought the extra verbosity over `insertion_marker` didn't pay off in clarity, but I don't feel strongly about it.

            File third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
            Line 3832, Patchset 13 (Latest): CalculateSelectionBounds(anchor_root_frame, focus_root_frame,
            Aaron Moss . unresolved

            I found these flipped params in existing code while looking into David's questions about focus vs. anchor on selection. They've been the way they are for years, so I'm running a fresh dry-run for the change, but the [declaration of `CalculateSelectionBounds`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/web_frame_widget_impl.cc;drc=cdf3ed32a94019461b37aa1f4a517847eb0989da;l=4662) has the parameters as anchor-then-focus, in line with my change, and this CL now follows focus instead of anchor (as intended).

            Line 4235, Patchset 11: insertion_marker_info = std::move(focus_rect);
            David Tseng . unresolved

            Are you sure `focus_rect` is the right choice here?

            What is `bounding_box_rect`? What happens if anchor is first? Should we use `anchor_rect` then? If you have a good understanding of
            GetSelectionBoundsInWindow
            then that works for me, but we want to get this part nailed down.

            Aaron Moss

            When I wrote this code, what I found out was that if you don't have a selection (e.g. blinking caret), `focus_rect` and `anchor_rect` are the same rectangle, the caret. If you are selecting text, `anchor_rect` is the fixed point where the text-selection process started, while `focus_rect` is the movable point where the text-selection grows or shrinks (and thus the one I'd expect users would want to be able to see as it moves). In both cases, `bounding_box_rect` is the rectangle surrounding the entire selection.

            That said, running this build on my dev phone, Magnification doesn't actually follow the focus rect, and I'm not sure if that's because I somehow got the definitions swapped or because the event is "cursor anchor moved" and doesn't fire for selection changes. I'll look into that more tomorrow.

            David Tseng

            Yeah, I think the boolean is interesting. In DOM terms, anchor and focus do behave as you state above, but when the selection is reversed or programmatically set, we may hit strange cases. e.g. after a select all, line, word, do we want to move to the focus or anchor? It's not clear in those cases that focus is expected.

            Aaron Moss

            "Looking into it more tomorrow" took most of the day, but it turns out that `GetSelectionBoundsInWindow()` had a years-old bug swapping anchor and focus in one of the calls it makes (now fixed and commented in this CL).

            I played around a bit with the build, and it seems like the only time the caret moves from the anchor and not the focus is when you've been selecting one direction and then navigate the other direction (e.g. select-backward then move caret forward), which is a jerky motion anyway. I'd appreciate your perspective as an assistive technology user, but I still think "focus is the one that's being actively moved, focus is the one that should be magnified".

            Full description of focus behaviour on keyboard navigation:

            • select all: anchor is beginning of text, focus is end
            • select to end-of-line: anchor is previous caret position, focus is end-of-line
            • select to start-of-line: anchor is previous caret position, focus is start-of-line
            • select line-up or down: anchor is previous caret position, focus is equivalent position one line up or down
            • select next word: anchor is previous caret position, focus is end of next word
            • select previous word: anchor is previous caret position, focus is beginning of previous word.
            • When abandoning the selection and returning to caret navigation by hitting the arrow keys without shift: up and down arrow move from the focus position, left and right move from the first and last position in the selection, respectively (I assume RTL languages reverse this, but didn't test it).
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Amanda Lin Dietz
            • Bo Liu
            • David Tseng
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ib894b95ca69e623f8fde7703431f125342f9e97e
            Gerrit-Change-Number: 7128421
            Gerrit-PatchSet: 13
            Gerrit-Owner: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Aaron Moss <aaro...@google.com>
            Gerrit-Reviewer: Bo Liu <bo...@chromium.org>
            Gerrit-Reviewer: David Tseng <dts...@chromium.org>
            Gerrit-Reviewer: Nico Weber <tha...@chromium.org>
            Gerrit-CC: Amanda Lin Dietz <ald...@google.com>
            Gerrit-CC: Arthur Sonzogni <arthurs...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Daniel Cheng <dch...@chromium.org>
            Gerrit-CC: Ziad Youssef <ziady...@chromium.org>
            Gerrit-Attention: Bo Liu <bo...@chromium.org>
            Gerrit-Attention: Amanda Lin Dietz <ald...@google.com>
            Gerrit-Attention: David Tseng <dts...@chromium.org>
            Gerrit-Comment-Date: Fri, 14 Nov 2025 21:14:12 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages