Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(autocomplete): add chrome suggestions, invalid warning #11342

Merged
merged 90 commits into from
Sep 2, 2020

Conversation

gMakunde
Copy link
Contributor

Summary

This pull request improves the autocomplete audit by suggesting correct attributes using chrome heuristics and pointing out incorrect autocomplete prefixes.

refactoring

Formerly, autocomplete enforced on every input type, now it is only enforced on input types that chrome heruristics determines needs an autofill attribute.

https://docs.google.com/document/d/1yiulNnV8uEy1jPaAEmWeHxHcQOzxpqvAV4hOFpXLJ1M/edit#heading=h.gjgriz8s7dlc
https://docs.google.com/document/d/1uu3rs3vX8tBhosnXTFvvZn6-UvE1lkd48WVbjbsd4Ds/edit

Related Issues/PRs

Issue #10450
Pull request #11062
Pull request #11186

@gMakunde gMakunde requested a review from a team as a code owner August 28, 2020 04:49
@gMakunde gMakunde requested review from connorjclark and removed request for a team August 28, 2020 04:49
@gMakunde gMakunde changed the title audit: add autocomplete to default config core: add autocomplete to default config Aug 28, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@gMakunde
Copy link
Contributor Author

@connorjclark @paulirish
here is an example of it being ran on the smokepage
report

example page with incorrect attributes: example page
report

example page with only off autocomplete: example page
report

example page where it passes: example page
report

@gMakunde
Copy link
Contributor Author

gMakunde commented Aug 28, 2020

Here is some important documentation that will give more context about autocomplete prefix tokens, and their ordering

https://cloudfour.com/thinks/autofill-what-web-devs-should-know-but-dont/#all-the-tokens

Edit: Now switching to calling them "optional tokens" not "prefix tokens"

tweak quotes in the form expecations file
q.txt Outdated Show resolved Hide resolved
Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last things then LGTM!

@@ -25,10 +25,161 @@ const UIStrings = {
'effort, consider enabling autocomplete by setting the `autocomplete` ' +
'attribute to a valid value.' +
' [Learn more](https://developers.google.com/web/fundamentals/design-and-ux/input/forms#use_metadata_to_enable_auto-complete)',
/** Label for a column in a data table; entries will be the autocomplete token suggestions based on heuristics. */
columnAutocompleteSuggestions: 'Autocomplete Suggested Token',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove Autocomplete from both of these column header strings?

lighthouse-core/audits/autocomplete.js Outdated Show resolved Hide resolved
lighthouse-core/audits/autocomplete.js Outdated Show resolved Hide resolved
types/artifacts.d.ts Outdated Show resolved Hide resolved
@connorjclark connorjclark changed the title core(autocomplete): add chrome prediction suggestion and invalid value warning core(autocomplete): add chrome suggestions and invalid value warning Sep 2, 2020
@connorjclark connorjclark changed the title core(autocomplete): add chrome suggestions and invalid value warning core(autocomplete): add chrome suggestions, invalid warning Sep 2, 2020
@connorjclark connorjclark merged commit db039c9 into GoogleChrome:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants