Skip to content

Commit 1b816b3

Browse files
committed
[css-sizing-4] Add property to switch among behaviors for zeroing out min-content contributions. w3c#4585
1 parent b46817d commit 1b816b3

File tree

1 file changed

+64
-1
lines changed

1 file changed

+64
-1
lines changed

css-sizing-4/Overview.bs

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ Min/Max Size Transfers</h3>
476476
<h2 id='intrinsic'>
477477
Intrinsic Size Determination</h2>
478478

479-
<h3 id="intrinsic-contribution">
479+
<h3 id="intrinsic-sizes">
480480
Intrinsic Sizes</h3>
481481

482482
ISSUE: [[css-sizing-3#intrinsic-sizes]]
@@ -628,6 +628,69 @@ Intrinsic Size Contributions</h3>
628628

629629
ISSUE: [[css-sizing-3#intrinsic-contribution]]
630630

631+
<h3 id='intrinsic-contribution-override'>
632+
Zeroing Min-Content Size Contributions: the 'min-intrinsic-sizing' property</h3>
633+
634+
<pre class="propdef">
635+
Name: min-intrinsic-sizing
636+
Value: legacy | zero-if-scroll || zero-if-extrinsic
637+
Initial: legacy
638+
Inherited: no
639+
Applies to: all elements except [=inline boxes=]
640+
Computed value: as specified
641+
Percentages: n/a
642+
Animation type: discrete
643+
</pre>
644+
645+
ISSUE: This property seriously needs some name bikeshedding.
646+
647+
This property defines whether the [=min-content contribution=]
648+
of a [=non-replaced=] box
649+
is “compressed” under certain circumstances.
650+
Values have the following meanings:
651+
652+
<dl dfn-for=min-intrinsic-size dfn-type=value>
653+
<dt><dfn>legacy</dfn>
654+
<dd>
655+
The box’s [=min-content contribution=]
656+
is handled as normal.
657+
658+
<dt><dfn>zero-if-scroll</dfn>
659+
<dd>
660+
The box’s [=min-content contribution=]
661+
is “compressed” if it is a [=scroll container=].
662+
663+
<dt><dfn>zero-if-extrinsic</dfn>
664+
<dd>
665+
The box’s [=min-content contribution=]
666+
is “compressed” if has an [=extrinsic size|extrinsic=]
667+
[=preferred size|preferred=] or [=maximum size|maximum=] size.
668+
669+
Note: This is the default behavior of most [=replaced elements=].
670+
</dl>
671+
672+
<div class="example">
673+
The following rule will make all [=scroll containers=]
674+
essentially ignore their contents
675+
when passing up their size contributions
676+
(unless they specifically requested a content-based size):
677+
678+
<pre highlight=css>*, ::before, ::after { min-intrinsic-size: zero-if-scroll; }</pre>
679+
680+
This prevents the [=scroll container=] from blowing up the size of its ancestors
681+
if it contains large items such as a table or long lines of unbreakable text.
682+
Meanwhile, it allows boxes that are not scroll containers
683+
to continue influencing the [=min-content size=] of their ancestors.
684+
</div>
685+
686+
Note: The behavior of ''zero-if-scroll'' would have been a better default,
687+
but due to Web-compat, it cannot be the initial value. :(
688+
689+
The “compressed” [=min-content contributions=] is calculated
690+
by pretending the box were empty,
691+
except when factoring in sizing constraints imposed by explicit
692+
''width/min-content'', ''width/max-content'', and ''width/fit-content'' values
693+
of the [=sizing properties=].
631694

632695
<!--
633696
████████ ██ ██ ████████ ████████ ████ ██ ██ ██████ ████ ██████

0 commit comments

Comments
 (0)