@@ -53335,6 +53335,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53335
53335
undefined <span data-x="dom-select-showPicker">showPicker</span>();
53336
53336
53337
53337
readonly attribute <span>NodeList</span> <span data-x="dom-lfe-labels">labels</span>;
53338
+
53339
+ attribute <code data-x="selectedoption">HTMLSelectedOptionElement</code>? <span data-x="dom-selectedoptionelement">selectedOptionElement</span>;
53338
53340
};</code></pre>
53339
53341
</dd>
53340
53342
<dd w-dev>Uses <code>HTMLSelectElement</code>.</dd>
@@ -53396,6 +53398,21 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53396
53398
<p>Every <code>select</code> element has <dfn>select descendant selectedoption elements</dfn>,
53397
53399
which is a <span>list</span> of <code>selectedoption</code> elements, initially « ».</p>
53398
53400
53401
+ <p>To get the <dfn>select target selectedoption elements</dfn>, given a <code>select</code>
53402
+ <var>select</var>:</p>
53403
+
53404
+ <ol>
53405
+ <li><p>Let <var>selectedoptions</var> be <var>select</var>'s <span>select descendant
53406
+ selectedoption elements</span>.</p></li>
53407
+
53408
+ <!-- TODO dom-selectedoptionelement can likely be overriden by script, but the "limited to only
53409
+ known values" getter steps don't seem callable either. -->
53410
+ <li><p><span data-x="list append">Append</span> the value of <var>select</var>'s <code
53411
+ data-x="dom-selectedoptionelement">selectedOptionElement</code>, if it is non-null.</p></li>
53412
+
53413
+ <li><p>Return <var>selectedoptions</var>.</p></li>
53414
+ </ol>
53415
+
53399
53416
<p>The <dfn element-attr for="select"><code data-x="attr-select-required">required</code></dfn>
53400
53417
attribute is a <span>boolean attribute</span>. When specified, the user will be required to select
53401
53418
a value before submitting the form.</p>
@@ -53455,7 +53472,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53455
53472
53456
53473
<li><p><span>Send <code>select</code> update notifications</span>.</p></li>
53457
53474
53458
- <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select descendant
53475
+ <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select target
53459
53476
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53460
53477
<var>option</var> and <var>selectedoption</var>.</p></li>
53461
53478
</ol>
@@ -53511,7 +53528,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53511
53528
data-x="concept-option-selectedness">selectedness</span> set to true, or null if there is no such
53512
53529
<code>option</code>.</p></li>
53513
53530
53514
- <li><p>For each <var>selectedoption</var> in <var>element</var>'s <span>select descendant
53531
+ <li><p>For each <var>selectedoption</var> in <var>element</var>'s <span>select target
53515
53532
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53516
53533
<var>option</var> and <var>selectedoption</var>.</p></li>
53517
53534
</ol>
@@ -53796,7 +53813,7 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53796
53813
data-x="concept-option-selectedness">selectedness</span> to true and its <span
53797
53814
data-x="concept-option-dirtiness">dirtiness</span> to true.
53798
53815
53799
- <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select descendant
53816
+ <li><p>For each <var>selectedoption</var> in <var>select</var>'s <span>select target
53800
53817
selectedoption elements</span>, run <span>clone an option into a selectedoption</span> given
53801
53818
<var>option</var> and <var>selectedoption</var>.</p></li>
53802
53819
</ol>
@@ -53919,6 +53936,64 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
53919
53936
…</code></pre>
53920
53937
</div>
53921
53938
53939
+ <h4>The <code data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute</h4>
53940
+
53941
+ <p><code>select</code> elements may have the <dfn element-attr
53942
+ for="select"><code data-x="attr-selectedoptionelement">selectedoptionelement</code></dfn>
53943
+ attribute. When specified its value must be the <span data-x="concept-ID">ID</span> of a
53944
+ <code>selectedoption</code> element in the same <span>tree</span> as the <code>select</code> with
53945
+ the <code data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute. The target
53946
+ <code>selectedoption</code> will update its contents to match the currently selected
53947
+ <code>option</code> of the <code>select</code>.</p>
53948
+
53949
+ <div class="example">
53950
+ <p>The following code shows how the <code
53951
+ data-x="attr-selectedoptionelement">selectedoptionelement</code> attribute can be used to render
53952
+ a <code>select</code> element's value outside of the <code>select</code>:</p>
53953
+
53954
+ <pre><code class="html"><label for="pet-select">Choose a pet:</label>
53955
+ <select id="pet-select" selectedoptionelement="summary-value">
53956
+ <option>dog</option>
53957
+ <option>cat</option>
53958
+ </select>
53959
+ <p>Summary: you chose the <selectedoption id="summary-value"></selectedoption>.<p></code></pre>
53960
+ </div>
53961
+
53962
+ <p>The <dfn attribute for="select"><code
53963
+ data-x="dom-selectedoptionelement">selectedOptionElement</code></dfn> IDL attribute must
53964
+ <span>reflect</span> the <code data-x="attr-selectedoptionelement">selectedoptionelement</code>
53965
+ attribute, <span>limited to only known values</span>.</p>
53966
+
53967
+ <p>The following <span data-x="concept-element-attributes-change-ext">attribute change
53968
+ steps</span> given <var>element</var>, <var>localName</var>, <var>oldValue</var>,
53969
+ <var>value</var>, and <var>namespace</var>, are used for <code>select</code> elements:</p>
53970
+
53971
+ <ol>
53972
+ <li><p>If <var>namespace</var> is not null, then return.</p></li>
53973
+
53974
+ <li><p>If <var>localName</var> is not <code
53975
+ data-x="attr-selectedoptionelement">selectedoptionelement</code>, then return.</p></li>
53976
+
53977
+ <li><p>Let <var>oldSelectedoption</var> be the first <code>selectedoption</code> element in
53978
+ <span>tree order</span> in <var>element</var>'s <span>root</span> whose <span
53979
+ data-x="concept-ID">ID</span> is <var>oldValue</var> if one exists, otherwise null.</p></li>
53980
+
53981
+ <li><p>Let <var>newSelectedoption</var> be the first <code>selectedoption</code> element in
53982
+ <span>tree order</span> in <var>element</var>'s <span>root</span> whose <span
53983
+ data-x="concept-ID">ID</span> is <var>value</var> if one exists, otherwise null.</p></li>
53984
+
53985
+ <li><p>If <var>oldSelectedoption</var> is eequal to <var>newSelectedoption</var>, then
53986
+ return.</p></li>
53987
+
53988
+ <li><p>If <var>oldSelectedoption</var> is not null, then run <span>clone an option into a
53989
+ selectedoption</span> given null and <var>oldSelectedOption</var>.</p></li>
53990
+
53991
+ <li><p>If <var>newSelectedoption</var> is not null, then run <span>clone an option into a
53992
+ selectedoption</span> given the value of <var>element</var>'s <code
53993
+ data-x="dom-selectedoptionelement">selectedOptionElement</code> and
53994
+ <var>newSelectedOption</var>.</p></li>
53995
+ </ol>
53996
+
53922
53997
53923
53998
53924
53999
<h4>The <dfn element><code>datalist</code></dfn> element</h4>
@@ -54319,7 +54394,7 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
54319
54394
<var>selectedOption</var>'s <span data-x="dom-option-label">label</span>.</p></li>
54320
54395
54321
54396
<li>
54322
- <p>For each <var>selectedoption</var> of <var>select</var>'s <span>select descendant
54397
+ <p>For each <var>selectedoption</var> of <var>select</var>'s <span>select target
54323
54398
selectedoption elements</span>:</p>
54324
54399
54325
54400
<ol>
0 commit comments