Skip to content

Commit 4bd3fe4

Browse files
committed
[css-flexbox] Try to fix errors in flexbox algo (missing definition of how to handle auto cross size when calculating a cross-size-dependent main size).
1 parent 3faec38 commit 4bd3fe4

2 files changed

Lines changed: 34 additions & 26 deletions

File tree

css-flexbox/Overview.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,25 +2054,25 @@ <h3 class="heading settled heading" data-level=9.2 id=line-sizing><span class=se
20542054
that’s the <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a>.
20552055

20562056
<li>
2057-
If the <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> is <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a> or depends on its available size,
2058-
and the flex container is being sized under a min-content or max-content constraint
2059-
(e.g. when performing <a href=http://www.w3.org/TR/CSS21/tables.html#auto-table-layout>automatic table layout</a> <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>),
2060-
size the item under that constraint.
2061-
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.
2062-
2063-
<li>
2064-
If the flex item has ..
2057+
If the flex item has ...
20652058
<ul>
20662059
<li>an intrinsic aspect ratio
20672060
<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>
20682061
<li>a definite <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>
20692062
</ul>
2070-
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>
2063+
then the <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> is calculated from its inner <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>
20712064
and the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s intrinsic aspect ratio.
20722065

20732066
<p class=issue id=issue-8a5126c8><a class=self-link href=#issue-8a5126c8></a>
20742067
This substep needs review, see thread at <a href=http://lists.w3.org/Archives/Public/www-style/2012Oct/0781.html>http://lists.w3.org/Archives/Public/www-style/2012Oct/0781.html</a>.
20752068

2069+
<li>
2070+
If the <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> is <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a> or depends on its available size,
2071+
and the flex container is being sized under a min-content or max-content constraint
2072+
(e.g. when performing <a href=http://www.w3.org/TR/CSS21/tables.html#auto-table-layout>automatic table layout</a> <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>),
2073+
size the item under that constraint.
2074+
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.
2075+
20762076
<li>
20772077
Otherwise,
20782078
if the <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> is <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a> or depends on its available size,
@@ -2084,10 +2084,14 @@ <h3 class="heading settled heading" data-level=9.2 id=line-sizing><span class=se
20842084

20852085
<li>
20862086
Otherwise,
2087-
lay out the item into the available space
2088-
using its flex basis in place of its main size,
2089-
and treating a main size of <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a> as <span class=css data-link-type=maybe title=max-content>max-content</span>.
2090-
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.
2087+
lay out the item into the <a data-link-type=dfn href=http://dev.w3.org/csswg/css-sizing-3/#available title="available space">available space</a>
2088+
using its <a data-link-type=dfn href=#flex-basis title="flex basis">flex basis</a> in place of its <a data-link-type=dfn href=#main-size title="main size">main size</a>,
2089+
treating a <a data-link-type=dfn href=#main-size title="main size">main size</a> of <a class=css-code data-link-for=width data-link-type=value title=auto>auto</a> as <span class=css data-link-type=maybe title=max-content>max-content</span>.
2090+
If a <a data-link-type=dfn href=#cross-size title="cross size">cross size</a> is needed to determine the <a data-link-type=dfn href=#main-size title="main size">main size</a>
2091+
(e.g. when the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s <a data-link-type=dfn href=#main-size title="main size">main size</a> is in it’s block axis)
2092+
and the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s cross size is <a class=css data-link-type=maybe href=#valuedef-auto0 title=auto>auto</a> and not <a data-link-type=dfn href=#definite title=definite>definite</a>,
2093+
in this calculation use <span class=css data-link-type=maybe title=fit-content>fit-content</span> as the <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>’s <a data-link-type=dfn href=#cross-size title="cross size">cross size</a>.
2094+
The <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> is the item’s resulting <a data-link-type=dfn href=#main-size title="main size">main size</a>.
20912095

20922096
</ol>
20932097

css-flexbox/Overview.src.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,25 +2041,25 @@ <h3 id='line-sizing'>
20412041
that's the <i>flex base size</i>.
20422042

20432043
<li>
2044-
If the <a>flex basis</a> is <a value for=width>auto</a> or depends on its available size,
2045-
and the flex container is being sized under a min-content or max-content constraint
2046-
(e.g. when performing <a href="http://www.w3.org/TR/CSS21/tables.html#auto-table-layout">automatic table layout</a> [[!CSS21]]),
2047-
size the item under that constraint.
2048-
The <i>flex base size</i> is the item's resulting main size.
2049-
2050-
<li>
2051-
If the flex item has ..
2044+
If the flex item has ...
20522045
<ul>
20532046
<li>an intrinsic aspect ratio
20542047
<li>a <a>flex basis</a> of <a value for=width>auto</a>
20552048
<li>a definite <i>cross size</i>
20562049
</ul>
2057-
then the <i>flex base size</i> is calculated from its <i>cross size</i>
2050+
then the <i>flex base size</i> is calculated from its inner <i>cross size</i>
20582051
and the <i>flex item</i>&rsquo;s intrinsic aspect ratio.
20592052

20602053
<p class='issue'>
20612054
This substep needs review, see thread at <a href="http://lists.w3.org/Archives/Public/www-style/2012Oct/0781.html">http://lists.w3.org/Archives/Public/www-style/2012Oct/0781.html</a>.
20622055

2056+
<li>
2057+
If the <a>flex basis</a> is <a value for=width>auto</a> or depends on its available size,
2058+
and the flex container is being sized under a min-content or max-content constraint
2059+
(e.g. when performing <a href="http://www.w3.org/TR/CSS21/tables.html#auto-table-layout">automatic table layout</a> [[!CSS21]]),
2060+
size the item under that constraint.
2061+
The <i>flex base size</i> is the item's resulting main size.
2062+
20632063
<li>
20642064
Otherwise,
20652065
if the <a>flex basis</a> is <a value for=width>auto</a> or depends on its available size,
@@ -2071,10 +2071,14 @@ <h3 id='line-sizing'>
20712071

20722072
<li>
20732073
Otherwise,
2074-
lay out the item into the available space
2075-
using its flex basis in place of its main size,
2076-
and treating a main size of <a value for=width>auto</a> as ''max-content''.
2077-
The <i>flex base size</i> is the item's resulting main size.
2074+
lay out the item into the <i>available space</i>
2075+
using its <i>flex basis</i> in place of its <i>main size</i>,
2076+
treating a <i>main size</i> of <a value for=width>auto</a> as ''max-content''.
2077+
If a <i>cross size</i> is needed to determine the <i>main size</i>
2078+
(e.g. when the <i>flex item</i>’s <i>main size</i> is in it’s block axis)
2079+
and the <i>flex item</i>’s cross size is ''auto'' and not <i>definite</i>,
2080+
in this calculation use ''fit-content'' as the <i>flex item</i>’s <i>cross size</i>.
2081+
The <i>flex base size</i> is the item's resulting <i>main size</i>.
20782082

20792083
</ol>
20802084

0 commit comments

Comments
 (0)