Skip to content

Commit 3f33b56

Browse files
committed
[css-sizing-3] Handle input intrinsic size minimum as a UA-imposed value, per fremy's comment in #2141 (comment) ; additional wording cleanup. #2141
1 parent eeb2d6f commit 3f33b56

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

css-sizing-3/Overview.bs

+15-10
Original file line numberDiff line numberDiff line change
@@ -802,17 +802,20 @@ Intrinsic Sizes</h3>
802802
The content in this case is defined to be the input control's values
803803
(the <l spec=html>[=raw value=]</l> in the case of <{textarea}>,
804804
or the <a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-value">value</a> in the case of <{input}>),
805-
possibly transformed to a localized display format,
805+
possibly transformed to a more human-readable and/or localized display format,
806806
which is then treated as child <a>text runs</a> of the input control.
807-
If the input control has <a>placeholder text</a> overlaid,
807+
If the input control has designated placeholder text
808+
to be overlaid in its value display area,
808809
then that text is also measured for the purpose of calculating the content-based size--
809810
whether or not the placeholder text is visible at the moment.
810811
(Thus the content-based intrinsic size of the input control
811812
is the larger of the size to fit the placeholder text and the size to fit the value.)
812-
813-
Issue: So that this gives sensible results,
814-
ensure minimum height via UA style sheet
815-
<code>textarea { min-height: 1lh; }</code>.
813+
The UA may enforce a minimum
814+
(such as the size required to contain a single zero-width character)
815+
on the form control’s
816+
<a lt="min-content size">min-content</a> and <a>max-content sizes</a>
817+
to ensure sufficient space for the caret
818+
and otherwise maintain usability of the form control.
816819

817820
Issue: <code>&lt;input type=text></code> only ever displays its value on a single line.
818821
This appears to be accomplished by "magic":
@@ -821,10 +824,12 @@ Intrinsic Sizes</h3>
821824
rather than the 'white-space' property in the UA stylesheet.
822825
Thus, the ''width/min-content'' size should probably automatically treat it as if it had ''white-space: pre''.
823826

824-
Note: See <a href="https://github.com/w3c/csswg-drafts/issues/1771">discussion about this functionality</a>.
825-
This might be extended to <{iframe}> or other content-containing replaced elements,
826-
but text inputs are the major use-case
827-
and have the least additional complications.
827+
Note:
828+
This might be extended to <{iframe}> or other content-containing replaced elements
829+
(see <a href="https://github.com/w3c/csswg-drafts/issues/1771">discussion</a>),
830+
but text inputs are a major use-case,
831+
and being document-internal,
832+
have the least additional complications.
828833

829834
<h3 id="intrinsic-contribution">
830835
Intrinsic Contributions</h3>

0 commit comments

Comments
 (0)