Autofill event - web exposed parts [chromium/src : main]

0 views
Skip to first unread message

Yoav Weiss (@Shopify) (Gerrit)

unread,
Dec 16, 2025, 9:07:24 AM12/16/25
to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
Attention needed from Christoph Schwering

Yoav Weiss (@Shopify) added 1 comment

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

Hey Christoph!

Took a stab at the Blink side of things for the autofill event, and it seems like it's working! :) I'd appreciate your review on this, to make sure there's nothing I missed.

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 satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
Gerrit-Change-Number: 7260442
Gerrit-PatchSet: 5
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, 16 Dec 2025 14:07:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Christoph Schwering (Gerrit)

unread,
Dec 16, 2025, 4:18:02 PM12/16/25
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, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
Attention needed from Yoav Weiss (@Shopify)

Christoph Schwering added 9 comments

File components/autofill/content/renderer/autofill_agent.cc
Line 1085, Patchset 5 (Latest): form_util::DispatchAutofillEvent(document, fields, *fill_id,
supports_refill);
Christoph Schwering . unresolved

IIRC we don't want to fire the event for Undo Autofill. If so, this needs to be wrapped in `if (action_type == mojom::FormActionType::kFill)`.

Line 1989, Patchset 5 (Latest): if (auto* autofill_driver = unsafe_autofill_driver()) {
autofill_driver->RequestRefill(FillId(fill_id));
}
Christoph Schwering . unresolved

Should this call `AutofillAgent::RequestRefill(FillId(fill_id), some_callback)`? Don't we need the callback in JavaScript to implement `await e.refill()`?


Imagine JavaScript code like
```
document.addEventListener('autofill', function(e) {
e.refill().then(foo).reject(bar);
};
```
would need to translate to C++ code like
```
autofill_agent.TriggerReparse(
fill_id, base::BindOnce([](bool success) {
if (success) {
foo();
} else {
bar();
}
});
```
File components/autofill/content/renderer/form_autofill_util.h
Line 187, Patchset 5 (Latest): const base::UnguessableToken& fill_id,
Christoph Schwering . unresolved

nit: `FillId`?

File third_party/blink/renderer/core/exported/web_document.cc
Line 421, Patchset 5 (Latest):void WebDocument::TriggerAutofillEvent(
Christoph Schwering . unresolved

nit: `Dispatch`?

File third_party/blink/renderer/core/html/forms/autofill_event.cc
Line 44, Patchset 5 (Latest): for (auto& pair : field_data) {
AutofillFieldData* data = AutofillFieldData::Create();
data->setField(pair.first.Get());
data->setValue(std::move(pair.second));
field_data_.push_back(data);
}
Line 81, Patchset 5 (Latest): return nullptr;
Christoph Schwering . unresolved

For my own education: In JavaScript, that translate to `e.refill === null`, right?

Line 86, Patchset 5 (Latest): RefillFunction* function =
MakeGarbageCollected<RefillFunction>(const_cast<AutofillEvent*>(this));
v8::Local<v8::Function> v8_function = function->ToV8Function(script_state);
refill_function_ = V8VoidFunction::Create(v8_function);
Christoph Schwering . unresolved

Related to my other comment in `AutofillAgent::RequestRefill()`: Should `refill_function_` return a `Promise<void>`? (I don't know what that looks like in C++.)

File third_party/blink/renderer/core/html/forms/autofill_event.idl
Line 7, Patchset 5 (Latest): RuntimeEnabled=AutofillEvent
Christoph Schwering . unresolved

Doy ou have thoughts on whether we should also introduce a `base::Feature` for `AutofillEvent` in `runtime_enabled_features.json5`? Would the rollout work only by origin trial or also a Finch study?

I assume OT is the way to go but I don't have first-hand experience with OTs.

If we go with OT, I'm wondering if we need an additional `base::Feature` for extra safety?

Line 7, Patchset 5 (Latest): RuntimeEnabled=AutofillEvent
Christoph Schwering . unresolved

For my education: Is that a base::Feature that must be enabled for `AutofillEvent` to be exposed?

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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    Gerrit-PatchSet: 5
    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: Tue, 16 Dec 2025 21:17:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Dec 17, 2025, 9:34:25 AM12/17/25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 8 comments

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1085, Patchset 5: form_util::DispatchAutofillEvent(document, fields, *fill_id,
    supports_refill);
    Christoph Schwering . resolved

    IIRC we don't want to fire the event for Undo Autofill. If so, this needs to be wrapped in `if (action_type == mojom::FormActionType::kFill)`.

    Yoav Weiss (@Shopify)

    Done

    Line 1989, Patchset 5: if (auto* autofill_driver = unsafe_autofill_driver()) {
    autofill_driver->RequestRefill(FillId(fill_id));
    }
    Christoph Schwering . resolved

    Should this call `AutofillAgent::RequestRefill(FillId(fill_id), some_callback)`? Don't we need the callback in JavaScript to implement `await e.refill()`?


    Imagine JavaScript code like
    ```
    document.addEventListener('autofill', function(e) {
    e.refill().then(foo).reject(bar);
    };
    ```
    would need to translate to C++ code like
    ```
    autofill_agent.TriggerReparse(
    fill_id, base::BindOnce([](bool success) {
    if (success) {
    foo();
    } else {
    bar();
    }
    });
    ```
    Yoav Weiss (@Shopify)

    Done

    File components/autofill/content/renderer/form_autofill_util.h
    Line 187, Patchset 5: const base::UnguessableToken& fill_id,
    Christoph Schwering . resolved

    nit: `FillId`?

    Yoav Weiss (@Shopify)

    The style guide suggests it should be snake_case: https://google.github.io/styleguide/cppguide.html#Variable_Names

    File third_party/blink/renderer/core/exported/web_document.cc
    Line 421, Patchset 5:void WebDocument::TriggerAutofillEvent(
    Christoph Schwering . resolved

    nit: `Dispatch`?

    Yoav Weiss (@Shopify)

    Done

    File third_party/blink/renderer/core/html/forms/autofill_event.cc
    Line 81, Patchset 5: return nullptr;
    Christoph Schwering . resolved

    For my own education: In JavaScript, that translate to `e.refill === null`, right?

    Yoav Weiss (@Shopify)

    I believe so, yeah.

    Line 86, Patchset 5: RefillFunction* function =

    MakeGarbageCollected<RefillFunction>(const_cast<AutofillEvent*>(this));
    v8::Local<v8::Function> v8_function = function->ToV8Function(script_state);
    refill_function_ = V8VoidFunction::Create(v8_function);
    Christoph Schwering . resolved

    Related to my other comment in `AutofillAgent::RequestRefill()`: Should `refill_function_` return a `Promise<void>`? (I don't know what that looks like in C++.)

    Yoav Weiss (@Shopify)

    Revamped

    File third_party/blink/renderer/core/html/forms/autofill_event.idl
    Line 7, Patchset 5: RuntimeEnabled=AutofillEvent
    Christoph Schwering . resolved

    Doy ou have thoughts on whether we should also introduce a `base::Feature` for `AutofillEvent` in `runtime_enabled_features.json5`? Would the rollout work only by origin trial or also a Finch study?

    I assume OT is the way to go but I don't have first-hand experience with OTs.

    If we go with OT, I'm wondering if we need an additional `base::Feature` for extra safety?

    For my education: Is that a base::Feature that must be enabled for `AutofillEvent` to be exposed?

    Yoav Weiss (@Shopify)

    It's a runtimeEnabledFeature (that has a base::Feature equivalent) that must be enabled for AutofillEvent to be exposed.

    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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    Gerrit-PatchSet: 6
    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, 17 Dec 2025 14:34:09 +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,
    Dec 17, 2025, 9:39:02 AM12/17/25
    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, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Christoph Schwering and Yoav Weiss (@Shopify)

    Christoph Schwering added 2 comments

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

    I'll take a proper look later (but there's a build error at the moment anyway).

    File components/autofill/content/renderer/form_autofill_util.h
    Line 187, Patchset 5: const base::UnguessableToken& fill_id,
    Christoph Schwering . unresolved

    nit: `FillId`?

    Yoav Weiss (@Shopify)

    The style guide suggests it should be snake_case: https://google.github.io/styleguide/cppguide.html#Variable_Names

    Christoph Schwering

    I meant the type :)
    I think within Autofill land where we have the strong alias, we should use `FillId` rather than `base::UnguessableToken`

    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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    Gerrit-PatchSet: 6
    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, 17 Dec 2025 14:38:50 +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,
    Dec 17, 2025, 10:58:27 AM12/17/25
    to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Yoav Weiss (@Shopify)

    Christoph Schwering added 3 comments

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1053, Patchset 7: autofill_driver->RequestRefill(fill_id, std::move(callback));
    Christoph Schwering . unresolved
    Line 1072, Patchset 7 (Parent): if (action_type == mojom::FormActionType::kFill &&
    action_persistence == mojom::ActionPersistence::kFill) {
    pending_refills_.Fulfill(fill_id);
    }
    Christoph Schwering . unresolved

    Keep this?

    File third_party/blink/renderer/core/html/forms/autofill_event.idl
    Line 7, Patchset 5: RuntimeEnabled=AutofillEvent
    Christoph Schwering . unresolved

    Doy ou have thoughts on whether we should also introduce a `base::Feature` for `AutofillEvent` in `runtime_enabled_features.json5`? Would the rollout work only by origin trial or also a Finch study?

    I assume OT is the way to go but I don't have first-hand experience with OTs.

    If we go with OT, I'm wondering if we need an additional `base::Feature` for extra safety?

    Yoav Weiss (@Shopify)

    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;l=667?q=AutofillEvent%20-f:test%20-f:out&ss=chromium%2Fchromium%2Fsrc generates a base feature automatically.

    e.g. https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/third_party/blink/common/features_generated.cc;l=411?q=AutofillEvent%20-f:test%20f:out%20Feature&ss=chromium%2Fchromium%2Fsrc&start=21

    Christoph Schwering

    Thanks! What do you think about Finch vs OT?

    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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    Gerrit-PatchSet: 7
    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: Wed, 17 Dec 2025 15:58:10 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Dec 18, 2025, 3:56:53 AM12/18/25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 4 comments

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1053, Patchset 7: autofill_driver->RequestRefill(fill_id, std::move(callback));
    Christoph Schwering . resolved
    Yoav Weiss (@Shopify)

    Removed the spurious bits. Apologies!

    Line 1072, Patchset 7 (Parent): if (action_type == mojom::FormActionType::kFill &&
    action_persistence == mojom::ActionPersistence::kFill) {
    pending_refills_.Fulfill(fill_id);
    }
    Christoph Schwering . resolved

    Keep this?

    Yoav Weiss (@Shopify)

    Done

    File components/autofill/content/renderer/form_autofill_util.h
    Line 187, Patchset 5: const base::UnguessableToken& fill_id,
    Christoph Schwering . resolved

    nit: `FillId`?

    Yoav Weiss (@Shopify)

    The style guide suggests it should be snake_case: https://google.github.io/styleguide/cppguide.html#Variable_Names

    Christoph Schwering

    I meant the type :)
    I think within Autofill land where we have the strong alias, we should use `FillId` rather than `base::UnguessableToken`

    Yoav Weiss (@Shopify)

    Got it!

    File third_party/blink/renderer/core/html/forms/autofill_event.idl
    Line 7, Patchset 5: RuntimeEnabled=AutofillEvent
    Christoph Schwering . unresolved

    Doy ou have thoughts on whether we should also introduce a `base::Feature` for `AutofillEvent` in `runtime_enabled_features.json5`? Would the rollout work only by origin trial or also a Finch study?

    I assume OT is the way to go but I don't have first-hand experience with OTs.

    If we go with OT, I'm wondering if we need an additional `base::Feature` for extra safety?

    Yoav Weiss (@Shopify)

    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;l=667?q=AutofillEvent%20-f:test%20-f:out&ss=chromium%2Fchromium%2Fsrc generates a base feature automatically.

    e.g. https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/third_party/blink/common/features_generated.cc;l=411?q=AutofillEvent%20-f:test%20f:out%20Feature&ss=chromium%2Fchromium%2Fsrc&start=21

    Christoph Schwering

    Thanks! What do you think about Finch vs OT?

    Yoav Weiss (@Shopify)

    I think an OT makes more sense, given that this is an API developers need to deliberately use.

    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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    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: Christoph Schwering <schw...@google.com>
    Gerrit-Comment-Date: Thu, 18 Dec 2025 08:56:40 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Dec 18, 2025, 3:57:09 AM12/18/25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 1 comment

    File third_party/blink/renderer/core/html/forms/autofill_event.cc
    Line 44, Patchset 5: for (auto& pair : field_data) {

    AutofillFieldData* data = AutofillFieldData::Create();
    data->setField(pair.first.Get());
    data->setValue(std::move(pair.second));
    field_data_.push_back(data);
    }
    Christoph Schwering . resolved
    Yoav Weiss (@Shopify)

    Done

    Gerrit-Comment-Date: Thu, 18 Dec 2025 08:56:57 +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,
    Dec 18, 2025, 5:52:35 AM12/18/25
    to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Yoav Weiss (@Shopify)

    Christoph Schwering added 6 comments

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

    THanks! Just a couple of nits.

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1048, Patchset 15 (Latest): autofill_driver->RequestRefill(FillId(fill_id));
    Christoph Schwering . unresolved

    nit: just `fill_id`

    Line 1086, Patchset 15 (Latest): if (action_type == mojom::FormActionType::kFill) {
    Christoph Schwering . unresolved

    Should we add `&& base::FeatureList::IsEnabled(blink::features::kAutofillEvent)`?

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2720, Patchset 15 (Latest): std::vector<std::pair<WebFormControlElement, WebString>> field_data;
    Christoph Schwering . unresolved

    nit: `field_data` sounds a lot like `FormFieldData`.

    Should we rename the `field_data` to `autofill_values` here and all the way to `AutofillEvent`?

    That'd match the name `AutofillEvent::autofillValues()`.

    Line 2721, Patchset 15 (Latest): for (const auto& field : fields) {
    Christoph Schwering . unresolved

    nit: `const FormFieldData::FillData`

    File third_party/blink/renderer/core/html/forms/autofill_event.idl
    Line 7, Patchset 5: RuntimeEnabled=AutofillEvent
    Christoph Schwering . resolved

    Doy ou have thoughts on whether we should also introduce a `base::Feature` for `AutofillEvent` in `runtime_enabled_features.json5`? Would the rollout work only by origin trial or also a Finch study?

    I assume OT is the way to go but I don't have first-hand experience with OTs.

    If we go with OT, I'm wondering if we need an additional `base::Feature` for extra safety?

    Yoav Weiss (@Shopify)

    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/runtime_enabled_features.json5;l=667?q=AutofillEvent%20-f:test%20-f:out&ss=chromium%2Fchromium%2Fsrc generates a base feature automatically.

    e.g. https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/third_party/blink/common/features_generated.cc;l=411?q=AutofillEvent%20-f:test%20f:out%20Feature&ss=chromium%2Fchromium%2Fsrc&start=21

    Christoph Schwering

    Thanks! What do you think about Finch vs OT?

    Yoav Weiss (@Shopify)

    I think an OT makes more sense, given that this is an API developers need to deliberately use.

    Christoph Schwering

    Ack, sgtm

    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
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
    Gerrit-Change-Number: 7260442
    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: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Dec 2025 10:52:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Dec 18, 2025, 7:28:20 AM12/18/25
    to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
    Attention needed from Christoph Schwering

    Yoav Weiss (@Shopify) added 4 comments

    File components/autofill/content/renderer/autofill_agent.cc
    Line 1048, Patchset 15: autofill_driver->RequestRefill(FillId(fill_id));
    Christoph Schwering . resolved

    nit: just `fill_id`

    Yoav Weiss (@Shopify)

    Done

    Line 1086, Patchset 15: if (action_type == mojom::FormActionType::kFill) {
    Christoph Schwering . resolved

    Should we add `&& base::FeatureList::IsEnabled(blink::features::kAutofillEvent)`?

    Yoav Weiss (@Shopify)

    There's already a flag check further down, but we can add one here as well.

    File components/autofill/content/renderer/form_autofill_util.cc
    Line 2720, Patchset 15: std::vector<std::pair<WebFormControlElement, WebString>> field_data;
    Christoph Schwering . resolved

    nit: `field_data` sounds a lot like `FormFieldData`.

    Should we rename the `field_data` to `autofill_values` here and all the way to `AutofillEvent`?

    That'd match the name `AutofillEvent::autofillValues()`.

    Yoav Weiss (@Shopify)

    Done

    Line 2721, Patchset 15: for (const auto& field : fields) {
    Christoph Schwering . resolved

    nit: `const FormFieldData::FillData`

    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 satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
      Gerrit-Change-Number: 7260442
      Gerrit-PatchSet: 17
      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 Dec 2025 12:28:07 +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,
      Dec 22, 2025, 5:52:41 AM12/22/25
      to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
      Attention needed from Yoav Weiss (@Shopify)

      Christoph Schwering added 1 comment

      File chrome/browser/autofill/autofill_event_handler_browsertest.cc
      Line 158, Patchset 18 (Latest): ASSERT_TRUE(manager->WaitForAutofillFill(/*num_expected_fills=*/2));
      Christoph Schwering . unresolved

      When I run the test `AutofillEventHandlerBrowserTest.CompleteAutofillFlow` with only one CPU core, this assertion times out -- even when I increase [these timeouts](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491):

      ```
      #14 0x558445e19468 autofill::TestAutofillManagerWaiter::Wait() [../../components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc:365:22]
      #15 0x55843423fec8 autofill::AutofillEventHandlerBrowserTest::TestAutofillManager::WaitForAutofillFill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:59:36]
      #16 0x55843423b5fb autofill::AutofillEventHandlerBrowserTest::NavigateAndTriggerAutofill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:158:26]
      #17 0x558434237d92 autofill::AutofillEventHandlerBrowserTest_CompleteAutofillFlow_Test::RunTestOnMainThread() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:186:3]
      ```

      For some reason the [diagnostic message](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc;l=360;drc=3d6df2f5cdb862de83bce3b4a0dea62311701090) is missing. The test isn't mocking time, is it? (In that case, we don't have those diagnostics for a [reason](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.h;l=361-362;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7).)

      I've debugged it a little and suspect that the bot is too slow to reparse the form within [these 200 ms](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=66;drc=5fe91acd428f2c0b9ca9af8a2ec0d72ef28d3d4b). That's plausible because parsing happens on a low-priority sequence runner.

      We could address this as follows:
      1. Wait for `OnFormsSeen()` (as you do now)
      2. Wait for first `OnDidAutofill()`
      3. Wait for another `OnFormsSeen()` triggered by the DOM
      4. Only now let JavaScript call `RequestRefill()`.
      5. Wait for the refill.

      ---

      Besides that, you may also want to do [this](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/autofill/autofill_across_iframes_browsertest.cc;l=85-86;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7) to effectively disable the first two of [these two](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491) timeouts. We don't have anything do disable the third because it's in the renderer process.

      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
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        Gerrit-PatchSet: 17
        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: Mon, 22 Dec 2025 10:52:22 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Christoph Schwering (Gerrit)

        unread,
        Dec 22, 2025, 6:22:09 AM12/22/25
        to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Christoph Schwering added 1 comment

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Line 158, Patchset 18 (Latest): ASSERT_TRUE(manager->WaitForAutofillFill(/*num_expected_fills=*/2));
        Christoph Schwering . unresolved

        When I run the test `AutofillEventHandlerBrowserTest.CompleteAutofillFlow` with only one CPU core, this assertion times out -- even when I increase [these timeouts](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491):

        ```
        #14 0x558445e19468 autofill::TestAutofillManagerWaiter::Wait() [../../components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc:365:22]
        #15 0x55843423fec8 autofill::AutofillEventHandlerBrowserTest::TestAutofillManager::WaitForAutofillFill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:59:36]
        #16 0x55843423b5fb autofill::AutofillEventHandlerBrowserTest::NavigateAndTriggerAutofill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:158:26]
        #17 0x558434237d92 autofill::AutofillEventHandlerBrowserTest_CompleteAutofillFlow_Test::RunTestOnMainThread() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:186:3]
        ```

        For some reason the [diagnostic message](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc;l=360;drc=3d6df2f5cdb862de83bce3b4a0dea62311701090) is missing. The test isn't mocking time, is it? (In that case, we don't have those diagnostics for a [reason](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.h;l=361-362;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7).)

        I've debugged it a little and suspect that the bot is too slow to reparse the form within [these 200 ms](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=66;drc=5fe91acd428f2c0b9ca9af8a2ec0d72ef28d3d4b). That's plausible because parsing happens on a low-priority sequence runner.

        We could address this as follows:
        1. Wait for `OnFormsSeen()` (as you do now)
        2. Wait for first `OnDidAutofill()`
        3. Wait for another `OnFormsSeen()` triggered by the DOM
        4. Only now let JavaScript call `RequestRefill()`.
        5. Wait for the refill.

        ---

        Besides that, you may also want to do [this](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/autofill/autofill_across_iframes_browsertest.cc;l=85-86;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7) to effectively disable the first two of [these two](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491) timeouts. We don't have anything do disable the third because it's in the renderer process.

        Christoph Schwering

        When I increase the 200 ms delay to 4 s, the test runs through on my machine with a single CPU core. I guess that supports the hypothesis in the previous comment.

        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
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        Gerrit-PatchSet: 18
        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: Mon, 22 Dec 2025 11:21:55 +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,
        Dec 22, 2025, 6:29:57 AM12/22/25
        to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Christoph Schwering added 1 comment

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Line 158, Patchset 18 (Latest): ASSERT_TRUE(manager->WaitForAutofillFill(/*num_expected_fills=*/2));
        Christoph Schwering . unresolved

        When I run the test `AutofillEventHandlerBrowserTest.CompleteAutofillFlow` with only one CPU core, this assertion times out -- even when I increase [these timeouts](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491):

        ```
        #14 0x558445e19468 autofill::TestAutofillManagerWaiter::Wait() [../../components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc:365:22]
        #15 0x55843423fec8 autofill::AutofillEventHandlerBrowserTest::TestAutofillManager::WaitForAutofillFill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:59:36]
        #16 0x55843423b5fb autofill::AutofillEventHandlerBrowserTest::NavigateAndTriggerAutofill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:158:26]
        #17 0x558434237d92 autofill::AutofillEventHandlerBrowserTest_CompleteAutofillFlow_Test::RunTestOnMainThread() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:186:3]
        ```

        For some reason the [diagnostic message](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc;l=360;drc=3d6df2f5cdb862de83bce3b4a0dea62311701090) is missing. The test isn't mocking time, is it? (In that case, we don't have those diagnostics for a [reason](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.h;l=361-362;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7).)

        I've debugged it a little and suspect that the bot is too slow to reparse the form within [these 200 ms](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=66;drc=5fe91acd428f2c0b9ca9af8a2ec0d72ef28d3d4b). That's plausible because parsing happens on a low-priority sequence runner.

        We could address this as follows:
        1. Wait for `OnFormsSeen()` (as you do now)
        2. Wait for first `OnDidAutofill()`
        3. Wait for another `OnFormsSeen()` triggered by the DOM
        4. Only now let JavaScript call `RequestRefill()`.
        5. Wait for the refill.

        ---

        Besides that, you may also want to do [this](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/autofill/autofill_across_iframes_browsertest.cc;l=85-86;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7) to effectively disable the first two of [these two](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491) timeouts. We don't have anything do disable the third because it's in the renderer process.

        Christoph Schwering

        When I increase the 200 ms delay to 4 s, the test runs through on my machine with a single CPU core. I guess that supports the hypothesis in the previous comment.

        Christoph Schwering

        s/triggered by the DOM/triggered by JavaScript updating the DOM/

        Gerrit-Comment-Date: Mon, 22 Dec 2025 11:29:39 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoav Weiss (@Shopify) (Gerrit)

        unread,
        Jan 2, 2026, 6:18:02 AM (11 days ago) Jan 2
        to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Christoph Schwering

        Yoav Weiss (@Shopify) added 1 comment

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Line 158, Patchset 18: ASSERT_TRUE(manager->WaitForAutofillFill(/*num_expected_fills=*/2));
        Christoph Schwering . unresolved

        When I run the test `AutofillEventHandlerBrowserTest.CompleteAutofillFlow` with only one CPU core, this assertion times out -- even when I increase [these timeouts](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491):

        ```
        #14 0x558445e19468 autofill::TestAutofillManagerWaiter::Wait() [../../components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc:365:22]
        #15 0x55843423fec8 autofill::AutofillEventHandlerBrowserTest::TestAutofillManager::WaitForAutofillFill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:59:36]
        #16 0x55843423b5fb autofill::AutofillEventHandlerBrowserTest::NavigateAndTriggerAutofill() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:158:26]
        #17 0x558434237d92 autofill::AutofillEventHandlerBrowserTest_CompleteAutofillFlow_Test::RunTestOnMainThread() [../../chrome/browser/autofill/autofill_event_handler_browsertest.cc:186:3]
        ```

        For some reason the [diagnostic message](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.cc;l=360;drc=3d6df2f5cdb862de83bce3b4a0dea62311701090) is missing. The test isn't mocking time, is it? (In that case, we don't have those diagnostics for a [reason](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/foundations/test_autofill_manager_waiter.h;l=361-362;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7).)

        I've debugged it a little and suspect that the bot is too slow to reparse the form within [these 200 ms](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/filling/form_filler.cc;l=66;drc=5fe91acd428f2c0b9ca9af8a2ec0d72ef28d3d4b). That's plausible because parsing happens on a low-priority sequence runner.

        We could address this as follows:
        1. Wait for `OnFormsSeen()` (as you do now)
        2. Wait for first `OnDidAutofill()`
        3. Wait for another `OnFormsSeen()` triggered by the DOM
        4. Only now let JavaScript call `RequestRefill()`.
        5. Wait for the refill.

        ---

        Besides that, you may also want to do [this](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/autofill/autofill_across_iframes_browsertest.cc;l=85-86;drc=4d61c530e1e440d78af6b82da0bb2472f06576a7) to effectively disable the first two of [these two](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/common/autofill_constants.h;l=89-98;drc=8b920155b9142d8e79e07083f47ed1b4e2dd1491) timeouts. We don't have anything do disable the third because it's in the renderer process.

        Christoph Schwering

        When I increase the 200 ms delay to 4 s, the test runs through on my machine with a single CPU core. I guess that supports the hypothesis in the previous comment.

        Christoph Schwering

        s/triggered by the DOM/triggered by JavaScript updating the DOM/

        Yoav Weiss (@Shopify)

        Thanks!!

        Added waits. Now waiting to see if the bots are happy 😊

        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
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: Fri, 02 Jan 2026 11:17:44 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoav Weiss (@Shopify) (Gerrit)

        unread,
        Jan 2, 2026, 6:56:03 AM (11 days ago) Jan 2
        to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Christoph Schwering and Yoav Weiss (@Shopify)

        Yoav Weiss (@Shopify) voted and added 1 comment

        Votes added by Yoav Weiss (@Shopify)

        Commit-Queue+1

        1 comment

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Yoav Weiss (@Shopify)

        They are not.. :\

        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
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-Attention: Christoph Schwering <schw...@google.com>
        Gerrit-Comment-Date: Fri, 02 Jan 2026 11:55:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoav Weiss (@Shopify) (Gerrit)

        unread,
        Jan 2, 2026, 11:53:24 AM (10 days ago) Jan 2
        to AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Christoph Schwering

        Yoav Weiss (@Shopify) added 1 comment

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Yoav Weiss (@Shopify)

        OK, got them passing, but I'm not 100% confident the flakiness is over..

        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
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: 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, 02 Jan 2026 16:53:10 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Christoph Schwering (Gerrit)

        unread,
        Jan 9, 2026, 10:06:29 AM (3 days ago) Jan 9
        to Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Christoph Schwering voted and added 3 comments

        Votes added by Christoph Schwering

        Code-Review+1

        3 comments

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

        LGTM. I can try to look more into the flakiness locally later today.

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Christoph Schwering

        (As discussed offline:) The test is still flaky on my machine but I haven't added LOG statements yet.

        File components/autofill/content/renderer/form_autofill_util.cc
        Line 2721, Patchset 22 (Latest): // for (const FormFieldData::FillData& autofill_value : autofill_values) {
        Christoph Schwering . unresolved

        nit: remove?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Yoav Weiss (@Shopify)
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: 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, 09 Jan 2026 15:06:12 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoav Weiss (@Shopify) (Gerrit)

        unread,
        Jan 11, 2026, 10:58:28 PM (20 hours ago) Jan 11
        to Stephen McGruer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org

        Yoav Weiss (@Shopify) added 1 comment

        File components/autofill/content/renderer/form_autofill_util.cc
        Line 2721, Patchset 22: // for (const FormFieldData::FillData& autofill_value : autofill_values) {
        Christoph Schwering . resolved

        nit: remove?

        Yoav Weiss (@Shopify)

        Done

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-CC: Stephen McGruer <smcg...@chromium.org>
        Gerrit-Comment-Date: Mon, 12 Jan 2026 03:58:12 +0000
        Gerrit-HasComments: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Christoph Schwering (Gerrit)

        unread,
        5:26 AM (14 hours ago) 5:26 AM
        to Yoav Weiss (@Shopify), Stephen McGruer, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, vasilii+watchlis...@chromium.org, gcasto+w...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Christoph Schwering voted and added 2 comments

        Votes added by Christoph Schwering

        Code-Review+1

        2 comments

        File chrome/browser/autofill/autofill_event_handler_browsertest.cc
        Line 169, Patchset 24 (Latest): ASSERT_TRUE(manager->WaitForAutofillFill(/*num_expected_fills=*/1));
        Christoph Schwering . unresolved

        Re test flakiness:

        I hadn't realized that the dynamic modification of the form happens asynchronously after the Autofill.

        Since it happens asynchronously, the autofill triggers not one but *two* `AutofillManager::OnFormsSeen()` events:

        • The first is triggered synchronously in `AutofillAgent::ApplyFieldsAction()`; at the time the form has only 8 fields.
        • The second is triggered (roughly 100 ms later) when the form is modified dynamically; now the form has 11 elements.

        To fix that, we have two options, I think:

        • Option 1: We make the dynamic change synchronous. Then only on `OnFormsSeen()` call will happen.
        • Option 2: We add another `manager->WaitForAutofillFill(/*num_expected_fills=*/1)` here.

        No strong preference on which option. I guess I'd go with Option 2 and change the code comment
        ```
        // Wait for the form rescan after DOM modification.
        ```
        to something like
        ```
        // Wait for the form rescan after the DOM modification that happens
        // asynchronously after the autofill.
        ```

        Line 190, Patchset 24 (Latest): //
        // We must wait until the FormStructure in the cache actually contains the
        // newly added fields (11 total: 8 original + 3 new). Simply waiting for
        // OnAfterFormsSeen is insufficient because:
        // 1. Form extraction on the renderer is throttled (100ms delay)
        // 2. Form parsing on the browser is asynchronous
        // 3. There may be multiple FormsSeen events in flight, and we might catch
        // a stale one before the DOM mutation's form parsing completes
        const size_t kExpectedFieldCount = 11;
        while (true) {
        ASSERT_TRUE(manager->WaitForFormsSeen(/*min_num_awaited_calls=*/1));
        const std::vector<const FormStructure*> structures =
        test_api(*manager).form_structures();
        if (!structures.empty() &&
        structures.front()->field_count() >= kExpectedFieldCount) {
        break;
        }
        // The form parsing hasn't caught up yet. Wait for the next FormsSeen.
        }
        Christoph Schwering . unresolved

        I believe that fixes the flakiness, too. But I'd rather go with Option 1 or 2 mentioned above to avoid the loop and to make it more explicit which `OnFormsSeen()` events happen and why.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Yoav Weiss (@Shopify)
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id58612487008e9e7b4db7bda27262305b8fb824d
        Gerrit-Change-Number: 7260442
        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: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-CC: Stephen McGruer <smcg...@chromium.org>
        Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-Comment-Date: Mon, 12 Jan 2026 10:26:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages