Editable password field not filled if the username field is pre-filled with a value and is disabled/readonly

RESOLVED FIXED in mozilla25

Status

()

defect
RESOLVED FIXED
9 years ago
6 years ago

People

(Reporter: asqueella, Assigned: MattN)

Tracking

({testcase})

Trunk
mozilla25
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

9 years ago
The patch in bug 361517 disabled auto-filling of the form when *either* of the username/password fields are read-only or disabled:

http://hg.mozilla.org/mozilla-central/annotate/e9c9b7d21a0c/toolkit/components/passwordmgr/src/nsLoginManager.js#l1045

1045 // If the fields are disabled or read-only, there's nothing to do.
1046 if (passwordField.disabled || passwordField.readOnly ||
1047     usernameField && (usernameField.disabled ||
1048                       usernameField.readOnly)) {
1049     this.log("not filling form, login fields disabled");
1050     return [false, foundLogins];
1051 }

The rationale was that we shouldn't edit a field that the user can't edit.

The problem is that sometimes the password field *is* editable, but the password manager still gives up because the user name is pre-filled and read-only. I don't see why it shouldn't just fill in the password (and the referenced bug gives no rationale).

I see this on https://getopenid.com/action/remotesignon (when you login with openid from another site the username field is pre-filled).
(Reporter)

Comment 1

9 years ago
Posted file testcase (obsolete) —
(Reporter)

Comment 2

9 years ago
> just fill in the password
... but only if there's a saved password in the DB with the login matching the one in the readonly username field.
(Reporter)

Comment 3

9 years ago
Posted file testcase
Attachment #461888 - Attachment is obsolete: true
Seems reasonable, I'd take a patch for this. :)
This depends on bug 896316 otherwise we will still show autocomplete suggestions on a read-only username field. The alternative would be to duplicate the usernameField.readOnly check in nsLoginManager's autoCompleteSearch function but it seems less ideal for autocomplete providers to have to duplicate that.
Assignee: nobody → mnoorenberghe+bmo
Status: NEW → ASSIGNED
Attachment #779038 - Flags: review?(dolske)
Try push: https://tbpl.mozilla.org/?tree=Try&rev=d7ef7e41c5fa

Note that https://login.mozilla.org/ is also affected and a good real-world testcase.
Attachment #779038 - Flags: review?(dolske) → review+
https://hg.mozilla.org/mozilla-central/rev/d2e44492e8a3
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
This is fantastic
You need to log in before you can comment on or make changes to this bug.