Skip to content

Commit cf2426f

Browse files
committed
[css-flexbox] Simplify intrinsic aspect ratio handling of main size, clarify definite sizing in stretch cases.
1 parent d2a1d23 commit cf2426f

2 files changed

Lines changed: 22 additions & 20 deletions

File tree

css-flexbox/Overview.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,11 +1993,14 @@ <h2 class="heading settled heading" data-level=9 id=layout-algorithm><span class
19931993
i.e. is a <var>&lt;length&gt;</var>,
19941994
a size of the initial containing block,
19951995
or a <var>&lt;percentage&gt;</var> that is resolved against a definite size.
1996-
If 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> has a definite cross size,
1997-
any <a data-link-type=dfn href=#flex-item title="flex items">flex items</a> with <a class=css data-link-type=propdesc href=#propdef-align-self title=align-self>align-self: stretch</a> must also be treated as having a definite cross size
1998-
(since its size is determined from the size of the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>).
19991996
An <dfn data-dfn-type=dfn data-noexport="" id=indefinite title="indefinite|indefinite size">indefinite size<a class=self-link href=#indefinite></a></dfn> is one that is not <a data-link-type=dfn href=#definite title=definite>definite</a>.
20001997

1998+
<p>
1999+
As a special case for handling stretched <a data-link-type=dfn href=#flex-item title="flex items">flex items</a>,
2000+
if 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> has a definite cross size,
2001+
any <a data-link-type=dfn href=#flex-item title="flex items">flex items</a> with <a class=css data-link-type=propdesc href=#propdef-align-self title=align-self>align-self: stretch</a> must also be treated as having a definite cross size
2002+
of the flex container’s inner cross size (clamped to the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s min and max <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>).
2003+
20012004
<p>
20022005
The following sections define the algorithm for laying out a flex container and its contents.
20032006

@@ -2057,15 +2060,13 @@ <h3 class="heading settled heading" data-level=9.2 id=line-sizing><span class=se
20572060
The <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> is the item’s resulting main size.
20582061

20592062
<li>
2060-
If the flex item ...
2063+
If the flex item has ..
20612064
<ul>
2062-
<li>has an intrinsic aspect ratio
2063-
<li>has <a class=css data-link-type=propdesc href=#propdef-align-self title=align-self>align-self: stretch</a>,
2064-
<li>has a <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> and cross size both <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a>
2065+
<li>an intrinsic aspect ratio
2066+
<li>a <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> of <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a>
2067+
<li>a definite <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>
20652068
</ul>
2066-
and the flex container is <a data-link-type=dfn href=#single-line title=single-line>single-line</a> and has a <a data-link-type=dfn href=#definite title=definite>definite</a> cross size,
2067-
the <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> is computed from the flex container’s inner cross size
2068-
(clamped to the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s min and max <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>)
2069+
then the <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> is calculated from its <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>
20692070
and the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s intrinsic aspect ratio.
20702071

20712072
<p class=issue id=issue-8a5126c8><a class=self-link href=#issue-8a5126c8></a>

css-flexbox/Overview.src.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,11 +1976,14 @@ <h2 id='layout-algorithm'>
19761976
i.e. is a <var>&lt;length></var>,
19771977
a size of the initial containing block,
19781978
or a <var>&lt;percentage></var> that is resolved against a definite size.
1979-
If a <i>single-line</i> <i>flex container</i> has a definite cross size,
1980-
any <i>flex items</i> with ''align-self: stretch'' must also be treated as having a definite cross size
1981-
(since its size is determined from the size of the <i>flex container</i>).
19821979
An <dfn title="indefinite|indefinite size">indefinite size</dfn> is one that is not <i>definite</i>.
19831980

1981+
<p>
1982+
As a special case for handling stretched <i>flex items</i>,
1983+
if a <i>single-line</i> <i>flex container</i> has a definite cross size,
1984+
any <i>flex items</i> with ''align-self: stretch'' must also be treated as having a definite cross size
1985+
of the flex container's inner cross size (clamped to the <i>flex item</i>&rsquo;s min and max <i>cross size</i>).
1986+
19841987
<p>
19851988
The following sections define the algorithm for laying out a flex container and its contents.
19861989

@@ -2044,15 +2047,13 @@ <h3 id='line-sizing'>
20442047
The <i>flex base size</i> is the item's resulting main size.
20452048

20462049
<li>
2047-
If the flex item ...
2050+
If the flex item has ..
20482051
<ul>
2049-
<li>has an intrinsic aspect ratio
2050-
<li>has ''align-self: stretch'',
2051-
<li>has a <a>flex basis</a> and cross size both <a value for=width>auto</a>
2052+
<li>an intrinsic aspect ratio
2053+
<li>a <a>flex basis</a> of <a value for=width>auto</a>
2054+
<li>a definite <i>cross size</i>
20522055
</ul>
2053-
and the flex container is <i>single-line</i> and has a <i>definite</i> cross size,
2054-
the <i>flex base size</i> is computed from the flex container's inner cross size
2055-
(clamped to the <i>flex item</i>&rsquo;s min and max <i>cross size</i>)
2056+
then the <i>flex base size</i> is calculated from its <i>cross size</i>
20562057
and the <i>flex item</i>&rsquo;s intrinsic aspect ratio.
20572058

20582059
<p class='issue'>

0 commit comments

Comments
 (0)