Skip to content

Commit 91bab66

Browse files
committed
[css-flexbox] Slightly restructured the text for resolving flexible lengths to resolve #5179. No normative changes intended.
1 parent b5fa96c commit 91bab66

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

css-flexbox-1/Overview.bs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,10 +2836,18 @@ Resolving Flexible Lengths</h3>
28362836
use the flex grow factor for the rest of this algorithm;
28372837
otherwise, use the flex shrink factor.
28382838

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+
28392847
<li>
28402848
<strong>Size inflexible items.</strong>
28412849
Freeze,
2842-
setting its <dfn>target main size</dfn>
2850+
setting its [=target main size=]
28432851
to its <a>hypothetical main size</a>&hellip;
28442852
<ul>
28452853
<li>
@@ -2856,10 +2864,8 @@ Resolving Flexible Lengths</h3>
28562864

28572865
<li>
28582866
<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,
28602868
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>.
28632869

28642870
<li>
28652871
Loop:
@@ -2880,16 +2886,14 @@ Resolving Flexible Lengths</h3>
28802886
use this as the <a>remaining free space</a>.
28812887

28822888
<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>:
28842891

28852892
<dl>
2886-
<dt>If the <a>remaining free space</a> is zero
2887-
<dd>
2888-
Do nothing.
2889-
28902893
<dt>If using the <a>flex grow factor</a>
28912894
<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
28932897
to the sum of the flex grow factors of all unfrozen items on the line.
28942898
Set the item's <a>target main size</a> to its <a>flex base size</a>
28952899
plus a fraction of the <a>remaining free space</a> proportional to the ratio.
@@ -2905,10 +2909,6 @@ Resolving Flexible Lengths</h3>
29052909
minus a fraction of the absolute value of the <a>remaining free space</a> proportional to the ratio.
29062910
<span class='note'>Note this may result in a negative inner <a>main size</a>;
29072911
it will be corrected in the next step.</span>
2908-
2909-
<dt>Otherwise
2910-
<dd>
2911-
Do nothing.
29122912
</dl>
29132913

29142914
<li>
@@ -2941,6 +2941,9 @@ Resolving Flexible Lengths</h3>
29412941
Freeze all the items with max violations.
29422942
</dl>
29432943

2944+
Note: This freezes at least one item,
2945+
ensuring that the loop makes progress and eventually terminates.
2946+
29442947
<li>
29452948
Return to the start of this loop.
29462949
</ol>
@@ -3704,7 +3707,7 @@ Changes since the <a href="https://www.w3.org/TR/2018/CR-css-flexbox-1-20181119/
37043707
<ul>
37053708
<li id="change-2019-bracket-range-notation">
37063709
Changed syntax to use <a>bracketed range notation</a> to reflect the prose restrictions on negative values.
3707-
3710+
37083711
<li id="change-2018-used-cross-size">
37093712
Clarified that the [=flex base size=] calculations
37103713
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/
37143717
its <ins>used</ins> inner cross size
37153718
and the flex item’s intrinsic aspect ratio.
37163719
</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>.
37173724
</ul>
37183725

37193726
<h3 id="changes-20171016">

0 commit comments

Comments
 (0)