Skip to content

Commit

Permalink
Code review tweaks; thanks Anne
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed May 15, 2019
1 parent c46c603 commit e861f77
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -55452,7 +55452,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<span data-x="form-associated custom element">form-associated custom elements</span>. <span
data-x="form-associated custom element">Form-associated custom elements</span> can have a
<span>custom validity error message</span> set via their <code>ElementInternals</code> object's
<code data-x="dom-setValidity">setValidity()</code> method. The user agent should use the
<code data-x="dom-ElementInternals-setValidity">setValidity()</code> method. The user agent should use the
<span>custom validity error message</span> when alerting the user to the problem with the
control.</p>

Expand All @@ -55473,7 +55473,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<code>select</code> elements and controls in <span data-x="radio button group">radio button
groups</span>, as specified in their sections.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">valueMissing</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55486,7 +55486,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
data-x="attr-input-type-email">E-mail</span>, <span data-x="attr-input-type-url">URL</span>).
</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">typeMismatch</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55497,7 +55497,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<p>When a control has a <span data-x="concept-fe-value">value</span> that doesn't satisfy the
<code data-x="attr-input-pattern">pattern</code> attribute.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">patternMismatch</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55510,7 +55510,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
(<code>input</code> <code data-x="attr-input-maxlength">maxlength</code>, <code>textarea</code>
<code data-x="attr-textarea-maxlength">maxlength</code>). </p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">tooLong</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55523,7 +55523,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
(<code>input</code> <code data-x="attr-input-minlength">minlength</code>, <code>textarea</code>
<code data-x="attr-textarea-minlength">minlength</code>). </p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">tooShort</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55534,7 +55534,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<p>When a control has a <span data-x="concept-fe-value">value</span> that is not the empty
string and is too low for the <code data-x="attr-input-min">min</code> attribute.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">rangeUnderflow</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55545,7 +55545,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<p>When a control has a <span data-x="concept-fe-value">value</span> that is not the empty
string and is too high for the <code data-x="attr-input-max">max</code> attribute.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">rangeOverflow</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55556,7 +55556,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<p>When a control has a <span data-x="concept-fe-value">value</span> that doesn't fit the
rules given by the <code data-x="attr-input-step">step</code> attribute.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">stepMismatch</code> flag to true for a
<span>form-associated custom element</span>.</p>
</dd>
Expand All @@ -55567,7 +55567,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD
<p>When a control has incomplete input and the user agent does not think the user ought to
be able to submit the form in its current state.</p>

<p>When the <code data-x="dom-setValidity">setValidity()</code> method sets
<p>When the <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method sets
<code data-x="">badInput</code> flag to true for a <span>form-associated custom element</span>.
</p>
</dd>
Expand All @@ -55576,7 +55576,7 @@ control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldD

<dd> <p>When a control's <span>custom validity error message</span> (as set by the element's
<code data-x="dom-cva-setCustomValidity">setCustomValidity()</code> method or
<code>ElementInternals</code>'s <code data-x="dom-setValidity">setValidity()</code> method) is
<code>ElementInternals</code>'s <code data-x="dom-ElementInternals-setValidity">setValidity()</code> method) is
not the empty string.</p> </dd>

</dl>
Expand Down Expand Up @@ -66328,10 +66328,10 @@ document.body.appendChild(flagIcon)</code></pre>

<!-- NON-NORMATIVE SECTION -->

<p>Just adding static <code data-x="">formAssociated</code> property with true makes an
<span>autonomous custom element</span> a <span>form-associated custom element</span>.
<p>Adding a static <code data-x="">formAssociated</code> property, with a true value, makes an
<span>autonomous custom element</span> a <span>form-associated custom element</span>. The
<code>ElementInternals</code> interface helps you to implement functions and properties common
in form control elements.</p>
to form control elements.</p>

<pre><code class="js" data-x="">class MyCheckbox extends HTMLElement {
static get formAssociated() { return true; }
Expand Down Expand Up @@ -67886,12 +67886,12 @@ interface <dfn>ElementInternals</dfn> {
<!-- 🔺🔺🔺 END change for https://github.com/whatwg/html/pull/4324 -->
// Form-associated custom elements

void <span data-x="dom-setFormValue">setFormValue</span>((<span>File</span> or <span data-x="idl-USVString">USVString</span> or <span>FormData</span>)? value,
void <span data-x="dom-ElementInternals-setFormValue">setFormValue</span>((<span>File</span> or <span data-x="idl-USVString">USVString</span> or <span>FormData</span>)? value,
optional (<span>File</span> or <span data-x="idl-USVString">USVString</span> or <span>FormData</span>)? state);

readonly attribute <span>HTMLFormElement</span>? <span data-x="dom-ElementInternals-form">form</span>;

void <span data-x="dom-setValidity">setValidity</span>(<span>ValidityStateFlags</span> flags,
void <span data-x="dom-ElementInternals-setValidity">setValidity</span>(<span>ValidityStateFlags</span> flags,
optional DOMString message,
optional <span>HTMLElement</span> anchor);
readonly attribute boolean <span data-x="dom-ElementInternals-willValidate">willValidate</span>;
Expand All @@ -67917,7 +67917,7 @@ dictionary <dfn>ValidityStateFlags</dfn> {
};</code></pre>

<dl class="domintro">
<dt><var>internals</var> . <code data-x="dom-setFormValue">setFormValue</code>(<var>value</var>)</dt>
<dt><var>internals</var> . <code data-x="dom-ElementInternals-setFormValue">setFormValue</code>(<var>value</var>)</dt>
<dd>
<p>Sets both the <span data-x="face-state">state</span> and
<span data-x="face-submission-value">submission value</span> of <var>internals</var>'s
Expand All @@ -67926,7 +67926,7 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<p>If <var>value</var> is null, the element won't participate in form submission.</p>
</dd>

<dt><var>internals</var> . <code data-x="dom-setFormValue">setFormValue</code>(<var>value</var>,
<dt><var>internals</var> . <code data-x="dom-ElementInternals-setFormValue">setFormValue</code>(<var>value</var>,
<var>state</var>)</dt>
<dd>
<p>Sets the <span data-x="face-submission-value">submission value</span> of
Expand All @@ -67940,7 +67940,7 @@ dictionary <dfn>ValidityStateFlags</dfn> {
<dd><p>Returns the <span>form owner</span> of <var>internals</var>'s
<span data-x="internals-target">target element</span>.</p></dd>

<dt><var>internals</var> . <code data-x="dom-setValidity">setValidity</code>(<var>flags</var>,
<dt><var>internals</var> . <code data-x="dom-ElementInternals-setValidity">setValidity</code>(<var>flags</var>,
<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
Expand All @@ -67950,7 +67950,7 @@ dictionary <dfn>ValidityStateFlags</dfn> {
interactively or <code data-x="dom-ElementInternals-reportValidity">reportValidity()</code> is
called.</p></dd>

<dt><var>internals</var> . <code data-x="dom-setValidity">setValidity</code>({})</dt>
<dt><var>internals</var> . <code data-x="dom-ElementInternals-setValidity">setValidity</code>({})</dt>
<dd><p>Marks <var>internals</var>'s <span data-x="internals-target">target element</span> as
<span data-x="concept-fv-valid">satisfying its constraints</span>.</p></dd>

Expand Down Expand Up @@ -68046,9 +68046,10 @@ dictionary <dfn>ValidityStateFlags</dfn> {
data-x="face-state">state</span> can be null, a string, a <code>File</code>, or a
<span>list</span> of <span data-x="formdata-entry">entries</span>.</p>

<p>The <code data-x="dom-setFormValue">setFormValue()</code> method is used by the custom element
author to set the element's <span data-x="face-submission-value">submission value</span> and <span
data-x="face-state">state</span>, thus communicating these to the user agent.</p>
<p>The <code data-x="dom-ElementInternals-setFormValue">setFormValue()</code> method is used by
the custom element author to set the element's <span data-x="face-submission-value">submission
value</span> and <span data-x="face-state">state</span>, thus communicating these to the user
agent.</p>

<p>When the user agent believes it is a good idea to restore a <span>form-associated custom
element</span>'s <span data-x="face-state">state</span>, for example after navigation or
Expand Down Expand Up @@ -68084,7 +68085,7 @@ dictionary <dfn>ValidityStateFlags</dfn> {

<div w-nodev>

<p>The <dfn><code data-x="dom-setFormValue">setFormValue(<var>value</var>,
<p>The <dfn><code data-x="dom-ElementInternals-setFormValue">setFormValue(<var>value</var>,
<var>state</var>)</code></dfn> method of the <code>ElementInternals</code> interface must
run the following steps:</p>

Expand Down Expand Up @@ -68128,7 +68129,7 @@ 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>

<p>The <dfn><code data-x="dom-setValidity">setValidity(<var>flags</var>,
<p>The <dfn><code data-x="dom-ElementInternals-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 Down

0 comments on commit e861f77

Please sign in to comment.