Skip to content

Commit

Permalink
Rename user interacted to user validity and adjust when it is set
Browse files Browse the repository at this point in the history
Fixes #10066. This should match WebKit and (soon) Gecko.
  • Loading branch information
emilio committed Feb 2, 2024
1 parent 57f9791 commit 055a678
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions source
Expand Up @@ -47657,8 +47657,9 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
<div w-nodev>

<p>The <span data-x="concept-form-reset-control">reset algorithm</span> for <code>input</code>
elements is to set the <span>user interacted</span>, <span data-x="concept-fe-dirty">dirty value
flag</span>, and <span data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span>
elements is to set its <span>user validity</span>,
<span data-x="concept-fe-dirty">dirty value flag</span>, and
<span data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span>
back to false, set the <span data-x="concept-fe-value">value</span> of the element to the value
of the <code data-x="attr-input-value">value</code> content attribute, if there is one, or the
empty string otherwise, set the <span data-x="concept-fe-checked">checkedness</span> of the
Expand Down Expand Up @@ -52602,7 +52603,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
data-x="dom-Event-bubbles">bubbles</code> and <code data-x="dom-Event-composed">composed</code>
attributes initialized to true, and any time the user commits the change, the user agent must
<span>queue an element task</span> on the <span>user interaction task source</span> given the
<code>input</code> element to set its <span>user interacted</span> to true and <span
<code>input</code> element to set its <span>user validity</span> to true and <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-change">change</code>
at the <code>input</code> element, with the <code data-x="dom-Event-bubbles">bubbles</code>
attribute initialized to true.</p>
Expand Down Expand Up @@ -53171,7 +53172,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
element to run these steps:</p>

<ol>
<li>Set the <code>select</code> element's <span>user interacted</span> to true.</li>
<li>Set the <code>select</code> element's <span>user validity</span> to true.</li>

<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
data-x="event-input">input</code> at the <code>select</code> element, with the <code
Expand All @@ -53187,7 +53188,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
element <var>selectElement</var> is:</p>

<ol>
<li><p>Set <var>selectElement</var>'s <span>user interacted</span> to false.</p></li>
<li><p>Set <var>selectElement</var>'s <span>user validity</span> to false.</p></li>

<li>
<p><span data-x="list iterate">For each</span> <var>optionElement</var> of
Expand Down Expand Up @@ -54161,7 +54162,7 @@ interface <dfn interface>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
content</span>.</p>

<p>The <span data-x="concept-form-reset-control">reset algorithm</span> for <code>textarea</code>
elements is to set the <span>user interacted</span> to false, <span
elements is to set the <span>user validity</span> to false, <span
data-x="concept-fe-dirty">dirty value flag</span> back to false, and set the <span
data-x="concept-textarea-raw-value">raw value</span> of element to its <span>child text
content</span>.</p>
Expand Down Expand Up @@ -55562,8 +55563,8 @@ interface <dfn interface>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
default value. If it is false, <span data-x="concept-fe-value">value</span> mirrors the default
value. If it is true, the default value is ignored.</p>

<p><code>input</code>, <code>textarea</code> and <code>select</code> elements have a <dfn>user
interacted</dfn> boolean. It is initially set to false.</p>
<p><code>input</code>, <code>textarea</code> and <code>select</code> elements have a
<dfn>user validity</dfn> boolean. It is initially set to false.</p>

<p>To define the behavior of constraint validation in the face of the <code>input</code>
element's <code data-x="attr-input-multiple">multiple</code> attribute, <code>input</code> elements
Expand Down Expand Up @@ -59222,6 +59223,10 @@ fur

<li><p>Set <var>form</var>'s <span>firing submission events</span> to true.</p></li>

<li><p>For each element <var>field</var> in the list of
<span data-x="category-submit">submittable elements</span> whose <span>form owner</span> is
<var>form</var>, set <var>field</var>'s <span>user validity</span> to true.

<li>
<p>If the <var>submitter</var> element's <span data-x="concept-fs-novalidate">no-validate
state</span> is false, then <span>interactively validate the constraints</span> of
Expand Down Expand Up @@ -59263,7 +59268,7 @@ fur
form</span>.</p>

<li><p>Let <var>entry list</var> be the result of <span>constructing the entry list</span> with
<var>form</var>, <var>submitter</var>, <var>encoding</var>, and true.</p></li>
<var>form</var>, <var>submitter</var>, and <var>encoding</var>.</p></li>

<li><p><span>Assert</span>: <var>entry list</var> is not null.</p></li>

Expand Down Expand Up @@ -59644,8 +59649,8 @@ fur

<p>To <dfn id="constructing-the-form-data-set" export data-lt="constructing the entry list"
data-x="constructing the entry list">construct the entry list</dfn> given a <var>form</var>, an
optional <var>submitter</var> (default null), an optional <var>encoding</var> (default
<span>UTF-8</span>), and an optional <var>setUserInteracted</var> (default false):
optional <var>submitter</var> (default null), and an optional <var>encoding</var> (default
<span>UTF-8</span>):

<ol>
<li><p>If <var>form</var>'s <span>constructing entry list</span> is true, then return
Expand All @@ -59662,9 +59667,6 @@ fur
<p>For each element <var>field</var> in <var>controls</var>, in <span>tree order</span>:</p>

<ol>
<li><p>If <var>setUserInteracted</var> is true, then set <var>field</var>'s <span>user
interacted</span> to true.</p></li>

<li>
<p>If any of the following are true:</p>

Expand Down Expand Up @@ -74039,19 +74041,19 @@ Demos:
<dt><dfn selector noexport><code data-x="selector-user-valid">:user-valid</code></dfn></dt>
<dd>
<p>The <code data-x="selector-user-valid">:user-valid</code> <span>pseudo-class</span> must
match <code>input</code>, <code>textarea</code>, and <code>select</code> elements that have
their <span>user interacted</span> set to true, are <span data-x="candidate for constraint
validation">candidates for constraint validation</span>, and that <span
data-x="concept-fv-valid">satisfy their constraints</span>.</p>
match <code>input</code>, <code>textarea</code>, and <code>select</code> elements whose
<span>user validity</span> is true, are
<span data-x="candidate for constraint validation">candidates for constraint validation</span>,
and that <span data-x="concept-fv-valid">satisfy their constraints</span>.</p>
</dd>

<dt><dfn selector noexport><code data-x="selector-user-invalid">:user-invalid</code></dfn></dt>
<dd>
<p>The <code data-x="selector-user-invalid">:user-invalid</code> <span>pseudo-class</span> must
match <code>input</code>, <code>textarea</code>, and <code>select</code> elements that have
their <span>user interacted</span> set to true, are <span data-x="candidate for constraint
validation">candidates for constraint validation</span> but do not <span
data-x="concept-fv-valid">satisfy their constraints</span>.</p>
match <code>input</code>, <code>textarea</code>, and <code>select</code> elements whose
<span>user validity</span> is true, are
<span data-x="candidate for constraint validation">candidates for constraint validation</span>
but do not <span data-x="concept-fv-valid">satisfy their constraints</span>.</p>
</dd>

<dt><dfn selector noexport><code data-x="selector-in-range">:in-range</code></dfn></dt>
Expand Down Expand Up @@ -79619,7 +79621,7 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
control was first focused), then:</p>

<ol>
<li><p>Set <var>entry</var>'s <span>user interacted</span> to true.</p></li>
<li><p>Set <var>entry</var>'s <span>user validity</span> to true.</p></li>

<li id="unfocus-causes-change-event"><p><span data-x="concept-event-fire">Fire an
event</span> named <code data-x="event-change">change</code> at the element, with the <code
Expand Down

0 comments on commit 055a678

Please sign in to comment.