Closed
Bug 1400760
Opened 7 years ago
Closed 7 years ago
[Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete
Categories
(Toolkit :: Form Manager, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: lchang, Assigned: lchang)
References
(Blocks 1 open bug)
Details
(Whiteboard: [form autofill:MVP])
Attachments
(1 file)
We currently define a valid credit-card form as the one with "cc-number" field no matter other fields are present or not. However, there's a chance that we might misdetect other fields to be "cc-number" (e.g. bug 1392950).
An additional condition may be able to alleviate this situation. After discussing with UX, we agreed to only popup credit card dropdown in a form that contains both "cc-number" and "cc-exp" (or its components, "cc-exp-month" and "cc-exp-year").
Since this rule is for reducing misdetection, we won't apply it to a form whose "cc-number" is defined explicitly by the @autocomplete attribute.
Comment 1•7 years ago
|
||
I'd like to add bug 1392940 as dep, since at least cc-exp family should be correctly identified to say we can mitigate this case with a confident basis.
Depends on: 1392940
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → lchang
Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8916531 [details]
Bug 1400760 - [Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete.
https://reviewboard.mozilla.org/r/187670/#review193944
The patch looks good! I am just curious if we should apply the same behavior to an address form.
::: browser/extensions/formautofill/FormAutofillHandler.jsm:194
(Diff revision 1)
> + hasExpiryDate = true;
> + break;
> + }
> + }
> +
> + return hasCCNumber && (ccNumberReason == "autocomplete" || hasExpiryDate);
If we care about cc-number with autocomplete or not, should we use the same idea to an address form?
::: browser/extensions/formautofill/test/unit/test_collectFormFields.js:215
(Diff revision 1)
> + ],
> + },
> + {
> + description: "A valid credit card form with non-autocomplete-attr cc-number and cc-exp-month/cc-exp-year.",
> + document: `<form>
> + <input id="cc-number" name="card-number">
According this line:
`return hasCCNumber && (ccNumberReason == "autocomplete" || hasExpiryDate);`
I think this case will have one item in `validFieldDetails`
<form>
<input id="cc-number" autocomplete="cc-number">
</form>
Do we have the test already?
Attachment #8916531 -
Flags: review?(selee)
Comment 4•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8916531 [details]
Bug 1400760 - [Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete.
https://reviewboard.mozilla.org/r/187670/#review193944
> According this line:
> `return hasCCNumber && (ccNumberReason == "autocomplete" || hasExpiryDate);`
>
> I think this case will have one item in `validFieldDetails`
> <form>
> <input id="cc-number" autocomplete="cc-number">
> </form>
>
> Do we have the test already?
In addition, this case will have an empty `validFieldDetails`, right?
<form>
<input id="cc-number">
</form>
Assignee | ||
Comment 5•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8916531 [details]
Bug 1400760 - [Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete.
https://reviewboard.mozilla.org/r/187670/#review193944
> If we care about cc-number with autocomplete or not, should we use the same idea to an address form?
I can't think of any case of an address form that needs this. Do you have any idea?
> In addition, this case will have an empty `validFieldDetails`, right?
> <form>
> <input id="cc-number">
> </form>
Added the test. Thanks.
And right. The second case gets an empty result.
Comment hidden (mozreview-request) |
Comment 7•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8916531 [details]
Bug 1400760 - [Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete.
https://reviewboard.mozilla.org/r/187670/#review193944
> I can't think of any case of an address form that needs this. Do you have any idea?
Yeah, we can discuss this later unitl we have the requiremenet to the similiar strategy for the address field based on autocomplete attr. Thanks.
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8916531 [details]
Bug 1400760 - [Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete.
https://reviewboard.mozilla.org/r/187670/#review195794
LGTM! Thanks.
Attachment #8916531 -
Flags: review?(selee) → review+
Pushed by lchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c05495fc2b51
[Form Autofill] Don't popup credit card dropdown if only cc-number field is identified and without @autocomplete. r=seanlee
Comment 10•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•