-
Notifications
You must be signed in to change notification settings - Fork 39
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
:autofill pseudo class always returns true #129
Comments
@zuzusik If I recall correctly the additions of these pseudo-class stems from a jsdom request to avoid breaking the process for all of the pseudo-class starting with "-webkit-" to be ignored and considered as invalid selectors, producing a "false" match but continuing the processing of the complete selector input. This was back in the days were none of these pseudo-classes was contemplated by any selectors specification. Only later, when the "-webkit-autofill" started appearing as a possible pseudo-class selector developers realized that choice to be wrong and started to be a problem. At that point I tried to revert the code to return a "noop" instead of a "false" match result and ended up adding the lines after the existing ones while probably they should have been added before the single ":" and double "::" resolvers. Here is the relevant code lines in the sources:
So currently that's the mess we are at. My suggestion is to change the resolver in a way it doesn't hurt us in the future when more of these sophisticated selectors will appear as valid. I am open to suggestions keeping in mind that we should absolutely mimic today's browsers functionality regarding this and if necessary have flags to let users change behaviour. |
Obviously the code should check if the property yielding the true result does effectively allow for such a property and pseudo-class as we normally do for any other selectors considered valid. |
Yeah, this seems reasonable to me - looking at the snippet you provided I agree that
I don't think it is really possible to detect auto-fill from Javascript, other than checking if the element is returned with respective |
It might be reasonable to always return
false
instead - autofill is not really possible in this environmentAutofill pseudo class: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
The text was updated successfully, but these errors were encountered: