Skip to content

Commit fd1b37c

Browse files
committed
[selectors] Add spec text for :user-valid.
1 parent 7b2b399 commit fd1b37c

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

selectors-4/Overview.bs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,21 +2606,29 @@ The Optionality Pseudo-classes: '':required'' and '':optional''</h4>
26062606
form elements are neither required nor optional.
26072607

26082608
<h4 id="user-pseudos">
2609-
The User-interaction Pseudo-class: '':user-invalid''</h4>
2609+
The User-interaction Pseudo-classes: '':user-valid'' and '':user-invalid''</h4>
2610+
2611+
The <dfn id="user-invalid-pseudo">:user-invalid</dfn>
2612+
and the <dfn id="user-valid-pseudo">:user-valid</dfn> pseudo-classes
2613+
represent an element with incorrect or correct input, respectively,
2614+
but only <em>after</em> the user has significantly interacted with it.
26102615

2611-
The <dfn id="user-invalid-pseudo">:user-invalid</dfn> pseudo-class
2612-
represents an element with incorrect input, but only
2613-
<em>after</em> the user has significantly interacted with it.
26142616
The '':user-invalid'' pseudo-class
2615-
must match an '':invalid'', '':out-of-range'', or blank-but-'':required'' elements
2616-
between the time the user has attempted to submit the form
2617-
and before the user has interacted again with the form element.
2618-
User-agents may allow it to match such elements at other times,
2617+
must match an '':invalid'', '':out-of-range'', or
2618+
blank-but-'':required'' elements between the time the user has attempted
2619+
to submit the form and before the user has interacted again with the
2620+
form element.
2621+
2622+
The '':user-valid'' pseudo-class must match a '':valid'' element between the
2623+
time the user has attempted to submit the form and before the user has
2624+
interacted again with the form element.
2625+
2626+
User-agents may allow them to match such elements at other times,
26192627
as would be appropriate for highlighting an error to the user.
2620-
For example, a UA may choose to have '':user-invalid'' match
2621-
an '':invalid'' element once the user has typed some text into it
2622-
and changed the focus to another element,
2623-
and to stop matching only after the user has successfully corrected the input.
2628+
For example, a UA may choose to have '':user-invalid'' match an
2629+
'':invalid'' element once the user has typed some text into it and
2630+
changed the focus to another element, and to stop matching only after
2631+
the user has successfully corrected the input.
26242632

26252633
<div class='example'>
26262634
For example, the input in the following document fragment
@@ -2642,8 +2650,6 @@ The User-interaction Pseudo-class: '':user-invalid''</h4>
26422650

26432651
Issue: Cross-check with <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/%3A-moz-ui-invalid">'':-moz-ui-invalid''</a>.
26442652

2645-
Issue: Add <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/%3A-moz-ui-valid">:-moz-ui-valid</a> as '':user-valid'' per WG resolution.
2646-
26472653
Issue: Evaluate proposed <a href="https://lists.w3.org/Archives/Public/www-style/2014Feb/0511.html">:dirty pseudo-class</a>
26482654

26492655
Issue: Clarify that this (and '':invalid''/'':valid'') can apply to form and fieldset elements.

0 commit comments

Comments
 (0)