Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -146166,10 +146166,13 @@ table {

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

input, select, button, textarea {
input, button, textarea {
letter-spacing: initial;
word-spacing: initial;
line-height: initial;
}

input, select, button, textarea {
text-transform: initial;
text-indent: initial;
text-shadow: initial;
Expand Down Expand Up @@ -147700,14 +147703,13 @@ progress { appearance: auto; }</code></pre>

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

<div algorithm>
<p>When the element renders as a <span>drop-down box</span>, it is a <span>devolvable
Expand Down Expand Up @@ -147827,15 +147829,27 @@ progress { appearance: auto; }</code></pre>

</div>

<p>The following styles are <span>expected</span> to apply to <code>select</code> elements when
they are being rendered as a <span>drop-down box</span> with <span>native appearance</span> or
<span>primitive appearance</span>:</p>

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

select {
display: inline-block;
letter-spacing: initial;
word-spacing: initial;
}</code></pre>

<p>The following styles are <span>expected</span> to apply to <code>select</code> elements when
they are being rendered as a <span>drop-down box</span> with <span>base appearance</span>:</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not already can you make a PR to add this to CSS forms spec?

If you link to the CSS resolution on the PR I can just go ahead and merge it. I'm guessing this is intended to apply to all button-like controls?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other properties (word-spacing, line-height, text-transform, text-indent, text-shadow) are also different between native/primitive and base in Chromium.

I would prefer these properties to be set only in the "native/primitive" sheet instead of being set to initial and then back to inherit (for base). I think it's not defined that the spec order of these separate sheets are of any importance, but if there are conflicting rules then the order is important.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not already can you make a PR to add this to CSS forms spec?

I just took a look and I think that css-forms is up to date. Is there something you think is missing? It seems that inherited properties are implied: https://github.com/w3c/csswg-drafts/pull/12138/files

The other properties (word-spacing, line-height, text-transform, text-indent, text-shadow) are also different between native/primitive and base in Chromium.

I see, then https://html.spec.whatwg.org/#form-controls is not accurate since it implies that both auto and base set all those properties to initial. I separated out and hopefully disambiguated, how does it look?


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

select {
text-transform: initial;
text-align: initial;
text-indent: initial;
letter-spacing: inherit;
word-spacing: inherit;
line-height: inherit;
background-color: transparent;
border: 1px solid currentColor;
padding-block: 0.25em;
Expand All @@ -147846,7 +147860,6 @@ select {
gap: 0.5em;
border-radius: 0.5em;
user-select: none;
box-sizing: border-box;
field-sizing: content !important;
}

Expand Down