Skip to content

Define the autofill pseudo-class. - #6273

Merged
domenic merged 2 commits into
whatwg:masterfrom
emilio:autofill
Jan 11, 2021
Merged

domenic merged 2 commits into
whatwg:masterfrom
emilio:autofill

Conversation

@emilio

@emilio emilio commented Jan 8, 2021 •

Copy link
Copy Markdown
Contributor

@annevk

annevk commented Jan 8, 2021

Copy link
Copy Markdown
Member

Why is the alias a may? Would any browser not implement it? Is there a test for the alias being done at parse time? And is there a more formal way of defining that?

@emilio

emilio commented Jan 8, 2021

Copy link
Copy Markdown
Contributor Author

It seemed a bit weird to require a WebKit prefix in the HTML spec, it was mostly given as a hint. The alias is somewhat needed for compat right now, but if authors adopt the unprefixed pseudo-class (once implemented everywhere), hopefully eventually it will not.

@annevk

annevk commented Jan 8, 2021

Copy link
Copy Markdown
Member

If everyone implements it we should require it. We do the same webkitMatchesSelector() in DOM for instance. And then if implementations decide to remove it we can do so and change the pass condition for the test, though I'm not sure if it's worth trying to remove these.

@domenic

domenic commented Jan 8, 2021

Copy link
Copy Markdown
Member

Strong +1 for requiring :-webkit-autofill. Even if CSS itself makes it optional, it should be required for HTML user agents.

@emilio

emilio commented Jan 8, 2021

Copy link
Copy Markdown
Contributor Author

Alright, changed it to must, will update the wpt PR as well.

Comment thread source
</ul>
</dd>

<dt><dfn noexport><code data-x="selector-autofill">:autofill</code></dfn></dt>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's just do two <dt>s, one for each selector, so that they're on equal footing?

Also, is there any normative connection we can state with https://html.spec.whatwg.org/#autofill ? It seems like that section is all about the autocomplete="" processing model, so if user agents autofill values beyond just those annotated, then maybe there is no such connection...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's just do two

s, one for each selector, so that they're on equal footing?

Sure, done.

Also, is there any normative connection we can state with https://html.spec.whatwg.org/#autofill ? It seems like that section is all about the autocomplete="" processing model, so if user agents autofill values beyond just those annotated, then maybe there is no such connection...

Yeah, pretty sure autocomplete is not the only thing that is looked at for form autofill...

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I pushed another commit that made them on more equal footing, and also added a note about other sources of autofilling. PTAL to make sure I haven't done anything wrong :).

@emilio

emilio commented Jan 9, 2021

Copy link
Copy Markdown
Contributor Author

Looks good, thanks! I'd keep the mention that :-webkit-autofill is legacy, but it looks good anyways :)

@domenic domenic added the addition/proposal New features or enhancements label Jan 11, 2021
@domenic
domenic merged commit 228e28f into whatwg:master Jan 11, 2021
@emilio
emilio deleted the autofill branch January 11, 2021 19:26
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jan 12, 2021
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this pull request Jan 12, 2021
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 16, 2021
Spec PR at whatwg/html#6273
Tests at web-platform-tests/wpt#27098

Differential Revision: https://phabricator.services.mozilla.com/D101148

UltraBlame original commit: 28268df8154dad7a2e686ff95ad5559a46316cbf
bhearsum pushed a commit to mozilla-releng/staging-firefox that referenced this pull request May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition/proposal New features or enhancements

Development

Successfully merging this pull request may close these issues.

3 participants