New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 833838 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
hobby only
Closed: Nov 6
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Task

Blocking:
issue 831123



Sign in to add a comment

Clean-up PasswordForm parsing

Project Member Reported by vabr@chromium.org, Apr 17 2018

Issue description

Living inside components/autofill/content/renderer/password_form_conversion_utils.* and related files, the code parsing HTML elements into PasswordForms is old and could be simplified.

This bug tracks clean-ups (removing dead code) and other changes not affecting the resulting behaviour. It might also involve reducing the use of HTML elements directly in favour of the generated FormData.

This bug does not track introducing an alternative PasswordForms parser in the browser process, that will be tracked separately.
 

Comment 1 by vabr@chromium.org, Apr 17 2018

The clean-ups in flight are https://crrev.com/c/1013980, https://crrev.com/c/1014130, https://crrev.com/c/1013983, https://crrev.com/c/1014043, https://crrev.com/c/1013716.

I was also looking at the strange difference of PasswordForm::action vs. FormData::action. Currently, the former is never invalid, has authentication and parameters stripped and if starting with an empty string, the result is the base href of the document. The latter ends up empty if started from an empty string and keeps auth info and params. Because FormData::action is also used beyond password manager code, I did not want to change it. Once the new PasswordForm parser is getting the FormData sent to browser without the encapsulating PasswordForm, FormData::action will need to be overwritten for that particular case to match today's PasswordForm::action.

Comment 2 by vabr@chromium.org, Apr 17 2018

Note for myself:
Next step is migrating the "form_has_password_field" check from the start of GetPasswordForm to only depend on FormData. This check consists of finding a field which:
* is a text field
* is enabled (!HTMLFormControlElement::IsDisabledFormControl)
* has been a password field (HTMLInputElement::HasBeenPasswordField)

The former is being added to FormFieldData in https://crrev.com/c/1013580, the other two will need to get added.
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3600e2155c16d72a1631a58b8d50d752c33b3b9c

commit 3600e2155c16d72a1631a58b8d50d752c33b3b9c
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 17 16:53:59 2018

Remove SyntheticForm::action

This data member is not used.

Bug:  833838 
Change-Id: I0b1483ffb9195284de70f2b0649f431c0278345e
Reviewed-on: https://chromium-review.googlesource.com/1013980
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551366}
[modify] https://crrev.com/3600e2155c16d72a1631a58b8d50d752c33b3b9c/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/95fca159d7e9a067aa40f7dd9cd0ccac9699df85

commit 95fca159d7e9a067aa40f7dd9cd0ccac9699df85
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 17 19:13:03 2018

Replace SyntheticForm::document with origin

SyntheticForm is an abstraction of a collection of form input elements
for the purpose of creating PasswordForm objects based on DOM tree.

It currently stores a reference to the web document, only to derive
the form's origin from it later.

This CL drops the reference to the web document and replaces it with
the computed origin. This way, SyntheticForm does not keep an
unnecessary amount of data alive. It does introduce one GURL copy, but
that will be addressed in a separate CL by making GetPasswordForm
consume a SyntheticForm instead of looking at its const reference.

Bug:  833838 
Change-Id: I33011146289b60bb50898f70f8001af6668a4203
Reviewed-on: https://chromium-review.googlesource.com/1014130
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551423}
[modify] https://crrev.com/95fca159d7e9a067aa40f7dd9cd0ccac9699df85/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35c8765c87d901f3edf6a6de115010b98fa1c4dc

commit 35c8765c87d901f3edf6a6de115010b98fa1c4dc
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 17 19:16:47 2018

Move SyntheticForm into GetPasswordForm

A SyntheticForm is an object created specifically for the
GetPasswordForm function to consume. Yet, the function only takes a
const reference of a SyntheticForm. This prevents the function from
sparing some copies in moving data from a SyntheticForm to a
PasswordForm.

This CL changes the const reference to a plain value, moves the
SyntheticForm via std::move on the callsites, and ensures that
SyntheticForm has a move constructor.

Bug:  833838 
Change-Id: Iaee54b092c7f12b91b2afd35f4882b9d451ce668
Reviewed-on: https://chromium-review.googlesource.com/1013983
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551425}
[modify] https://crrev.com/35c8765c87d901f3edf6a6de115010b98fa1c4dc/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46f3835280c95592706fa2885e28c182c377941b

commit 46f3835280c95592706fa2885e28c182c377941b
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 17 19:24:05 2018

Remove SyntheticForm::fieldsets

SyntheticForm's data member fieldsets is only set and used once, in
the same function.

Therefore this CL reduces the size of SyntheticForm and extracts the
fieldsets data member as a local variable in said function.

Bug:  833838 
Change-Id: Ie5970adf3b0a2c52c783e599b658d1d0f27473eb
Reviewed-on: https://chromium-review.googlesource.com/1014043
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551431}
[modify] https://crrev.com/46f3835280c95592706fa2885e28c182c377941b/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4bd1eea20d3b5a4dab2ade2a8c800356dc77e1b0

commit 4bd1eea20d3b5a4dab2ade2a8c800356dc77e1b0
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 17 19:27:34 2018

Modernize unique_ptr usage in form utils

password_form_conversion_utils.cc used the constructor of
std::unique_ptr explicitly. This is to be avoided in Chromium's code
(//PRESUBMIT.py has a check against introducing new instances) and
nullptr and std::make_unique are preferred.

form_autofill_util.cc used a raw owning pointer and base::WrapUnique
to convert it to std::unique_ptr. Instead, the owned object should be
wrapped in unique_ptr since construction, to avoid the risk of
introducing a leak later.

This CL fixes both issues mentioned above.

Bug:  833838 
Change-Id: Id62f146e69a659bd594678989310f2d212151572
Reviewed-on: https://chromium-review.googlesource.com/1013716
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551433}
[modify] https://crrev.com/4bd1eea20d3b5a4dab2ade2a8c800356dc77e1b0/components/autofill/content/renderer/form_autofill_util.cc
[modify] https://crrev.com/4bd1eea20d3b5a4dab2ade2a8c800356dc77e1b0/components/autofill/content/renderer/password_form_conversion_utils.cc

Comment 8 by vabr@chromium.org, Apr 18 2018

Expanding on #2:

WebFormControlElement::FormControlTypeForAutofill, used in WebFormControlElementToFormField, assigns the type "password" iff the field is a text field and HTMLInputElement::HasBeenPasswordField is true.

That means that the only info needing to be added to FormData of the purpose of the "form_has_password_field" is the result of HTMLFormControlElement::IsDisabledFormControl.

Comment 9 by vabr@chromium.org, Apr 18 2018

Blocking: 831123
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31b91d3cb80451fc16cb46fc14a6885269631a92

commit 31b91d3cb80451fc16cb46fc14a6885269631a92
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed Apr 18 14:10:10 2018

Clarify the meaning of AUTOFILLED in FieldPropertiesFlags

(No code change, just added a comment.)

Bug:  833838 
Change-Id: Iea3a4b61fede82cb98b91eef71398f2c46a97985
Reviewed-on: https://chromium-review.googlesource.com/1016303
Reviewed-by: Maxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551663}
[modify] https://crrev.com/31b91d3cb80451fc16cb46fc14a6885269631a92/components/autofill/core/common/form_field_data.h

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/50eaf1b2a9940600db105bd872f87e632692c7b0

commit 50eaf1b2a9940600db105bd872f87e632692c7b0
Author: Vaclav Brozek <vabr@chromium.org>
Date: Thu Apr 19 11:32:30 2018

Add FormFieldData::is_enabled

This CL adds a flag to FormFieldData to record whether the form field
was enabled or not.

The flag is meant to be used for parsing only, not for storing.
Therefore Pickle-related serialization support is omitted for the
flag. However, Mojo traits are defined, because this flag is expected
to be preserved when being sent across the process boundary.

The CL also uses the flag to rewrite a small part of GetPasswordForm
to use FormData instead of direct access to HTML elements. While still
happening in renderer, ultimately GetPasswordForm will move to
browser.

The original check in GetPasswordForm tries to find one control element
which:
* is a text field, and
* is enabled (!HTMLFormControlElement::IsDisabledFormControl), and
* has been a password field (HTMLInputElement::HasBeenPasswordField).

The new check tries to find a corresponding field instead, such that:
* the field's form_control_type is "password", and
* the field is enabled.

WebFormControlElement::FormControlTypeForAutofill, used in
WebFormControlElementToFormField, assigns the form_control_type of
"password" if the corresponding element is a text field and
HasBeenPasswordField is true. Hence, the two checks are equivalent.

Bug:  833838 
Change-Id: I9e61143b73e4d95af919a6089351e51fc8420789
Reviewed-on: https://chromium-review.googlesource.com/1015573
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551981}
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/common/autofill_types.mojom
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/common/autofill_types_struct_traits.cc
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/common/autofill_types_struct_traits.h
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/renderer/form_autofill_util.cc
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/renderer/form_autofill_util_browsertest.cc
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/content/renderer/password_form_conversion_utils.cc
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/core/common/form_field_data.cc
[modify] https://crrev.com/50eaf1b2a9940600db105bd872f87e632692c7b0/components/autofill/core/common/form_field_data.h

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3946acbded87b42fb6e0dc22748dbb555749cb69

commit 3946acbded87b42fb6e0dc22748dbb555749cb69
Author: Vaclav Brozek <vabr@chromium.org>
Date: Mon Apr 23 13:57:47 2018

Extend FormFieldData with further data members

This CL adds the following data members of FormFieldData. They are
needed to move parsing away from inspecting DOM elements and towards
only using FormData.

* is_readonly to reflect the presence of the readonly attribute
* is_default to reflect the situation when the value attribute of an
  input element is the same as its value property
* typed_value to keep an alternative of the input element's value in
  case Chrome detects unwanted edits to user-typed values from the page
  scripts' side

The CL does not put those new values to use yet, that will happen in a
follow-up CL, to limit the CL size.

Finally, the CL changes the calls to WebFormElementToFormData from
CreatePasswordFormFrom* functions to request EXTRACT_VALUE. This causes
the field value to be added to PasswordForm::form_data. It is not needed
for parsing yet (that will come in a subsequent CL), but it helps test
the new functionality.

Bug:  833838 
Change-Id: Iaf19b81335d7f8dbaf81a30f36366a4c6d11a49c
Reviewed-on: https://chromium-review.googlesource.com/1016982
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552683}
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/common/autofill_types.mojom
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/common/autofill_types_struct_traits.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/common/autofill_types_struct_traits.h
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/renderer/form_autofill_util.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/renderer/form_autofill_util_browsertest.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/renderer/password_form_conversion_utils.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/core/common/form_field_data.cc
[modify] https://crrev.com/3946acbded87b42fb6e0dc22748dbb555749cb69/components/autofill/core/common/form_field_data.h

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/52f4ca77092926f61a9142f675f50fc3c3c02eaa

commit 52f4ca77092926f61a9142f675f50fc3c3c02eaa
Author: Vaclav Brozek <vabr@chromium.org>
Date: Mon Apr 23 21:32:35 2018

Add a test for setting FormFieldData::is_focusable

Bug:  833838 
Change-Id: I703356548edde4f316d19e8c68dbd41b09c804fe
Reviewed-on: https://chromium-review.googlesource.com/1016765
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552839}
[modify] https://crrev.com/52f4ca77092926f61a9142f675f50fc3c3c02eaa/components/autofill/content/renderer/form_autofill_util_browsertest.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad1435b289845b2faab59c2423071642889871c3

commit ad1435b289845b2faab59c2423071642889871c3
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 24 12:36:23 2018

Stop using HasNonEmptyLayout in IsWebElementVisible

Autofill and password autofill uses IsFocusable to approximate
visibility of form fields, as long as Blink is done rendering the page
and triggering a layout in order to compute visibility is acceptable.

Triggering a layout is not acceptable when Blink is about to render the
page. See https://crbug.com/595078 for past issues with this.

When triggering a layout is not acceptable, the variable
g_prevent_layout is set to true and computing visibility for
(non-password) autofill in WebFormControlElementToFormField is given up,
assuming all fields are potentially visible.

Password autofill used a different path to compute visibility for the
form fields, querying IsWebElementVisible. This has historically used
HasNonEmptyLayout at all times, but then switched to using IsFocusable
when triggering a layout was acceptable (see
https://codereview.chromium.org/2769023003). Calling HasNonEmptyLayout
remained to minimize the change in behaviour, leading to the puzzling
situation when a function clearly triggering a layout was called when
layout should not be triggered.

While the latter never seemed to produce crashes as seen in
https://crbug.com/595078, it is a potential landmine, and likely
unnecessary, given that the data it provided needed improvement in the
form of IsFocusable anyway.

Therefore this CL stops calling HasNonEmptyLayout from
IsWebElementVisible. It also extends a visibility-related test to
check IsWebElementVisible and two scenarios based on prevention of
layout.

Bug:  833838 
Change-Id: I6aedca91ff0369c541891c96336125dff9adeac0
Reviewed-on: https://chromium-review.googlesource.com/1021573
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553059}
[modify] https://crrev.com/ad1435b289845b2faab59c2423071642889871c3/components/autofill/content/renderer/form_autofill_util.cc
[modify] https://crrev.com/ad1435b289845b2faab59c2423071642889871c3/components/autofill/content/renderer/form_autofill_util_browsertest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5ade7264f204272d84c2aacefce92dd760836cf

commit a5ade7264f204272d84c2aacefce92dd760836cf
Author: Vaclav Brozek <vabr@chromium.org>
Date: Tue Apr 24 16:31:31 2018

Use IsWebElementVisible consistently

On some places in the autofill code, IsWebElementVisible is used,
on other that function is "inlined".

This CL changes one such inlined call to call IsWebElementVisible
explicitly.

There should be no visible behaviour changes caused by this CL.

Bug:  833838 
Change-Id: Ia0efb92d1a2b781467af929848c8999d8bb72d34
Reviewed-on: https://chromium-review.googlesource.com/1017202
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553159}
[modify] https://crrev.com/a5ade7264f204272d84c2aacefce92dd760836cf/components/autofill/content/renderer/form_autofill_util.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Apr 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c455f43c2eb81f1d059de0376793e7e1b6e98b57

commit c455f43c2eb81f1d059de0376793e7e1b6e98b57
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed Apr 25 22:32:47 2018

No static destructors in IsCreditCardVerificationPasswordField

Currently, IsCreditCardVerificationPasswordField creates a static
string16 object. That involves a static destructor, which is forbidden
by the style guide:
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

This CL fixes that by using base::NoDestructor. It also restructures the
function slightly.

There should be no visible change caused by this CL.

Bug:  833838 
Change-Id: Id879c5595113aae295e858bebf6cacc7f211b373
Reviewed-on: https://chromium-review.googlesource.com/1028272
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553797}
[modify] https://crrev.com/c455f43c2eb81f1d059de0376793e7e1b6e98b57/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Apr 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ffb7a888c86a70cb5adc70b1cad73a30d5758e34

commit ffb7a888c86a70cb5adc70b1cad73a30d5758e34
Author: Vaclav Brozek <vabr@chromium.org>
Date: Thu Apr 26 14:26:00 2018

Remove parsing flags from FormFieldData::SameFieldAs

FormFieldData contains a few flags, such as is_enabled, which are useful
for parsing FormFieldData into higher-level structures such as
PasswordForm. However, those flags are not important for the identity of
the fields and are also not stored on disk.

By accident, https://crrev.com/c/1016982 included those flags in the
identity checks (SameFieldAs and operator<), which broke autofill.

This CL removes those flags from the identity checks.

Bug:  833838 
Change-Id: Ifd33393841ff3a94aa0a4b778ec7b1262246b239
Reviewed-on: https://chromium-review.googlesource.com/1030070
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554019}
[modify] https://crrev.com/ffb7a888c86a70cb5adc70b1cad73a30d5758e34/components/autofill/core/common/form_field_data.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4bf81f921793f552c3eb0c7201901a32549b18b

commit a4bf81f921793f552c3eb0c7201901a32549b18b
Author: Vaclav Brozek <vabr@chromium.org>
Date: Fri Apr 27 13:47:10 2018

Regroup GetPasswordForm: predictions

GetPasswordForm does a number of tasks in order to create a
PasswordForm from DOM elements and FormData. Currently, those tasks
are interleaved, which makes their dependencies hard to assess.

This CL isolates the particular tasks in smaller blobs and orders them
based on their dependency.

In follow-up CLs, most of GetPasswordForm will get converted to using
FormData instead of DOM elements, which itself is a prerequisite to
moving that code to browser process. The only piece which will stay in
renderer is the HTML-based classifier. Having GetPasswordForm
disentangled will help switching all but the classifier to FormData.

The CL should not change the behaviour of Chrome.

Bug:  833838 
Change-Id: I8a8915daf0939e12dadb63e04c2db526fcf36b4c
Reviewed-on: https://chromium-review.googlesource.com/1027834
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554373}
[modify] https://crrev.com/a4bf81f921793f552c3eb0c7201901a32549b18b/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b7a75b1ada306c62b5d1f285ca9314aa8f13b9b3

commit b7a75b1ada306c62b5d1f285ca9314aa8f13b9b3
Author: Vaclav Brozek <vabr@chromium.org>
Date: Mon Apr 30 16:06:10 2018

Add comment in form_autofill_util.cc

There is a non-trivial condition with a bitmask at the end of
WebFormControlElementToFormField(). This CL adds an explaining comment
for it.

Bug:  833838 
Change-Id: I24001eb091643d7fa0ff4d7bda126d848a8432c7
Reviewed-on: https://chromium-review.googlesource.com/1033672
Reviewed-by: Mathieu Perreault <mathp@chromium.org>
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554768}
[modify] https://crrev.com/b7a75b1ada306c62b5d1f285ca9314aa8f13b9b3/components/autofill/content/renderer/form_autofill_util.cc

Project Member

Comment 20 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/357f5e2dc2ba593895f70cc2ee8fd2182f4ae49e

commit 357f5e2dc2ba593895f70cc2ee8fd2182f4ae49e
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed May 16 15:00:09 2018

Pull FindUsernameInPredictions out of html_based_username_detector.cc

The HTML based username detector first computes an ordered list of
potential usernames out of all form fields, and then tries to identify the
front-most of that list which is also on a list of plausible username fields
computed by other parts of Chrome.

This bundling may become a source of trouble once most of the parsing code,
including the one which produces the plausible username fields, gets moved to
a different process (renderer -> browser) and will get run after the HTML
classifier.

To solve this problem, this CL keeps the first part within
html_based_username_detector.cc, but moves the latter to the callsite, the
password_form_conversion_utils.cc. This way the HTML based detector only
needs the list of all form fields and loses its dependency on the code
computing the plausible fields.

Bug:  833838 
Change-Id: I66eef8098cd523c52fc54d02197a46382ada2fc6
Reviewed-on: https://chromium-review.googlesource.com/1032738
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559093}
[modify] https://crrev.com/357f5e2dc2ba593895f70cc2ee8fd2182f4ae49e/components/autofill/content/renderer/html_based_username_detector.cc
[modify] https://crrev.com/357f5e2dc2ba593895f70cc2ee8fd2182f4ae49e/components/autofill/content/renderer/html_based_username_detector.h
[modify] https://crrev.com/357f5e2dc2ba593895f70cc2ee8fd2182f4ae49e/components/autofill/content/renderer/password_form_conversion_utils.cc

Project Member

Comment 21 by bugdroid1@chromium.org, May 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48

commit e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48
Author: Vaclav Brozek <vabr@chromium.org>
Date: Thu May 24 09:47:03 2018

Improve computing autcomplete attributes in utils.

Autocomplete attributes are string properties of DOM elements. For
parsing password forms, a few special values are important.

This CL adds a few functions to password_form_conversion_utils to
compute an enum representation of the autocomplete attributes, and a
simple cache to keep those computed values to minimize string
comparisons.

Bug:  833838 
Change-Id: I6c386895be9af54ae1e31c715795a26b29eb0e5c
Reviewed-on: https://chromium-review.googlesource.com/1027881
Reviewed-by: Roger McFarlane <rogerm@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561441}
[modify] https://crrev.com/e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48/components/autofill/content/renderer/password_autofill_agent.cc
[modify] https://crrev.com/e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48/components/autofill/content/renderer/password_form_conversion_utils.cc
[modify] https://crrev.com/e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48/components/autofill/content/renderer/password_form_conversion_utils.h
[modify] https://crrev.com/e55b2920a9fc4addd9bb7c45fb1feeb2341a3e48/components/autofill/content/renderer/password_generation_agent.cc

Project Member

Comment 22 by bugdroid1@chromium.org, May 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/abceec3a7429ced8bab04bec10fa7fb9ceac3d0d

commit abceec3a7429ced8bab04bec10fa7fb9ceac3d0d
Author: Vaclav Brozek <vabr@chromium.org>
Date: Wed May 30 15:44:13 2018

Convert GetPasswordForm to work with FormData

GetPasswordForm parses web forms into PasswordForms. So far, it takes as
input the DOM elements directly. This makes it necessary to run the
parsing in renderer.

In the future, parsing should be run in browser, for various reasons.
The browser process can only work with an abstraction of the DOM
elements, captured in FormData and FormFieldData. This abstraction is
already computed at the time GetPasswordForm is run, and contains enough
information to replace the direct access to DOM elements.

The only exception is the HTML-based username detector, which may
require richer information in the future and should thus stay in the
renderer process.

Therefore this CL translates the code of GetPasswordForm to deal with
FormData instead of DOM elements, with the notable exception of the
HTML-based username detector.

Bug:  833838 
Change-Id: I75c1dcc932511539d84559d6813ef53f4ee210c2
Reviewed-on: https://chromium-review.googlesource.com/1032789
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562846}
[modify] https://crrev.com/abceec3a7429ced8bab04bec10fa7fb9ceac3d0d/components/autofill/content/renderer/form_autofill_util.cc
[modify] https://crrev.com/abceec3a7429ced8bab04bec10fa7fb9ceac3d0d/components/autofill/content/renderer/password_form_conversion_utils.cc

Status: Fixed (was: Started)

Sign in to add a comment