Autofill: Better recognize credit card fields.
Based on field attributes, oftentimes it is very likely a field is a
given type, while its name or label may be ambiguous.
BUG=464002, 466685
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/core/browser/credit_card_field.cc File components/autofill/core/browser/credit_card_field.cc (right): https://codereview.chromium.org/1001193002/diff/40001/components/autofill/core/browser/credit_card_field.cc#newcode50 components/autofill/core/browser/credit_card_field.cc:50: !LikelyCardNumberField(scanner) && Why are you checking !LikelyCardNumberField in several ...
5 years, 9 months ago
(2015-03-13 20:57:13 UTC)
#4
5 years, 9 months ago
(2015-03-13 23:11:01 UTC)
#5
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
File components/autofill/core/browser/credit_card_field.cc (right):
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:50:
!LikelyCardNumberField(scanner) &&
On 2015/03/13 20:57:13, Evan Stade wrote:
> Why are you checking !LikelyCardNumberField in several places, as opposed to,
> say, moving the card number matcher earlier in the loop?
Changing the order may creates more of the same problem. Instead of incorrectly
recognizing a name as a number, we may end up incorrectly recgonzing a number as
a name. The order we have seem to work well for most cases, so I don't want to
change it. I just want to make it more accurate. The !LikelyFoo() calls act as
filters to help decrease false positives.
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:75: // but
LikelyCardType() works as well and produces fewer incorrect matches.
On 2015/03/13 20:57:13, Evan Stade wrote:
> this extra documentation is perhaps relevant to this code review but I'd not
> leave it in the code
Removed.
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:168: // Look for a form of
the right type with a 16 to 19 digit maxlength.
On 2015/03/13 20:57:13, Evan Stade wrote:
> the minimum card has less than 16 digits
Yes, but if a website made it less than 16, then they can't accept a
VISA/Mastercard CC number.
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:181: if
(MatchesFormControlType(field->form_control_type, MATCH_SELECT)) {
On 2015/03/13 20:57:13, Evan Stade wrote:
> I feel like this code should go somewhere we can reuse it for address pieces
>
> Also you should reuse/share with the filling code, i.e.
> FillCreditCardTypeSelectControl
Done.
Issue 1001193002: Autofill: Better recognize credit card fields.
(Closed)
Created 5 years, 9 months ago by Lei Zhang
Modified 4 years ago
Reviewers: Evan Stade
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 10