Skip to content
Open
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
68 changes: 43 additions & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -55622,6 +55622,46 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {

<div w-nodev>

<div algorithm>
<p>To <dfn data-x="determine-if-command-is-valid">determine if a command is valid for a
target</dfn> given a <code data-x="attr-button-command">command</code> attribute
<var>command</var> and an element <var>target</var>:</p>

<ol>
<li><p>If <var>command</var> is in the <span
data-x="attr-button-command-unknown-state">Unknown</span> state, then return false.</p></li>

<li><p>If <var>command</var> is in the <span
data-x="attr-button-command-custom-state">Custom</span> state, then return true.</p></li>

Copy link
Member

@lukewarlow lukewarlow Dec 17, 2025

Choose a reason for hiding this comment

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

We need to add an extra step here (so it would become step 3) that says if target's namespace is not the HTML namespace then return false.

<li><p>If <var>target</var>'s <span data-x="concept-element-namespace">namespace</span> is not
the <span>HTML namespace</span>, then return false.</p></li>

<li>
<p>If <var>target</var>'s <code data-x="attr-popover">popover</code> attribute is not in the
<span data-x="attr-popover-none-state">No Popover</span> state, and <var>command</var> is in any
of the following states:</p>

<ul>
<li><p><span data-x="attr-button-command-toggle-popover-state">Toggle Popover</span></p></li>

<li><p><span data-x="attr-button-command-show-popover-state">Show Popover</span></p></li>

<li><p><span data-x="attr-button-command-hide-popover-state">Hide Popover</span></p></li>
</ul>

<p>then return true.</p>
</li>

<li><p>If this standard does not define <span>is valid command steps</span> for
<var>target</var>'s <span data-x="concept-element-local-name">local name</span>, then return
false.</p></li>

<li><p>Otherwise, return the result of running <var>target</var>'s corresponding <span>is valid
command steps</span> given <var>command</var>.</p></li>
</ol>
</div>

<div algorithm>
<p>A <code>button</code> element <var>element</var>'s <span>activation behavior</span> given
<var>event</var> is:</p>
Expand Down Expand Up @@ -55666,31 +55706,9 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
<li><p>Let <var>command</var> be <var>element</var>'s <code
data-x="attr-button-command">command</code> attribute.</p></li>

<li><p>If <var>command</var> is in the <span
data-x="attr-button-command-unknown-state">Unknown</span> state, then return.</p></li>

<li><p>Let <var>isPopover</var> be true if <var>target</var>'s <code
data-x="attr-popover">popover</code> attribute is not in the <span
data-x="attr-popover-none-state">No Popover</span> state; otherwise false.</p></li>

<li>
<p>If <var>isPopover</var> is false and <var>command</var> is not in the <span
data-x="attr-button-command-custom-state">Custom</span> state:</p>

<ol>
<li><p><span>Assert</span>: <var>target</var>'s <span
data-x="concept-element-namespace">namespace</span> is the
<span>HTML namespace</span>.</p></li>

<li><p>If this standard does not define <span>is valid command steps</span> for
<var>target</var>'s <span data-x="concept-element-local-name">local name</span>, then
return.</p></li>

<li><p>Otherwise, if the result of running <var>target</var>'s corresponding <span>is valid
command steps</span> given <var>command</var> is false, then
return.</p></li>
</ol>
</li>
<li><p>If the result of <span data-x="determine-if-command-is-valid">determining if a command
is valid for a target</span> given <var>command</var> and <var>target</var> is false, then
return.</p></li>

<li>
<p>Let <var>continue</var> be the result of <span data-x="concept-event-fire">firing an
Expand Down