Skip to content

Commit 2eda98a

Browse files
committed
[css-sizing] Make block dimension behave like auto for all -content keywords, per WG resolution.
1 parent 8b287d3 commit 2eda98a

File tree

2 files changed

+28
-42
lines changed

2 files changed

+28
-42
lines changed

css-sizing-3/Overview.bs

+14-20
Original file line numberDiff line numberDiff line change
@@ -267,27 +267,32 @@ New Keywords for 'width' and 'height'</h3>
267267

268268
<dt><dfn>max-content</dfn>
269269
<dd>
270-
Use the <a>max-content inline size</a> or <a>max-content block size</a>,
271-
as appropriate to the writing mode.
270+
If specified for the inline axis,
271+
use the <a>max-content inline size</a>;
272+
otherwise compute to ''width/auto''.
272273

273274
<dt><dfn>min-content</dfn>
274275
<dd>
275-
Use the <a>min-content inline size</a> or <a>min-content block size</a>,
276-
as appropriate to the writing mode.
276+
If specified for the inline axis,
277+
use the <a>min-content inline size</a>;
278+
otherwise compute to ''width/auto''.
277279

278280
<dt><dfn>fit-content</dfn>
279281
<dd>
280-
Use the <a>fit-content inline size</a> or <a>fit-content block size</a>,
281-
as appropriate to the writing mode,
282+
If specified for the inline axis,
283+
use the <a>max-content inline size</a>
282284
i.e.
283-
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <a>fill-available size</a>))</code>
285+
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <a>fill-available size</a>))</code>;
286+
otherwise compute to ''width/auto''.
284287

285288
<dt><dfn>fit-content(<<length-percentage>>)</dfn>
286289
<dd>
287-
Use the fit-content formula
290+
If specified for the inline axis,
291+
use the fit-content formula
288292
with the <a>available space</a> replaced by the specified argument,
289293
i.e.
290-
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>
294+
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>;
295+
otherwise compute to ''width/auto''.
291296
</dl>
292297

293298
Issue: Is ''width/stretch'' stable enough or should we defer to L4?
@@ -298,15 +303,6 @@ New Keywords for 'width' and 'height'</h3>
298303
this is true automatically.
299304
For Block layout, this means using ''display: flow-root;''.
300305

301-
<p class="issue">
302-
Right now all of these except ''width/fill'' mean the same thing
303-
for block-sizes. This may or may not be ideal.
304-
305-
<p class='issue'>
306-
If the inline-size is ''width/auto'',
307-
we could have min-content block-size imply a max-content inline-size,
308-
and vice versa.
309-
310306
<p class='note'>
311307
Note that percentages resolved against the intrinsic sizes
312308
(''width/max-content'', ''width/min-content'', ''width/fit-content'')
@@ -354,10 +350,8 @@ Column Sizing Keywords</h3>
354350
<dd>
355351
Specifies the optimal column width as
356352
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>
357-
358353
</dl>
359354

360-
361355
<h2 id='intrinsic'>
362356
Intrinsic Size Determination</h2>
363357

css-sizing/Overview.bs

+14-22
Original file line numberDiff line numberDiff line change
@@ -265,31 +265,34 @@ New Keywords for 'width' and 'height'</h3>
265265
It allows re-using this formula for boxes that are otherwise shrink-wrapped,
266266
like tables.
267267

268-
Issue: The working group agreed to rename this to <dfn>stretch</dfn> on 2017-01-13.
269-
270268
<dt><dfn>max-content</dfn>
271269
<dd>
272-
Use the <a>max-content inline size</a> or <a>max-content block size</a>,
273-
as appropriate to the writing mode.
270+
If specified for the inline axis,
271+
use the <a>max-content inline size</a>;
272+
otherwise compute to ''width/auto''.
274273

275274
<dt><dfn>min-content</dfn>
276275
<dd>
277-
Use the <a>min-content inline size</a> or <a>min-content block size</a>,
278-
as appropriate to the writing mode.
276+
If specified for the inline axis,
277+
use the <a>min-content inline size</a>;
278+
otherwise compute to ''width/auto''.
279279

280280
<dt><dfn>fit-content</dfn>
281281
<dd>
282-
Use the <a>fit-content inline size</a> or <a>fit-content block size</a>,
283-
as appropriate to the writing mode,
282+
If specified for the inline axis,
283+
use the <a>max-content inline size</a>
284284
i.e.
285-
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <a>fill-available size</a>))</code>
285+
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <a>fill-available size</a>))</code>;
286+
otherwise compute to ''width/auto''.
286287

287288
<dt><dfn>fit-content(<<length-percentage>>)</dfn>
288289
<dd>
289-
Use the fit-content formula
290+
If specified for the inline axis,
291+
use the fit-content formula
290292
with the <a>available space</a> replaced by the specified argument,
291293
i.e.
292-
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>
294+
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>;
295+
otherwise compute to ''width/auto''.
293296
</dl>
294297

295298
Note: To size an element such that it avoids overlapping sibling floats,
@@ -298,15 +301,6 @@ New Keywords for 'width' and 'height'</h3>
298301
this is true automatically.
299302
For Block layout, this means using ''display: flow-root;''.
300303

301-
<p class="issue">
302-
Right now all of these except ''width/stretch'' mean the same thing
303-
for block-sizes. This may or may not be ideal.
304-
305-
<p class='issue'>
306-
If the inline-size is ''width/auto'',
307-
we could have min-content block-size imply a max-content inline-size,
308-
and vice versa.
309-
310304
<p class='note'>
311305
Note that percentages resolved against the intrinsic sizes
312306
(''width/max-content'', ''width/min-content'', ''width/fit-content'')
@@ -354,10 +348,8 @@ Column Sizing Keywords</h3>
354348
<dd>
355349
Specifies the optimal column width as
356350
<code>min(<a>max-content size</a>, max(<a>min-content size</a>, <<length-percentage>>))</code>
357-
358351
</dl>
359352

360-
361353
<h2 id='intrinsic'>
362354
Intrinsic Size Determination</h2>
363355

0 commit comments

Comments
 (0)