Closed
Bug 1413118
Opened 7 years ago
Closed 7 years ago
[Form Autofill] Fill "tel-national" to a recognized "tel" field even the international format passes "maxlength"
Categories
(Toolkit :: Form Manager, defect, P5)
Toolkit
Form Manager
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: lchang, Assigned: lchang)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [form autofill:MVP])
Attachments
(1 file)
It's a follow-up bug of bug 1405997.
Most websites expect the national format of a telephone number. However, they might set the "maxlength" of the field more than a valid national format (10 characters in US) because they expect the formatted number or they will help to format it after a user enters the number.
In order to better support the targeting websites, we should fill "tel-national" to a recognized "tel" field even the international format passes "maxlength" check.
Assignee | ||
Updated•7 years ago
|
status-firefox57:
--- → affected
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → lchang
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Status: NEW → ASSIGNED
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8924423 [details]
Bug 1413118 - [Form Autofill] Fill "tel-national" to a recognized "tel" field even the international format passes "maxlength".
https://reviewboard.mozilla.org/r/195720/#review201816
LGTM! Thanks.
::: browser/extensions/formautofill/FormAutofillHandler.jsm:341
(Diff revision 1)
> };
> if (element.pattern) {
> if (testPattern(profile.tel)) {
> return;
> }
> - } else if (element.maxLength) {
> + } else if (element.maxLength && detail._reason == "autocomplete") {
checking `element.pattern` or `element.maxLength` is to make sure their existence should be considered as the first priority. If we want to follow the concept, I think the check would be better to look like this:
```JS
} else if (element.maxLength) {
if (detail._reason == "autocomplete" && profile.tel.length <= element.maxLength) {
return;
}
}
```
or we can just use a simpler version:
```JS
} else if (element.maxLength && detail._reason == "autocomplete" && profile.tel.length <= element.maxLength) {
return;
}
```
Attachment #8924423 -
Flags: review?(selee) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•7 years ago
|
||
Makes sense. Thanks.
Pushed by lchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c760f9b3e6c9
[Form Autofill] Fill "tel-national" to a recognized "tel" field even the international format passes "maxlength". r=seanlee
Comment 6•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Comment 7•7 years ago
|
||
The combination of "P5" and "form autofill:MVP" has me confused. In any case, this is too late for 57, so wontfix.
You need to log in
before you can comment on or make changes to this bug.
Description
•