Skip to content

Commit f5f655b

Browse files
committed
[css-sizing-3] Defer 'stretch' and 'fit-content' to Level 4 per WG resolution.
1 parent ab5d18e commit f5f655b

1 file changed

Lines changed: 48 additions & 18 deletions

File tree

css-sizing-3/Overview.bs

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Title: CSS Intrinsic & Extrinsic Sizing Module Level 3
33
Shortname: css-sizing
44
Level: 3
5-
Status: WD
6-
Work Status: Revising
5+
Status: ED
6+
Work Status: Refining
77
Group: csswg
88
ED: https://drafts.csswg.org/css-sizing-3/
99
TR: https://www.w3.org/TR/css-sizing-3/
@@ -146,14 +146,20 @@ Auto Box Sizes</h3>
146146
: <dfn>stretch-fit size</dfn>
147147
: <dfn>stretch-fit inline size</dfn>
148148
: <dfn>stretch-fit block size</dfn>
149-
:: Roughly, the <a>size</a> a box would take
150-
if it filled the <a>available space</a>
151-
in the given axis.
152-
(See [[#extrinsic]].)
149+
:: The <a>size</a> a box would take
150+
if its <a>outer size</a> filled the <a>available space</a>
151+
in the given axis;
152+
in other words, the <a>stretch fit</a> into the <a>available space</a>,
153+
if that is <a>definite</a>.
154+
Undefined if the <a>available space</a> is <a>indefinite</a>.
153155

154156
Note: For the <a>inline axis</a>, this is called the “available width” in <a href="https://www.w3.org/TR/CSS2/visudet.html#float-width">CSS2.1§10.3.5</a>
155157
and computed by the rules in <a href="https://www.w3.org/TR/CSS2/visudet.html#blockwidth">CSS2.1§10.3.3</a>.
156158

159+
Note: Calculations involving this size need to specify a fallback behavior
160+
for when the <a>available space</a> is <a>indefinite</a>
161+
if that happens to be possible.
162+
157163
: <dfn lt="max-content | max-content size">max-content size</dfn>
158164
:: A box’s “ideal” <a>size</a> in a given axis when given infinite available space.
159165
Usually this is the smallest <a>size</a> the box could take in that axis
@@ -247,7 +253,7 @@ New Keywords for 'width' and 'height'</h3>
247253

248254
<pre class=propdef partial>
249255
Name: width, max-width, height, max-height
250-
New values: stretch | max-content | min-content | fit-content | fit-content(<<length-percentage>>)
256+
New values: max-content | min-content | fit-content(<<length-percentage>>)
251257
</pre>
252258

253259
<pre class=propdef partial>
@@ -260,6 +266,7 @@ New Keywords for 'width' and 'height'</h3>
260266
defined above):
261267

262268
<dl dfn-type=value dfn-for="width, min-width, max-width, height, min-height, max-height">
269+
<!--
263270
<dt><dfn for="width, max-width, height, max-height">stretch</dfn>
264271
<dd>
265272
If 'align-self' or 'justify-self' (as appropriate to the relevant axis)
@@ -275,6 +282,7 @@ New Keywords for 'width' and 'height'</h3>
275282
for non-replaced blocks in normal flow, see <a href="https://www.w3.org/TR/CSS2/visudet.html#blockwidth">CSS2.1§10.3.3</a>.
276283
It allows re-using this formula for boxes that are otherwise shrink-wrapped,
277284
like tables.
285+
-->
278286

279287
<dt><dfn>max-content</dfn>
280288
<dd>
@@ -287,15 +295,15 @@ New Keywords for 'width' and 'height'</h3>
287295
If specified for the inline axis,
288296
use the <a>min-content inline size</a>;
289297
otherwise compute to the property’s <a>initial value</a>.
290-
298+
<!--
291299
<dt><dfn for="width, max-width, height, max-height">fit-content</dfn>
292300
<dd>
293301
If specified for the inline axis,
294302
use the <a>fit-content inline size</a>
295303
i.e.
296304
<code>min(''width/max-content'', max(''width/min-content'', ''width/stretch''))</code>;
297305
otherwise compute to the property’s <a>initial value</a>.
298-
306+
-->
299307
<dt><dfn for="width, max-width, height, max-height">fit-content(<<length-percentage>>)</dfn>
300308
<dd>
301309
If specified for the inline axis,
@@ -306,24 +314,39 @@ New Keywords for 'width' and 'height'</h3>
306314
otherwise compute to the property’s <a>initial value</a>.
307315
</dl>
308316

309-
Issue: Is ''width/stretch'' stable enough or should we defer to L4?
317+
Note: This section previously defined ''width/stretch'' and ''width/fit-content''
318+
as keywords representing the <a>stretch-fit size</a> and <a>fit-content size</a>,
319+
respectively.
320+
These keywords have been deferred to Level 4
321+
(along with an additional ''width/contain'' keyword that
322+
behaves similarly to ''width/stretch''
323+
but preserves the intrinsic aspect ratio, if any)
324+
to better work out the implications in situations with
325+
<a>indefinite</a> <a>available space</a>.
310326

311327
Note: To size an element such that it avoids overlapping sibling floats,
312328
make sure it's a <a>formatting context</a> root.
313329
For some layout modes, such as Grid and Flexbox,
314330
this is true automatically.
315331
For Block layout, this means using ''display: flow-root;''.
316332

333+
<h4 id="behave-auto">
334+
“Behaving as ''width/auto''”</h4>
335+
336+
<!-- THIS NEED SOME THINKING THROUGH, WE DID WEIRD THINGS WITH FLEXBOX/GRID
317337
Note: Percentages resolved against the intrinsic sizes
318338
(''width/max-content'', ''width/min-content'', ''width/fit-content'')
319339
will behave as ''width/auto''.
340+
-->
320341
<!-- <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">as defined by CSS 2</a>. [[!CSS2]] -->
321342
<!-- Restore the above when 2.1 is updated and published with the new "behaves as" text we resolved on. -->
322343

323344
To have a common term for both when
324345
'width'/'height' computes to ''width/auto''
325-
and when it is defined to behave as ''width/auto''
326-
(as in the case above),
346+
and when it is defined to behave as if ''width/auto'' were specified
347+
(as in the case of <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">block percentage heights</a>
348+
resolving against an <a>indefinite</a> size,
349+
see <a href="https://www.w3.org/TR/CSS2/visudet.html#the-height-property">CSS2&sect;10.5</a>),
327350
the property is said to <dfn export lt="behave as auto|behaves as auto|behaving as auto">behave as auto</dfn>
328351
in both of these cases.
329352

@@ -346,35 +369,42 @@ Column Sizing Keywords</h3>
346369

347370
<pre class="propdef partial">
348371
Name: column-width
349-
New values: stretch | max-content | min-content | fit-content | fit-content(<<length-percentage>>)
372+
New values: max-content | min-content | fit-content(<<length-percentage>>)
350373
</pre>
351374

352375
<p>When used as values for 'column-width',
353376
the new keywords specify the optimal column width:
354377

355378
<dl dfn-type=value dfn-for="column-width">
379+
<!--
356380
<dt><dfn>stretch</dfn>
357381
<dd>Specifies the optimal column width as the <a>stretch-fit inline size</a>
358382
of the multi-column element.
359-
383+
-->
360384
<dt><dfn>max-content</dfn>
361385
<dd>Specifies the optimal column width as the <a>max-content inline size</a>
362386
of the multi-column element's contents.
363387

364388
<dt><dfn>min-content</dfn>
365389
<dd>Specifies the optimal column width as the <a>min-content inline size</a>
366390
of the multi-column element's contents.
367-
391+
<!--
368392
<dt><dfn>fit-content</dfn>
369393
<dd>Specifies the optimal column width as
370394
<code>min(<a>max-content inline size</a>, max(<a>min-content inline size</a>, <a>stretch-fit inline size</a>))</code>.
371-
395+
-->
372396
<dt><dfn>fit-content(<<length-percentage>>)</dfn>
373397
<dd>
374398
Specifies the optimal column width as
375399
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>
376400
</dl>
377401

402+
Note: The column width does not vary by column.
403+
When the column width is informed by the multi-column element's contents
404+
(as in the keywords above),
405+
all of its contents are taken under consideration
406+
and the calculated width is shared by all the columns.
407+
378408
<h2 id='intrinsic'>
379409
Intrinsic Size Determination</h2>
380410

@@ -672,8 +702,8 @@ Changes</h2>
672702
<li>Compute new keywords to the initial value, not to a potentially non-existent ''width/auto'', when applied to the block axis.
673703
<li>Specify that percent sizes on replaced elements zero out their min-content contribution.
674704
<li>Fix confusing/wrong definition of percentage sizes resolved against a dependent containing block.
675-
<li>
676-
ISSUE: Drop ''width/stretch'' for now?
705+
<li>Deferred the ''width/stretch'' and ''width/fit-content'' keywords to Level 4
706+
to allow for further consideration of their behavior in <a>indefinite</a> containing blocks.
677707
</ul>
678708

679709
<h2 class=no-num id="acknowledgments">

0 commit comments

Comments
 (0)