Closed
Bug 1415077
Opened 7 years ago
Closed 7 years ago
[Form Autofill] Classify the fields into multiple sections based on the section part of autocomplete attr.
Categories
(Toolkit :: Form Autofill, enhancement, P3)
Toolkit
Form Autofill
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: selee, Assigned: selee)
References
(Blocks 1 open bug)
Details
(Whiteboard: [form autofill:V2])
Attachments
(3 files)
If there are any fields with the section part of autocomplete attr, these fields should be classified with `autocomplete` attr.
If there is a form looks like this one:
<form>
<input autocomplete="name">
<input autocomplete="billing street-address">
<input autocomplete="billing postal-code">
<input autocomplete="shipping street-address">
<input autocomplete="shipping postal-code">
<input autocomplete="email">
</form>
`FormAutofillHeuristics.getFormInfo` should provide the result:
[
[{fieldName: "name"}, {fieldName: "email"}], // fields without section name
[{fieldName: "street-address", ...}, {fieldName: "postal-code", ...}], // billing
[{fieldName: "street-address", ...}, {fieldName: "postal-code", ...}], // shipping
]
The detail autocomplete info should be based on the real result of getAutoCompleteInfo() API.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → selee
Status: NEW → ASSIGNED
Updated•7 years ago
|
Component: Form Manager → Form Autofill
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•7 years ago
|
||
The latest patch provides the section support, and the sections can be classified by the section part of autocomplete attributes. The related test will be implemented soon. BTW, bug 1416664 will handle the heuristic of grouping.
This sample page is good for trying this patch with your own tweaks:
http://jsbin.com/dedoqoxako/1/edit?html,output
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8928082 [details]
Bug 1415077 - Classify the field details with autocomplete attr into multiple groups.
https://reviewboard.mozilla.org/r/199318/#review205196
Thanks, overall looks good!
If the section concept is running on dual tracks behind pref, it's fine to keep orginial path as is. Though, I'm thinking there's no harm keeping only one fieldDetails store instead of two, and use a single access point to "fieldDetails" getter that return conditionally according to pref, then we don't have to trace two different routes with or without pref section enabled.
::: browser/extensions/formautofill/FormAutofillHeuristics.jsm:115
(Diff revision 2)
> + name,
> + fieldDetails: [fieldDetail],
> + });
> + }
> +
> + getSections(allowDuplicates) {
function name getSections seems a bit misleading.
::: browser/extensions/formautofill/FormAutofillHeuristics.jsm:746
(Diff revision 2)
> string = string.toLowerCase().split("united state").join("");
> }
> if (this.RULES[regexp].test(string)) {
> return {
> fieldName: regexp,
> section: "",
just curious to know, should we someways set the serialized section name here?
Attachment #8928082 -
Flags: review?(ralin) → review+
Comment 6•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8928082 [details]
Bug 1415077 - Classify the field details with autocomplete attr into multiple groups.
https://reviewboard.mozilla.org/r/199318/#review205196
> function name getSections seems a bit misleading.
Maybe `getSectionFieldDetails`?
Comment 7•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8928082 [details]
Bug 1415077 - Classify the field details with autocomplete attr into multiple groups.
https://reviewboard.mozilla.org/r/199318/#review205196
> just curious to know, should we someways set the serialized section name here?
Sorry, misunderstood this. Please ignore and close the issue :P
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8928082 [details]
Bug 1415077 - Classify the field details with autocomplete attr into multiple groups.
https://reviewboard.mozilla.org/r/199318/#review205834
Attachment #8928082 -
Flags: review?(lchang) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8930137 [details]
Bug 1415077 - Modify FormAutofill test to satisfy the section support feature.
https://reviewboard.mozilla.org/r/201306/#review207194
Looks good! Thanks
::: browser/extensions/formautofill/test/unit/heuristics/third_party/test_HomeDepot.js:10
(Diff revision 2)
> runHeuristicsTest([
> {
> fixturePath: "Checkout_ShippingPayment.html",
> expectedResult: [
> [
> + [
nit: inconsistent line break for array brackets, maybe keep in the same way regardless of the amount of items.
Attachment #8930137 -
Flags: review?(ralin) → review+
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8930138 [details]
Bug 1415077 - Implement the new multiple section tests.
https://reviewboard.mozilla.org/r/201308/#review207196
Attachment #8930138 -
Flags: review?(ralin) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8930137 [details]
Bug 1415077 - Modify FormAutofill test to satisfy the section support feature.
https://reviewboard.mozilla.org/r/201306/#review207244
::: browser/extensions/formautofill/test/unit/head.js:84
(Diff revision 2)
> }
>
> +function verifySectionFieldDetails(sections, expectedResults) {
> + Assert.equal(sections.length, expectedResults.length, "Expected section count.");
> + sections.forEach((section, sectionIndex) => {
> + let sectionInfo = sections[sectionIndex];
Why don't you use `section` directly?
Attachment #8930137 -
Flags: review?(lchang) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8930138 [details]
Bug 1415077 - Implement the new multiple section tests.
https://reviewboard.mozilla.org/r/201308/#review207248
Attachment #8930138 -
Flags: review?(lchang) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 25•7 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e1667b83dc10
Classify the field details with autocomplete attr into multiple groups. r=lchang,ralin
https://hg.mozilla.org/integration/autoland/rev/e78023ba8b13
Modify FormAutofill test to satisfy the section support feature. r=lchang,ralin
https://hg.mozilla.org/integration/autoland/rev/d827c67e862e
Implement the new multiple section tests. r=lchang,ralin
Keywords: checkin-needed
Comment 26•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e1667b83dc10
https://hg.mozilla.org/mozilla-central/rev/e78023ba8b13
https://hg.mozilla.org/mozilla-central/rev/d827c67e862e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•