Skip to content

Commit 70a0dfc

Browse files
committed
Make the linebreaking algo handle forced breaks, per f2f resolution.
1 parent 14b5df2 commit 70a0dfc

2 files changed

Lines changed: 35 additions & 15 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,15 +2426,25 @@ <h3 id=main-sizing><span class=secno>9.3. </span> Main Size Determination</h3>
24262426
single flexbox line.
24272427

24282428
<li> Otherwise, starting from the first uncollected item, collect as
2429-
many consecutive flexbox items as will fit (but collect at least one)
2430-
into the flexbox's inner main size into a flexbox line. For this step,
2431-
the size of a flexbox item is its hypothetical outer main size, clamped
2432-
according to its min and max main size properties. Repeat until all
2433-
flexbox items have been collected into flexbox lines.
2429+
many consecutive flexbox items as will fit or until a forced break is
2430+
encountered (but collect at least one) into the flexbox's inner main
2431+
size into a flexbox line. A break is forced wherever the CSS2.1
2432+
<code class=css>page-break-before/after</code><a href="#CSS21"
2433+
rel=biblioentry>[CSS21]<!--{{CSS21}}--></a> or the CSS3 ‘<code
2434+
class=css>break-before/after</code><a href="#CSS3-BREAK"
2435+
rel=biblioentry>[CSS3-BREAK]<!--{{CSS3-BREAK}}--></a> properties
2436+
specify a fragmentation break.
2437+
<p> For this step, the size of a flexbox item is its hypothetical outer
2438+
main size, clamped according to its min and max main size properties.
2439+
2440+
<p> Repeat until all flexbox items have been collected into flexbox
2441+
lines.
2442+
24342443
<p class=note> Note that items with zero main size will never start a
2435-
line unless they're the very first items in the flexbox. The "collect
2436-
as many" line will collect them onto the end of the previous line even
2437-
if the last non-zero item exactly "filled up" the line.
2444+
line unless they're the very first items in the flexbox, or they're
2445+
preceded by a forced break. The "collect as many" line will collect
2446+
them onto the end of the previous line even if the last non-zero item
2447+
exactly "filled up" the line.
24382448
</ul>
24392449

24402450
<li id=algo-flex> <strong><a href="#resolve-flexible-lengths">Resolve the

css3-flexbox/Overview.src.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,17 +1677,27 @@ <h3 id='main-sizing'>
16771677
<li>
16781678
Otherwise,
16791679
starting from the first uncollected item,
1680-
collect as many consecutive flexbox items as will fit
1681-
(but collect at least one)
1680+
collect as many consecutive flexbox items as will fit
1681+
or until a forced break is encountered
1682+
(but collect at least one)
16821683
into the flexbox's inner main size into a flexbox line.
1683-
For this step,
1684-
the size of a flexbox item is its hypothetical outer main size,
1685-
clamped according to its min and max main size properties.
1686-
Repeat until all flexbox items have been collected into flexbox lines.
1684+
A break is forced wherever
1685+
the CSS2.1 'page-break-before/after' [[CSS21]]
1686+
or the CSS3 'break-before/after' [[CSS3-BREAK]] properties
1687+
specify a fragmentation break.
1688+
1689+
<p>
1690+
For this step,
1691+
the size of a flexbox item is its hypothetical outer main size,
1692+
clamped according to its min and max main size properties.
1693+
1694+
<p>
1695+
Repeat until all flexbox items have been collected into flexbox lines.
16871696

16881697
<p class='note'>
16891698
Note that items with zero main size will never start a line
1690-
unless they're the very first items in the flexbox.
1699+
unless they're the very first items in the flexbox,
1700+
or they're preceded by a forced break.
16911701
The "collect as many" line will collect them
16921702
onto the end of the previous line
16931703
even if the last non-zero item exactly "filled up" the line.

0 commit comments

Comments
 (0)