Skip to content

Commit 3d51987

Browse files
committed
[css-flexbox] Fix special cases of multi-line flex containers iwht a single line to fall under the multi-line behavior, not the single-line flex container behavior.
1 parent 455fc00 commit 3d51987

2 files changed

Lines changed: 16 additions & 18 deletions

File tree

css-flexbox/Overview.bs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,11 +1409,12 @@ Flex Lines</h2>
14091409
flexible lengths and the 'justify-content' and 'align-self' properties only consider the items on a single line at a time.
14101410

14111411
<p>
1412-
When a flex container has multiple lines, the <i>cross size</i> of each line
1412+
In a <i>multi-line</i> <i>flex container</i> (even one with only a single line),
1413+
the <i>cross size</i> of each line
14131414
is the minimum size necessary to contain the <i>flex items</i> on the line
14141415
(after aligment due to 'align-self'),
14151416
and the lines are aligned within the flex container with the 'align-content' property.
1416-
When a flex container (even a <i>multi-line</i> one) has only one line,
1417+
In a <i>single-line</i> <i>flex container</i>,
14171418
the <i>cross size</i> of the line is the <i>cross size</i> of the flex container,
14181419
and 'align-content' has no effect.
14191420
The <i>main size</i> of a line is always the same as the <i>main size</i> of the flex container's content box.
@@ -2068,7 +2069,7 @@ Packing Flex Lines: the 'align-content' property</h3>
20682069
The 'align-content' property aligns a flex container's lines within the flex container
20692070
when there is extra space in the <i>cross-axis</i>,
20702071
similar to how 'justify-content' aligns individual items within the <i>main-axis</i>.
2071-
Note, this property has no effect when the flex container has only a single line.
2072+
Note, this property has no effect on a <i>single-line</i> <i>flex container</i>.
20722073
Values have the following meanings:
20732074

20742075
<dl dfn-type=value dfn-for=align-content>
@@ -2134,9 +2135,9 @@ Packing Flex Lines: the 'align-content' property</h3>
21342135
</dl>
21352136

21362137
<p class='note'>
2137-
Note: Only flex containers with multiple lines
2138+
Note: Only <i>multi-line</i> <i>flex containers</i>
21382139
ever have free space in the <i>cross-axis</i> for lines to be aligned in,
2139-
because in a flex container with a single line
2140+
because in a <i>single-line</i> flex container
21402141
the sole line automatically stretches to fill the space.
21412142

21422143
<div class="figure">
@@ -2406,8 +2407,7 @@ Cross Size Determination</h3>
24062407
<strong>Calculate the cross size of each flex line.</strong>
24072408

24082409
<p>
2409-
If the flex container has only one <i>flex line</i>
2410-
(even if it's a <i>multi-line</i> <i>flex container</i>)
2410+
If the flex container is <i>single-line</i>
24112411
and has a <i>definite</i> <i>cross size</i>,
24122412
the <i>cross size</i> of the <i>flex line</i>
24132413
is the <i>flex container</i>'s inner <i>cross size</i>.
@@ -2432,8 +2432,7 @@ Cross Size Determination</h3>
24322432
<li>
24332433
The used cross-size of the <a>flex line</a> is the largest of the numbers found in the previous two steps and zero.
24342434

2435-
If the flex container has only one flex line
2436-
(even if it's a multi-line flex container),
2435+
If the flex container is <i>single-line</i>,
24372436
then clamp the line's cross-size to be within the container's computed min and max cross-size properties.
24382437
<span class='note'>Note that if CSS 2.1's definition of min/max-width/height applied more generally,
24392438
this behavior would fall out automatically.</span>

css-flexbox/Overview.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,12 @@ <h2 class="heading settled" data-level=6 id=flex-lines><span class=secno>6. </sp
14221422
flexible lengths and the <a class=property data-link-type=propdesc href=#propdef-justify-content title=justify-content>justify-content</a> and <a class=property data-link-type=propdesc href=#propdef-align-self title=align-self>align-self</a> properties only consider the items on a single line at a time.
14231423

14241424
<p>
1425-
When a flex container has multiple lines, the <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> of each line
1425+
In a <a data-link-type=dfn href=#multi-line title=multi-line>multi-line</a> <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> (even one with only a single line),
1426+
the <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> of each line
14261427
is the minimum size necessary to contain the <a data-link-type=dfn href=#flex-item title="flex items">flex items</a> on the line
14271428
(after aligment due to <a class=property data-link-type=propdesc href=#propdef-align-self title=align-self>align-self</a>),
14281429
and the lines are aligned within the flex container with the <a class=property data-link-type=propdesc href=#propdef-align-content title=align-content>align-content</a> property.
1429-
When a flex container (even a <a data-link-type=dfn href=#multi-line title=multi-line>multi-line</a> one) has only one line,
1430+
In a <a data-link-type=dfn href=#single-line title=single-line>single-line</a> <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>,
14301431
the <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> of the line is the <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> of the flex container,
14311432
and <a class=property data-link-type=propdesc href=#propdef-align-content title=align-content>align-content</a> has no effect.
14321433
The <a data-link-type=dfn href=#main-size title="main size">main size</a> of a line is always the same as the <a data-link-type=dfn href=#main-size title="main size">main size</a> of the flex container’s content box.
@@ -1971,7 +1972,7 @@ <h3 class="heading settled" data-level=8.4 id=align-content-property><span class
19711972
The <a class=property data-link-type=propdesc href=#propdef-align-content title=align-content>align-content</a> property aligns a flex container’s lines within the flex container
19721973
when there is extra space in the <a data-link-type=dfn href=#cross-axis title=cross-axis>cross-axis</a>,
19731974
similar to how <a class=property data-link-type=propdesc href=#propdef-justify-content title=justify-content>justify-content</a> aligns individual items within the <a data-link-type=dfn href=#main-axis title=main-axis>main-axis</a>.
1974-
Note, this property has no effect when the flex container has only a single line.
1975+
Note, this property has no effect on a <a data-link-type=dfn href=#single-line title=single-line>single-line</a> <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>.
19751976
Values have the following meanings:
19761977

19771978
<dl data-dfn-for=align-content data-dfn-type=value>
@@ -2037,9 +2038,9 @@ <h3 class="heading settled" data-level=8.4 id=align-content-property><span class
20372038
</dl>
20382039

20392040
<p class=note>
2040-
Note: Only flex containers with multiple lines
2041+
Note: Only <a data-link-type=dfn href=#multi-line title=multi-line>multi-line</a> <a data-link-type=dfn href=#flex-container title="flex containers">flex containers</a>
20412042
ever have free space in the <a data-link-type=dfn href=#cross-axis title=cross-axis>cross-axis</a> for lines to be aligned in,
2042-
because in a flex container with a single line
2043+
because in a <a data-link-type=dfn href=#single-line title=single-line>single-line</a> flex container
20432044
the sole line automatically stretches to fill the space.
20442045

20452046
<div class=figure>
@@ -2284,8 +2285,7 @@ <h3 class="heading settled" data-level=9.4 id=cross-sizing><span class=secno>9.4
22842285
<strong>Calculate the cross size of each flex line.</strong>
22852286

22862287
<p>
2287-
If the flex container has only one <a data-link-type=dfn href=#flex-line title="flex line">flex line</a>
2288-
(even if it’s a <a data-link-type=dfn href=#multi-line title=multi-line>multi-line</a> <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>)
2288+
If the flex container is <a data-link-type=dfn href=#single-line title=single-line>single-line</a>
22892289
and has a <a data-link-type=dfn href=#definite title=definite>definite</a> <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>,
22902290
the <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> of the <a data-link-type=dfn href=#flex-line title="flex line">flex line</a>
22912291
is the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>’s inner <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>.
@@ -2310,8 +2310,7 @@ <h3 class="heading settled" data-level=9.4 id=cross-sizing><span class=secno>9.4
23102310
<li>
23112311
The used cross-size of the <a data-link-type=dfn href=#flex-line title="flex line">flex line</a> is the largest of the numbers found in the previous two steps and zero.
23122312

2313-
<p>If the flex container has only one flex line
2314-
(even if it’s a multi-line flex container),
2313+
<p>If the flex container is <a data-link-type=dfn href=#single-line title=single-line>single-line</a>,
23152314
then clamp the line’s cross-size to be within the container’s computed min and max cross-size properties.
23162315
<span class=note>Note that if CSS 2.1’s definition of min/max-width/height applied more generally,
23172316
this behavior would fall out automatically.</span></p>

0 commit comments

Comments
 (0)