Skip to content

Commit d67b1bf

Browse files
committed
Spec :user-invalid & :user-valid
Fixes whatwg#8452
1 parent 16c7464 commit d67b1bf

File tree

1 file changed

+46
-15
lines changed

1 file changed

+46
-15
lines changed

source

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51780,17 +51780,18 @@ You cannot submit this form when the field is incorrect.</samp></pre>
5178051780

5178151781
<p>For <code>input</code> elements without a defined <span>input activation behavior</span>, but
5178251782
to which these events <span data-x="concept-input-apply">apply</span>, and for which the user
51783-
interface involves both interactive manipulation and an explicit commit action, then when the user
51784-
changes the element's <span data-x="concept-fe-value">value</span>, the user agent must
51783+
interface involves both interactive manipulation and an explicit commit action, then when the
51784+
user changes the element's <span data-x="concept-fe-value">value</span>, the user agent must
5178551785
<span>queue an element task</span> on the <span>user interaction task source</span> given the
5178651786
<code>input</code> element to <span data-x="concept-event-fire">fire an event</span> named <code
5178751787
data-x="event-input">input</code> at the <code>input</code> element, with the <code
5178851788
data-x="dom-Event-bubbles">bubbles</code> and <code data-x="dom-Event-composed">composed</code>
5178951789
attributes initialized to true, and any time the user commits the change, the user agent must
5179051790
<span>queue an element task</span> on the <span>user interaction task source</span> given the
51791-
<code>input</code> element to <span data-x="concept-event-fire">fire an event</span> named <code
51792-
data-x="event-change">change</code> at the <code>input</code> element, with the <code
51793-
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p>
51791+
<code>input</code> element to set its <span>user-interacted flag</span> to true and <span
51792+
data-x="concept-event-fire">fire an event</span> named <code data-x="event-change">change</code>
51793+
at the <code>input</code> element, with the <code data-x="dom-Event-bubbles">bubbles</code>
51794+
attribute initialized to true.</p>
5179451795

5179551796
<p class="example">An example of a user interface involving both interactive manipulation and a
5179651797
commit action would be a <span data-x="attr-input-type-range">Range</span> controls that use a
@@ -54673,6 +54674,10 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5467354674
default value. If it is false, <span data-x="concept-fe-value">value</span> mirrors the default
5467454675
value. If it is true, the default value is ignored.</p>
5467554676

54677+
<p id="concept-input-value-user-interacted-flag"><span id="concept-textarea-user-interacted"></span><code>input</code>
54678+
and <code>textarea</code> elements have a <dfn>user-interacted flag</dfn>.
54679+
It is initially set to false.</p>
54680+
5467654681
<p>To define the behavior of constraint validation in the face of the <code>input</code>
5467754682
element's <code data-x="attr-input-multiple">multiple</code> attribute, <code>input</code> elements
5467854683
can also have separately defined <dfn data-x="concept-fe-values">value<em>s</em></dfn>.</p>
@@ -58749,6 +58754,8 @@ fur
5874958754
<p>For each element <var>field</var> in <var>controls</var>, in <span>tree order</span>:</p>
5875058755

5875158756
<ol>
58757+
<li>Set <var>field</var>'s <span>user-interacted flag</span> to false.</li>
58758+
5875258759
<li>
5875358760
<p>If any of the following is true:</p>
5875458761

@@ -72549,6 +72556,22 @@ Demos:
7254972556
</ul>
7255072557
</dd>
7255172558

72559+
<dt><dfn selector noexport><code data-x="selector-user-valid">:user-valid</code></dfn></dt>
72560+
<dd>
72561+
<p>The <code data-x="selector-user-valid">:user-valid</code> <span>pseudo-class</span> must
72562+
match elements that have their <span>user-interacted flag</span> set to true, are <span
72563+
data-x="candidate for constraint validation">candidates for constraint validation</span> and
72564+
that <span data-x="concept-fv-valid">satisfy their constraints</span>.</p>
72565+
</dd>
72566+
72567+
<dt><dfn selector noexport><code data-x="selector-user-invalid">:user-invalid</code></dfn></dt>
72568+
<dd>
72569+
<p>The <code data-x="selector-user-invalid">:user-invalid</code> <span>pseudo-class</span> must
72570+
match elements that have their <span>user-interacted flag</span> set to true and are <span
72571+
data-x="candidate for constraint validation">candidates for constraint validation</span> but do
72572+
not <span data-x="concept-fv-valid">satisfy their constraints</span>.</p>
72573+
</dd>
72574+
7255272575
<dt><dfn selector noexport><code data-x="selector-in-range">:in-range</code></dfn></dt>
7255372576
<dd>
7255472577
<p>The <code data-x="selector-in-range">:in-range</code> <span>pseudo-class</span> must match
@@ -77870,16 +77893,24 @@ partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
7787077893
these substeps:</p>
7787177894

7787277895
<ol>
77873-
<li id="unfocus-causes-change-event"><p>If <var>entry</var> is an <code>input</code>
77874-
element, and the <code data-x="event-change">change</code> event <span
77875-
data-x="concept-input-apply">applies</span> to the element, and the element does not have a
77876-
defined <span>activation behavior</span>, and the user has changed the element's <span
77877-
data-x="concept-fe-value">value</span> or its list of <span
77878-
data-x="concept-input-type-file-selected">selected files</span> while the control was focused
77879-
without committing that change (such that it is different to what it was when the control was
77880-
first focused), then <span data-x="concept-event-fire">fire an event</span> named <code
77881-
data-x="event-change">change</code> at the element, with the <code
77882-
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p>
77896+
<li>
77897+
<p>If <var>entry</var> is an <code>input</code>
77898+
element, and the <code data-x="event-change">change</code> event <span
77899+
data-x="concept-input-apply">applies</span> to the element, and the element does not have a
77900+
defined <span>activation behavior</span>, and the user has changed the element's <span
77901+
data-x="concept-fe-value">value</span> or its list of <span
77902+
data-x="concept-input-type-file-selected">selected files</span> while the control was focused
77903+
without committing that change (such that it is different to what it was when the control was
77904+
first focused), then:
77905+
77906+
<ol>
77907+
<li>Change <var>entry</var>'s <span>user-interacted flag</span> to true.</li>
77908+
77909+
<li id="unfocus-causes-change-event"><span data-x="concept-event-fire">Fire an event</span> named <code
77910+
data-x="event-change">change</code> at the element, with the <code
77911+
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</li>
77912+
</ol>
77913+
</li>
7788377914

7788477915
<li>
7788577916
<p>If <var>entry</var> is an element, let <var>blur event target</var> be

0 commit comments

Comments
 (0)