Address autofill API [chromium/src : main]

0 views
Skip to first unread message

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:24:54 AMSep 18
to Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
Attention needed from Christoph Schwering

Yoav Weiss (@Shopify) voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I9a06ff81466fca7d97d06699a31fec750d15eddb
Gerrit-Change-Number: 6965138
Gerrit-PatchSet: 2
Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 13:24:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:33:07 AMSep 18
to Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
Attention needed from Christoph Schwering

Yoav Weiss (@Shopify) added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Yoav Weiss (@Shopify) . resolved

This is identical to https://chromium-review.googlesource.com/c/chromium/src/+/6200613, with the following differences:

  • The AutofillEvent now has a browser test
  • Removed the extra `Lift` from ContentAutofillDriver
  • Brought back `WebString key = control_element.NameForAutofill();` in form_autofill_util and removed the TODO (which was incorrect)
  • Bring back the direct call to `RetriggerAutofillImpl` from BrowserAutofillManager (instead of `ScheduleRefill`), as we don't need to schedule a refill in the future, but to trigger it immediately (as a response to the promise resolving).
  • Add a null check to web_form_element.

I'll add comments in the code itself to make the above clearer and easier to review.

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
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: I9a06ff81466fca7d97d06699a31fec750d15eddb
Gerrit-Change-Number: 6965138
Gerrit-PatchSet: 2
Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 13:32:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:37:49 AMSep 18
to Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
Attention needed from Christoph Schwering

Yoav Weiss (@Shopify) voted and added 3 comments

Votes added by Yoav Weiss (@Shopify)

Commit-Queue+1

3 comments

File components/autofill/content/renderer/form_autofill_util.cc
Line 2728, Patchset 3 (Latest): WebString key = control_element.NameForAutofill();
Yoav Weiss (@Shopify) . unresolved

@schw...@google.com - I brought back the name here, as this is the fields that are web-exposed to developers, and they should have meaningful names.

File components/autofill/core/browser/foundations/browser_autofill_manager.cc
Line 2425, Patchset 3 (Latest): form_filler_->RetriggerAutofillImpl(
Yoav Weiss (@Shopify) . unresolved

@schw...@google.com - This calls RetriggerAutofillImpl rather than ScheduleRefill as I believe we need to trigger it immediately, not in some point in the future.

File third_party/blink/renderer/core/exported/web_form_element.cc
Line 89, Patchset 3 (Latest): if (!element) {
Yoav Weiss (@Shopify) . unresolved

@schw...@google.com - Added this null check, as some tests arrive here without an HTMLFormElement.

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Thu, 18 Sep 2025 13:37:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Sep 18, 2025, 1:27:24 PMSep 18
    to Yoav Weiss (@Shopify), Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Yoav Weiss (@Shopify)

    Christoph Schwering added 10 comments

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 65, Patchset 3 (Latest): // Retrigger an autofill after the onautofill event fired and the Promise it
    // passed to `waitForIt` was resolved.
    Christoph Schwering . unresolved

    I suspect most readers won't know what this is referring to, especially what `waitForIt` is. (At least I don't 😊.)

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 3 (Latest): bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    How many times may JS delay the autofill? Once, right?

    File components/autofill/content/renderer/form_autofill_util.h
    Line 180, Patchset 3 (Latest):bool DispatchAutofillEvent(const blink::WebDocument& document,
    Christoph Schwering . unresolved

    Please document what this does.

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2728, Patchset 3 (Latest): WebString key = control_element.NameForAutofill();
    Yoav Weiss (@Shopify) . unresolved

    @schw...@google.com - I brought back the name here, as this is the fields that are web-exposed to developers, and they should have meaningful names.

    Christoph Schwering

    I see! There will a specification for what the keys should be, right? I think we don't guarantee stability of `NameForAutofill()` so perhaps we should implement our own fallback from `name` to `id` or vice versa, if we want such a fallback at all.

    Line 2737, Patchset 3 (Latest): .TriggerAutofillEvent(is_undo, field_values);
    Christoph Schwering . unresolved

    std::move() or make the parameter a const ref?

    File components/autofill/core/browser/filling/form_filler.h
    Line 187, Patchset 3 (Latest): void RetriggerAutofillImpl(const FormData& form,
    Christoph Schwering . unresolved

    Keep `TriggerRefill()`?

    File third_party/blink/renderer/core/exported/web_form_element.cc
    Yoav Weiss (@Shopify) . unresolved

    @schw...@google.com - Added this null check, as some tests arrive here without an HTMLFormElement.

    Christoph Schwering

    It seems odd to me to have a meaningful operation on null `WebFormElement`s. Analogous with [this](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/renderer/form_autofill_util.cc;l=1882-1891;drc=48d6f7175422b2c969c14258f9f8d5b196c28d18), I think the null case should be handled by `WebDocument`.

    File third_party/blink/renderer/core/html/forms/autofill_event.h
    Line 35, Patchset 3 (Latest): void waitForIt(ScriptState*, ScriptPromise<IDLUndefined>);
    Christoph Schwering . unresolved

    What is "it"?

    Line 20, Patchset 3 (Latest):class AutofillEvent : public Event {
    Christoph Schwering . unresolved

    Should this be documented?

    File third_party/blink/renderer/core/html/forms/html_form_element.cc
    Line 1230, Patchset 3 (Latest): std::unordered_map<String, String> converted_form_values;
    Christoph Schwering . unresolved

    Do we really want `std::unordered_map` here? base/containers/README.md suggests it for no scenario. And we already take the `std::map` by value here; couldn't we just pass it on?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 3
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Sep 2025 17:27:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 19, 2025, 9:01:07 AMSep 19
    to Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 4 comments

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 65, Patchset 3: // Retrigger an autofill after the onautofill event fired and the Promise it

    // passed to `waitForIt` was resolved.
    Christoph Schwering . unresolved

    I suspect most readers won't know what this is referring to, especially what `waitForIt` is. (At least I don't 😊.)

    Yoav Weiss (@Shopify)

    It's the function you can call inside the event, to pass a promise that tells the browser autofill can refill. I need to rename it (both here and in the proposal). This was a placeholder..

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 3: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    How many times may JS delay the autofill? Once, right?

    Yoav Weiss (@Shopify)

    Indeed

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2728, Patchset 3: WebString key = control_element.NameForAutofill();
    Yoav Weiss (@Shopify) . unresolved

    @schw...@google.com - I brought back the name here, as this is the fields that are web-exposed to developers, and they should have meaningful names.

    Christoph Schwering

    I see! There will a specification for what the keys should be, right? I think we don't guarantee stability of `NameForAutofill()` so perhaps we should implement our own fallback from `name` to `id` or vice versa, if we want such a fallback at all.

    Yoav Weiss (@Shopify)

    Yeah, we probably want to create a more thought-through mapping..

    File third_party/blink/renderer/core/html/forms/autofill_event.h
    Line 35, Patchset 3: void waitForIt(ScriptState*, ScriptPromise<IDLUndefined>);
    Christoph Schwering . unresolved

    What is "it"?

    Yoav Weiss (@Shopify)

    I'll rename this (in the proposal and code..)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 13:00:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Sep 19, 2025, 9:42:44 AMSep 19
    to Yoav Weiss (@Shopify), Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Yoav Weiss (@Shopify)

    Christoph Schwering added 2 comments

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 304, Patchset 4 (Latest): const FormFieldData& trigger_field = form.fields()[0];
    Christoph Schwering . unresolved

    That's a security issue because the triggering field's origin matters when there are multiple frames involved.

    In `BrowserAutofillManager`, that issue is handled by the refill logic, which remembers the origin in the `RefillContex`.

    In `AndroidAutofillManager` the closest to that I know is [`current_field_`](https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.h;l=327-333;drc=524850a07d7849a97763c3b848063d3dfdbd653d), but I guess just using `current_field_` isn't sufficent.

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 65, Patchset 3: // Retrigger an autofill after the onautofill event fired and the Promise it
    // passed to `waitForIt` was resolved.
    Christoph Schwering . unresolved

    I suspect most readers won't know what this is referring to, especially what `waitForIt` is. (At least I don't 😊.)

    Yoav Weiss (@Shopify)

    It's the function you can call inside the event, to pass a promise that tells the browser autofill can refill. I need to rename it (both here and in the proposal). This was a placeholder..

    Christoph Schwering

    I see. I guess we should abstract from this here in the mojo documentation.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 4
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Sep 2025 13:42:31 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 23, 2025, 7:27:55 AM (13 days ago) Sep 23
    to Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 3 comments

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 65, Patchset 3: // Retrigger an autofill after the onautofill event fired and the Promise it
    // passed to `waitForIt` was resolved.
    Christoph Schwering . unresolved

    I suspect most readers won't know what this is referring to, especially what `waitForIt` is. (At least I don't 😊.)

    Yoav Weiss (@Shopify)

    It's the function you can call inside the event, to pass a promise that tells the browser autofill can refill. I need to rename it (both here and in the proposal). This was a placeholder..

    Christoph Schwering

    I see. I guess we should abstract from this here in the mojo documentation.

    Yoav Weiss (@Shopify)

    Renamed the function to make things clearer. Let me know if more changes are needed

    File third_party/blink/renderer/core/html/forms/autofill_event.h
    Line 35, Patchset 3: void waitForIt(ScriptState*, ScriptPromise<IDLUndefined>);
    Christoph Schwering . resolved

    What is "it"?

    Yoav Weiss (@Shopify)

    I'll rename this (in the proposal and code..)

    Yoav Weiss (@Shopify)

    Renamed

    File third_party/blink/renderer/core/html/forms/html_form_element.cc
    Line 1230, Patchset 3: std::unordered_map<String, String> converted_form_values;
    Christoph Schwering . resolved

    Do we really want `std::unordered_map` here? base/containers/README.md suggests it for no scenario. And we already take the `std::map` by value here; couldn't we just pass it on?

    Yoav Weiss (@Shopify)

    Nuked this conversion in favor of conversion in web_form_element (where it belongs)..

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 9
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 11:27:39 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 23, 2025, 8:54:43 AM (13 days ago) Sep 23
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2728, Patchset 3: WebString key = control_element.NameForAutofill();
    Yoav Weiss (@Shopify) . unresolved

    @schw...@google.com - I brought back the name here, as this is the fields that are web-exposed to developers, and they should have meaningful names.

    Christoph Schwering

    I see! There will a specification for what the keys should be, right? I think we don't guarantee stability of `NameForAutofill()` so perhaps we should implement our own fallback from `name` to `id` or vice versa, if we want such a fallback at all.

    Yoav Weiss (@Shopify)

    Yeah, we probably want to create a more thought-through mapping..

    Yoav Weiss (@Shopify)

    I'm hesitating on the best approach here.. IIUC, we have the "autocomplete" attribute (translated to HTMLFieldType), as well as `NameForAutofill` which is essentially the "name" and "id".

    Should we try to map all three to the HTML autocomplete tokens? Something else?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 9
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 23 Sep 2025 12:54:29 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 24, 2025, 6:27:54 AM (12 days ago) Sep 24
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering and Yoav Weiss (@Shopify)

    Yoav Weiss (@Shopify) voted and added 4 comments

    Votes added by Yoav Weiss (@Shopify)

    Commit-Queue+1

    4 comments

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2737, Patchset 3: .TriggerAutofillEvent(is_undo, field_values);
    Christoph Schwering . resolved

    std::move() or make the parameter a const ref?

    Yoav Weiss (@Shopify)

    moved

    File components/autofill/core/browser/filling/form_filler.h
    Line 187, Patchset 3: void RetriggerAutofillImpl(const FormData& form,
    Christoph Schwering . resolved

    Keep `TriggerRefill()`?

    Yoav Weiss (@Shopify)

    Done

    File third_party/blink/renderer/core/exported/web_form_element.cc
    Line 89, Patchset 3: if (!element) {
    Yoav Weiss (@Shopify) . resolved

    @schw...@google.com - Added this null check, as some tests arrive here without an HTMLFormElement.

    Christoph Schwering

    It seems odd to me to have a meaningful operation on null `WebFormElement`s. Analogous with [this](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/renderer/form_autofill_util.cc;l=1882-1891;drc=48d6f7175422b2c969c14258f9f8d5b196c28d18), I think the null case should be handled by `WebDocument`.

    Yoav Weiss (@Shopify)

    Handled this at the call site!

    File third_party/blink/renderer/core/html/forms/autofill_event.h
    Line 20, Patchset 3:class AutofillEvent : public Event {
    Christoph Schwering . resolved

    Should this be documented?

    Yoav Weiss (@Shopify)

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 13
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 10:27:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 24, 2025, 6:31:14 AM (12 days ago) Sep 24
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File components/autofill/content/renderer/form_autofill_util.h
    Line 180, Patchset 3:bool DispatchAutofillEvent(const blink::WebDocument& document,
    Christoph Schwering . resolved

    Please document what this does.

    Yoav Weiss (@Shopify)

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 14
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 10:30:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 24, 2025, 6:35:34 AM (12 days ago) Sep 24
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 65, Patchset 3: // Retrigger an autofill after the onautofill event fired and the Promise it
    // passed to `waitForIt` was resolved.
    Christoph Schwering . resolved

    I suspect most readers won't know what this is referring to, especially what `waitForIt` is. (At least I don't 😊.)

    Yoav Weiss (@Shopify)

    It's the function you can call inside the event, to pass a promise that tells the browser autofill can refill. I need to rename it (both here and in the proposal). This was a placeholder..

    Christoph Schwering

    I see. I guess we should abstract from this here in the mojo documentation.

    Yoav Weiss (@Shopify)

    Renamed the function to make things clearer. Let me know if more changes are needed

    Yoav Weiss (@Shopify)

    Resolving

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 15
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 10:35:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 24, 2025, 8:20:14 AM (12 days ago) Sep 24
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) voted and added 1 comment

    Votes added by Yoav Weiss (@Shopify)

    Commit-Queue+1

    1 comment

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 304, Patchset 4: const FormFieldData& trigger_field = form.fields()[0];
    Christoph Schwering . unresolved

    That's a security issue because the triggering field's origin matters when there are multiple frames involved.

    In `BrowserAutofillManager`, that issue is handled by the refill logic, which remembers the origin in the `RefillContex`.

    In `AndroidAutofillManager` the closest to that I know is [`current_field_`](https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.h;l=327-333;drc=524850a07d7849a97763c3b848063d3dfdbd653d), but I guess just using `current_field_` isn't sufficent.

    Yoav Weiss (@Shopify)

    Revamped to use current_field_'s ID and origin. Let me know if this is not sufficient..

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 16
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 12:19:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 25, 2025, 11:01:40 AM (11 days ago) Sep 25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2728, Patchset 3: WebString key = control_element.NameForAutofill();
    Yoav Weiss (@Shopify) . resolved

    @schw...@google.com - I brought back the name here, as this is the fields that are web-exposed to developers, and they should have meaningful names.

    Christoph Schwering

    I see! There will a specification for what the keys should be, right? I think we don't guarantee stability of `NameForAutofill()` so perhaps we should implement our own fallback from `name` to `id` or vice versa, if we want such a fallback at all.

    Yoav Weiss (@Shopify)

    Yeah, we probably want to create a more thought-through mapping..

    Yoav Weiss (@Shopify)

    I'm hesitating on the best approach here.. IIUC, we have the "autocomplete" attribute (translated to HTMLFieldType), as well as `NameForAutofill` which is essentially the "name" and "id".

    Should we try to map all three to the HTML autocomplete tokens? Something else?

    Yoav Weiss (@Shopify)

    Added a TODO to resolve this in an issue on the spec repo

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 19
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Thu, 25 Sep 2025 15:01:21 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 25, 2025, 11:49:44 PM (10 days ago) Sep 25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 3 comments

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 315, Patchset 19 (Latest): auto* provider = GetAutofillProvider();
    Yoav Weiss (@Shopify) . unresolved

    It's unclear what this would do in terms of UI when retriggering autofill in WebViews.

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 3: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . resolved

    How many times may JS delay the autofill? Once, right?

    Yoav Weiss (@Shopify)

    Indeed

    Yoav Weiss (@Shopify)

    Resolving

    File components/autofill/core/browser/foundations/browser_autofill_manager.cc
    Line 2425, Patchset 3: form_filler_->RetriggerAutofillImpl(
    Yoav Weiss (@Shopify) . resolved

    @schw...@google.com - This calls RetriggerAutofillImpl rather than ScheduleRefill as I believe we need to trigger it immediately, not in some point in the future.

    Yoav Weiss (@Shopify)

    Resolving

    Gerrit-Comment-Date: Fri, 26 Sep 2025 03:49:24 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cathy Li (Gerrit)

    unread,
    Sep 26, 2025, 3:12:52 AM (10 days ago) Sep 26
    to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering and Yoav Weiss (@Shopify)

    Cathy Li added 2 comments

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 295, Patchset 19 (Latest): auto current_field_info = provider->GetCurrentFieldIdAndOrigin();
    Cathy Li . unresolved

    In an ideal world, we can also cache the last-triggered field from the last OnAutofillAvailable call in the provider, and use that. We'd need to cache that information when we cache the form info (see other comment)

    My personal playing around with shopify's sites in this space previously showed that the form manipulation usually changes the autofill session (which doesn't matter in C++, but *does matter a lot* if we notify the Java side - aka option A in the other comment), and the last-modified form field ends up becoming the "current_field". For shopify sites I've played around with, this always ends up being the telephone number country code field for me.

    That means by the time you are trying to retrigger the autofill, the current_field is probably already updated to telephone number - hence, you want to cache the original trigger field inside autofillProvider when OnAutofillAvailable happens, and use that trigger field, if it exists, as the re-fill trigger

    Line 325, Patchset 19 (Latest): provider->OnAskForValuesToFill(
    Cathy Li . unresolved

    What kind of flow do you want to trigger with the retrigger autofill?

    By this time, presumably the autofill service (e.g. Meta's custom autofill or OnePass) would have:
    1. already processed the form
    2. prompted the user for whether they consent to autofill
    3. the user has already consented
    4. sent back a list of IDs with values for setting values.

    Your choices at this point are:
    A. potentially notify the autofill service that the form is ready for re-fill (meaning an Android change to update the Android AutofillManager API to notify AutofillService/client implementations)
    B. silently trigger a refill based on the information (id, value pairs) that the service provided with #4 above.

    If A, this is a much bigger change.
    If B, you'll need to make some changes inside AndroidAutofillProvider to cache the last-filled form information from OnAutofillAvailable method (https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.cc;l=337), create a new method (maybe called "retriggerAutofill" inside AndroidAutofillProvider which takes the cached last-filled form information, map it into the new form, and call FillOrPreviewForm with that newly mapped information.

    From API standpoint, A is going to be much better, where autofill services (like onepass) can then retrigger fills with updated information.

    From fast experiment standpoint, B is going to be better. I can custom-hookup this into meta's custom autofill APIs when I land this change into our custom webview

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 19
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Fri, 26 Sep 2025 07:12:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 26, 2025, 3:58:48 AM (10 days ago) Sep 26
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) added 2 comments

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 295, Patchset 19: auto current_field_info = provider->GetCurrentFieldIdAndOrigin();
    Cathy Li . unresolved

    In an ideal world, we can also cache the last-triggered field from the last OnAutofillAvailable call in the provider, and use that. We'd need to cache that information when we cache the form info (see other comment)

    My personal playing around with shopify's sites in this space previously showed that the form manipulation usually changes the autofill session (which doesn't matter in C++, but *does matter a lot* if we notify the Java side - aka option A in the other comment), and the last-modified form field ends up becoming the "current_field". For shopify sites I've played around with, this always ends up being the telephone number country code field for me.

    That means by the time you are trying to retrigger the autofill, the current_field is probably already updated to telephone number - hence, you want to cache the original trigger field inside autofillProvider when OnAutofillAvailable happens, and use that trigger field, if it exists, as the re-fill trigger

    Yoav Weiss (@Shopify)

    Revamped to cache the last-triggered field. PTAL?

    Line 325, Patchset 19: provider->OnAskForValuesToFill(
    Cathy Li . unresolved

    What kind of flow do you want to trigger with the retrigger autofill?

    By this time, presumably the autofill service (e.g. Meta's custom autofill or OnePass) would have:
    1. already processed the form
    2. prompted the user for whether they consent to autofill
    3. the user has already consented
    4. sent back a list of IDs with values for setting values.

    Your choices at this point are:
    A. potentially notify the autofill service that the form is ready for re-fill (meaning an Android change to update the Android AutofillManager API to notify AutofillService/client implementations)
    B. silently trigger a refill based on the information (id, value pairs) that the service provided with #4 above.

    If A, this is a much bigger change.
    If B, you'll need to make some changes inside AndroidAutofillProvider to cache the last-filled form information from OnAutofillAvailable method (https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.cc;l=337), create a new method (maybe called "retriggerAutofill" inside AndroidAutofillProvider which takes the cached last-filled form information, map it into the new form, and call FillOrPreviewForm with that newly mapped information.

    From API standpoint, A is going to be much better, where autofill services (like onepass) can then retrigger fills with updated information.

    From fast experiment standpoint, B is going to be better. I can custom-hookup this into meta's custom autofill APIs when I land this change into our custom webview

    Yoav Weiss (@Shopify)

    Do I understand correctly and A would require a change on the Android OS side, as well as an eco-system change with various autofill providers?

    If so, I think we should probably start with B.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 20
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Fri, 26 Sep 2025 07:58:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cathy Li <lyc...@meta.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Sep 26, 2025, 10:40:05 AM (10 days ago) Sep 26
    to Yoav Weiss (@Shopify), Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Yoav Weiss (@Shopify)

    Christoph Schwering added 14 comments

    File chrome/browser/autofill/BUILD.gn
    Line 218, Patchset 20 (Latest): "//net:test_support",
    Christoph Schwering . unresolved

    Move this upwards?

    File chrome/browser/autofill/autofill_event_handler_browsertest.cc
    Line 119, Patchset 20 (Latest):#if BUILDFLAG(IS_ANDROID)
    return chrome_test_utils::GetActiveWebContents(this);
    #else
    return browser()->tab_strip_model()->GetActiveWebContents();
    #endif
    }
    Christoph Schwering . unresolved

    Dosen't `chrome_test_utils::GetActiveWebContents(this);` work on Desktop?

    Line 181, Patchset 20 (Latest): // Enable the AddressAutofillAPI feature for this test
    Christoph Schwering . unresolved

    nitty nit: `.` (also below)

    Line 182, Patchset 20 (Latest): scoped_feature_list_.InitAndEnableFeature(
    blink::features::kAddressAutofillAPI);
    Christoph Schwering . unresolved
    nit: Do this at the test fixture's construction time? 
    ```
    base::test::ScopedFeatureList scoped_feature_list_{
    blink::features::kAddressAutofillAPI};
    ```
    should suffice
    Line 210, Patchset 20 (Latest): // === Verify autofill event was fired ===
    Christoph Schwering . unresolved

    nit: remove (and below)

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 304, Patchset 4: const FormFieldData& trigger_field = form.fields()[0];
    Christoph Schwering . resolved

    That's a security issue because the triggering field's origin matters when there are multiple frames involved.

    In `BrowserAutofillManager`, that issue is handled by the refill logic, which remembers the origin in the `RefillContex`.

    In `AndroidAutofillManager` the closest to that I know is [`current_field_`](https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.h;l=327-333;drc=524850a07d7849a97763c3b848063d3dfdbd653d), but I guess just using `current_field_` isn't sufficent.

    Yoav Weiss (@Shopify)

    Revamped to use current_field_'s ID and origin. Let me know if this is not sufficient..

    Christoph Schwering

    Thanks

    Line 325, Patchset 19: provider->OnAskForValuesToFill(
    Cathy Li . unresolved

    What kind of flow do you want to trigger with the retrigger autofill?

    By this time, presumably the autofill service (e.g. Meta's custom autofill or OnePass) would have:
    1. already processed the form
    2. prompted the user for whether they consent to autofill
    3. the user has already consented
    4. sent back a list of IDs with values for setting values.

    Your choices at this point are:
    A. potentially notify the autofill service that the form is ready for re-fill (meaning an Android change to update the Android AutofillManager API to notify AutofillService/client implementations)
    B. silently trigger a refill based on the information (id, value pairs) that the service provided with #4 above.

    If A, this is a much bigger change.
    If B, you'll need to make some changes inside AndroidAutofillProvider to cache the last-filled form information from OnAutofillAvailable method (https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.cc;l=337), create a new method (maybe called "retriggerAutofill" inside AndroidAutofillProvider which takes the cached last-filled form information, map it into the new form, and call FillOrPreviewForm with that newly mapped information.

    From API standpoint, A is going to be much better, where autofill services (like onepass) can then retrigger fills with updated information.

    From fast experiment standpoint, B is going to be better. I can custom-hookup this into meta's custom autofill APIs when I land this change into our custom webview

    Yoav Weiss (@Shopify)

    Do I understand correctly and A would require a change on the Android OS side, as well as an eco-system change with various autofill providers?

    If so, I think we should probably start with B.

    Christoph Schwering

    For my understanding: B does not support added fields, does it? If so, isn't A necessary?

    File components/android_autofill/browser/android_autofill_provider.h
    Line 344, Patchset 20 (Latest): // Properties of the last-focused field of the current session for `form_`
    // (queried input or changed select box).
    CurrentFieldInfo current_field_;

    // Properties of the original trigger field that initiated the autofill
    // session. This is cached in OnAutofillAvailable to ensure retrigger
    // operations use the original field even if form manipulation changes the
    // current field.
    CurrentFieldInfo original_trigger_field_;
    Christoph Schwering . unresolved

    I guess `Reset()` should reset this, too.

    Can we collect the session-specific state in one `struct`? Maybe there should be a member `std::optional<SessionState>`.

    I find it rather difficult to understand what a session is in AndroidAutofillProvider (when does it start, when does it end, and what's its state).

    Line 349, Patchset 20 (Latest): // session. This is cached in OnAutofillAvailable to ensure retrigger
    Christoph Schwering . unresolved

    nit: `()`

    Line 131, Patchset 20 (Latest): // AutofillProvider:
    std::optional<std::pair<FieldGlobalId, url::Origin>>
    GetOriginalTriggerFieldIdAndOrigin() const override;
    Christoph Schwering . unresolved

    nit: Move up to the other overrides?

    Line 118, Patchset 20 (Latest): private:
    Christoph Schwering . unresolved

    Should this be public or should `GetCurrentFieldInfo()` be private??

    File components/android_autofill/browser/android_autofill_provider.cc
    Line 337, Patchset 20 (Latest): // Cache the original trigger field that initiated this autofill session.
    Christoph Schwering . unresolved

    I find no information what the event means and when it's fired (I didn't look beyond the C++ code). There's a `StartNewSession()` function. The comment sounds to me like `original_trigger_field_` should be set there. WDYT?

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 20 (Latest): bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    Like you mention below, we need a timer that fires `RetriggerAutofill()` if JS hasn't responded fast enough. I guess we can just replace the `bool` with a `base::OneShotTimer`?

    Line 572, Patchset 20 (Latest): bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    Suppose `waiting_for_autofill_retrigger` is true. How will we deal with `ApplyFieldsAction()` messages coming in?

    One option could be to ignore them. Then we should also not send any `AskForValuesToFill()` while `waiting_for_autufill_retrigger`. Otherwise, the user could see Autofill suggestions and maybe even the preview, but filling would do nothing.

    We could try to refine the skipping and only block `AskForValuesToFill()` and `ApplyFieldsAction()` on fields that are touched by ongoing fill operations.

    I'm also wondering how things behave when we have a frame-transcending form. Suppose we have a frame-transcending form in two documents A and B and

    • A and B both observe `onautofill` and
    • Autofill fills the fields in A and B
    • A adds some field X to its form (--> the browser process is informed about the change)
    • B adds some field Y to its form (--> the browser process is informed about the change)
    • A resolves the promise
    • the browser process refills the frame-transcending form, including the new fields X and Y.

    What should B do? Should it fill the new data into Y or ignore it?

    I guess it's OK for B to ignore it. Because B can and will still resolve the promise, which would trigger another refill that again includes X and Y, and B would not ignore that second refill.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 20
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Sep 2025 14:39:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cathy Li <lyc...@meta.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 29, 2025, 1:21:24 AM (7 days ago) Sep 29
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) added 6 comments

    File chrome/browser/autofill/BUILD.gn
    Line 218, Patchset 20: "//net:test_support",
    Christoph Schwering . resolved

    Move this upwards?

    Yoav Weiss (@Shopify)

    Done

    File chrome/browser/autofill/autofill_event_handler_browsertest.cc
    Line 119, Patchset 20:#if BUILDFLAG(IS_ANDROID)

    return chrome_test_utils::GetActiveWebContents(this);
    #else
    return browser()->tab_strip_model()->GetActiveWebContents();
    #endif
    }
    Christoph Schwering . resolved

    Dosen't `chrome_test_utils::GetActiveWebContents(this);` work on Desktop?

    Yoav Weiss (@Shopify)

    It does!!

    Line 181, Patchset 20: // Enable the AddressAutofillAPI feature for this test
    Christoph Schwering . resolved

    nitty nit: `.` (also below)

    Yoav Weiss (@Shopify)

    Removed

    Line 182, Patchset 20: scoped_feature_list_.InitAndEnableFeature(
    blink::features::kAddressAutofillAPI);
    Christoph Schwering . resolved
    nit: Do this at the test fixture's construction time? 
    ```
    base::test::ScopedFeatureList scoped_feature_list_{
    blink::features::kAddressAutofillAPI};
    ```
    should suffice
    Yoav Weiss (@Shopify)

    Done

    Line 210, Patchset 20: // === Verify autofill event was fired ===
    Christoph Schwering . resolved

    nit: remove (and below)

    Yoav Weiss (@Shopify)

    Done

    File components/android_autofill/browser/android_autofill_provider.h
    Line 349, Patchset 20: // session. This is cached in OnAutofillAvailable to ensure retrigger
    Christoph Schwering . resolved

    nit: `()`

    Yoav Weiss (@Shopify)

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 20
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Mon, 29 Sep 2025 05:21:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 29, 2025, 1:29:35 AM (7 days ago) Sep 29
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) voted and added 3 comments

    Votes added by Yoav Weiss (@Shopify)

    Commit-Queue+1

    3 comments

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 325, Patchset 19: provider->OnAskForValuesToFill(
    Cathy Li . unresolved

    What kind of flow do you want to trigger with the retrigger autofill?

    By this time, presumably the autofill service (e.g. Meta's custom autofill or OnePass) would have:
    1. already processed the form
    2. prompted the user for whether they consent to autofill
    3. the user has already consented
    4. sent back a list of IDs with values for setting values.

    Your choices at this point are:
    A. potentially notify the autofill service that the form is ready for re-fill (meaning an Android change to update the Android AutofillManager API to notify AutofillService/client implementations)
    B. silently trigger a refill based on the information (id, value pairs) that the service provided with #4 above.

    If A, this is a much bigger change.
    If B, you'll need to make some changes inside AndroidAutofillProvider to cache the last-filled form information from OnAutofillAvailable method (https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.cc;l=337), create a new method (maybe called "retriggerAutofill" inside AndroidAutofillProvider which takes the cached last-filled form information, map it into the new form, and call FillOrPreviewForm with that newly mapped information.

    From API standpoint, A is going to be much better, where autofill services (like onepass) can then retrigger fills with updated information.

    From fast experiment standpoint, B is going to be better. I can custom-hookup this into meta's custom autofill APIs when I land this change into our custom webview

    Yoav Weiss (@Shopify)

    Do I understand correctly and A would require a change on the Android OS side, as well as an eco-system change with various autofill providers?

    If so, I think we should probably start with B.

    Christoph Schwering

    For my understanding: B does not support added fields, does it? If so, isn't A necessary?

    Yoav Weiss (@Shopify)

    That's a great point. Cathy - thoughts?

    File components/android_autofill/browser/android_autofill_provider.h
    Line 131, Patchset 20: // AutofillProvider:

    std::optional<std::pair<FieldGlobalId, url::Origin>>
    GetOriginalTriggerFieldIdAndOrigin() const override;
    Christoph Schwering . resolved

    nit: Move up to the other overrides?

    Yoav Weiss (@Shopify)

    Done

    Line 118, Patchset 20: private:
    Christoph Schwering . resolved

    Should this be public or should `GetCurrentFieldInfo()` be private??

    Yoav Weiss (@Shopify)

    It's actually dead code. Removed!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 21
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Mon, 29 Sep 2025 05:29:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Sep 29, 2025, 9:54:41 AM (7 days ago) Sep 29
    to Yoav Weiss (@Shopify), Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Yoav Weiss (@Shopify)

    Christoph Schwering added 1 comment

    Patchset-level comments
    File-level comment, Patchset 22 (Latest):
    Christoph Schwering . resolved

    Nothing needed from my side at the moment, right?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 22
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Mon, 29 Sep 2025 13:54:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 29, 2025, 12:09:48 PM (7 days ago) Sep 29
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    Patchset-level comments
    Christoph Schwering . resolved

    Nothing needed from my side at the moment, right?

    Yoav Weiss (@Shopify)

    Indeed. I owe you some answers/changes 😊

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 22
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Mon, 29 Sep 2025 16:09:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 30, 2025, 6:57:55 AM (6 days ago) Sep 30
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) voted and added 3 comments

    Votes added by Yoav Weiss (@Shopify)

    Commit-Queue+1

    3 comments

    File components/android_autofill/browser/android_autofill_provider.h
    Line 344, Patchset 20: // Properties of the last-focused field of the current session for `form_`

    // (queried input or changed select box).
    CurrentFieldInfo current_field_;

    // Properties of the original trigger field that initiated the autofill
    // session. This is cached in OnAutofillAvailable to ensure retrigger
    // operations use the original field even if form manipulation changes the
    // current field.
    CurrentFieldInfo original_trigger_field_;
    Christoph Schwering . unresolved

    I guess `Reset()` should reset this, too.

    Can we collect the session-specific state in one `struct`? Maybe there should be a member `std::optional<SessionState>`.

    I find it rather difficult to understand what a session is in AndroidAutofillProvider (when does it start, when does it end, and what's its state).

    Yoav Weiss (@Shopify)

    Did that as part of https://chromium-review.googlesource.com/c/chromium/src/+/6998451 as it seemed like a large non-functional change. Once that lands, I can fold original_trigger_field_ into SessionState.

    File components/android_autofill/browser/android_autofill_provider.cc
    Line 337, Patchset 20: // Cache the original trigger field that initiated this autofill session.
    Christoph Schwering . resolved

    I find no information what the event means and when it's fired (I didn't look beyond the C++ code). There's a `StartNewSession()` function. The comment sounds to me like `original_trigger_field_` should be set there. WDYT?

    Yoav Weiss (@Shopify)

    Done

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 20: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    Like you mention below, we need a timer that fires `RetriggerAutofill()` if JS hasn't responded fast enough. I guess we can just replace the `bool` with a `base::OneShotTimer`?

    Yoav Weiss (@Shopify)

    This adds a bit of complexity so I thought it's best to do this in a followup. But I can integrate it to this CL if this is better from your perspective

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 23
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 30 Sep 2025 10:57:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 30, 2025, 7:32:09 AM (6 days ago) Sep 30
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) voted and added 1 comment

    Votes added by Yoav Weiss (@Shopify)

    Commit-Queue+1

    1 comment

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 20: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . resolved

    Suppose `waiting_for_autofill_retrigger` is true. How will we deal with `ApplyFieldsAction()` messages coming in?

    One option could be to ignore them. Then we should also not send any `AskForValuesToFill()` while `waiting_for_autufill_retrigger`. Otherwise, the user could see Autofill suggestions and maybe even the preview, but filling would do nothing.

    We could try to refine the skipping and only block `AskForValuesToFill()` and `ApplyFieldsAction()` on fields that are touched by ongoing fill operations.

    I'm also wondering how things behave when we have a frame-transcending form. Suppose we have a frame-transcending form in two documents A and B and

    • A and B both observe `onautofill` and
    • Autofill fills the fields in A and B
    • A adds some field X to its form (--> the browser process is informed about the change)
    • B adds some field Y to its form (--> the browser process is informed about the change)
    • A resolves the promise
    • the browser process refills the frame-transcending form, including the new fields X and Y.

    What should B do? Should it fill the new data into Y or ignore it?

    I guess it's OK for B to ignore it. Because B can and will still resolve the promise, which would trigger another refill that again includes X and Y, and B would not ignore that second refill.

    Yoav Weiss (@Shopify)

    Suppose waiting_for_autofill_retrigger is true. How will we deal with ApplyFieldsAction() messages coming in?

    One option could be to ignore them. Then we should also not send any AskForValuesToFill() while waiting_for_autufill_retrigger. Otherwise, the user could see Autofill suggestions and maybe even the preview, but filling would do nothing.

    We could try to refine the skipping and only block AskForValuesToFill() and ApplyFieldsAction() on fields that are touched by ongoing fill operations.

    Implemented the blocking behavior. Currently it can block autofill forever, but once we add a timeout blocking makes more sense.


    > I'm also wondering how things behave when we have a frame-transcending form. Suppose we have a frame-transcending form in two documents A and B and

    A and B both observe onautofill and
    Autofill fills the fields in A and B
    A adds some field X to its form (--> the browser process is informed about the change)
    B adds some field Y to its form (--> the browser process is informed about the change)
    A resolves the promise
    the browser process refills the frame-transcending form, including the new fields X and Y.
    What should B do? Should it fill the new data into Y or ignore it?

    I guess it's OK for B to ignore it. Because B can and will still resolve the promise, which would trigger another refill that again includes X and Y, and B would not ignore that second refill.

    Yeah, I think it's fine for each form to fill once it resolves the promise. That way if it moves fields around we won't get an inconsistent outcome.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 24
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 30 Sep 2025 11:31:55 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Sep 30, 2025, 11:00:45 AM (6 days ago) Sep 30
    to Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li and Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File components/android_autofill/browser/android_autofill_provider.h
    Line 344, Patchset 20: // Properties of the last-focused field of the current session for `form_`
    // (queried input or changed select box).
    CurrentFieldInfo current_field_;

    // Properties of the original trigger field that initiated the autofill
    // session. This is cached in OnAutofillAvailable to ensure retrigger
    // operations use the original field even if form manipulation changes the
    // current field.
    CurrentFieldInfo original_trigger_field_;
    Christoph Schwering . resolved

    I guess `Reset()` should reset this, too.

    Can we collect the session-specific state in one `struct`? Maybe there should be a member `std::optional<SessionState>`.

    I find it rather difficult to understand what a session is in AndroidAutofillProvider (when does it start, when does it end, and what's its state).

    Yoav Weiss (@Shopify)

    Did that as part of https://chromium-review.googlesource.com/c/chromium/src/+/6998451 as it seemed like a large non-functional change. Once that lands, I can fold original_trigger_field_ into SessionState.

    Yoav Weiss (@Shopify)

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 27
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 30 Sep 2025 15:00:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cathy Li (Gerrit)

    unread,
    Sep 30, 2025, 11:42:29 AM (6 days ago) Sep 30
    to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering and Yoav Weiss (@Shopify)

    Cathy Li added 1 comment

    File components/android_autofill/browser/android_autofill_manager.cc
    Line 325, Patchset 19: provider->OnAskForValuesToFill(
    Cathy Li . unresolved

    What kind of flow do you want to trigger with the retrigger autofill?

    By this time, presumably the autofill service (e.g. Meta's custom autofill or OnePass) would have:
    1. already processed the form
    2. prompted the user for whether they consent to autofill
    3. the user has already consented
    4. sent back a list of IDs with values for setting values.

    Your choices at this point are:
    A. potentially notify the autofill service that the form is ready for re-fill (meaning an Android change to update the Android AutofillManager API to notify AutofillService/client implementations)
    B. silently trigger a refill based on the information (id, value pairs) that the service provided with #4 above.

    If A, this is a much bigger change.
    If B, you'll need to make some changes inside AndroidAutofillProvider to cache the last-filled form information from OnAutofillAvailable method (https://source.chromium.org/chromium/chromium/src/+/main:components/android_autofill/browser/android_autofill_provider.cc;l=337), create a new method (maybe called "retriggerAutofill" inside AndroidAutofillProvider which takes the cached last-filled form information, map it into the new form, and call FillOrPreviewForm with that newly mapped information.

    From API standpoint, A is going to be much better, where autofill services (like onepass) can then retrigger fills with updated information.

    From fast experiment standpoint, B is going to be better. I can custom-hookup this into meta's custom autofill APIs when I land this change into our custom webview

    Yoav Weiss (@Shopify)

    Do I understand correctly and A would require a change on the Android OS side, as well as an eco-system change with various autofill providers?

    If so, I think we should probably start with B.

    Christoph Schwering

    For my understanding: B does not support added fields, does it? If so, isn't A necessary?

    Cathy Li

    Yoav: yes, A would probably require eco-system change, which you may be pushing for anyway. It's the only way webviews can notify system autofill services that form has changed so they can re-examine all of the fields and issue a re-fill request without potentially triggering yet another UI prompt.

    Yoav/Christoph: I think for long-term we probably want A. For an initial implementation where we just want to see if this idea actually works, we can maybe start with B?

    Additional context: we fork the chromium webview code and package it into Meta's in-app-browser x Meta's autofill. We were intending to run a trial test between Meta and Shopify for this API to see how it affects autofill "in the wild". I can make custom changes in our forked webview to make the connections necessary for this initial trial test, while we work on what A would look like

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 27
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Tue, 30 Sep 2025 15:42:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cathy Li <lyc...@meta.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    gwsq (Gerrit)

    unread,
    Oct 1, 2025, 3:35:32 AM (5 days ago) Oct 1
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering, Jan Keitel and Kinuko Yasuda

    Message from gwsq

    From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
    IPC: kin...@chromium.org

    📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

    IPC reviewer(s): kin...@chromium.org


    Reviewer source(s):
    kin...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christoph Schwering
    • Jan Keitel
    • Kinuko Yasuda
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 27
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Jan Keitel <jke...@google.com>
    Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Jan Keitel <jke...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Wed, 01 Oct 2025 07:35:27 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cathy Li (Gerrit)

    unread,
    Oct 1, 2025, 4:16:21 PM (4 days ago) Oct 1
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Christoph Schwering, Jan Keitel and Kinuko Yasuda

    Cathy Li added 1 comment

    File components/autofill/content/browser/content_autofill_driver.h
    Line 297, Patchset 27 (Latest): void RetriggerAutofill(const FormData&) override;
    Cathy Li . unresolved

    note - this doesn't compile. you're missing the name for this parameter

    e.g. const FormData& form

    Gerrit-Comment-Date: Wed, 01 Oct 2025 20:16:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Oct 1, 2025, 11:07:34 PM (4 days ago) Oct 1
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Jan Keitel, Kinuko Yasuda and Yoav Weiss (@Shopify)

    Christoph Schwering added 11 comments

    File components/android_autofill/browser/android_autofill_provider.h
    Line 388, Patchset 27 (Latest): base::WeakPtr<AndroidAutofillManager> manager_;
    Christoph Schwering . unresolved

    Seems to be unused -- remove?

    Line 386, Patchset 27 (Latest): content::GlobalRenderFrameHostId last_queried_field_rfh_id_;
    Christoph Schwering . unresolved

    Seems to be unused -- remove?

    Line 322, Patchset 27 (Latest): CurrentFieldInfo original_trigger_field;
    Christoph Schwering . unresolved

    Can it be `const`?

    Line 319, Patchset 27 (Latest): // session. This is cached in OnAutofillAvailable() to ensure retrigger

    // operations use the original field even if form manipulation changes the
    // current field.
    Christoph Schwering . unresolved

    I don't understand this, perhaps because I don't know `OnAutofillAvailable()` means.

    I'd assume that the "original" trigger field is set when a `SessionState` is created and remains unchanged. Is that not the case?

    File components/autofill/content/browser/content_autofill_driver.h
    Line 297, Patchset 27 (Latest): void RetriggerAutofill(const FormData&) override;
    Cathy Li . unresolved

    note - this doesn't compile. you're missing the name for this parameter

    e.g. const FormData& form

    Christoph Schwering

    Parameters don't need names (https://en.cppreference.com/w/cpp/language/function.html#Parameter_list), but I also think we should have one for consistency.

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 67, Patchset 27 (Latest): RetriggerAutofill(FormData form);
    Christoph Schwering . unresolved

    How about naming this `RequestRefill()`?

    "Refill" sounds more familiar to those who who are familiar with refills, and IIUC for `BrowserAutofillManager` it's the the behaviour that we trigger.

    And "request" makes it sound less binding. For example, if the originally filled field is gone, Chrome won't refill the form (at least now).

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 20: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    Like you mention below, we need a timer that fires `RetriggerAutofill()` if JS hasn't responded fast enough. I guess we can just replace the `bool` with a `base::OneShotTimer`?

    Yoav Weiss (@Shopify)

    This adds a bit of complexity so I thought it's best to do this in a followup. But I can integrate it to this CL if this is better from your perspective

    Christoph Schwering

    Hmm I think we need to move this to the browser process. Otherwise, it wouldn't work properly for frame-transcending forms.

    Otherwise, if frame A observes `autofill` and frame B does not, the user could still trigger an autofill before frame A has fulfilled the promise.

    I imagine something like this: every frame reports when a promise is pending and when a promise is fulfilled. The browser process (probably `AutofillClient` or `AutofillDriverFactory`) have a counter. The browser process only shows suggestions -- and maybe also only fills forms -- if this counter is zero.

    Moving this to a separate CL sgtm, but I think we should have a concrete idea how it'll work already. WDYT?

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1153, Patchset 27 (Latest): if (autofill_retrigger_state_ == AutofillRetriggerState::kNotWaiting &&
    base::FeatureList::IsEnabled(blink::features::kAddressAutofillAPI) &&
    form_util::DispatchAutofillEvent(document, is_undo, fields) ==
    AutofillEventResult::DELAY) {
    autofill_retrigger_state_ = AutofillRetriggerState::kWaiting;
    // We need to delay autofill triggering until the AutofillEvent
    // prepareForm promise is resolved.

    // TODO: Kick off a timer here that will retrigger the autofill on the
    // same form if the promise is not resolved in that time.
    return;
    }
    autofill_retrigger_state_ = AutofillRetriggerState::kNotWaiting;
    Christoph Schwering . unresolved

    A suggestion to reduce overall complexity:

    • Chrome supports only address and credit card refills.
    • WebView supports no refills at all.

    How about we add a parameter to `ApplyFieldsAction()` (say, `bool fire_js_event`), which we always set to `false` except for non-refill address or credit card fils ([here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=920-926;drc=30914745e420f4e9b1e95dd8dffe37441f7c779e)).

    File components/autofill/core/browser/foundations/autofill_manager.h
    Line 277, Patchset 27 (Latest): virtual void RetriggerAutofill(const FormData& form);
    Christoph Schwering . unresolved

    nit: `On...`

    Line 171, Patchset 27 (Latest): void NoOp(AutofillManager&) {}
    Christoph Schwering . unresolved

    What does this mean?

    File components/autofill/core/browser/foundations/autofill_manager.cc
    Line 234, Patchset 27 (Latest): .Then(NotifyObserversCallback(&Observer::NoOp)));
    Christoph Schwering . unresolved

    If we don't want an `Observer` event, just remove this?

    Otherwise, there should be an `OnBeforeFoo()` and an `OnAfterFoo()` event.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jan Keitel
    • Kinuko Yasuda
    • Yoav Weiss (@Shopify)
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 03:07:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Oct 2, 2025, 3:21:56 AM (4 days ago) Oct 2
    to Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li, Christoph Schwering, Jan Keitel and Kinuko Yasuda

    Yoav Weiss (@Shopify) added 9 comments

    File components/android_autofill/browser/android_autofill_provider.h
    Line 388, Patchset 27: base::WeakPtr<AndroidAutofillManager> manager_;
    Christoph Schwering . resolved

    Seems to be unused -- remove?

    Yoav Weiss (@Shopify)

    Done

    Line 386, Patchset 27: content::GlobalRenderFrameHostId last_queried_field_rfh_id_;
    Christoph Schwering . resolved

    Seems to be unused -- remove?

    Yoav Weiss (@Shopify)

    Done

    Line 322, Patchset 27: CurrentFieldInfo original_trigger_field;
    Christoph Schwering . unresolved

    Can it be `const`?

    Yoav Weiss (@Shopify)

    I don't think it can without further changes to how SessionState is constructed

    Line 319, Patchset 27: // session. This is cached in OnAutofillAvailable() to ensure retrigger

    // operations use the original field even if form manipulation changes the
    // current field.
    Christoph Schwering . resolved

    I don't understand this, perhaps because I don't know `OnAutofillAvailable()` means.

    I'd assume that the "original" trigger field is set when a `SessionState` is created and remains unchanged. Is that not the case?

    Yoav Weiss (@Shopify)

    Stale comment. Fixed

    File components/autofill/content/browser/content_autofill_driver.h
    Line 297, Patchset 27: void RetriggerAutofill(const FormData&) override;
    Cathy Li . resolved

    note - this doesn't compile. you're missing the name for this parameter

    e.g. const FormData& form

    Christoph Schwering

    Parameters don't need names (https://en.cppreference.com/w/cpp/language/function.html#Parameter_list), but I also think we should have one for consistency.

    Yoav Weiss (@Shopify)

    It built for me.. added the parameter name

    File components/autofill/content/common/mojom/autofill_driver.mojom
    Line 67, Patchset 27: RetriggerAutofill(FormData form);
    Christoph Schwering . resolved

    How about naming this `RequestRefill()`?

    "Refill" sounds more familiar to those who who are familiar with refills, and IIUC for `BrowserAutofillManager` it's the the behaviour that we trigger.

    And "request" makes it sound less binding. For example, if the originally filled field is gone, Chrome won't refill the form (at least now).

    Yoav Weiss (@Shopify)

    Renamed

    File components/autofill/core/browser/foundations/autofill_manager.h
    Line 277, Patchset 27: virtual void RetriggerAutofill(const FormData& form);
    Christoph Schwering . resolved

    nit: `On...`

    Yoav Weiss (@Shopify)

    Done

    Line 171, Patchset 27: void NoOp(AutofillManager&) {}
    Christoph Schwering . resolved

    What does this mean?

    Yoav Weiss (@Shopify)

    Removed

    File components/autofill/core/browser/foundations/autofill_manager.cc
    Line 234, Patchset 27: .Then(NotifyObserversCallback(&Observer::NoOp)));
    Christoph Schwering . resolved

    If we don't want an `Observer` event, just remove this?

    Otherwise, there should be an `OnBeforeFoo()` and an `OnAfterFoo()` event.

    Yoav Weiss (@Shopify)

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    • Jan Keitel
    • Kinuko Yasuda
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Jan Keitel <jke...@google.com>
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 07:21:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cathy Li <lyc...@meta.com>
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Oct 2, 2025, 5:20:28 AM (4 days ago) Oct 2
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li, Jan Keitel, Kinuko Yasuda and Yoav Weiss (@Shopify)

    Christoph Schwering added 1 comment

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1153, Patchset 27: if (autofill_retrigger_state_ == AutofillRetriggerState::kNotWaiting &&

    base::FeatureList::IsEnabled(blink::features::kAddressAutofillAPI) &&
    form_util::DispatchAutofillEvent(document, is_undo, fields) ==
    AutofillEventResult::DELAY) {
    autofill_retrigger_state_ = AutofillRetriggerState::kWaiting;
    // We need to delay autofill triggering until the AutofillEvent
    // prepareForm promise is resolved.

    // TODO: Kick off a timer here that will retrigger the autofill on the
    // same form if the promise is not resolved in that time.
    return;
    }
    autofill_retrigger_state_ = AutofillRetriggerState::kNotWaiting;
    Christoph Schwering . unresolved

    A suggestion to reduce overall complexity:

    • Chrome supports only address and credit card refills.
    • WebView supports no refills at all.

    How about we add a parameter to `ApplyFieldsAction()` (say, `bool fire_js_event`), which we always set to `false` except for non-refill address or credit card fils ([here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=920-926;drc=30914745e420f4e9b1e95dd8dffe37441f7c779e)).

    Christoph Schwering

    I left that comment half-finished:

    In the `AutofillAgents::ApplyFieldsAction()`, we'd only fire the JavaScript event if `fire_js_event` is true.

    That way, we won't need to extend Chrome's refill mechanism and build a refill mechanism for WebView, both of which may be significant pieces of work. We can of course still implement them in the future.

    The spec may need to be relaxed though to tolerate this, i.e., to allow the browser not to fill the event. I think currently it does not allow that, right?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Jan Keitel
    • Kinuko Yasuda
    • Yoav Weiss (@Shopify)
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I9a06ff81466fca7d97d06699a31fec750d15eddb
    Gerrit-Change-Number: 6965138
    Gerrit-PatchSet: 29
    Gerrit-Owner: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Reviewer: Christoph Schwering <schw...@google.com>
    Gerrit-Reviewer: Jan Keitel <jke...@google.com>
    Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Cathy Li <lyc...@meta.com>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Cathy Li <lyc...@meta.com>
    Gerrit-Attention: Jan Keitel <jke...@google.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 09:20:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Oct 2, 2025, 5:35:19 AM (4 days ago) Oct 2
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li, Jan Keitel, Kinuko Yasuda and Yoav Weiss (@Shopify)

    Christoph Schwering added 1 comment

    File components/autofill/content/renderer/autofill_agent.h
    Line 572, Patchset 20: bool waiting_for_autofill_retrigger_ = false;
    Christoph Schwering . unresolved

    Suppose `waiting_for_autofill_retrigger` is true. How will we deal with `ApplyFieldsAction()` messages coming in?

    Christoph Schwering

    Could you add a test for that two frames requesting a refill works?

    I just thought it doesn't because it I thought the refill mechanism has a limitation to at most 1 refill, but I can't find such a limit so I guess I was wrong.

    Gerrit-Comment-Date: Thu, 02 Oct 2025 09:35:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Oct 2, 2025, 6:14:24 AM (4 days ago) Oct 2
    to Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li, Christoph Schwering, Jan Keitel and Kinuko Yasuda

    Yoav Weiss (@Shopify) added 1 comment

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1153, Patchset 27: if (autofill_retrigger_state_ == AutofillRetriggerState::kNotWaiting &&
    base::FeatureList::IsEnabled(blink::features::kAddressAutofillAPI) &&
    form_util::DispatchAutofillEvent(document, is_undo, fields) ==
    AutofillEventResult::DELAY) {
    autofill_retrigger_state_ = AutofillRetriggerState::kWaiting;
    // We need to delay autofill triggering until the AutofillEvent
    // prepareForm promise is resolved.

    // TODO: Kick off a timer here that will retrigger the autofill on the
    // same form if the promise is not resolved in that time.
    return;
    }
    autofill_retrigger_state_ = AutofillRetriggerState::kNotWaiting;
    Christoph Schwering . unresolved

    A suggestion to reduce overall complexity:

    • Chrome supports only address and credit card refills.
    • WebView supports no refills at all.

    How about we add a parameter to `ApplyFieldsAction()` (say, `bool fire_js_event`), which we always set to `false` except for non-refill address or credit card fils ([here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=920-926;drc=30914745e420f4e9b1e95dd8dffe37441f7c779e)).

    Christoph Schwering

    I left that comment half-finished:

    In the `AutofillAgents::ApplyFieldsAction()`, we'd only fire the JavaScript event if `fire_js_event` is true.

    That way, we won't need to extend Chrome's refill mechanism and build a refill mechanism for WebView, both of which may be significant pieces of work. We can of course still implement them in the future.

    The spec may need to be relaxed though to tolerate this, i.e., to allow the browser not to fill the event. I think currently it does not allow that, right?

    Yoav Weiss (@Shopify)

    If the browser doesn't trigger a refill, that would create a problem from the web developer's perpective. Right now developers have all kinda of hacks to deal with browsers that don't refill. They'd need to create more hacks to deal with browsers that support the autofill event, yet don't refill after the promise is resolved..

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Christoph Schwering
    • Jan Keitel
    • Kinuko Yasuda
    Gerrit-Attention: Christoph Schwering <schw...@google.com>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 10:14:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Christoph Schwering <schw...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Oct 2, 2025, 6:15:41 AM (4 days ago) Oct 2
    to Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    File components/autofill/content/renderer/autofill_agent.cc
    Yoav Weiss (@Shopify)

    To be clear, I'm all for the "support only address and credit card refills" part. But I think we need to support refills (at least to some extent) on all platforms that support the autofill event.

    Gerrit-Comment-Date: Thu, 02 Oct 2025 10:15:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Christoph Schwering (Gerrit)

    unread,
    Oct 2, 2025, 6:59:52 AM (4 days ago) Oct 2
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, Cathy Li, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Cathy Li, Jan Keitel, Kinuko Yasuda and Yoav Weiss (@Shopify)

    Christoph Schwering added 1 comment

    File components/autofill/content/renderer/autofill_agent.cc
    Christoph Schwering

    They'd need to create more hacks to deal with browsers that support the autofill event, yet don't refill after the promise is resolved..

    I agree. I think the `fire_js_event` addresses that by not firing the `autofill` event in the first place.

    Let me add some details:

    ---

    Re refilling other non-addresses, non-credit-card things: To clarify, Chrome currently also supports or is building support for: usernames, passwords, OTPs, Autocomplete (single-field data without specific semantics), "Help me write", IBANs, passports, driver's licenses, ... (code pointers are [this](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.h;l=45-49;drc=9a326bd4b652f9c3f55103c1fd902a1a468ee37f) and [this](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/single_field_fillers/single_field_fill_router.h;l=70-82;drc=639b11a3b1c98212e81a9e49ad03672fd5569043), but that's not a complete list). Implementing refills for them isn't trivial for two reasons:

    (1) Proper refilling isn't trivial for security reasons. For example, refills are limited to the same `FieldTypeGroup`s that were filled in the original fill ([code](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=436-437;drc=30914745e420f4e9b1e95dd8dffe37441f7c779e)). But there's no meaningful `FieldTypeGroup` that'd distinguish between the different `AttributeType`s of an `EntityType`, e.g., between a driver's license number and the name on the license. There are no plans to build this at the moment.

    (2) Simply sending the same filling data to the renderer a second time won't work: while we do [remember the `FormData`](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=441-443;drc=ae249e81ef263546d4b6d1cd5fbb5101e6f94374) in some cases, deriving the refill data from that alone isn't trivial either. It'd be hacky at least, and in cases where the data-to-fill was determined outside of the core Autofill code (like with "Help me write"), I don't see any practical way of doing that.

    So I think the browser must be able to skip the `autofill` event. Adding a `bool fire_js_event` parameter for `ApplyFieldsAction()` that skips the `autofill` event seems like the simplest way to do that.

    ---

    Re WebView: I agree it'd be great to support the `onautofill` on WebView and refills on WebView. But option A from Cathy's comment looks quite complex to me. So it'd be good if we can decouple WebView from the CL and to unblock project, right?

    I'm not suggesting to never implement support for WebView.

    ---

    So I thought: We need something like a `bool fire_js_event` parameter to disable the mechanism. Since we need it anyway, we can use it to decouple WebView.

    WDYT?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cathy Li
    • Jan Keitel
    • Kinuko Yasuda
    • Yoav Weiss (@Shopify)
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 10:59:34 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cathy Li (Gerrit)

    unread,
    Oct 2, 2025, 11:04:41 AM (4 days ago) Oct 2
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    Attention needed from Jan Keitel, Kinuko Yasuda and Yoav Weiss (@Shopify)

    Cathy Li added 1 comment

    File components/autofill/content/renderer/autofill_agent.cc
    Cathy Li

    I'm fine with decoupling this from WebView and have a separate WebView change to at least call the refill.

    My thought for WebView is a 2-step process, but the overall code could be a bit challenging:

    Step 1: We can have some necessary methods that hook up all the way to the Java side of AutofillProvider. The Java implementation can be stubbed out for something like NotifyRefillReady() or something. This step allows me to run potential public tests on WebView through Facebook's integration, and potentially help with overall direction.

    Step 1.5: If we want to implement a potentially throw-away implementation where the webview itself intrinsically triggers the refill, my thinking is we can store the virtual ID -> values array from the autofill() call on the Java side and translate it to a FieldGlobalId -> values list to C++. Refill would happen on all fields whose global id still exists. Imperfect, but should still be no worse than current implementation.

    Step 2: Based on findings from 1, we can write a proposal for how to get other Autofill services onboarded with this API through Android's AutofillManager integration and make the API changes on Android with the understanding that it's a bigger, more complicated process. We'd have at least one data point that the API is sound.

    Open in Gerrit

    Related details

    Attention is currently required from:
    Gerrit-Attention: Jan Keitel <jke...@google.com>
    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Comment-Date: Thu, 02 Oct 2025 15:04:26 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Cathy Li (Gerrit)

    unread,
    Oct 2, 2025, 1:02:22 PM (4 days ago) Oct 2
    to Yoav Weiss (@Shopify), Chromium IPC Reviews, Kinuko Yasuda, Jan Keitel, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, core-timi...@chromium.org, gcasto+w...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, milicau+watchlis...@google.com, rouslan+au...@chromium.org, speed-metrics...@chromium.org, vasilii+watchlis...@chromium.org
    File components/autofill/content/renderer/autofill_agent.cc
    Cathy Li

    Thinking it'd be good to verify my assumptions first:

    The proposed API is to get a list of fields -> values so JS developers can pre-prepare the form and send back a notification that the form is ready. The browser can either re-examine the form for re-fill, or re-initiate the previously paused fill.

    For compatibility:
    If the browser fires the js event, then it should wait for the callback:
    1. if browser gets a callback, it should notify the autofill service (Chrome's internal autofill for Chrome browser, or the registered AutofillService for WebViews).
    1.1 If the service ignores the re-fill call, we should re-initiate the previously paused fill
    1.2 If the service does not ignore by calling TriggerRefill(), we use the refill values (form or otherwise) to trigger the fill.

    2. If browser does not get a callback after a set period, it will do 1.1 above

    And this thread is whether to extend Chrome's refill capabilities for chrome browser in case of 1.2, and how to have that work in WebViews (probably fork to separate CL)

    An alternate question is whether 1.1 (re-initiating the previously paused fill) should happen on a deeper level (e.g. autofill_agent/autofill_driver) or at the autofill_provider (webview) / browser_autofill_manager level?

    But Christoph's thought is if we are triggering the JS event, maybe we completely skip the autofill altogether, and rely on autofill service to know/detect that their autofill was skipped, and to re-issue... I think this works for Chrome browser because everything is in-house. It doesn't work well for WebView because with the AutofillManager as a middle-man between the WebView and the AutofillService, there's almost no way to tell the Service that their last fill was just ignored, and may cause system autofill service for WebViews to just break down completely.

    This makes me think we should bring the refill mechanism to the autofill_provider/browser_autofill_manager level, where chrome can ignore, but autofill_provider issues a refill with last known fill data using either cached FormData or a FieldGlobalId -> values map.

    Gerrit-Comment-Date: Thu, 02 Oct 2025 17:02:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Cathy Li <lyc...@meta.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages