| Index: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
|
| diff --git a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
|
| index ed79cfe61ff52871a165ef77b80ba56e2b4ca8f9..dc627e982186c5a39b50bad9f2b209cdb43093ab 100644
|
| --- a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
|
| +++ b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
|
| @@ -64,20 +64,24 @@ PasswordCredential* PasswordCredential::create(HTMLFormElement* form,
|
| if (!result.isUSVString())
|
| continue;
|
|
|
| - AtomicString autocomplete =
|
| - toHTMLElement(element)->fastGetAttribute(HTMLNames::autocompleteAttr);
|
| - if (equalIgnoringCase(autocomplete, "current-password") ||
|
| - equalIgnoringCase(autocomplete, "new-password")) {
|
| - data.setPassword(result.getAsUSVString());
|
| - passwordName = element->name();
|
| - } else if (equalIgnoringCase(autocomplete, "photo")) {
|
| - data.setIconURL(result.getAsUSVString());
|
| - } else if (equalIgnoringCase(autocomplete, "name") ||
|
| - equalIgnoringCase(autocomplete, "nickname")) {
|
| - data.setName(result.getAsUSVString());
|
| - } else if (equalIgnoringCase(autocomplete, "username")) {
|
| - data.setId(result.getAsUSVString());
|
| - idName = element->name();
|
| + Vector<String> autofillTokens;
|
| + toHTMLElement(element)
|
| + ->fastGetAttribute(HTMLNames::autocompleteAttr)
|
| + .getString()
|
| + .lower() // Lowercase here once to avoid the case-folding logic below.
|
| + .split(' ', autofillTokens);
|
| + for (const auto& token : autofillTokens) {
|
| + if (token == "current-password" || token == "new-password") {
|
| + data.setPassword(result.getAsUSVString());
|
| + passwordName = element->name();
|
| + } else if (token == "photo") {
|
| + data.setIconURL(result.getAsUSVString());
|
| + } else if (token == "name" || token == "nickname") {
|
| + data.setName(result.getAsUSVString());
|
| + } else if (token == "username") {
|
| + data.setId(result.getAsUSVString());
|
| + idName = element->name();
|
| + }
|
| }
|
| }
|
|
|
|
|