Hook up clearing of autofill state for <selectmenu> [chromium/src : main]

0 views
Skip to first unread message

Peter Kotwicz (Gerrit)

unread,
Mar 22, 2023, 10:23:09 PM3/22/23
to Stephen McGruer, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org

Attention is currently required from: Stephen McGruer.

Peter Kotwicz would like Stephen McGruer to review this change.

View Change

Hook up clearing of autofill state for <selectmenu>

This CL:
- Makes clearing autofill state for <selectmenu> work
- Makes HTMLSelectMenuElement update
HTMLFormControlElement::autofill_state_ and
HTMLFormControlElementWithState::user_has_edited_the_field_

BUG=1420414,1424116
TEST=AutofillChromeClientTest.*
FormAutofillUtilsTest.*
FormCacheBrowserTest.*

Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
---
M components/autofill/content/renderer/form_autofill_util.cc
M components/autofill/content/renderer/form_autofill_util.h
M components/autofill/content/renderer/form_autofill_util_browsertest.cc
M components/autofill/content/renderer/form_cache.cc
M components/autofill/content/renderer/form_cache.h
M components/autofill/content/renderer/form_cache_browsertest.cc
M components/autofill/content/renderer/form_cache_test_api.h
M third_party/blink/renderer/core/BUILD.gn
M third_party/blink/renderer/core/exported/web_form_control_element.cc
M third_party/blink/renderer/core/html/forms/html_select_menu_element.cc
M third_party/blink/renderer/core/html/forms/html_select_menu_element.h
M third_party/blink/renderer/core/page/DEPS
M third_party/blink/renderer/core/page/chrome_client_impl_test.cc
13 files changed, 399 insertions(+), 119 deletions(-)


To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-MessageType: newchange

Peter Kotwicz (Gerrit)

unread,
Mar 22, 2023, 10:23:14 PM3/22/23
to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, chromium...@chromium.org

Attention is currently required from: Stephen McGruer.

View Change

1 comment:

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Mar 2023 02:23:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Stephen McGruer (Gerrit)

unread,
Mar 23, 2023, 5:33:25 PM3/23/23
to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Tricium, Stephen McGruer, chromium...@chromium.org

Attention is currently required from: Peter Kotwicz.

View Change

9 comments:

  • Patchset:

    • Patch Set #4:

      Hey, sorry, I've been swamped so I didn't manage to finish the full review by EoD. Still to review the below, but wanted to give you some feedback to start with.

      Still to review:
      - components/autofill/content/renderer/form_cache_browsertest.cc
      - third_party/blink/renderer/core/page/chrome_client_impl_test.cc
  • File components/autofill/content/renderer/form_autofill_util.h:

    • Patch Set #4, Line 186: bool IsCheckableElement(const blink::WebInputElement& element);

      There are a few callsites (2 I found) that call `IsCheckableElement` with an inline DynamicTo call. These could be replaced to call the new version without the DynamicTo now I believe.

    • Patch Set #4, Line 187: bool IsCheckableElement(const blink::WebFormControlElement& element);

      I wonder if we should just replace the WebInputElement version with the new WebFormControlElement one, since WebInputElement is-a WebFormControlElement (and so all existing call-sites should just work).

      WDYT?

      (I guess the question might be how expensive is an unnecessary DynamicTo call, for the objects that are already WebInputElements. I would hope near-free, but maybe not?)

  • File components/autofill/content/renderer/form_autofill_util_browsertest.cc:

    • Patch Set #4, Line 86: bool AreRendererIdsEqual(const WebElement& element,

      Nit: when initially reading this, I thought that it checked the ID of the renderer for the element and the field. That isn't the case, it checks the *field* ID (which is only unique for this renderer). Can we think of a name that reflects that, perhaps:

      HaveSameFormControlId

      (Not sure if the unique-per-renderer part is relevant for the method name)

    • Patch Set #4, Line 88: if (!element.IsFormControlElement()) {

      I think that this should ASSERT that the element is a WebFormControlElement, or just take one as input, rather than check and return false. The current behavior makes it harder to know in the case of:

      `EXPECT_FALSE(AreRendererIdsEqual(element, field))`

      Did this pass because they didn't have equivalent renderer IDs, or because element wasn't actually a WebFormControlElement.

    • Patch Set #4, Line 103: ~FormAutofillUtilsTest() override {}

      use '= default' to define a trivial destructor (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html)

      (Note: building this file or its dependencies failed; this diagnostic might be incorrect as a result. Potentially relevant: clang-tidy currently runs in c++17 mode. Use of c++20-only features is currently discouraged. See crbug.com/1406869.)

      (Lint observed on `android-clang-tidy-rel`, `linux-chromeos-clang-tidy-rel`, and `linux-clang-tidy-rel`)

      Please fix.

    • Patch Set #4, Line 1522: class SelectMenuEnableParamTest : public FormAutofillUtilsTest,

      I think this name could be better, though I'm struggling to come up with one immediately. Perhaps this just needs to somehow indicate that it is about SelectMenuAutofilling rather than just SelectMenu?

      SelectMenuAutofillParamTest ?

  • File components/autofill/content/renderer/form_cache_browsertest.cc:

  • File third_party/blink/renderer/core/html/forms/html_select_menu_element.cc:

    • Patch Set #4, Line 831: SetAutofillState(autofill_state);

      Is this in line with how other autofilled elements work? I was trying to track down the same code for HTMLSelectElement, but failed to find equivalent code.

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Mar 2023 21:33:18 +0000

Peter Kotwicz (Gerrit)

unread,
Mar 24, 2023, 4:05:12 PM3/24/23
to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Tricium, Stephen McGruer, chromium...@chromium.org

Attention is currently required from: Stephen McGruer.

View Change

9 comments:

  • Patchset:

  • File components/autofill/content/renderer/form_autofill_util.h:

    • There are a few callsites (2 I found) that call `IsCheckableElement` with an inline DynamicTo call. […]

      Replaced those other call sites.

    • I wonder if we should just replace the WebInputElement version with the new WebFormControlElement on […]

      I will defer to someone with more autofill experience.

  • File components/autofill/content/renderer/form_autofill_util_browsertest.cc:

    • Nit: when initially reading this, I thought that it checked the ID of the renderer for the element a […]

      HaveSameFormControlId() it is.

    • I think that this should ASSERT that the element is a WebFormControlElement, or just take one as inp […]

      The function now takes a WebFormControlElement as a parameter.

      Adding an ASSERT() to this function does not compile because the method returns a bool instead of being void.

    • I think this name could be better, though I'm struggling to come up with one immediately. […]

      Changed to SelectMenuAutofillParamTest.

      As SelectMenuAutofillParamTest is used in a parameterized test, the base class is part of the test name.

      Ex: FormAutofillUtilsTest/SelectMenuAutofillParamTest.WebFormElementToFormData/0

  • File components/autofill/content/renderer/form_cache_browsertest.cc:

    • I meant `form_fill_data`. Thanks for catching the documentation inconsistency. Fixed.

  • File third_party/blink/renderer/core/html/forms/html_select_menu_element.cc:

    • Is this in line with how other autofilled elements work? I was trying to track down the same code fo […]

      Yes it is in line with how HTMLSelectElement works - HTMLSelectElement::SelectOption()

      The general rule of "if you see a large comment in a CL it likely was copied verbatim from somewhere else" applies 😊

      This line of code is tested in AutofillChromeClientTest.

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 6
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Mar 2023 20:05:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Stephen McGruer <smcg...@chromium.org>
Gerrit-MessageType: comment

Stephen McGruer (Gerrit)

unread,
Mar 27, 2023, 4:06:15 PM3/27/23
to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Tricium, Stephen McGruer, chromium...@chromium.org

Attention is currently required from: Stephen McGruer.

View Change

7 comments:

  • Patchset:

    • Patch Set #6:

      (Just resolving the finished comments, then will take another look)

  • File components/autofill/content/renderer/form_autofill_util.h:

    • Replaced those other call sites.

      (Marking resolved; please resolve comments where you have completed the requested action 😊).

  • File components/autofill/content/renderer/form_autofill_util_browsertest.cc:

    • HaveSameFormControlId() it is.

      (Resolving comment)

    • The function now takes a WebFormControlElement as a parameter. […]

      (Resolving comment.)

    • Changed to SelectMenuAutofillParamTest. […]

      Thanks!

      (Resolving comment.)

  • File components/autofill/content/renderer/form_cache_browsertest.cc:

    • I meant `form_fill_data`. Thanks for catching the documentation inconsistency. Fixed.

      (Resolving comment)

  • File third_party/blink/renderer/core/html/forms/html_select_menu_element.cc:

    • Yes it is in line with how HTMLSelectElement works - HTMLSelectElement::SelectOption() […]

      Thanks!

      (Resolving comment)

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 6
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Mar 2023 20:06:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Stephen McGruer <smcg...@chromium.org>
Comment-In-Reply-To: Peter Kotwicz <pkot...@chromium.org>
Gerrit-MessageType: comment

Stephen McGruer (Gerrit)

unread,
Mar 27, 2023, 4:42:03 PM3/27/23
to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Tricium, chromium...@chromium.org

Attention is currently required from: Peter Kotwicz.

Patch set 6:Code-Review +1

View Change

1 comment:

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 6
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Comment-Date: Mon, 27 Mar 2023 20:41:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Peter Kotwicz (Gerrit)

unread,
Mar 28, 2023, 11:21:47 AM3/28/23
to Florian Leimgruber, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer

Attention is currently required from: Florian Leimgruber.

Peter Kotwicz would like Florian Leimgruber to review this change.

View Change

13 files changed, 406 insertions(+), 130 deletions(-)


To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 7
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Florian Leimgruber <fleim...@google.com>
Gerrit-MessageType: newchange

Peter Kotwicz (Gerrit)

unread,
Mar 28, 2023, 11:21:53 AM3/28/23
to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Florian Leimgruber, Stephen McGruer, Tricium, chromium...@chromium.org

Attention is currently required from: Florian Leimgruber.

View Change

1 comment:

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 7
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Florian Leimgruber <fleim...@google.com>
Gerrit-Comment-Date: Tue, 28 Mar 2023 15:21:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Florian Leimgruber (Gerrit)

unread,
Mar 29, 2023, 9:59:14 AM3/29/23
to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Tricium, chromium...@chromium.org

Attention is currently required from: Peter Kotwicz.

Patch set 7:Code-Review +1

View Change

10 comments:

  • Patchset:

    • Patch Set #7:

      I didn't look at the blink code. Autofill code LGTM.

  • File components/autofill/content/renderer/form_autofill_util.h:

    • Patch Set #4, Line 187: bool IsCheckableElement(const blink::WebFormControlElement& element);

      I will defer to someone with more autofill experience.

      I don't know how expensive it is either. But it just seems to be an if + static_cast<>. So I vote for removing the WebInputElement version.

  • File components/autofill/content/renderer/form_autofill_util_browsertest.cc:

    • Patch Set #7, Line 100: base::test::ScopedFeatureList scoped_feature_list_;

      nit: private

    • Patch Set #7, Line 1523:

          if (IsAutofillingSelectMenuEnabled()) {
      scoped_feature_list_.InitAndEnableFeature(
      features::kAutofillEnableSelectMenu);
      } else {
      scoped_feature_list_.InitAndDisableFeature(
      features::kAutofillEnableSelectMenu);
      }

      ```
      scoped_feature_list.InitWithFeatureState(
      features::kAutofillEnableSelectMenu,
      IsAutofillingSelectMenuEnabled());
      ```
    • Patch Set #7, Line 1533:

      const

    • Patch Set #7, Line 1673:

      TODO(crbug.com/1422114): Make test work without explicit <selectmenu>
      // tabindex

      Why is the tabindex necessary right now?

  • File components/autofill/content/renderer/form_cache.h:

    • Patch Set #7, Line 146:

        std::map<FieldRendererId, std::u16string> initial_select_values_;
      std::map<FieldRendererId, std::u16string> initial_selectmenu_values_;

      Is the distinction between select and selectmenu necessary here? Could we just have a single `initial_select_or_selectmenu_values_` map?

  • File components/autofill/content/renderer/form_cache.cc:

  • File components/autofill/content/renderer/form_cache_browsertest.cc:

    • Patch Set #7, Line 408:

        for (FormFieldData& field : form_data.fields) {
      if (field.name == search_field_name.Utf16()) {
      return &field;
      }
      }
      return nullptr;

      ```
      auto it = base::ranges::find(form_data.fields,
      search_field_name.Utf16(), &FormFieldData::name);
      return it != form_data.fields.end() ? &*it : nullptr;
      ```
    • Patch Set #7, Line 428: FormFieldData* value_to_fill = FindFieldByName(

      optional nit: I find `field_to_fill` a more intuitive name.

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 7
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Comment-Date: Wed, 29 Mar 2023 13:59:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

Peter Kotwicz (Gerrit)

unread,
Mar 29, 2023, 11:49:40 AM3/29/23
to Joey Arhar, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Florian Leimgruber, Stephen McGruer

Attention is currently required from: Florian Leimgruber, Joey Arhar, Stephen McGruer.

Peter Kotwicz would like Joey Arhar to review this change.

View Change

13 files changed, 399 insertions(+), 134 deletions(-)


To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 9
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Florian Leimgruber <fleim...@google.com>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-MessageType: newchange

Peter Kotwicz (Gerrit)

unread,
Mar 29, 2023, 11:49:47 AM3/29/23
to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Joey Arhar, Florian Leimgruber, Stephen McGruer, Tricium, chromium...@chromium.org

Attention is currently required from: Florian Leimgruber, Joey Arhar, Stephen McGruer.

View Change

10 comments:

  • Patchset:

    • Patch Set #9:

      Joey can you please take a look at the blink changes?

  • File components/autofill/content/renderer/form_autofill_util.h:

    • I don't know how expensive it is either. But it just seems to be an if + static_cast<>. […]

      Removed the WebInputElement version.

  • File components/autofill/content/renderer/form_autofill_util_browsertest.cc:

    • Done

    • Patch Set #7, Line 1523:

          if (IsAutofillingSelectMenuEnabled()) {
      scoped_feature_list_.InitAndEnableFeature(
      features::kAutofillEnableSelectMenu);
      } else {
      scoped_feature_list_.InitAndDisableFeature(
      features::kAutofillEnableSelectMenu);
      }

    • ``` […]

      Thanks. I was unaware of InitWithFeatureState()!

    • Done

    • Because HTMLSelectMenuElement::SupportsFocus() has a custom override.

  • File components/autofill/content/renderer/form_cache.h:

    • Patch Set #7, Line 146:

        std::map<FieldRendererId, std::u16string> initial_select_values_;
      std::map<FieldRendererId, std::u16string> initial_selectmenu_values_;

    • Is the distinction between select and selectmenu necessary here? Could we just have a single `initia […]

      I added a 2nd map for the sake of legibility. There is no difference.

  • File components/autofill/content/renderer/form_cache.cc:

    • The comment is still needed because I haven't dealt with selectmenus in ScanFormControlElements(). Handling selectmenus in ScanFormControlElements() is trivial. I am trying to make each CL as small as possible to prove that each change is tested.

  • File components/autofill/content/renderer/form_cache_browsertest.cc:

    • ``` […]

      That's super cool! I did not know that the base::ranges utility functions existed! Changed.

    • Patch Set #7, Line 428: FormFieldData* value_to_fill = FindFieldByName(

      optional nit: I find `field_to_fill` a more intuitive name.

    • Changed.

To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
Gerrit-Change-Number: 4364438
Gerrit-PatchSet: 9
Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Florian Leimgruber <fleim...@google.com>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Wed, 29 Mar 2023 15:49:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Florian Leimgruber <fleim...@google.com>

Joey Arhar (Gerrit)

unread,
Mar 29, 2023, 11:25:14 PM3/29/23
to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Florian Leimgruber, Stephen McGruer, Tricium, chromium...@chromium.org

Attention is currently required from: Florian Leimgruber, Peter Kotwicz, Stephen McGruer.

Patch set 9:Code-Review +1

View Change

    To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
    Gerrit-Change-Number: 4364438
    Gerrit-PatchSet: 9
    Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
    Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
    Gerrit-Attention: Florian Leimgruber <fleim...@google.com>
    Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
    Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
    Gerrit-Comment-Date: Thu, 30 Mar 2023 03:25:02 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Florian Leimgruber (Gerrit)

    unread,
    Mar 30, 2023, 5:55:04 AM3/30/23
    to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Tricium, chromium...@chromium.org

    Attention is currently required from: Peter Kotwicz, Stephen McGruer.

    Patch set 9:Code-Review +1

    View Change

    7 comments:

      •     if (IsAutofillingSelectMenuEnabled()) {
        scoped_feature_list_.InitAndEnableFeature(
        features::kAutofillEnableSelectMenu);
        } else {
        scoped_feature_list_.InitAndDisableFeature(
        features::kAutofillEnableSelectMenu);
        }

      • Thanks. […]

        Acknowledged

      • Because HTMLSelectMenuElement::SupportsFocus() has a custom override.

        Acknowledged

    • File components/autofill/content/renderer/form_cache.h:

      • Patch Set #7, Line 146:

          std::map<FieldRendererId, std::u16string> initial_select_values_;
        std::map<FieldRendererId, std::u16string> initial_selectmenu_values_;

      • I added a 2nd map for the sake of legibility. There is no difference.

        Acknowledged

    • File components/autofill/content/renderer/form_cache.cc:

      • The comment is still needed because I haven't dealt with selectmenus in ScanFormControlElements(). […]

        Ok, thanks!

    • File components/autofill/content/renderer/form_cache_browsertest.cc:

      • Patch Set #7, Line 408:

          for (FormFieldData& field : form_data.fields) {
        if (field.name == search_field_name.Utf16()) {
        return &field;
        }
        }
        return nullptr;

        That's super cool! I did not know that the base::ranges utility functions existed! Changed.

      • Acknowledged

      • Changed.

        Acknowledged

    To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
    Gerrit-Change-Number: 4364438
    Gerrit-PatchSet: 9
    Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
    Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
    Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
    Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
    Gerrit-Comment-Date: Thu, 30 Mar 2023 09:54:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Florian Leimgruber <fleim...@google.com>

    Stephen McGruer (Gerrit)

    unread,
    Mar 31, 2023, 1:48:25 PM3/31/23
    to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Florian Leimgruber, Tricium, chromium...@chromium.org

    Attention is currently required from: Peter Kotwicz.

    Patch set 9:Code-Review +1

    View Change

      To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
      Gerrit-Change-Number: 4364438
      Gerrit-PatchSet: 9
      Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
      Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
      Gerrit-Attention: Peter Kotwicz <pkot...@chromium.org>
      Gerrit-Comment-Date: Fri, 31 Mar 2023 17:48:14 +0000

      Peter Kotwicz (Gerrit)

      unread,
      Mar 31, 2023, 2:51:40 PM3/31/23
      to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Florian Leimgruber, Tricium, chromium...@chromium.org

      Patch set 10:Commit-Queue +1

      View Change

        To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
        Gerrit-Change-Number: 4364438
        Gerrit-PatchSet: 10
        Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
        Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Peter Kotwicz <pkot...@chromium.org>
        Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
        Gerrit-Comment-Date: Fri, 31 Mar 2023 18:51:30 +0000

        Peter Kotwicz (Gerrit)

        unread,
        Mar 31, 2023, 4:40:23 PM3/31/23
        to blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Chromium LUCI CQ, Stephen McGruer, Florian Leimgruber, Tricium, chromium...@chromium.org

        Patch set 10:Commit-Queue +2

        View Change

          To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
          Gerrit-Change-Number: 4364438
          Gerrit-PatchSet: 10
          Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
          Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
          Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Peter Kotwicz <pkot...@chromium.org>
          Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
          Gerrit-Comment-Date: Fri, 31 Mar 2023 20:38:57 +0000

          Chromium LUCI CQ (Gerrit)

          unread,
          Mar 31, 2023, 4:40:54 PM3/31/23
          to Peter Kotwicz, blink-rev...@chromium.org, blink-...@chromium.org, browser-comp...@chromium.org, Stephen McGruer, Florian Leimgruber, Joey Arhar, Tricium, chromium...@chromium.org

          Chromium LUCI CQ submitted this change.

          View Change



          9 is the latest approved patch-set.
          The change was submitted with unreviewed changes in the following files:

          ```
          The name of the file: components/autofill/content/renderer/form_autofill_util.cc
          Insertions: 2, Deletions: 1.

          The diff is too large to show. Please review the diff.
          ```
          ```
          The name of the file: components/autofill/content/renderer/form_cache.h
          Insertions: 2, Deletions: 1.

          The diff is too large to show. Please review the diff.
          ```

          Approvals: Joey Arhar: Looks good to me Stephen McGruer: Looks good to me Peter Kotwicz: Commit Florian Leimgruber: Looks good to me
          Hook up clearing of autofill state for <selectmenu>

          This CL:
          - Makes clearing autofill state for <selectmenu> work
          - Makes HTMLSelectMenuElement update
          HTMLFormControlElement::autofill_state_ and
          HTMLFormControlElementWithState::user_has_edited_the_field_

          BUG=1420414,1424116
          TEST=AutofillChromeClientTest.*
          FormAutofillUtilsTest.*
          FormCacheBrowserTest.*

          Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
          Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4364438
          Reviewed-by: Joey Arhar <jar...@chromium.org>
          Reviewed-by: Florian Leimgruber <fleim...@google.com>
          Reviewed-by: Stephen McGruer <smcg...@chromium.org>
          Commit-Queue: Peter Kotwicz <pkot...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1124883}

          ---
          M components/autofill/content/renderer/form_autofill_util.cc
          M components/autofill/content/renderer/form_autofill_util.h
          M components/autofill/content/renderer/form_autofill_util_browsertest.cc
          M components/autofill/content/renderer/form_cache.cc
          M components/autofill/content/renderer/form_cache.h
          M components/autofill/content/renderer/form_cache_browsertest.cc
          M components/autofill/content/renderer/form_cache_test_api.h
          M third_party/blink/renderer/core/BUILD.gn
          M third_party/blink/renderer/core/exported/web_form_control_element.cc
          M third_party/blink/renderer/core/html/forms/html_select_menu_element.cc
          M third_party/blink/renderer/core/html/forms/html_select_menu_element.h
          M third_party/blink/renderer/core/page/DEPS
          M third_party/blink/renderer/core/page/chrome_client_impl_test.cc
          13 files changed, 401 insertions(+), 134 deletions(-)


          To view, visit change 4364438. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ibaa320aba94f796780564d5d3098de5105c9e824
          Gerrit-Change-Number: 4364438
          Gerrit-PatchSet: 11
          Gerrit-Owner: Peter Kotwicz <pkot...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Florian Leimgruber <fleim...@google.com>
          Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Peter Kotwicz <pkot...@chromium.org>
          Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
          Gerrit-MessageType: merged
          Reply all
          Reply to author
          Forward
          0 new messages