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

[Editorial] rework button states to allow for command/commandfor attributes #10960

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
59 changes: 27 additions & 32 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -45861,8 +45861,8 @@ interface <dfn interface>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {

<p>Some <span data-x="category-submit">submittable elements</span> can be, depending on their
attributes, <dfn data-x="concept-button">buttons</dfn>. The prose below defines when an element
is a button. Some buttons are specifically <dfn export data-lt="submit button"
data-x="concept-submit-button">submit buttons</dfn>.</p>
is a button. Some buttons are specifically <span
data-x="concept-submit-button">submit buttons</span>.</p>
</dd>

<dt><dfn data-x="category-reset">Resettable elements</dfn></dt>
Expand Down Expand Up @@ -53484,35 +53484,35 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<tr>
<td><dfn attr-value for="button/type"><code
data-x="attr-button-type-submit">submit</code></dfn>
<td><span data-x="attr-button-type-submit-state">Submit Button</span>
<td><dfn data-x="attr-button-type-submit-state">Submit Button</dfn>
<td>Submits the form.
<tr>
<td><dfn attr-value for="button/type"><code data-x="attr-button-type-reset">reset</code></dfn>
<td><span data-x="attr-button-type-reset-state">Reset Button</span>
<td><dfn data-x="attr-button-type-reset-state">Reset Button</dfn>
<td>Resets the form.
<tr>
<td><dfn attr-value for="button/type"><code
data-x="attr-button-type-button">button</code></dfn>
<td><span data-x="attr-button-type-button-state">Button</span>
<td><dfn data-x="attr-button-type-button-state">Button</dfn>
<td>Does nothing.
</table>

<p>The attribute's <i data-x="missing value default">missing value default</i> and <i
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="invalid value default">invalid value default</i> are both the <span
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="attr-button-type-submit-state">Submit Button</span> state.</p>

keithamus marked this conversation as resolved.
Show resolved Hide resolved
<p>If the <code data-x="attr-button-type">type</code> attribute is in the <span
data-x="attr-button-type-submit-state">Submit Button</span> state, the element is specifically a
<span data-x="concept-submit-button">submit button</span>.</p>
<p>A <code>button</code> element is said to be a <dfn
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="concept-submit-button">submit button</dfn> if the <code
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="attr-button-type">type</code> attribute is in the <span
data-x="attr-button-type-submit-state">Submit Button</span> state.</p>

<div w-nodev>

<p><strong>Constraint validation</strong>: If the <code data-x="attr-button-type">type</code>
attribute is in the <span data-x="attr-button-type-reset-state">Reset Button</span> state or the
<span data-x="attr-button-type-button-state">Button</span> state, the element is <span>barred from
constraint validation</span>.</p>
<p><strong>Constraint validation</strong>: If the element is not a <span
data-x="concept-submit-button">submit button</span>, the element is <span>barred from constraint
validation</span>.</p>

<p>A <code>button</code> element <var>element</var>'s <span>activation behavior</span> given
<p>A <code>button</code> <var>element</var>'s <span>activation behavior</span> given
<var>event</var> is:</p>

<ol>
Expand All @@ -53523,23 +53523,20 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
return.</p></li>

<li>
<p>If <var>element</var> has a <span>form owner</span> then switch on <var>element</var>'s <code
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="attr-button-type">type</code> attribute's state, then:</p>
<p>If <var>element</var> has a <span>form owner</span>:</p>

<dl>
<dt> <dfn data-x="attr-button-type-submit-state">Submit Button</dfn> </dt>
<dd><p><span data-x="concept-form-submit">Submit</span> <var>element</var>'s <span>form
owner</span> from <var>element</var> with <i
<ol>
<li><p>If <var>element</var> is a <span data-x="concept-submit-button">submit button</span>,
then <span data-x="concept-form-submit">submit</span> <var>element</var>'s
<span>form owner</span> from <var>element</var> with <i
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="submit-user-involvement">userInvolvement</i> set to <var>event</var>'s <span
keithamus marked this conversation as resolved.
Show resolved Hide resolved
data-x="event-uni">user navigation involvement</span>.</p></dd>

<dt> <dfn data-x="attr-button-type-reset-state">Reset Button</dfn> </dt>
<dd><p><span data-x="concept-form-reset">Reset</span> <var>element</var>'s <span>form
owner</span>.</p></dd>
data-x="event-uni">user navigation involvement</span> and return.</p></li>

<dt> <dfn data-x="attr-button-type-button-state">Button</dfn>
<dd><p>Do nothing.</p></dd>
</dl>
<li><p>If <var>element</var>'s <code data-x="attr-button-type">type</code> attribute is in the
<span data-x="attr-button-type-reset-state">Reset Button</span> state, then <span
data-x="concept-form-reset">reset</span> <var>element</var>'s
keithamus marked this conversation as resolved.
Show resolved Hide resolved
keithamus marked this conversation as resolved.
Show resolved Hide resolved
<span>form owner</span>.</p></li>
</ol>
</li>

<li><p>Run the <span>popover target attribute activation behavior</span> given <var>element</var>
Expand All @@ -53566,9 +53563,8 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
data-x="attr-fs-formenctype">formenctype</code>, <code
data-x="attr-fs-formmethod">formmethod</code>, <code
data-x="attr-fs-formnovalidate">formnovalidate</code>, and <code
data-x="attr-fs-formtarget">formtarget</code> must not be specified if the element's <code
data-x="attr-button-type">type</code> attribute is not in the <span
data-x="attr-button-type-submit-state">Submit Button</span> state.</p>
data-x="attr-fs-formtarget">formtarget</code> must not be specified if the element is not
a <span data-x="concept-submit-button">submit button</span>.</p>

<p>The <dfn element-attr for="button"><code data-x="attr-button-value">value</code></dfn>
attribute gives the element's value for the purposes of form submission. The element's <span
Expand All @@ -53587,8 +53583,7 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
IDL attribute must <span>reflect</span> the content attribute of the same name.</p>

<p>The <dfn attribute for="HTMLButtonElement"><code data-x="dom-button-type">type</code></dfn> IDL
attribute must <span>reflect</span> the content attribute of the same name, <span>limited to only
known values</span>.</p>
attribute must <span>reflect</span> the content attribute of the same name.</p>

<p>The <code data-x="dom-cva-willValidate">willValidate</code>, <code
data-x="dom-cva-validity">validity</code>, and <code
Expand Down