Skip to content

Commit 5d4835a

Browse files
committed
Update selectedcontent in selectedness setting
This PR makes sure that the contents of the selectedcontent element stay up to date when the selected option is changed in the selectedness setting algorithm. This issue was found here: web-platform-tests/wpt#55849 (comment)
1 parent 50d6d4f commit 5d4835a

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

source

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56241,24 +56241,45 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
5624156241
<var>element</var>, is to run the following steps:</p>
5624256242

5624356243
<ol>
56244-
<li><p>If <var>element</var>'s <code data-x="attr-select-multiple">multiple</code> attribute is
56245-
absent, and <var>element</var>'s <span data-x="concept-select-size">display size</span> is 1,
56246-
and no <code>option</code> elements in the <var>element</var>'s <span
56247-
data-x="concept-select-option-list">list of options</span> have their <span
56248-
data-x="concept-option-selectedness">selectedness</span> set to true, then set the <span
56249-
data-x="concept-option-selectedness">selectedness</span> of the first <code>option</code>
56250-
element in the <span data-x="concept-select-option-list">list of options</span> in
56251-
<span>tree order</span> that is not <span data-x="concept-option-disabled">disabled</span>,
56252-
if any, to true, and return.</p></li>
56253-
56254-
<li><p>If <var>element</var>'s <code data-x="attr-select-multiple">multiple</code> attribute is
56255-
absent, and two or more <code>option</code> elements in <var>element</var>'s <span
56256-
data-x="concept-select-option-list">list of options</span> have their <span
56257-
data-x="concept-option-selectedness">selectedness</span> set to true, then set the <span
56258-
data-x="concept-option-selectedness">selectedness</span> of all but the last <code>option</code>
56259-
element with its <span data-x="concept-option-selectedness">selectedness</span> set to true in
56260-
the <span data-x="concept-select-option-list">list of options</span> in <span>tree order</span>
56261-
to false.</p></li>
56244+
<li><p>Let <var>updateSelectedcontent</var> be false.</p></li>
56245+
56246+
<li>
56247+
<p>If <var>element</var>'s <code data-x="attr-select-multiple">multiple</code> attribute is
56248+
absent, and <var>element</var>'s <span data-x="concept-select-size">display size</span> is 1,
56249+
and no <code>option</code> elements in the <var>element</var>'s <span
56250+
data-x="concept-select-option-list">list of options</span> have their <span
56251+
data-x="concept-option-selectedness">selectedness</span> set to true, then:</p>
56252+
56253+
<ol>
56254+
<li><p>Set the <span
56255+
data-x="concept-option-selectedness">selectedness</span> of the first <code>option</code>
56256+
element in the <span data-x="concept-select-option-list">list of options</span> in
56257+
<span>tree order</span> that is not <span data-x="concept-option-disabled">disabled</span>,
56258+
if any, to true.</p></li>
56259+
56260+
<li><p>Set <var>updateSelectedcontent</var> to true.</p></li>
56261+
</ol>
56262+
</li>
56263+
56264+
<li>
56265+
<p>Otherwise, if <var>element</var>'s <code data-x="attr-select-multiple">multiple</code>
56266+
attribute is absent, and two or more <code>option</code> elements in <var>element</var>'s <span
56267+
data-x="concept-select-option-list">list of options</span> have their <span
56268+
data-x="concept-option-selectedness">selectedness</span> set to true, then:</p>
56269+
56270+
<ol>
56271+
<li><p>Set the <span data-x="concept-option-selectedness">selectedness</span> of all but the
56272+
last <code>option</code> element with its <span
56273+
data-x="concept-option-selectedness">selectedness</span> set to true in the <span
56274+
data-x="concept-select-option-list">list of options</span> in <span>tree order</span> to
56275+
false.</p></li>
56276+
56277+
<li><p>Set <var>updateSelectedcontent</var> to true.</p></li>
56278+
</ol>
56279+
</li>
56280+
56281+
<li><p>If <var>updateSelectedcontent</var> is true, then run <span>update a <code>select</code>'s
56282+
<code>selectedcontent</code></span> given <var>element</var>.</p></li>
5626256283
</ol>
5626356284
</div>
5626456285

0 commit comments

Comments
 (0)