Skip to content

Commit 7b17352

Browse files
committed
[css-flexbox-2] Tiebreak balance assignments by biasing toward earlier assignments.
1 parent cbc1bd8 commit 7b17352

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

css-flexbox-2/Overview.bs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,6 +4193,7 @@ Balancing Flex Items</h3>
41934193
and it could be assigned either to the end of the preceding sequence
41944194
or the beginning of the next sequence,
41954195
it is assigned to the end of the preceding sequence.
4196+
Otherwise, it's assigned to the beginning of the next sequence.
41964197
* Calling the difference between the |line size|
41974198
and the [=flex container's=] [=inner size|inner=] [=main size=]
41984199
a sequence's |error|,
@@ -4204,14 +4205,17 @@ Balancing Flex Items</h3>
42044205
is its [=outer size|outer=] [=hypothetical main size=],
42054206
floored at 0.
42064207

4208+
If multiple possible sequence assignments
4209+
have equal minimum |error|,
4210+
select the sequence that assigns the most items to the first line;
4211+
if multiple sequences tie by that metric,
4212+
select the sequence among them that assigns the most items to the second line;
4213+
etc.
4214+
42074215
Assign each sequence of [=flex items=]
42084216
to the corresponding [=flex line=].
42094217
</div>
42104218

4211-
Issue: Can there be multiple equally valid sequence assignments?
4212-
If so, do we care which we choose?
4213-
Do the efficient algos make it possible to reasonably choose between them?
4214-
42154219
Note: Because all items have zero or positive size,
42164220
and thus adding an item to a line never increases the error,
42174221
there are efficient, nearly linear algorithms

0 commit comments

Comments
 (0)