CSS :autofill pseudo-class is not working for form-history filling
Categories
(Toolkit :: Autocomplete, defect)
Tracking
()
People
(Reporter: zozuliak, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
1.26 MB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Steps to reproduce:
Go to https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
Scroll down to Try It section
Try picking any autofill values that browser suggests
Actual results:
The CSS styles for :autfill pseudo class aren't applied - look at attached screenshot, notice no orange border around the input
Calling .match(":autofill") on the element returns false
Expected results:
The CSS styles for :autfill pseudo class are applied - this works well in Chrome and Safari
Calling .match(":autofill") on the element returns true
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
Did this work in earlier Firefox versions? If so, using mozregression to identify when it broke would be really helpful.
So MDN says :autofill is fully supported starting from Firefox version 86. I have downloaded 86 for Mac and can confirm it actually doesn't work there. Then 86 automatically updated to 109 and :autofill doesn't work there either. It seems like this has never really worked although it was officially shipped.
Related links:
Comment 4•2 years ago
|
||
Yeah, it doesn't appear to work for me on the MDN examples either. But does work in some other cases; e.g. I used the Inspector to add an :autofill rule to the amazon.co.uk login page, and that worked as expected when Firefox filled in my email.
So I think this is an issue of exactly when the browser considers the field to be "auto-filled" vs "set by the user". Emilio, do you know more about what's involved here?
Comment 5•2 years ago
|
||
Yeah, autofill matches only with user / password / etc autofill.
E.g. if you go here, everything that becomes yellow when you fill a login matches :autofill.
It's unclear if we should consider the other form filling stuff as autofill, Dimi wdyt?
Other major browsers, Chrome and Safari, consider it autofill when user selects from prompt which comes from autocomplete input functionality.
More over, the spec itself mentions it:
https://html.spec.whatwg.org/multipage/semantics-other.html#selector-autofill
One way such autofilling might happen is via the autocomplete attribute, but user agents could autofill even without that attribute being involved.
So I think Firefox actually should consider autocomplete as autofill
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Not opposed to making that change. The toolkit code is what manages this and should set the pseudo-class.
Comment 8•2 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #5)
It's unclear if we should consider the other form filling stuff as autofill, Dimi wdyt?
Yes, I agree this should be considered as autofill. Currently, there are discrepancies in how we display autofill or preview states across form history, login, address, and credit card modules. We plan to unify the behavior across all these modules, and this is included in our roadmap. This issue will be addressed as part of that unification work.
Description
•