Skip to content

Commit

Permalink
Clarify when an element is disabled (w3c#1807)
Browse files Browse the repository at this point in the history
Selenium's atom "Is Element Enabled" special-cases the
disabled state for "option" and "optgroup" elements
when the nearest anchestor "select" is disabled as well.
  • Loading branch information
whimboo authored Apr 16, 2024
1 parent 43903d0 commit 98140ea
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4505,8 +4505,8 @@ <h2>Elements</h2>
<dl class=subcategories>
<dt><dfn data-lt="mutable form control element">Mutable form control elements</dfn>
<dd><p>Denotes [^input^] elements
that are <a>mutable</a> (e.g. that are not <a>read only</a> or <a>actually disabled</a>)
and whose [^input/type^] attribute
that are <a>mutable</a> (e.g. that are not <a>read only</a> or
<a>disabled</a>) and whose [^input/type^] attribute
is in one of the following states:

<ul class=brief>
Expand Down Expand Up @@ -4603,6 +4603,22 @@ <h3>Interactability</h3>
<li><p>Return the pair of (<var>x</var>, <var>y</var>).
</ol>

<p>An <a>element</a> |element| is <dfn>disabled</dfn> if the following steps
return true:

<ol>
<li><p>If |element| is an <a>option</a> element or |element| is an <a>optgroup</a> element:
<ol>
<li><p>For each [=tree/inclusive ancestor=] |ancestor| of |element|:
<ol>
<li><p>If |ancestor| is an <a>optgroup</a> element or |ancestor| is a <a>select</a>
element, and |ancestor| is [=actually disabled=], return true.
</ol>
<li><p>Return false.
</ol>
<li><p>Return |element| is [=actually disabled=].
</ol>

<p>An <a>element</a> is <dfn>in view</dfn>
if it is a member of its own <a>pointer-interactable paint tree</a>,
given the pretense that its <a>pointer events are not disabled</a>.
Expand Down Expand Up @@ -5912,7 +5928,7 @@ <h4><dfn>Is Element Enabled</dfn></h4>
<p>Otherwise, let <var>enabled</var> to false
and jump to the last step of this algorithm.

<li><p>Set <var>enabled</var> to false if a form control is <a>actually disabled</a>.
<li><p>Set <var>enabled</var> to false if a form control is <a>disabled</a>.

<li><p>Return <a>success</a> with data <var>enabled</var>.
</ol>
Expand Down Expand Up @@ -6099,7 +6115,7 @@ <h4><dfn>Element Click</dfn></h4>

<li><p>Run the <a>focusing steps</a> on <var>parent node</var>.

<li><p>If <var>element</var> is not <a>actually disabled</a>:
<li><p>If <var>element</var> is not <a>disabled</a>:

<ol>
<li><p>[=fire an event|Fire=] an <a><code>input</code></a> event at <var>parent node</var>.
Expand Down

0 comments on commit 98140ea

Please sign in to comment.