Address autofill API - initial implementation [chromium/src : main]

0 views
Skip to first unread message

Christoph Schwering (Gerrit)

unread,
Apr 2, 2025, 8:40:00 AMApr 2
to Daniel Kift, Chromium LUCI CQ, Yoav Weiss (@Shopify), Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Daniel Kift and Yoav Weiss (@Shopify)

Christoph Schwering added 7 comments

File components/autofill/content/browser/content_autofill_driver.h
Line 260, Patchset 25 (Latest): void RetriggerAutofill(const FormData&) override;
Christoph Schwering . unresolved

The implementation doesn't (and probably shouldn't) fall under Group 2a.

File components/autofill/content/browser/content_autofill_driver.cc
Line 616, Patchset 25 (Latest): FormData lifted_form_data = Lift(*this, form_data);
WithNewVersion(lifted_form_data);
GetAutofillManager().RetriggerAutofill(lifted_form_data);
Christoph Schwering . unresolved

Shouldn't this follow the pattern from the other events?

File components/autofill/content/renderer/form_autofill_util.cc
Line 2717, Patchset 25 (Latest): // TODO: A single autofill event can probably trigger filling fields in
// multiple forms. We should iterate the fields, and create a mapping of forms
Christoph Schwering . unresolved

Yes, that's correct.

Line 2719, Patchset 25 (Latest): // to field keys and values. Then we need to trigger the event on each one of
// the forms. If any of the forms had `waitForIt` called, we should call off
Christoph Schwering . unresolved

I'm not sure about that. The browser has a different definition of form than the renderer.

When the user does an autofill operation, it concerns a single form according to the browser process's understanding of a form.

This autofill operation may lead to multiple ApplyFieldsAction() calls; at most one per document ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/autofill_driver_router.h)).

Each ApplyFieldsAction() call may fill form controls that are associated to different and/or no form elements. That's due to shadow DOM ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/renderer/README.md)).

File components/autofill/core/browser/filling/form_filler.h
Line 159, Patchset 25 (Latest): // Attempts to refill the form that was changed dynamically. Should only be
// called if `FormFiller::ShouldTriggerRefill()` returns true.
Christoph Schwering . unresolved

That's not the case anymore, is it?

File components/autofill/core/browser/foundations/autofill_manager.h
Line 394, Patchset 25 (Latest): virtual void TriggerRefill(const FormData&) = 0;
Christoph Schwering . unresolved

Please name this `RetriggerAutofillImpl` (or `FooImpl` if the other function is `Foo`).

File components/autofill/core/browser/foundations/browser_autofill_manager.cc
Line 2042, Patchset 25 (Latest): form_filler_->TriggerRefill(form,
Christoph Schwering . unresolved

Shouldn't this call ScheduleRefill()?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Kift
  • Yoav Weiss (@Shopify)
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 25
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.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: Daniel Kift <danie...@shopify.com>
Gerrit-Comment-Date: Wed, 02 Apr 2025 12:39:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Christoph Schwering (Gerrit)

unread,
Apr 2, 2025, 8:42:31 AMApr 2
to Daniel Kift, Chromium LUCI CQ, Yoav Weiss (@Shopify), Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Daniel Kift and Yoav Weiss (@Shopify)

Christoph Schwering added 1 comment

File components/autofill/content/renderer/form_autofill_util.cc
Line 2736, Patchset 25 (Latest): WebString key = control_element.NameForAutofill();
Christoph Schwering . unresolved

Autofill doesn't (almost) only uses the name and id attributes for heuristics. This should probably be a `FieldRendererId`, which in the browser process must be lifted to `FieldGlobalId`.

Gerrit-Comment-Date: Wed, 02 Apr 2025 12:42:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 17, 2025, 7:06:20 AM (4 days ago) Sep 17
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 1 comment

File components/autofill/content/browser/content_autofill_driver.h
Line 260, Patchset 25: void RetriggerAutofill(const FormData&) override;
Christoph Schwering . resolved

The implementation doesn't (and probably shouldn't) fall under Group 2a.

Yoav Weiss (@Shopify)

Moved to 2b

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 27
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 11:06: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 17, 2025, 7:43:55 AM (4 days ago) Sep 17
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 1 comment

File components/autofill/core/browser/foundations/autofill_manager.h
Line 394, Patchset 25: virtual void TriggerRefill(const FormData&) = 0;
Christoph Schwering . resolved

Please name this `RetriggerAutofillImpl` (or `FooImpl` if the other function is `Foo`).

Yoav Weiss (@Shopify)

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 27
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 11:43:42 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 17, 2025, 10:16:12 AM (4 days ago) Sep 17
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 4 comments

File components/autofill/content/browser/content_autofill_driver.cc
Line 616, Patchset 25: FormData lifted_form_data = Lift(*this, form_data);
WithNewVersion(lifted_form_data);
GetAutofillManager().RetriggerAutofill(lifted_form_data);
Christoph Schwering . resolved

Shouldn't this follow the pattern from the other events?

Yoav Weiss (@Shopify)

Done

File components/autofill/content/renderer/form_autofill_util.cc
Line 2736, Patchset 25: WebString key = control_element.NameForAutofill();
Christoph Schwering . unresolved

Autofill doesn't (almost) only uses the name and id attributes for heuristics. This should probably be a `FieldRendererId`, which in the browser process must be lifted to `FieldGlobalId`.

Yoav Weiss (@Shopify)

Passed a FieldRenderId (converted to a string). I'm not sure where I should Lift it on the browser side though, so I'd appreciate guidance there

File components/autofill/core/browser/filling/form_filler.h
Line 159, Patchset 25: // Attempts to refill the form that was changed dynamically. Should only be

// called if `FormFiller::ShouldTriggerRefill()` returns true.
Christoph Schwering . resolved

That's not the case anymore, is it?

Yoav Weiss (@Shopify)

Yup

File components/autofill/core/browser/foundations/browser_autofill_manager.cc
Line 2042, Patchset 25: form_filler_->TriggerRefill(form,
Christoph Schwering . resolved

Shouldn't this call ScheduleRefill()?

Yoav Weiss (@Shopify)

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 28
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 14:15:59 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 17, 2025, 10:31:26 AM (4 days ago) Sep 17
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 1 comment

File components/android_autofill/browser/android_autofill_manager.h
Line 52, Patchset 30 (Latest): void RetriggerAutofillImpl(const FormData& form) override {}
Yoav Weiss (@Shopify) . unresolved

I need to actually implement (and test) this!!

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 30
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Comment-Date: Wed, 17 Sep 2025 14:31:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 2:10:10 AM (3 days ago) Sep 18
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering, Daniel Kift and Yoav Weiss (@Shopify)

Yoav Weiss (@Shopify) voted and added 1 comment

Votes added by Yoav Weiss (@Shopify)

Commit-Queue+1

1 comment

File components/autofill/content/renderer/form_autofill_util.cc
Line 2736, Patchset 31 (Latest): return GetFormByRendererId(fields[0].host_form_id)
Yoav Weiss (@Shopify) . unresolved

I now see that I'm not getting the form, as the host_form_id here is 0. What's a good way to grab the right value? (this used to work, but I guess things changed)

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
  • 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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 31
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 06:09:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Christoph Schwering (Gerrit)

unread,
Sep 18, 2025, 6:14:51 AM (3 days ago) Sep 18
to Daniel Kift, Yoav Weiss (@Shopify), Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Daniel Kift and Yoav Weiss (@Shopify)

Christoph Schwering added 2 comments

File components/autofill/content/browser/content_autofill_driver.cc
Line 635, Patchset 32 (Latest): FormData lifted_form_data = Lift(*this, form);
WithNewVersion(lifted_form_data);
Christoph Schwering . unresolved
File components/autofill/content/renderer/form_autofill_util.cc
Line 2736, Patchset 25: WebString key = control_element.NameForAutofill();
Christoph Schwering . unresolved

Autofill doesn't (almost) only uses the name and id attributes for heuristics. This should probably be a `FieldRendererId`, which in the browser process must be lifted to `FieldGlobalId`.

Yoav Weiss (@Shopify)

Passed a FieldRenderId (converted to a string). I'm not sure where I should Lift it on the browser side though, so I'd appreciate guidance there

Christoph Schwering

This happens in `ContentAutofillDriver::RouteToManager()` when it calls [this overload](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/browser/content_autofill_driver.cc;l=110-112;drc=2ca52c732385c3f987f8ad1140bbf5d7491bdfe4) of `Lift()`.

---

Btw my sentence in the original comment was butchered:

Autofill doesn't (almost) only uses the name and id attributes for heuristics.

should have been

Autofill uses the name and id attributes almost only for heuristics (that is, for determining field types).

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Kift
  • 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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 32
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Sep 2025 10:14:33 +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

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 8:48:16 AM (3 days ago) Sep 18
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 4 comments

File components/autofill/content/browser/content_autofill_driver.cc
Line 635, Patchset 32 (Latest): FormData lifted_form_data = Lift(*this, form);
WithNewVersion(lifted_form_data);
Christoph Schwering . resolved
Yoav Weiss (@Shopify)

Indeed! This fixed an issue I was seeing where the form ID was arriving as 0..

File components/autofill/content/renderer/form_autofill_util.cc
Line 2719, Patchset 25: // to field keys and values. Then we need to trigger the event on each one of

// the forms. If any of the forms had `waitForIt` called, we should call off
Christoph Schwering . unresolved

I'm not sure about that. The browser has a different definition of form than the renderer.

When the user does an autofill operation, it concerns a single form according to the browser process's understanding of a form.

This autofill operation may lead to multiple ApplyFieldsAction() calls; at most one per document ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/autofill_driver_router.h)).

Each ApplyFieldsAction() call may fill form controls that are associated to different and/or no form elements. That's due to shadow DOM ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/renderer/README.md)).

Yoav Weiss (@Shopify)

OK, so if the form is split to multiple renderers, ApplyFieldsAction would trigger the event on each of them? That makes sense..

Line 2736, Patchset 25: WebString key = control_element.NameForAutofill();
Christoph Schwering . unresolved

Autofill doesn't (almost) only uses the name and id attributes for heuristics. This should probably be a `FieldRendererId`, which in the browser process must be lifted to `FieldGlobalId`.

Yoav Weiss (@Shopify)

Passed a FieldRenderId (converted to a string). I'm not sure where I should Lift it on the browser side though, so I'd appreciate guidance there

Christoph Schwering

This happens in `ContentAutofillDriver::RouteToManager()` when it calls [this overload](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/browser/content_autofill_driver.cc;l=110-112;drc=2ca52c732385c3f987f8ad1140bbf5d7491bdfe4) of `Lift()`.

---

Btw my sentence in the original comment was butchered:

Autofill doesn't (almost) only uses the name and id attributes for heuristics.

should have been

Autofill uses the name and id attributes almost only for heuristics (that is, for determining field types).

Yoav Weiss (@Shopify)

Oh, there was some misunderstanding here. The key here is not passed to the browser, but is passed to the AutofillEvent as the value to communicate to web developers. As such I brought it back to be `NameForAutofill` which is more human readable than the ID

Line 2736, Patchset 31: return GetFormByRendererId(fields[0].host_form_id)
Yoav Weiss (@Shopify) . resolved

I now see that I'm not getting the form, as the host_form_id here is 0. What's a good way to grab the right value? (this used to work, but I guess things changed)

Yoav Weiss (@Shopify)

NM, fixed

Open in Gerrit

Related details

Attention is currently required from:
  • Christoph Schwering
  • Daniel Kift
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: Id63f0d8a15e2d5f1f93691014fe94048689453b5
Gerrit-Change-Number: 6200613
Gerrit-PatchSet: 32
Gerrit-Owner: Daniel Kift <danie...@shopify.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Christoph Schwering <schw...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniel Kift <danie...@shopify.com>
Gerrit-Attention: Christoph Schwering <schw...@google.com>
Gerrit-Comment-Date: Thu, 18 Sep 2025 12:47:58 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:23:09 AM (3 days ago) Sep 18
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 2 comments

File components/autofill/content/renderer/form_autofill_util.cc
Line 2717, Patchset 25: // TODO: A single autofill event can probably trigger filling fields in

// multiple forms. We should iterate the fields, and create a mapping of forms
Christoph Schwering . resolved

Yes, that's correct.

Yoav Weiss (@Shopify)

Resolving

Line 2719, Patchset 25: // to field keys and values. Then we need to trigger the event on each one of
// the forms. If any of the forms had `waitForIt` called, we should call off
Christoph Schwering . resolved

I'm not sure about that. The browser has a different definition of form than the renderer.

When the user does an autofill operation, it concerns a single form according to the browser process's understanding of a form.

This autofill operation may lead to multiple ApplyFieldsAction() calls; at most one per document ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/autofill_driver_router.h)).

Each ApplyFieldsAction() call may fill form controls that are associated to different and/or no form elements. That's due to shadow DOM ([documented here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/content/renderer/README.md)).

Yoav Weiss (@Shopify)

OK, so if the form is split to multiple renderers, ApplyFieldsAction would trigger the event on each of them? That makes sense..

Yoav Weiss (@Shopify)

Resolving (and removing the TODO)

Gerrit-Comment-Date: Thu, 18 Sep 2025 13:22:49 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:24:04 AM (3 days ago) Sep 18
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org
Attention needed from Christoph Schwering and Daniel Kift

Yoav Weiss (@Shopify) added 1 comment

Yoav Weiss (@Shopify) . resolved

Due to Gerrit complications (working on multiple machines, as well as multiple authors for the CL), I'll continue work on this in https://chromium-review.googlesource.com/c/chromium/src/+/6965138

Gerrit-Comment-Date: Thu, 18 Sep 2025 13:23:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Sep 18, 2025, 9:24:18 AM (3 days ago) Sep 18
to Daniel Kift, Chromium LUCI CQ, Raphael Kubo da Costa, AyeAye, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, gcasto+w...@chromium.org, milicau+watchlis...@google.com, vasilii+watchlis...@chromium.org, ipc-securi...@chromium.org, blink-revi...@chromium.org, dtapuska+...@chromium.org, dominicc+...@chromium.org, blink-re...@chromium.org, asvitkine...@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, jmedle...@chromium.org, kinuko...@chromium.org, rouslan+au...@chromium.org

Yoav Weiss (@Shopify) abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages