























@@ -57354,7 +57354,8 @@ interface <dfn interface>HTMLSelectElement</dfn> : <span>HTMLElement</span> {
5735457354 value, or through a <span data-x="option-command">menu command</span>, or through any other
5735557355 mechanism) by running the <span data-x="concept-select-pick">pick an option</span> algorithm given
5735657356 the <code>select</code> element, the <code>option</code> element, and if the
57357- <span><code>select</code>'s <code>option</code>s are being rendered with base appearance</span>, a
57357+ <span data-x="select's options are being rendered with base appearance"><code>select</code>'s
57358+ contents are being rendered with base appearance</span>, a
5735857359 corresponding <code data-x="event-keydown">keydown</code> or <code
5735957360 data-x="event-mouseup">mouseup</code> event, otherwise null.</p>
5736057361 </div>
@@ -152792,12 +152793,45 @@ progress { appearance: auto; }</code></pre>
152792152793 <p>The <span>'::checkmark'</span> pseudo-element only applies to <code>option</code> elements
152793152794 which are <span data-x="option-base-appearance">being rendered with base appearance</span>.</p>
152794152795152795- <p>An <code>optgroup</code> element is <span>expected</span> to be rendered by displaying the
152796- element's <code data-x="attr-optgroup-label">label</code> attribute.</p>
152796+ <p>An <code>optgroup</code> element has an internal <span>shadow tree</span> with at least one
152797+ <code>slot</code> element.</p>
152798+152799+ <p>An <code>optgroup</code> element is <dfn data-x="optgroup-base-appearance">rendered with base
152800+ appearance</dfn> if it has a <span data-x="option element nearest ancestor select">nearest
152801+ ancestor <code>select</code></span> whose <span data-x="select's options are being rendered with
152802+ base appearance">contents are being rendered with base appearance</span>.</p>
152803+152804+ <p>If an <code>optgroup</code> element is not being <span
152805+ data-x="optgroup-base-appearance">rendered with base appearance</span>, then it is
152806+ <span>expected</span> to be rendered by displaying the element's <span
152807+ data-x="concept-optgroup-label">label</span> and children.</p>
152808+152809+ <p>If an <code>optgroup</code> element is being <span data-x="optgroup-base-appearance">rendered
152810+ with base appearance</span>, then it is <span>expected</span> to render with a <span>shadow
152811+ tree</span> that contains the following elements:</p>
152812+152813+ <ol>
152814+ <li><p>An <dfn>optgroup legend slot</dfn>, which is a <code>slot</code> element. It is appended
152815+ to the <code>optgroup</code>'s <span>shadow root</span> as the first child. It is
152816+ <span>expected</span> to take the first child element of the <code>optgroup</code> if the first
152817+ child element is a <code>legend</code> element.</p></li>
152818+152819+ <li><p>An <dfn>optgroup label element</dfn>, which is a <code>div</code> element. It is appended
152820+ to the <span>optgroup legend slot</span>. It is <span>expected</span> to contain a
152821+ <code>Text</code> node whose <span data-x="concept-cd-data">data</span> is the value of the
152822+ <code>optgroup</code>'s <code data-x="attr-optgroup-label">label</code> attribute, or the empty
152823+ string if the attribute is not present.</p></li>
152824+152825+ <li><p>An <dfn>optgroup contents slot</dfn>, which is a <code>slot</code> element. It is appended
152826+ to the <code>optgroup</code>'s <span>shadow root</span> after the <span>optgroup legend
152827+ slot</span>. It is <span>expected</span> to take all remaining child nodes of the
152828+ <code>optgroup</code> element.</p></li>
152829+ </ol>
152797152830152798152831 <div algorithm>
152799- <p>To determine if a <dfn><code>select</code>'s <code>option</code>s are being rendered with base
152800- appearance</dfn>, given a <code>select</code> element <var>select</var>:</p>
152832+ <p>To determine if a <dfn data-x="select's options are being rendered with base
152833+ appearance"><code>select</code>'s contents are being rendered with base appearance</dfn>, given a
152834+ <code>select</code> element <var>select</var>:</p>
152801152835152802152836 <ol>
152803152837 <li><p>If <var>select</var> is being rendered as a <span>list box</span> with <span>base
@@ -152812,18 +152846,45 @@ progress { appearance: auto; }</code></pre>
152812152846 </ol>
152813152847 </div>
152814152848152849+ <p>An <code>option</code> element has an internal <span>shadow tree</span> with a
152850+ <code>slot</code> element.</p>
152851+152815152852 <p>An <code>option</code> element is <dfn data-x="option-base-appearance">rendered with base
152816152853 appearance</dfn> if it has a <span data-x="option element nearest ancestor select">nearest
152817- ancestor <code>select</code></span> and the <span><code>select</code>'s <code>option</code>s are
152818- being rendered with base appearance</span>.</p>
152854+ ancestor <code>select</code></span> and the <span data-x="select's options are being rendered
152855+ with base appearance"><code>select</code>'s contents are being rendered with base
152856+ appearance</span>.</p>
152857+152858+ <p>If an <code>option</code> does not have a <span data-x="option element nearest ancestor
152859+ select">nearest ancestor <code>select</code></span>, then it is <span>expected</span> to render
152860+ its children.</p>
152861+152862+ <p>Otherwise, if an <code>option</code> element is not being <span
152863+ data-x="option-base-appearance">rendered with base appearance</span>, then it is
152864+ <span>expected</span> to be rendered by displaying the result of <span>collect option text</span>
152865+ given the <code>option</code> and true.</p>
152819152866152820- <p>An <code>option</code> element is <span>expected</span> to be rendered by displaying the result
152821- of <span>collect option text</span> given the <code>option</code> and true, indented under its
152822- <code>optgroup</code> element if it has one. If the <code>option</code> <span
152823- data-x="option-base-appearance">is being rendered with base appearance</span> and the
152824- <code>option</code>'s <code data-x="attr-option-label">label</code> attribute is not set, then the
152825- <code>option</code> is <span>expected</span> to render all of its children rather than by
152826- displaying its <span data-x="concept-option-label">label</span>.</p>
152867+ <p>Otherwise, it is <span>expected</span> to render with a <span>shadow tree</span>
152868+ that contains the following elements:</p>
152869+152870+ <ol>
152871+ <li>
152872+ <p>An <dfn>option contents slot</dfn>, which is a <code>slot</code> element. It is appended to
152873+ the <code>option</code>'s <span>shadow root</span> as the first child.
152874+ If the <code>option</code> element has a <code data-x="attr-option-label">label</code>
152875+ attribute whose value is not the empty string, then the <span>option contents slot</span> is
152876+ <span>expected</span> to not take any nodes. Otherwise, it is <span>expected</span> to take all
152877+ child nodes of the <code>option</code> element.</p>
152878+152879+ <p class="note">When the <span>option contents slot</span> does not take any elements, the
152880+ <span>option label element</span> is rendered as fallback content.</p>
152881+ </li>
152882+152883+ <li><p>An <dfn>option label element</dfn>, which is a <code>span</code> element. It is appended
152884+ to the <span>option contents slot</span>. It is <span>expected</span> to contain a
152885+ <code>Text</code> node whose <span data-x="concept-cd-data">data</span> is the value of the
152886+ <code>option</code>'s <code data-x="attr-option-label">label</code> attribute.</p></li>
152887+ </ol>
152827152888152828152889 <p>Each sequence of one or more child <code>hr</code> element siblings may be rendered as a single
152829152890 separator.</p>
@@ -152861,6 +152922,17 @@ progress { appearance: auto; }</code></pre>
152861152922152862152923 </div>
152863152924152925+ <pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
152926+152927+option {
152928+ display: block;
152929+}
152930+152931+optgroup {
152932+ display: block;
152933+ font-weight: bolder;
152934+}</code></pre>
152935+152864152936 <p>The following styles are <span>expected</span> to apply to <code>select</code> elements when
152865152937 they are being rendered with <span>native appearance</span> or <span>primitive
152866152938 appearance</span>:</p>
@@ -153005,6 +153077,15 @@ select {
153005153077 block-size: calc(max(24px, 1lh) * attr(size type(<integer>), 4));
153006153078}</code></pre>
153007153079153080+ <p>The following styles are <span>expected</span> to apply to the <span>optgroup label
153081+ element</span>:</p>
153082+153083+ <ul>
153084+ <li><p><code data-x="" class="css">padding-inline: 0.5em</code></p></li>
153085+153086+ <li><p><code data-x="" class="css">min-block-size: 1lh</code></p></li>
153087+ </ul>
153088+153008153089 <div w-nodev>
153009153090153010153091 <h4>The <code>textarea</code> element</h4>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。