Skip to content

Commit 8aed1e9

Browse files
authored
Fix base appearance select styles
This PR fixes some duplication and conflicts between UA styles for select elements: - display:inline-block was declared unconditionally for select elements but display:inline-flex is used for base appearance, so I created a separate section for native/primitive appearance and put display:inline-block in there to disambiguate the base appearance value. - The form-controls section has a block of CSS which sets some text properties to initial and sets box-sizing:border-box for select elements, so I removed the duplicate values for those from the base appearance select section. - Inherit letter-spacing for base appearance, which was resolved in CSSWG and implemented in chromium but not added to this spec. Fixes #11804.
1 parent 80fa5b5 commit 8aed1e9

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

source

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146480,10 +146480,13 @@ table {
146480146480

146481146481
<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
146482146482

146483-
input, select, button, textarea {
146483+
input, button, textarea {
146484146484
letter-spacing: initial;
146485146485
word-spacing: initial;
146486146486
line-height: initial;
146487+
}
146488+
146489+
input, select, button, textarea {
146487146490
text-transform: initial;
146488146491
text-indent: initial;
146489146492
text-shadow: initial;
@@ -148014,14 +148017,13 @@ progress { appearance: auto; }</code></pre>
148014148017

148015148018
<p>A <code>select</code> element whose <code data-x="attr-select-multiple">multiple</code>
148016148019
attribute is absent, and whose <span data-x="concept-select-size">display size</span> is 1, is
148017-
<span>expected</span> to render as an <span>'inline-block'</span> one-line <span>drop-down
148018-
box</span>. The <span>inline size</span> of its <span>intrinsic size</span> is the
148019-
<span>width of the <code>select</code>'s labels</span>. If the <span>'field-sizing'</span>
148020-
property on the element has a <span>computed value</span> of
148021-
<span data-x="field-sizing-content">'content'</span>, the <span>inline size</span> of the
148022-
<span>intrinsic size</span> depends on the shown text. The shown text is typically the label of
148023-
an <code>option</code> of which <span data-x="concept-option-selectedness">selectedness</span> is
148024-
set to true.</p>
148020+
<span>expected</span> to render as a <span>drop-down box</span>. The <span>inline size</span> of
148021+
its <span>intrinsic size</span> is the <span>width of the <code>select</code>'s labels</span>. If
148022+
the <span>'field-sizing'</span> property on the element has a <span>computed value</span> of <span
148023+
data-x="field-sizing-content">'content'</span>, the <span>inline size</span> of the
148024+
<span>intrinsic size</span> depends on the shown text. The shown text is typically the label of an
148025+
<code>option</code> of which <span data-x="concept-option-selectedness">selectedness</span> is set
148026+
to true.</p>
148025148027

148026148028
<div algorithm>
148027148029
<p>When the element renders as a <span>drop-down box</span>, it is a <span>devolvable
@@ -148141,15 +148143,25 @@ progress { appearance: auto; }</code></pre>
148141148143

148142148144
</div>
148143148145

148146+
<p>The following styles are <span>expected</span> to apply to <code>select</code> elements when
148147+
they are being rendered as a <span>drop-down box</span> with <span>native appearance</span> or
148148+
<span>primitive appearance</span>:</p>
148149+
148150+
<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
148151+
148152+
select {
148153+
display: inline-block;
148154+
letter-spacing: initial;
148155+
word-spacing: initial;
148156+
line-height: initial;
148157+
}</code></pre>
148158+
148144148159
<p>The following styles are <span>expected</span> to apply to <code>select</code> elements when
148145148160
they are being rendered as a <span>drop-down box</span> with <span>base appearance</span>:</p>
148146148161

148147148162
<pre><code class="css">@namespace "http://www.w3.org/1999/xhtml";
148148148163

148149148164
select {
148150-
text-transform: initial;
148151-
text-align: initial;
148152-
text-indent: initial;
148153148165
background-color: transparent;
148154148166
border: 1px solid currentColor;
148155148167
padding-block: 0.25em;
@@ -148160,7 +148172,6 @@ select {
148160148172
gap: 0.5em;
148161148173
border-radius: 0.5em;
148162148174
user-select: none;
148163-
box-sizing: border-box;
148164148175
field-sizing: content !important;
148165148176
}
148166148177

0 commit comments

Comments
 (0)