Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move where the user-valid/invalid flag is set. #10067

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -47671,8 +47671,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>,
emilio marked this conversation as resolved.
Show resolved Hide resolved
<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 @@ -52622,7 +52623,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 @@ -53191,7 +53192,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 @@ -53207,7 +53208,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 @@ -54181,7 +54182,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 @@ -55581,8 +55582,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>
emilio marked this conversation as resolved.
Show resolved Hide resolved

<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 @@ -59236,6 +59237,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.
emilio marked this conversation as resolved.
Show resolved Hide resolved

<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 @@ -59277,7 +59282,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 @@ -59658,8 +59663,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 @@ -59676,9 +59681,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 @@ -74043,19 +74045,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
emilio marked this conversation as resolved.
Show resolved Hide resolved
<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 @@ -79577,7 +79579,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