@@ -2836,10 +2836,18 @@ Resolving Flexible Lengths</h3>
2836
2836
use the flex grow factor for the rest of this algorithm;
2837
2837
otherwise, use the flex shrink factor.
2838
2838
2839
+ <li>
2840
+ Each item in the flex line has a <dfn>target main size</dfn> ,
2841
+ initially set to its [=flex base size=] .
2842
+ Each item is initially <i> unfrozen</i>
2843
+ and may become <i> frozen</i> .
2844
+
2845
+ Note: An item’s [=target main size=] doesn’t change after freezing.
2846
+
2839
2847
<li>
2840
2848
<strong> Size inflexible items.</strong>
2841
2849
Freeze,
2842
- setting its <dfn> target main size</dfn>
2850
+ setting its [= target main size=]
2843
2851
to its <a>hypothetical main size</a> …
2844
2852
<ul>
2845
2853
<li>
@@ -2856,10 +2864,8 @@ Resolving Flexible Lengths</h3>
2856
2864
2857
2865
<li>
2858
2866
<strong> Calculate <dfn>initial free space</dfn> .</strong>
2859
- Sum the outer sizes of all items on the line,
2867
+ Sum the outer [=target main sizes=] of all items on the line,
2860
2868
and subtract this from the flex container's inner <a>main size</a> .
2861
- For frozen items, use their outer <a>target main size</a> ;
2862
- for other items, use their outer <a>flex base size</a> .
2863
2869
2864
2870
<li>
2865
2871
Loop:
@@ -2880,16 +2886,14 @@ Resolving Flexible Lengths</h3>
2880
2886
use this as the <a>remaining free space</a> .
2881
2887
2882
2888
<li>
2883
- <strong> Distribute free space proportional to the flex factors.</strong>
2889
+ If the [=remaining free space=] is non-zero,
2890
+ <strong> distribute it proportional to the flex factors</strong> :
2884
2891
2885
2892
<dl>
2886
- <dt> If the <a>remaining free space</a> is zero
2887
- <dd>
2888
- Do nothing.
2889
-
2890
2893
<dt> If using the <a>flex grow factor</a>
2891
2894
<dd>
2892
- Find the ratio of the item's flex grow factor
2895
+ For every unfrozen item on the line,
2896
+ find the ratio of the item's flex grow factor
2893
2897
to the sum of the flex grow factors of all unfrozen items on the line.
2894
2898
Set the item's <a>target main size</a> to its <a>flex base size</a>
2895
2899
plus a fraction of the <a>remaining free space</a> proportional to the ratio.
@@ -2905,10 +2909,6 @@ Resolving Flexible Lengths</h3>
2905
2909
minus a fraction of the absolute value of the <a>remaining free space</a> proportional to the ratio.
2906
2910
<span class='note'> Note this may result in a negative inner <a>main size</a> ;
2907
2911
it will be corrected in the next step.</span>
2908
-
2909
- <dt> Otherwise
2910
- <dd>
2911
- Do nothing.
2912
2912
</dl>
2913
2913
2914
2914
<li>
@@ -2941,6 +2941,9 @@ Resolving Flexible Lengths</h3>
2941
2941
Freeze all the items with max violations.
2942
2942
</dl>
2943
2943
2944
+ Note: This freezes at least one item,
2945
+ ensuring that the loop makes progress and eventually terminates.
2946
+
2944
2947
<li>
2945
2948
Return to the start of this loop.
2946
2949
</ol>
@@ -3704,7 +3707,7 @@ Changes since the <a href="https://www.w3.org/TR/2018/CR-css-flexbox-1-20181119/
3704
3707
<ul>
3705
3708
<li id="change-2019-bracket-range-notation">
3706
3709
Changed syntax to use <a>bracketed range notation</a> to reflect the prose restrictions on negative values.
3707
-
3710
+
3708
3711
<li id="change-2018-used-cross-size">
3709
3712
Clarified that the [=flex base size=] calculations
3710
3713
rely on the <em> used</em> [=cross size=] .
@@ -3714,6 +3717,10 @@ Changes since the <a href="https://www.w3.org/TR/2018/CR-css-flexbox-1-20181119/
3714
3717
its <ins> used</ins> inner cross size
3715
3718
and the flex item’s intrinsic aspect ratio.
3716
3719
</blockquote>
3720
+
3721
+ <li id="change-2018-flexible-length-text">
3722
+ Slightly restructured the prose in [[#resolve-flexible-lengths]]
3723
+ to resolve <a href="https://github.com/w3c/csswg-drafts/issues/5179">Issue 5179</a> .
3717
3724
</ul>
3718
3725
3719
3726
<h3 id="changes-20171016">
0 commit comments