1919
2020 < h1 id =title > Selectors Level 4</ h1 >
2121
22- < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 14 August 2012</ h2 >
22+ < h2 class ="no-num no-toc " id =longstatus-date > Editor's Draft 16 August 2012</ h2 >
2323
2424 < dl >
2525 < dt > This version: <!--
26- <dd><a href="http://www.w3.org/TR/2012/ED-selectors4-20120814 /">
27- http://www.w3.org/TR/2012/WD-selectors4-20120814 /</a>
26+ <dd><a href="http://www.w3.org/TR/2012/ED-selectors4-20120816 /">
27+ http://www.w3.org/TR/2012/WD-selectors4-20120816 /</a>
2828
2929 <dt>Editor's draft:
3030-->
@@ -320,8 +320,8 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
320320 default option pseudo-class < code > :default</ code > </ a >
321321
322322 < li > < a href ="#validity-pseudos "> < span class =secno > 11.5. </ span > The
323- validity pseudo-classes: < code > :valid</ code > , < code > :invalid </ code > ,
324- and < code > :user-error </ code > </ a >
323+ validity pseudo-classes: < code > :valid</ code > and
324+ < code > :invalid </ code > </ a >
325325
326326 < li > < a href ="#range-pseudos "> < span class =secno > 11.6. </ span > The range
327327 pseudo-classes < code > :in-range</ code > and
@@ -331,7 +331,10 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
331331 optionality pseudo-classes < code > :required</ code > and
332332 < code > :optional</ code > </ a >
333333
334- < li > < a href ="#rw-pseudos "> < span class =secno > 11.8. </ span > The mutability
334+ < li > < a href ="#user-pseudos "> < span class =secno > 11.8. </ span > The
335+ user-interaction pseudo-class < code > :user-error</ code > </ a >
336+
337+ < li > < a href ="#rw-pseudos "> < span class =secno > 11.9. </ span > The mutability
335338 pseudo-classes < code > :read-only</ code > and < code > :read-write</ code > </ a >
336339
337340 </ ul >
@@ -1240,14 +1243,14 @@ <h3 id=scoping><span class=secno>3.3. </span> Scoped Selectors</h3>
12401243 href ="#scope-pseudo "> < code > :scope</ code > </ a > pseudo-class.
12411244
12421245 < div class =example >
1243- < p > For example, the < code > document .querySelector()</ code > function
1244- defined in < a href ="#SELECTORS-API2 "
1246+ < p > For example, the < code > element .querySelector()</ code > function defined
1247+ in < a href ="#SELECTORS-API2 "
12451248 rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > allows the
12461249 author to define a < a
12471250 href ="#scope-constrained "> < i > scope-constrained</ i > </ a > selector.
12481251
1249- < p > On the other hand, the < code > document .find()</ code > function defined
1250- in < a href ="#SELECTORS-API2 "
1252+ < p > On the other hand, the < code > element .find()</ code > function defined in
1253+ < a href ="#SELECTORS-API2 "
12511254 rel =biblioentry > [SELECTORS-API2]<!--{{SELECTORS-API2}}--> </ a > and the
12521255 selectors within an < a href ="#HTML5 "
12531256 rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > scoped stylesheet, define < a
@@ -1894,7 +1897,8 @@ <h3 id=attribute-case><span class=secno>6.3. </span> Case-sensitivity</h3>
18941897 has a value of < code > hsides</ code > , whether that value is represented as
18951898 < code > hsides</ code > , < code > HSIDES</ code > , < code > hSides</ code > , etc. even
18961899 in an XML environment where attribute values are case-sensitive.
1897- f<!-- --> [frame=hsides i] { border-style: solid none; }
1900+
1901+ < pre > [frame=hsides i] { border-style: solid none; }</ pre >
18981902 </ div >
18991903 <!-- plinss notes we may eventually want to choose other normalizations
19001904 for attribute matching; but since there's no normalization scheme
@@ -2787,64 +2791,27 @@ <h3 id=the-default-pseudo><span class=secno>11.4. </span> The default
27872791 selection of pizza toppings for example.
27882792
27892793 < h3 id =validity-pseudos > < span class =secno > 11.5. </ span > The validity
2790- pseudo-classes: < a href ="#valid-pseudo "> < code > :valid</ code > </ a > , < a
2791- href ="#invalid-pseudo "> < code > :invalid</ code > </ a > , and < a
2792- href ="#user-error-pseudo "> < code > :user-error</ code > </ a > </ h3 >
2794+ pseudo-classes: < a href ="#valid-pseudo "> < code > :valid</ code > </ a > and < a
2795+ href ="#invalid-pseudo "> < code > :invalid</ code > </ a > </ h3 >
27932796
27942797 < p > An element is < dfn id =valid-pseudo > :valid</ dfn > or < dfn
27952798 id =invalid-pseudo > :invalid</ dfn > when its contents or value is,
27962799 respectively, valid or invalid with respect to data validity semantics
27972800 defined by the document language (e.g. [[XFORMS10]] or < a href ="#HTML5 "
2798- rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > ).
2801+ rel =biblioentry > [HTML5]<!--{{HTML5}}--> </ a > ). An element which lacks data
2802+ validity semantics is neither < a
2803+ href ="#valid-pseudo "> < code > :valid</ code > </ a > nor < a
2804+ href ="#invalid-pseudo "> < code > :invalid</ code > </ a > .
27992805
2800- < p > Note that there is a difference between an element which has no
2801- constraints, and thus would always be < a
2806+ < p class = note > Note that there is a difference between an element which has
2807+ no constraints, and thus would always be < a
28022808 href ="#valid-pseudo "> < code > :valid</ code > </ a > , and one which has no data
28032809 validity semantics at all, and thus is neither < a
28042810 href ="#valid-pseudo "> < code > :valid</ code > </ a > nor < a
28052811 href ="#invalid-pseudo "> < code > :invalid</ code > </ a > . In HTML, for example, an
28062812 < code > <input type="text"> </ code > element may have no constraints, but a
28072813 < code > <p> </ code > element has no validity semantics at all, and so it
2808- never matches either of these pseudoclasses.
2809-
2810- < p > The < dfn id =user-error-pseudo > :user-error</ dfn > pseudo-class matches
2811- the same elements as < a href ="#invalid-pseudo "> < code > :invalid</ code > </ a > ,
2812- but it only does so after the user has interacted with them. The < a
2813- href ="#user-error-pseudo "> < code > :user-error</ code > </ a > pseudo-class must
2814- match elements that are invalid after the user attempts to submit the form
2815- containing them. User-agents may allow it to match invalid elements
2816- earlier, if they determine (in a UA-specific manner) that the user has
2817- "significantly interacted" with them.
2818-
2819- < div class =example >
2820- < p > For example, the input in the following document fragment would match
2821- < a href ="#invalid-pseudo "> < code > :invalid</ code > </ a > as soon as the page
2822- is loaded (because it’s empty, which violates the "required"
2823- constraint), but it won't match < a
2824- href ="#user-error-pseudo "> < code > :user-error</ code > </ a > until the user
2825- significantly interacts with the element, or attempts to submit the form
2826- it's part of.
2827-
2828- < pre > <!--
2829- --> <form>
2830- <!--
2831- --> <label>
2832- <!--
2833- --> First Name:
2834- <!--
2835- --> <input name='first-name' required value=''>
2836- <!--
2837- --> </label>
2838- <!--
2839- --> ...
2840- <!--
2841- --> </form> </pre>
2842- </ pre >
2843- </ div >
2844-
2845- < p class =issue > What parts of < a
2846- href ="https://developer.mozilla.org/en-US/docs/CSS/:-moz-ui-invalid "> :-moz-ui-invalid
2847- description</ a > do we want to spec here? Or put as examples?
2814+ never matches either of these pseudo-classes.
28482815
28492816 < h3 id =range-pseudos > < span class =secno > 11.6. </ span > The range
28502817 pseudo-classes < a href ="#in-range-psuedo "> < code > :in-range</ code > </ a > and
@@ -2875,7 +2842,69 @@ <h3 id=opt-pseudos><span class=secno>11.7. </span> The optionality
28752842 submitted. Elements that are not form elements are neither required nor
28762843 optional.
28772844
2878- < h3 id =rw-pseudos > < span class =secno > 11.8. </ span > The mutability
2845+ < h3 id =user-pseudos > < span class =secno > 11.8. </ span > The user-interaction
2846+ pseudo-class < a href ="#user-error-pseudo "> < code > :user-error</ code > </ a > </ h3 >
2847+
2848+ < p > The < dfn id =user-error-pseudo > :user-error</ dfn > pseudo-class represents
2849+ an input element with incorrect input, but only < em > after</ em > the user
2850+ has significantly interacted with it. The < a
2851+ href ="#user-error-pseudo "> < code > :user-error</ code > </ a > pseudo-class must
2852+ match an < a href ="#invalid-pseudo "> < code > :invalid</ code > </ a > , < a
2853+ href ="#out-of-range-pseudo "> < code > :out-of-range</ code > </ a > , or
2854+ empty-but-< a href ="#required-pseudo "> < code > :required</ code > </ a > form
2855+ element between the time the user has attempted to submit the form and
2856+ before the user has interacted again with the form element. User-agents
2857+ may allow it to match such elements at other times, as would be
2858+ appropriate for highlighting an error to the user. For example, a UA may
2859+ choose to have < a href ="#user-error-pseudo "> < code > :user-error</ code > </ a >
2860+ match an < a href ="#invalid-pseudo "> < code > :invalid</ code > </ a > element once
2861+ the user has typed some text into it and changed the focus to another
2862+ element, and to stop matching only after the user has successfully
2863+ corrected the input.
2864+
2865+ < div class =example >
2866+ < p > For example, the input in the following document fragment would match
2867+ < a href ="#invalid-pseudo "> < code > :invalid</ code > </ a > as soon as the page
2868+ is loaded (because it the initial value violates the max-constraint), but
2869+ it won’t match < a
2870+ href ="#user-error-pseudo "> < code > :user-error</ code > </ a > until the user
2871+ significantly interacts with the element, or attempts to submit the form
2872+ it's part of.
2873+
2874+ < pre > <!--
2875+ --> <form>
2876+ <!--
2877+ --> <label>
2878+ <!--
2879+ --> Volume:
2880+ <!--
2881+ --> <input name='vol' type=number min=0 max=10 value=11>
2882+ <!--
2883+ --> </label>
2884+ <!--
2885+ --> ...
2886+ <!--
2887+ --> </form> </pre>
2888+ </ pre >
2889+ </ div >
2890+ <!--
2891+ <p class="issue">
2892+ If it's necessary to distinguish between omitted and invalid values,
2893+ <code>:user-invalid</code> and <code>:user-omitted</code> could be used.
2894+ -->
2895+
2896+ < p class =issue > What parts of < a
2897+ href ="https://developer.mozilla.org/en-US/docs/CSS/:-moz-ui-invalid "> :-moz-ui-invalid
2898+ description</ a > do we want to spec here? Or put as examples?
2899+
2900+ < p class =issue > There was a suggestion to have a
2901+ < code > :user-interacted</ code > pseudo-class instead of or in addition to
2902+ this one. It's unclear what the criteria would be for matching it,
2903+ however. In particular, it seems unlikely to be a replacement of this one
2904+ if form validation of an untouched form control is not part of the
2905+ criteria.
2906+
2907+ < h3 id =rw-pseudos > < span class =secno > 11.9. </ span > The mutability
28792908 pseudo-classes < a href ="#read-only-pseudo "> < code > :read-only</ code > </ a > and
28802909 < a href ="#read-write-pseudo "> < code > :read-write</ code > </ a > </ h3 >
28812910
0 commit comments