@@ -53365,6 +53365,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53365
53365
undefined <span data-x="dom-select-showPicker">showPicker</span>();
53366
53366
53367
53367
readonly attribute <span>NodeList</span> <span data-x="dom-lfe-labels">labels</span>;
53368
+
53369
+ attribute <code data-x="selectedoption">HTMLSelectedOptionElement</code>? <span data-x="dom-selectedoptionelement">selectedOptionElement</span>;
53368
53370
};</code></pre>
53369
53371
</dd>
53370
53372
<dd w-dev>Uses <code>HTMLSelectElement</code>.</dd>
@@ -53426,6 +53428,21 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53426
53428
<p>Every <code>select</code> element has <dfn>select descendant selectedoption elements</dfn>,
53427
53429
which is a <span>list</span> of <code>selectedoption</code> elements, initially « ».</p>
53428
53430
53431
+ <p>To get the <dfn>select target selectedoption elements</dfn>, given a <code>select</code>
53432
+ <var>select</var>:</p>
53433
+
53434
+ <ol>
53435
+ <li><p>Let <var>selectedoptions</var> be <var>select</var>'s <span>select descendant
53436
+ selectedoption elements</span>.</p></li>
53437
+
53438
+ <!-- TODO dom-selectedoptionelement can likely be overriden by script, but the "limited to only
53439
+ known values" getter steps don't seem callable either. -->
53440
+ <li><p><span data-x="list append">Append</span> the value of <var>select</var>'s <code
53441
+ data-x="dom-selectedoptionelement">selectedOptionElement</code>, if it is non-null.</p></li>
53442
+
53443
+ <li><p>Return <var>selectedoptions</var>.</p></li>
53444
+ </ol>
53445
+
53429
53446
<p>The <dfn element-attr for="select"><code data-x="attr-select-required">required</code></dfn>
53430
53447
attribute is a <span>boolean attribute</span>. When specified, the user will be required to select
53431
53448
a value before submitting the form.</p>
@@ -53485,7 +53502,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53485
53502
53486
53503
<li><p><span>Send <code>select</code> update notifications</span>.</p></li>
53487
53504
53488
- <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select descendant
53505
+ <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select target
53489
53506
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53490
53507
<var>option</var> and <var>selectedoption</var>.</p></li>
53491
53508
</ol>
@@ -53541,7 +53558,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53541
53558
data-x="concept-option-selectedness">selectedness</span> set to true, or null if there is no such
53542
53559
<code>option</code>.</p></li>
53543
53560
53544
- <li><p>For each <var>selectedoption</var> in <var>element</var>'s <span>select descendant
53561
+ <li><p>For each <var>selectedoption</var> in <var>element</var>'s <span>select target
53545
53562
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53546
53563
<var>option</var> and <var>selectedoption</var>.</p></li>
53547
53564
</ol>
@@ -53876,7 +53893,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53876
53893
data-x="concept-option-selectedness">selectedness</span> to true and its <span
53877
53894
data-x="concept-option-dirtiness">dirtiness</span> to true.
53878
53895
53879
- <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select descendant
53896
+ <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select target
53880
53897
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53881
53898
<var>option</var> and <var>selectedoption</var>.</p></li>
53882
53899
</ol>
@@ -53999,6 +54016,64 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53999
54016
…</code></pre>
54000
54017
</div>
54001
54018
54019
+ <h4>The <code data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute</h4>
54020
+
54021
+ <p><code>select</code> elements may have the <dfn element-attr
54022
+ for="select"><code data-x="attr-selectedoptionelement">selectedoptionelement</code></dfn>
54023
+ attribute. When specified its value must be the <span data-x="concept-ID">ID</span> of a
54024
+ <code>selectedoption</code> element in the same <span>tree</span> as the <code>select</code> with
54025
+ the <code data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute. The target
54026
+ <code>selectedoption</code> will update its contents to match the currently selected
54027
+ <code>option</code> of the <code>select</code>.</p>
54028
+
54029
+ <div class="example">
54030
+ <p>The following code shows how the <code
54031
+ data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute can be used to render
54032
+ a <code>select</code> element's value outside of the <code>select</code>:</p>
54033
+
54034
+ <pre><code class="html"><label for="pet-select">Choose a pet:</label>
54035
+ <select id="pet-select" selectedoptionelement="summary-value">
54036
+ <option>dog</option>
54037
+ <option>cat</option>
54038
+ </select>
54039
+ <p>Summary: you chose the <selectedoption id="summary-value"></selectedoption>.<p></code></pre>
54040
+ </div>
54041
+
54042
+ <p>The <dfn attribute for="select"><code
54043
+ data-x="dom-selectedoptionelement">selectedOptionElement</code></dfn> IDL attribute must
54044
+ <span>reflect</span> the <code data-x="attr-selectedoptionelement">selectedoptionelement</code>
54045
+ attribute, <span>limited to only known values</span>.</p>
54046
+
54047
+ <p>The following <span data-x="concept-element-attributes-change-ext">attribute change
54048
+ steps</span> given <var>element</var>, <var>localName</var>, <var>oldValue</var>,
54049
+ <var>value</var>, and <var>namespace</var>, are used for <code>select</code> elements:</p>
54050
+
54051
+ <ol>
54052
+ <li><p>If <var>namespace</var> is not null, then return.</p></li>
54053
+
54054
+ <li><p>If <var>localName</var> is not <code
54055
+ data-x="attr-selectedoptionelement">selectedoptionelement</code>, then return.</p></li>
54056
+
54057
+ <li><p>Let <var>oldSelectedoption</var> be the first <code>selectedoption</code> element in
54058
+ <span>tree order</span> in <var>element</var>'s <span>root</span> whose <span
54059
+ data-x="concept-ID">ID</span> is <var>oldValue</var> if one exists, otherwise null.</p></li>
54060
+
54061
+ <li><p>Let <var>newSelectedoption</var> be the first <code>selectedoption</code> element in
54062
+ <span>tree order</span> in <var>element</var>'s <span>root</span> whose <span
54063
+ data-x="concept-ID">ID</span> is <var>value</var> if one exists, otherwise null.</p></li>
54064
+
54065
+ <li><p>If <var>oldSelectedoption</var> is eequal to <var>newSelectedoption</var>, then
54066
+ return.</p></li>
54067
+
54068
+ <li><p>If <var>oldSelectedoption</var> is not null, then run <span>clone an option into a
54069
+ selectedoption</span> given null and <var>oldSelectedOption</var>.</p></li>
54070
+
54071
+ <li><p>If <var>newSelectedoption</var> is not null, then run <span>clone an option into a
54072
+ selectedoption</span> given the value of <var>element</var>'s <code
54073
+ data-x="dom-selectedoptionelement">selectedOptionElement</code> and
54074
+ <var>newSelectedOption</var>.</p></li>
54075
+ </ol>
54076
+
54002
54077
54003
54078
54004
54079
<h4>The <dfn element><code>datalist</code></dfn> element</h4>
@@ -54403,7 +54478,7 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
54403
54478
data-x="dom-option-label">label</span>.</p></li>
54404
54479
54405
54480
<li>
54406
- <p>For each <var>selectedoption</var> of <var>select</var>'s <span>select descendant
54481
+ <p>For each <var>selectedoption</var> of <var>select</var>'s <span>select target
54407
54482
selectedoption elements</span>:</p>
54408
54483
54409
54484
<ol>
0 commit comments