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

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
54 changes: 25 additions & 29 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how you can move this definition to the button element section. The button element is not alone in being able to be a submit button.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, this swap of definition and use was my suggestion in #10960 (comment). I didn't check other uses of the concept and now see that it's used a lot to make various things "specifically a submit button."

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,33 +53484,33 @@ 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
data-x="invalid value default">invalid value default</i> are both the <span
data-x="attr-button-type-submit-state">Submit Button</span> state.</p>

<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
data-x="concept-submit-button">submit button</dfn> 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.</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
<var>event</var> is:</p>
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
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
data-x="submit-user-involvement">userInvolvement</i> set to <var>event</var>'s <span
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>.</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
<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 Down