@@ -2878,15 +2878,32 @@ Intrinsic Sizes</h3>
28782878Flex Container Intrinsic Main Sizes</h4>
28792879
28802880 The <strong> <a>max-content</a> <a>main size</a> of a <a>flex container</a> </strong>
2881- is, fundamentally , the smallest size the <a>flex container</a> can take
2881+ is, theoretically , the smallest size the <a>flex container</a> can take
28822882 such that when flex layout is run with that container size,
28832883 each [=flex item=] ends up at least as large as
28842884 its [[#intrinsic-item-contributions|max-content contribution]] ,
28852885 to the extent allowed by the items’ flexibility.
28862886
2887- It is calculated,
2888- considering only non-[=collapsed=] [=flex items=] ,
2889- by:
2887+ The <strong> [=min-content=] [=main size=] is, theoretically,
2888+ the smallest size the [=flex container can take=]
2889+ such that no items overflow it,
2890+ and no item's contents overflow the item--
2891+ setting aside the cases in which the boxes layouts are <em> defined</em> to overflow
2892+ (for example with negative margins or percentage sizes that add up to more than 100%).
2893+
2894+ <h5 id='intrinsic-main-sizes-ideal'>
2895+ Ideal Algorithm</h5>
2896+
2897+ Note: The following algorithm calculates the [=flex container=] ’s ideal
2898+ intrinsic [=main sizes=] .
2899+ However, because it was not implemented correctly initially,
2900+ and existing content became dependent on the (unfortunately consistent) incorrect implemented behavior,
2901+ <a href="https://github.com/w3c/csswg-drafts/issues/8884">it is not Web-compatible</a> .
2902+ Implementers and the CSS Working Group are investigating to what extent
2903+ Web browser implementations can safely approach this behavior,
2904+ and further experimentation is welcome.
2905+
2906+ Considering only non-[=collapsed=] [=flex items=] ;
28902907
28912908 <ol>
28922909 <li>
@@ -2940,15 +2957,6 @@ Flex Container Intrinsic Main Sizes</h4>
29402957 except that the <a>flex items</a> ’ [[#intrinsic-item-contributions|min-content contributions]] are used
29412958 instead of their [[#intrinsic-item-contributions|max-content contributions]] .
29422959
2943- However, for a <em> <a>multi-line</a> </em> container,
2944- the [=min-content=] [=main size=] is simply the largest [[#intrinsic-item-contributions|min-content contribution]]
2945- of all the non-[=collapsed=] <a>flex items</a> in the <a>flex container</a> .
2946- For this purpose,
2947- each item's contribution
2948- is capped by the item’s [=flex base size=] if the item is not growable,
2949- floored by the item’s [=flex base size=] if the item is not shrinkable,
2950- and then further clamped by the item's min and max main sizes.
2951-
29522960 <details class=note>
29532961 <summary> Implications of this algorithm when the sum of flex is less than 1</summary>
29542962
@@ -3029,6 +3037,27 @@ Flex Container Intrinsic Main Sizes</h4>
30293037 </details>
30303038 </details>
30313039
3040+ <h5 id="intrinsic-main-sizes-compat">
3041+ Web-compatible Intrinsic Sizing Algorithm</h5>
3042+
3043+ Note: The following algorithm has been demonstrated to be Web-compatible.
3044+ It may be altered in the future to bring it closer to the ideal algorithm above,
3045+ if possible.
3046+
3047+ ISSUE(8884): Outline Web-compatible algorithm here, once we have one.
3048+
3049+ <h5 id="intrinsic-main-sizes-multiline">
3050+ Multi-line Min-content Algorithm</h5>
3051+
3052+ For a <em> <a>multi-line</a> </em> container,
3053+ the [=min-content=] [=main size=] is simply the largest [[#intrinsic-item-contributions|min-content contribution]]
3054+ of all the non-[=collapsed=] <a>flex items</a> in the <a>flex container</a> .
3055+ For this purpose,
3056+ each item's contribution
3057+ is capped by the item’s [=flex base size=] if the item is not growable,
3058+ floored by the item’s [=flex base size=] if the item is not shrinkable,
3059+ and then further clamped by the item's min and max main sizes.
3060+
30323061<h4 id='intrinsic-cross-sizes'>
30333062Flex Container Intrinsic Cross Sizes</h4>
30343063
0 commit comments