Skip to content

Commit

Permalink
fix selectedIndex setter and algorithm declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharhar committed Jan 28, 2025
1 parent 51f0f41 commit 6f251fb
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions source
Original file line number Diff line number Diff line change
@@ -54076,18 +54076,29 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
order</span> that has its <span data-x="concept-option-selectedness">selectedness</span> set to
true, if any. If there isn't one, then it must return &#x2212;1.</p>

<p>On setting, the <code data-x="dom-select-selectedIndex">selectedIndex</code> attribute must run
the following steps:</p>
<p>The <code data-x="dom-select-selectedIndex">selectedIndex</code> setter steps are:</p>

<ol>
<li><p>Set the <span data-x="concept-option-selectedness">selectedness</span> of all the
<code>option</code> elements in the <span data-x="concept-select-option-list">list of
options</span> to false.</p></li>
<li><p>Let <var>firstMatchingOption</var> be null.</p></li>

<li>
<p>For each <var>option</var> in the <code>select</code>'s <span
data-x="concept-select-option-list">list of options</span>:</p>

<ol>
<li><p>Set <var>option</var>'s <span data-x="concept-option-selectedness">selectedness</span>
to false.</p></li>

<li><p>The <code>option</code> element in the <span data-x="concept-select-option-list">list of
options</span> whose <span data-x="concept-option-index">index</span> is the given new value, if
any, must have its <span data-x="concept-option-selectedness">selectedness</span> set to true and
its <span data-x="concept-option-dirtiness">dirtiness</span> set to true.</p></li>
<li><p>If <var>firstMatchingOption</var> is null and <var>option</var>'s <span
data-x="concept-option-index">index</span> is equal to the given new value, then set
<var>firstMatchingOption</var> to <var>option</var>.</p></li>
</ol>
</li>

<li><p>If <var>firstMatchingOption</var> is not null, then set <var>firstMatchingOption</var>'s
<span data-x="concept-option-selectedness">selectedness</span> to true and set
<var>firstMatchingOption</var>'s <span data-x="concept-option-dirtiness">dirtiness</span> to
true.</p></li>

<li><p>Run <span>update a <code>select</code>'s <code>selectedcontent</code></span> given this
<code>select</code>.</p></li>
@@ -54589,7 +54600,7 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
</div>

<p>To get the <dfn><code>option</code> element nearest ancestor <code>select</code></dfn> given an
<code>option</code> <var>option</var>:</p>
<code>option</code> <var>option</var>, run these steps. They return a <code>select</code> or null.</p>

<ol>
<li>
@@ -54606,7 +54617,7 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
</ol>

<p>To <dfn>maybe clone an <code>option</code> into <code>selectedcontent</code></dfn>, given an
<code>option</code> <var>option</var>:</p>
<code>option</code> <var>option</var>, run these steps:</p>

<ol>
<li><p>Let <var>select</var> be <var>option</var>'s <span><code>option</code> element nearest

0 comments on commit 6f251fb

Please sign in to comment.