-
Notifications
You must be signed in to change notification settings - Fork 669
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
[selectors-4] Replace :user-valid/:user-invalid definition with HTML spec #9308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure editorially what'd be the best way to do this but the intention of the change looks good. @fantasai / @tabatkins could you take a look?
selectors-4/Overview.bs
Outdated
</form> | ||
</pre> | ||
</div> | ||
The '':user-valid'' and '':user-invalid'' pseudo-classes are defined in HTML here: https://html.spec.whatwg.org/#selector-user-valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd probably do <a href="https://html.spec.whatwg.org/#selector-user-valid">in HTML</a>.
or so (or using some bikeshed magic to get that), rather than dropping the raw URL there.
@tabatkins or @fantasai should look at this as editors, but lgtm for the general change, we shouldn't have two incompatible definitions of these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we'll want language like "are defined by the host language" along with a vague description of what the selectors are about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I brought back the summary paragraph and said that its defined by the host language instead of html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped a suggestion, and think we should restore the example, but after that r+
Co-authored-by: Tab Atkins Jr. <[email protected]>
@tabatkins can we merge this? |
I think this approach doesn't do a good job of keeping a baseline definition for host languages that don't define their own rules. Let me see if I can come up with a sort of halfway step here... |
Happy to take any suggestions or a new PR |
So I think the existing definition that this is removing is a bit of a mess: it seems to talk about relationships between some of the other pseudo-classes ( I think the essence of these pseudo-classes is that they are subsets of So I think perhaps the key things to add back to address @fantasai's concern are:
Hopefully we're ok with dropping the bit about no longer matching when the user returns to the control, given that HTML doesn't say that. (Or do any engines implement that?) |
Yeah I don't think this is a thing. I think that the only case we start matching these and then stop matching them is when the form is reset.
Ok, I added a paragraph to the :valid and :invalid sections. How does it look?
I added a paragraph for this. How does it look? |
Fixes #9257
As suggested here, this definition is not up to par with the HTML definition and should be replaced by it: #9257 (comment)