Permalink
Browse files

element click: prevent selectedness change on <option disabled>

WebDriver currently toggles the selectedness state of <option
disabled> elements.  Because we can interact with the containing
<select> element we should simulate the mouse interaction steps but
prevent it from changing the selectedness state.

Fixes: #1187
  • Loading branch information...
andreastt authored and AutomatedTester committed Jan 10, 2018
1 parent 6a235e2 commit 981a0feb166f7d8bfc855eb0e916b32fce3b0ed6
Showing with 16 additions and 13 deletions.
  1. +16 −13 webdriver-spec.html
@@ -5617,23 +5617,26 @@ <h3>Element Click</h3>

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

<li><p><a>Fire</a> an <a><code>input</code></a> event at <var>parent node</var>.
<li><p>If <var>element</var> is not <a>disabled</a>:

<li><p>Let <var>previous selectedness</var> be equal to <var>element</var>
<a>selectedness</a>.
<ol>
<li><p><a>Fire</a> an <a><code>input</code></a> event at <var>parent node</var>.

<li><p>If <var>element</var>’s <a>container</a>
has the <a><code>multiple</code> attribute</a>,
toggle the <var>element</var>’s <a>selectedness</a> state
by setting it to the opposite value of its current <a>selectedness</a>.
<li><p>Let <var>previous selectedness</var> be equal
to <var>element</var> <a>selectedness</a>.

<p>Otherwise,
set the <var>element</var>’s <a>selectedness</a> state to true.
<li><p>If <var>element</var>’s <a>container</a>
has the <a><code>multiple</code> attribute</a>,
toggle the <var>element</var>’s <a>selectedness</a> state
by setting it to the opposite value of its current <a>selectedness</a>.

<li><p>If <var>previous selectedness</var> is false:
<ol>
<li><p><a>Fire</a> a <a><code>change</code></a> event at <var>parent node</var>.
</ol>
<p>Otherwise,
set the <var>element</var>’s <a>selectedness</a> state to true.

<li><p>If <var>previous selectedness</var> is false,
<a>fire</a> a <a><code>change</code></a> event
at <var>parent node</var>.
</ol>

<li><p><a>Fire</a> a <a>mouseUp event</a> at <var>parent node</var>.

0 comments on commit 981a0fe

Please sign in to comment.