|
|
Chromium Code Reviews
DescriptionAllow PasswordCredential instantiation when an input element has multiple 'autocomplete' tokens.
BUG=651298
Committed: https://crrev.com/24a145b4b6485c3c8c5a45ff4019e5c7f1bf045b
Cr-Commit-Position: refs/heads/master@{#431540}
Patch Set 1 #
Total comments: 5
Patch Set 2 : comments #Patch Set 3 : PasswordCredential.cpp #
Total comments: 2
Patch Set 4 : change test #
Messages
Total messages: 28 (17 generated)
The CQ bit was checked by vasilii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
vasilii@chromium.org changed reviewers: + mkwst@chromium.org
Hi Mike, please review.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
haraken@chromium.org changed reviewers: + haraken@chromium.org
https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... File third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp (right): https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp:72: auto hasToken = [&autofillTokens](const StringView& expectedToken) { Nit: The lambda function is allowed in the style guide but is not commonly used in Blink. I'd prefer using a simple helper function.
https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html (right): https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html:197: }, 'PasswordCredential creation from `HTMLFormElement` with no multiple autocomplete attributes'); Nit: s/ no// https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... File third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp (right): https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp:72: auto hasToken = [&autofillTokens](const StringView& expectedToken) { On 2016/11/10 at 02:01:51, haraken wrote: > Nit: The lambda function is allowed in the style guide but is not commonly used in Blink. I'd prefer using a simple helper function. It also seems like it would be more efficient to loop through the list once rather than once for each token we care about. That is, I'd prefer something like: ``` 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") { ... } else if (...) { ... } } ```
https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html (right): https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html:197: }, 'PasswordCredential creation from `HTMLFormElement` with no multiple autocomplete attributes'); On 2016/11/10 07:46:39, Mike West wrote: > Nit: s/ no// Done. https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... File third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp (right): https://codereview.chromium.org/2492553002/diff/1/third_party/WebKit/Source/m... third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp:72: auto hasToken = [&autofillTokens](const StringView& expectedToken) { On 2016/11/10 07:46:39, Mike West wrote: > On 2016/11/10 at 02:01:51, haraken wrote: > > Nit: The lambda function is allowed in the style guide but is not commonly > used in Blink. I'd prefer using a simple helper function. > > It also seems like it would be more efficient to loop through the list once > rather than once for each token we care about. That is, I'd prefer something > like: > > ``` > 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") { > ... > } else if (...) { > ... > } > } > ``` Done.
The CQ bit was checked by vasilii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The red bots aren't my fault.
The CQ bit was checked by vasilii@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Please review.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2492553002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html (right): https://codereview.chromium.org/2492553002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html:197: }, 'PasswordCredential creation from `HTMLFormElement` with multiple autocomplete attributes'); Can you please add junk values to each of the `autocomplete` slots? We already test most of the behavior above; the only new thing here is multiple values in the `autocomplete` attribute. So, `autocomplete='current-password value1 value2'`, and so on can verify the various other branches of the `if` in your code. LGTM with that change.
https://codereview.chromium.org/2492553002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html (right): https://codereview.chromium.org/2492553002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html:197: }, 'PasswordCredential creation from `HTMLFormElement` with multiple autocomplete attributes'); On 2016/11/11 08:09:45, Mike West wrote: > Can you please add junk values to each of the `autocomplete` slots? We already > test most of the behavior above; the only new thing here is multiple values in > the `autocomplete` attribute. So, `autocomplete='current-password value1 > value2'`, and so on can verify the various other branches of the `if` in your > code. > > LGTM with that change. Done.
The CQ bit was checked by vasilii@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mkwst@chromium.org Link to the patchset: https://codereview.chromium.org/2492553002/#ps60001 (title: "change test")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Allow PasswordCredential instantiation when an input element has multiple 'autocomplete' tokens. BUG=651298 ========== to ========== Allow PasswordCredential instantiation when an input element has multiple 'autocomplete' tokens. BUG=651298 Committed: https://crrev.com/24a145b4b6485c3c8c5a45ff4019e5c7f1bf045b Cr-Commit-Position: refs/heads/master@{#431540} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/24a145b4b6485c3c8c5a45ff4019e5c7f1bf045b Cr-Commit-Position: refs/heads/master@{#431540} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
