Bug 447788 - Login not filled if existing form username differs in case. r=gavin.

This commit is contained in:
Justin Dolske 2008-09-07 00:01:11 -07:00
parent 3047dd6c7e
commit b371c503be
2 changed files with 13 additions and 4 deletions

View File

@ -1091,13 +1091,13 @@ LoginManager.prototype = {
// If username was specified in the form, only fill in the
// password if we find a matching login.
var username = usernameField.value;
var username = usernameField.value.toLowerCase();
var matchingLogin;
var found = logins.some(function(l) {
matchingLogin = l;
return (l.username == username);
});
matchingLogin = l;
return (l.username.toLowerCase() == username);
});
if (found)
selectedLogin = matchingLogin;
else

View File

@ -58,6 +58,12 @@ Login Manager test: forms with 1 password field, part 2
<button type='submit'>Submit</button>
</form>
<form id='form9' action='formtest.js'> 9
<input type='text' name='uname' value='TESTUSER'>
<input type='password' name='pname' value=''>
<button type='submit'>Submit</button>
</form>
</div>
<pre id="test">
@ -68,11 +74,14 @@ Login Manager test: forms with 1 password field, part 2
function startTest() {
var f;
// Test various combinations of disabled/readonly inputs
checkForm(1, "testpass"); // control
checkUnmodifiedForm(2);
checkUnmodifiedForm(3);
checkForm(4, "testuser", "testpass"); // control
for (f = 5; f <= 8; f++) { checkUnmodifiedForm(f); }
// Test case-insensitive comparison of username field
checkForm(9, "testuser", "testpass");
SimpleTest.finish();
}