Closed Bug 1383058 Opened 3 years ago Closed 3 years ago

[Form Autofill] Always adopt autocomplete attribute and the info should not be changed.

Categories

(Toolkit :: Form Manager, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox56 --- fixed
firefox57 --- fixed

People

(Reporter: selee, Assigned: selee)

References

(Blocks 1 open bug)

Details

(Whiteboard: [form autofill:M4] )

Attachments

(1 file)

The info from autocomplete attribute should not be modified by any codes e.g. _parsePhoneFields and _parseAddressFields.
Comment on attachment 8888801 [details]
Bug 1383058 - Always adopt the info from autocomplete attribute.

https://reviewboard.mozilla.org/r/159838/#review174210

::: browser/extensions/formautofill/FormAutofillHandler.jsm:117
(Diff revision 3)
>     * Set fieldDetails from the form about fields that can be autofilled.
>  
>     * @returns {Array} The valid address and credit card details.
>     */
> -  collectFormFields() {
> +  collectFormFields(allowDuplicates = false) {

Please document this argument in the comment

::: browser/extensions/formautofill/FormAutofillHeuristics.jsm:295
(Diff revision 3)
> -  getFormInfo(form) {
> +  getFormInfo(form, allowDuplicates = false) {
>      if (form.autocomplete == "off" || form.elements.length <= 0) {

Please document this method with jsdoc

::: browser/extensions/formautofill/test/fixtures/telephone_fields.html:5
(Diff revision 3)
> +  <title>Form Autofill Demo Page</title>
> +</head>
> +<body>
> +  <h1>Form Autofill Demo Page</h1>

Please provide a more descriptive title+h1

::: browser/extensions/formautofill/test/fixtures/telephone_fields.html:10
(Diff revision 3)
> +    <p><label>organization: <input type="text" id="organization" name="organization" autocomplete="organization" /></label></p>
> +    <p><label>streetAddress: <input type="text" id="street-address" name="street-address" autocomplete="street-address" /></label></p>
> +    <p><label>addressLevel2: <input type="text" id="address-level2" name="address-level2" autocomplete="address-level2" /></label></p>

Please remove any unnecessary attributes e.g. type="text"
Attachment #8888801 - Flags: review?(MattN+bmo) → review+
In the previous version, these two files are the leftover when testing the patch. I removed them in the latest version.
browser/extensions/formautofill/test/fixtures/telephone_fields.html
browser/extensions/formautofill/test/unit/heuristics/test_telephone.js

Sorry for the confusion.
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a315cc6a25bb
Always adopt the info from autocomplete attribute. r=MattN
Keywords: checkin-needed
Backed out for eslint failure at browser/extensions/formautofill/FormAutofillHeuristics.jsm:329:12 | Unnecessary 'else' after 'return':

https://hg.mozilla.org/integration/autoland/rev/632a4aed2e2cdd273dfcf1b0d9a7572507555077

Push with failure: browser/extensions/formautofill/FormAutofillHeuristics.jsm:329:12 | Unnecessary 'else' after 'return'. 
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=123549721&repo=autoland
> TEST-UNEXPECTED-ERROR | /home/worker/checkouts/gecko/browser/extensions/formautofill/FormAutofillHeuristics.jsm:329:12 | Unnecessary 'else' after 'return'. (no-else-return)
Flags: needinfo?(selee)
Pushed by mozilla@noorenberghe.ca:
https://hg.mozilla.org/integration/mozilla-inbound/rev/15514c755d21
Always adopt the info from the autocomplete attribute for autofill. r=MattN
https://hg.mozilla.org/mozilla-central/rev/15514c755d21
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Hey MattN, thanks for fixing the eslint issue!
Flags: needinfo?(selee)
You need to log in before you can comment on or make changes to this bug.