Skip to content

Commit

Permalink
Minor tweaks to anchor stuff
Browse files Browse the repository at this point in the history
Most notably, moving the impact from a note to the "interactively validate the constraints" algorithm.
  • Loading branch information
domenic committed May 14, 2019
1 parent 089e2c7 commit c46c603
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -55665,16 +55665,29 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD

<li><p>If the result was <i>positive</i>, then return that result.</p></li>

<li><p>Report the problems with the constraints of at least one of the elements given in
<var>unhandled invalid controls</var> to the user. User agents may focus one of those elements in
the process, by running the <span>focusing steps</span> for that element, and may change the
scrolling position of the document, or perform some other action that brings the element to the
user's attention. User agents may report more than one constraint violation. User agents may
coalesce related constraint violation reports if appropriate (e.g. if multiple radio buttons in a
<span data-x="radio button group">group</span> are marked as required, only one error need be
reported). If one of the controls is not <span>being rendered</span> (e.g. it has the <code
data-x="attr-hidden">hidden</code> attribute set) then user agents may report a script
error.</p></li>
<li>
<p>Report the problems with the constraints of at least one of the elements given in
<var>unhandled invalid controls</var> to the user.</p>

<ul>
<li><p>User agents may focus one of those elements in the process, by running the
<span>focusing steps</span> for that element, and may change the scrolling position of the
document, or perform some other action that brings the element to the user's attention. For
elements that are <span data-x="form-associated custom element">form-associated custom
elements</span>, user agents should use their <span data-x="face-validation-anchor">validation
anchor</span> instead, for the purposes of these actions.</p></li>

<li><p>User agents may report more than one constraint violation.</p></li>

<li><p>User agents may coalesce related constraint violation reports if appropriate (e.g. if
multiple radio buttons in a <span data-x="radio button group">group</span> are marked as
required, only one error need be reported).</p></li>

<li><p>If one of the controls is not <span>being rendered</span> (e.g. it has the <code
data-x="attr-hidden">hidden</code> attribute set) then user agents may report a script
error.</p></li>
</ul>
</li>

<li><p>Return a <i>negative</i> result.</p></li>

Expand Down Expand Up @@ -67931,9 +67944,9 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<var>message</var> [, <var>anchor</var> ])</dt>
<dd><p>Marks <var>internals</var>'s <span data-x="internals-target">target element</span> as
suffering from the constraints indicated by the <var>flags</var> argument, and sets the element's
validation message to <var>message</var>. If <var>anchor</var> is specified, <var>message</var>
might be shown beside <var>anchor</var> instead of <var>internals</var>'
<span data-x="internals-target">target element</span> when the owner form is validated
validation message to <var>message</var>. If <var>anchor</var> is specified, the user agent might
use it to indicate problems with the constraints of <var>internals</var>'s <span
data-x="internals-target">target element</span> when the <span>form owner</span> is validated
interactively or <code data-x="dom-ElementInternals-reportValidity">reportValidity()</code> is
called.</p></dd>

Expand Down Expand Up @@ -68115,19 +68128,6 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<p>Each <span>form-associated custom element</span> has a
<dfn data-x="face-validation-anchor">validation anchor</dfn> element. It is null initially.</p>

<div class="note">
<p>A user agent might run <span>focusing steps</span> for
<span data-x="face-validation-anchor">validation anchor</span>, might change the scrolling
position to show <span data-x="face-validation-anchor">validation anchor</span>, and might
report constraint violations beside <span data-x="face-validation-anchor">validation anchor</span>
instead of <code>ElementInternals</code>' <span data-x="internals-target">target element</span>
when the user agent <span data-x="interactively validate the constraints"
>interactively validates the constraints</span> of the
<span data-x="internals-target">target element</span>'s <span>form owner</span> or runs
<span>report validity steps</span> for the <span data-x="internals-target">target element</span>.
</p>
</div>

<p>The <dfn><code data-x="dom-setValidity">setValidity(<var>flags</var>,
<var>message</var>, <var>anchor</var>)</code></dfn> method of the <code>ElementInternals</code>
interface must run the following steps:</p>
Expand All @@ -68139,27 +68139,27 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<li><p>If <var>element</var> is not a <span>form-associated custom element</span>, then throw a
<span>"<code>NotSupportedError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>If <var>flags</var> contains one or more true values and the second argument is omitted
or empty, then throw a <code>TypeError</code>.</p></li>
<li><p>If <var>flags</var> contains one or more true values and <var>message</var> is not given
or is the empty string, then throw a <code>TypeError</code>.</p></li>

<li><p>For each entry <var>flag</var> → <var>value</var> of <var>flags</var>, set
<var>element</var>'s validity flag with the name <var>flag</var> to <var>value</var>.</p></li>

<li><p>Set <var>element</var>'s <span data-x="face-validation-message">validation message</span>
to the empty string if the second argument is omitted or all of <var>element</var>'s validity
to the empty string if <var>message</var> is not given or all of <var>element</var>'s validity
flags are false, or to <var>message</var> otherwise.</p></li>

<li><p>If <var>element</var>'s <code data-x="">customError</code> validity flag is true, then set
<var>element</var>'s <span>custom validity error message</span> to <var>element</var>'s
<span data-x="face-validation-message">validation message</span>. Otherwise, set
<var>element</var>'s <span>custom validity error message</span> to the empty string.</p></li>

<li><p>Set <var>element</var>'s <span data-x="face-validation-anchor">validation anchor</span>
to null if the third argument is omitted. Otherwise, if the third argument is not a
<li><p>Set <var>element</var>'s <span data-x="face-validation-anchor">validation anchor</span> to
null if <var>anchor</var> is not given. Otherwise, if <var>anchor</var> is not a
<span>shadow-including descendant</span> of <var>element</var>, then throw a
<span>"<code>NotFoundError</code>"</span> <code>DOMException</code>. Otherwise, set
<var>element</var>'s <span data-x="face-validation-anchor">validation anchor</span> to the
third argument.</p></li>
<var>element</var>'s <span data-x="face-validation-anchor">validation anchor</span> to
<var>anchor</var>.</p></li>
</ol>

<p>The <dfn><code data-x="dom-ElementInternals-validationMessage">validationMessage</code></dfn>
Expand Down

0 comments on commit c46c603

Please sign in to comment.