@@ -47331,15 +47331,16 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
47331
47331
<div w-nodev>
47332
47332
47333
47333
<p>The <span data-x="concept-form-reset-control">reset algorithm</span> for <code>input</code>
47334
- elements is to set the <span data-x="concept-fe-dirty">dirty value flag</span> and <span
47335
- data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span> back to false, set the
47336
- <span data-x="concept-fe-value">value</span> of the element to the value of the <code
47337
- data-x="attr-input-value">value</code> content attribute, if there is one, or the empty string
47338
- otherwise, set the <span data-x="concept-fe-checked">checkedness</span> of the element to true if
47339
- the element has a <code data-x="attr-input-checked">checked</code> content attribute and false if
47340
- it does not, empty the list of <span data-x="concept-input-type-file-selected">selected
47341
- files</span>, and then invoke the <span>value sanitization algorithm</span>, if the <code
47342
- data-x="attr-input-type">type</code> attribute's current state defines one.</p>
47334
+ elements is to set the <span>user interacted</span>, <span data-x="concept-fe-dirty">dirty value
47335
+ flag</span> and <span data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span>
47336
+ back to false, set the <span data-x="concept-fe-value">value</span> of the element to the value
47337
+ of the <code data-x="attr-input-value">value</code> content attribute, if there is one, or the
47338
+ empty string otherwise, set the <span data-x="concept-fe-checked">checkedness</span> of the
47339
+ element to true if the element has a <code data-x="attr-input-checked">checked</code> content
47340
+ attribute and false if it does not, empty the list of <span
47341
+ data-x="concept-input-type-file-selected">selected files</span>, and then invoke the <span>value
47342
+ sanitization algorithm</span>, if the <code data-x="attr-input-type">type</code> attribute's
47343
+ current state defines one.</p>
47343
47344
47344
47345
<p>Each <code>input</code> element can be <i data-x="concept-fe-mutable">mutable</i>. Except where
47345
47346
otherwise specified, an <code>input</code> element is always <i
@@ -52260,17 +52261,18 @@ You cannot submit this form when the field is incorrect.</samp></pre>
52260
52261
52261
52262
<p>For <code>input</code> elements without a defined <span>input activation behavior</span>, but
52262
52263
to which these events <span data-x="concept-input-apply">apply</span>, and for which the user
52263
- interface involves both interactive manipulation and an explicit commit action, then when the user
52264
- changes the element's <span data-x="concept-fe-value">value</span>, the user agent must
52264
+ interface involves both interactive manipulation and an explicit commit action, then when the
52265
+ user changes the element's <span data-x="concept-fe-value">value</span>, the user agent must
52265
52266
<span>queue an element task</span> on the <span>user interaction task source</span> given the
52266
52267
<code>input</code> element to <span data-x="concept-event-fire">fire an event</span> named <code
52267
52268
data-x="event-input">input</code> at the <code>input</code> element, with the <code
52268
52269
data-x="dom-Event-bubbles">bubbles</code> and <code data-x="dom-Event-composed">composed</code>
52269
52270
attributes initialized to true, and any time the user commits the change, the user agent must
52270
52271
<span>queue an element task</span> on the <span>user interaction task source</span> given the
52271
- <code>input</code> element to <span data-x="concept-event-fire">fire an event</span> named <code
52272
- data-x="event-change">change</code> at the <code>input</code> element, with the <code
52273
- data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p>
52272
+ <code>input</code> element to set its <span>user interacted</span> to true and <span
52273
+ data-x="concept-event-fire">fire an event</span> named <code data-x="event-change">change</code>
52274
+ at the <code>input</code> element, with the <code data-x="dom-Event-bubbles">bubbles</code>
52275
+ attribute initialized to true.</p>
52274
52276
52275
52277
<p class="example">An example of a user interface involving both interactive manipulation and a
52276
52278
commit action would be a <span data-x="attr-input-type-range">Range</span> controls that use a
@@ -52827,6 +52829,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
52827
52829
element to run these steps:</p>
52828
52830
52829
52831
<ol>
52832
+ <li>Set the <code>select</code> element's <span>user interacted</span> to true.</li>
52833
+
52830
52834
<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
52831
52835
data-x="event-input">input</code> at the <code>select</code> element, with the <code
52832
52836
data-x="dom-Event-bubbles">bubbles</code> and <code data-x="dom-Event-composed">composed</code>
@@ -52843,7 +52847,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
52843
52847
data-x="concept-option-selectedness">selectedness</span> to true if the <code>option</code>
52844
52848
element has a <code data-x="attr-option-selected">selected</code> attribute, and false otherwise,
52845
52849
set their <span data-x="concept-option-dirtiness">dirtiness</span> to false, and then have the
52846
- <code>option</code> elements <span>ask for a reset</span>.</p>
52850
+ <code>option</code> elements <span>ask for a reset</span>. The element should also set the
52851
+ <span>user interacted</span> to false.</p>
52847
52852
52848
52853
</div>
52849
52854
@@ -53779,9 +53784,9 @@ interface <dfn interface>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
53779
53784
content</span>.</p>
53780
53785
53781
53786
<p>The <span data-x="concept-form-reset-control">reset algorithm</span> for <code>textarea</code>
53782
- elements is to set the <span data-x="concept-fe-dirty">dirty value flag</span> back to false, and
53783
- set the <span data-x="concept-textarea-raw-value">raw value</span> of element to its <span>child
53784
- text content</span>.</p>
53787
+ elements is to set the user interacted, <span data-x="concept-fe-dirty">dirty value flag</span>
53788
+ back to false, and set the <span data-x="concept-textarea-raw-value">raw value</span> of element
53789
+ to its <span>child text content</span>.</p>
53785
53790
53786
53791
<p>When a <code>textarea</code> element is popped off the <span>stack of open elements</span> of
53787
53792
an <span>HTML parser</span> or <span>XML parser</span>, then the user agent must invoke the
@@ -55169,6 +55174,9 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
55169
55174
default value. If it is false, <span data-x="concept-fe-value">value</span> mirrors the default
55170
55175
value. If it is true, the default value is ignored.</p>
55171
55176
55177
+ <p><code>input</code>, <code>textarea</code> and <code>select</code> elements have an
55178
+ <dfn>user interacted</dfn> (a boolean). It is initially set to false.</p>
55179
+
55172
55180
<p>To define the behavior of constraint validation in the face of the <code>input</code>
55173
55181
element's <code data-x="attr-input-multiple">multiple</code> attribute, <code>input</code> elements
55174
55182
can also have separately defined <dfn data-x="concept-fe-values">value<em>s</em></dfn>.</p>
@@ -58863,7 +58871,7 @@ fur
58863
58871
form</span>.</p>
58864
58872
58865
58873
<li><p>Let <var>entry list</var> be the result of <span>constructing the entry list</span> with
58866
- <var>form</var>, <var>submitter</var>, and <var>encoding </var>.</p></li>
58874
+ <var>form</var>, <var>submitter</var>, <var>encoding</var> and <var>true </var>.</p></li>
58867
58875
58868
58876
<li><p><span>Assert</span>: <var>entry list</var> is not null.</p></li>
58869
58877
@@ -59239,8 +59247,8 @@ fur
59239
59247
59240
59248
<p>The algorithm to <dfn id="constructing-the-form-data-set" export data-lt="constructing the
59241
59249
entry list" data-x="constructing the entry list">construct the entry list</dfn> given a
59242
- <var>form</var>, an optional <var>submitter</var>, and an optional <var>encoding </var>, is as
59243
- follows. If not specified otherwise, <var>submitter</var> is null.</p>
59250
+ <var>form</var>, an optional <var>submitter</var>, an optional <var>setUserInteracted </var>
59251
+ and an optional <var>encoding</var>, is as follows. If not specified otherwise, <var>submitter</var> is null.</p>
59244
59252
59245
59253
<ol>
59246
59254
<li><p>If <var>form</var>'s <span>constructing entry list</span> is true, then return
@@ -59257,6 +59265,8 @@ fur
59257
59265
<p>For each element <var>field</var> in <var>controls</var>, in <span>tree order</span>:</p>
59258
59266
59259
59267
<ol>
59268
+ <li>If <var>setUserInteracted</var> is true, set <var>field</var>'s <span>user interacted</span> to true.</li>
59269
+
59260
59270
<li>
59261
59271
<p>If any of the following is true:</p>
59262
59272
@@ -73089,6 +73099,32 @@ Demos:
73089
73099
</ul>
73090
73100
</dd>
73091
73101
73102
+ <dt><dfn selector noexport><code data-x="selector-user-valid">:user-valid</code></dfn></dt>
73103
+ <dd>
73104
+ <p>The <code data-x="selector-user-valid">:user-valid</code> <span>pseudo-class</span> must match
73105
+ any element falling into one of the following categories:</p>
73106
+ <ul>
73107
+ <li><code>input</code> and <code>textarea</code> elements that have their <span>user interacted</span>
73108
+ set to true, are <span data-x="candidate for constraint validation">candidates for constraint validation</span>
73109
+ and that <span data-x="concept-fv-valid">satisfy their constraints</span>.</li>
73110
+ <li><span data-x="concept-button">Buttons</span> and other built-in elements that are <span data-x="candidate for constraint validation">candidates
73111
+ for constraint validation</span> and that <span data-x="concept-fv-valid">satisfy their constraints</span>.</li>
73112
+ </ul>
73113
+ </dd>
73114
+
73115
+ <dt><dfn selector noexport><code data-x="selector-user-invalid">:user-invalid</code></dfn></dt>
73116
+ <dd>
73117
+ <p>The <code data-x="selector-user-invalid">:user-invalid</code> <span>pseudo-class</span> must match
73118
+ any element falling into one of the following categories:</p>
73119
+ <ul>
73120
+ <li><code>input</code> and <code>textarea</code> elements that have their <span>user interacted</span>
73121
+ set to true, are <span data-x="candidate for constraint validation">candidates for constraint validation</span>
73122
+ but do not <span data-x="concept-fv-valid">satisfy their constraints</span>.</li>
73123
+ <li><span data-x="concept-button">Buttons</span> and other built-in elements that are <span data-x="candidate for constraint validation">candidates
73124
+ for constraint validation</span> but do not <span data-x="concept-fv-valid">satisfy their constraints</span>.</li>
73125
+ </ul>
73126
+ </dd>
73127
+
73092
73128
<dt><dfn selector noexport><code data-x="selector-in-range">:in-range</code></dfn></dt>
73093
73129
<dd>
73094
73130
<p>The <code data-x="selector-in-range">:in-range</code> <span>pseudo-class</span> must match
@@ -78542,16 +78578,24 @@ partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
78542
78578
these substeps:</p>
78543
78579
78544
78580
<ol>
78545
- <li id="unfocus-causes-change-event"><p>If <var>entry</var> is an <code>input</code>
78546
- element, and the <code data-x="event-change">change</code> event <span
78547
- data-x="concept-input-apply">applies</span> to the element, and the element does not have a
78548
- defined <span>activation behavior</span>, and the user has changed the element's <span
78549
- data-x="concept-fe-value">value</span> or its list of <span
78550
- data-x="concept-input-type-file-selected">selected files</span> while the control was focused
78551
- without committing that change (such that it is different to what it was when the control was
78552
- first focused), then <span data-x="concept-event-fire">fire an event</span> named <code
78553
- data-x="event-change">change</code> at the element, with the <code
78554
- data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p>
78581
+ <li>
78582
+ <p>If <var>entry</var> is an <code>input</code>
78583
+ element, and the <code data-x="event-change">change</code> event <span
78584
+ data-x="concept-input-apply">applies</span> to the element, and the element does not have a
78585
+ defined <span>activation behavior</span>, and the user has changed the element's <span
78586
+ data-x="concept-fe-value">value</span> or its list of <span
78587
+ data-x="concept-input-type-file-selected">selected files</span> while the control was focused
78588
+ without committing that change (such that it is different to what it was when the control was
78589
+ first focused), then:
78590
+
78591
+ <ol>
78592
+ <li>Set <var>entry</var>'s <span>user interacted</span> to true.</li>
78593
+
78594
+ <li id="unfocus-causes-change-event"><span data-x="concept-event-fire">Fire an event</span> named <code
78595
+ data-x="event-change">change</code> at the element, with the <code
78596
+ data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</li>
78597
+ </ol>
78598
+ </li>
78555
78599
78556
78600
<li>
78557
78601
<p>If <var>entry</var> is an element, let <var>blur event target</var> be
0 commit comments