Skip to content

Commit 98140ea

Browse files
authored
Clarify when an element is disabled (#1807)
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.
1 parent 43903d0 commit 98140ea

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

index.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,8 +4505,8 @@ <h2>Elements</h2>
45054505
<dl class=subcategories>
45064506
<dt><dfn data-lt="mutable form control element">Mutable form control elements</dfn>
45074507
<dd><p>Denotes [^input^] elements
4508-
that are <a>mutable</a> (e.g. that are not <a>read only</a> or <a>actually disabled</a>)
4509-
and whose [^input/type^] attribute
4508+
that are <a>mutable</a> (e.g. that are not <a>read only</a> or
4509+
<a>disabled</a>) and whose [^input/type^] attribute
45104510
is in one of the following states:
45114511

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

4606+
<p>An <a>element</a> |element| is <dfn>disabled</dfn> if the following steps
4607+
return true:
4608+
4609+
<ol>
4610+
<li><p>If |element| is an <a>option</a> element or |element| is an <a>optgroup</a> element:
4611+
<ol>
4612+
<li><p>For each [=tree/inclusive ancestor=] |ancestor| of |element|:
4613+
<ol>
4614+
<li><p>If |ancestor| is an <a>optgroup</a> element or |ancestor| is a <a>select</a>
4615+
element, and |ancestor| is [=actually disabled=], return true.
4616+
</ol>
4617+
<li><p>Return false.
4618+
</ol>
4619+
<li><p>Return |element| is [=actually disabled=].
4620+
</ol>
4621+
46064622
<p>An <a>element</a> is <dfn>in view</dfn>
46074623
if it is a member of its own <a>pointer-interactable paint tree</a>,
46084624
given the pretense that its <a>pointer events are not disabled</a>.
@@ -5912,7 +5928,7 @@ <h4><dfn>Is Element Enabled</dfn></h4>
59125928
<p>Otherwise, let <var>enabled</var> to false
59135929
and jump to the last step of this algorithm.
59145930

5915-
<li><p>Set <var>enabled</var> to false if a form control is <a>actually disabled</a>.
5931+
<li><p>Set <var>enabled</var> to false if a form control is <a>disabled</a>.
59165932

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

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

6102-
<li><p>If <var>element</var> is not <a>actually disabled</a>:
6118+
<li><p>If <var>element</var> is not <a>disabled</a>:
61036119

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

0 commit comments

Comments
 (0)