Bug 1531164 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

```html
<input autocomplete=username>
```
should provide username suggestions from saved logins in autocomplete instead of form history.

This would probably be easiest to implement like the existing [type=password special case](https://searchfox.org/mozilla-central/rev/2a6f3dde00801374d3b2a704232de54a132af389/toolkit/components/satchel/nsFormFillController.cpp#664-665) in `nsFormFillController::StartSearch` (skipping `markAsLoginManagerField`) and then teaching the password manager autocomplete search code that the field should be treated as a username field.

The chrome-only API GetAutocompleteInfo exists on <input> to get the parsed values. We can check that the `fieldName` returned is "username".
```html
<input autocomplete=username>
```
should provide username suggestions from saved logins in autocomplete instead of form history.

This would probably be easiest to implement like the existing [type=password special case](https://searchfox.org/mozilla-central/rev/2a6f3dde00801374d3b2a704232de54a132af389/toolkit/components/satchel/nsFormFillController.cpp#664-665) in `nsFormFillController::StartSearch` (skipping `markAsLoginManagerField`) and then teaching the password manager autocomplete search code that the field should be treated as a username field.
* The downside of this approach is that it means that if there are no saved usernames, the user won't get a form history fallback…

The chrome-only API GetAutocompleteInfo exists on <input> to get the parsed values. We can check that the `fieldName` returned is "username".

Back to Bug 1531164 Comment 0