|
29 | 29 |
|
30 | 30 | <h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1> |
31 | 31 |
|
32 | | - <h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 24 April 2012</h2> |
| 32 | + <h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 25 April 2012</h2> |
33 | 33 |
|
34 | 34 | <dl> |
35 | 35 | <dt>This version: |
36 | | - <!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120424/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120424/</a>--> |
| 36 | + <!--<dd><a href="http://www.w3.org/TR/2012/ED-css3-flexbox-20120425/">http://www.w3.org/TR/2012/WD-css3-flexbox-20120425/</a>--> |
37 | 37 |
|
38 | 38 |
|
39 | 39 | <dd><a |
@@ -2021,39 +2021,65 @@ <h2 id=layout-algorithm><span class=secno>9. </span> Flexbox Layout |
2021 | 2021 | generate boxes in the box-tree, and how the rest of this algorithm deals |
2022 | 2022 | with the items. |
2023 | 2023 |
|
2024 | | - <li> <strong>Determine the main size of the flexbox</strong> using its <a |
2025 | | - href="#main-size-property"><i>main size property</i></a>. In this |
2026 | | - calculation, the <i>min content main size</i> of the flexbox is the |
2027 | | - maximum of the flexbox's items' <i>min-content size contributions</i>, |
2028 | | - and the <i>max content main size</i> of the flexbox is the sum of the |
2029 | | - flexbox's items' <i>max-content size contributions</i>. For these |
2030 | | - computations, ‘<code class=css>auto</code>’ margins are |
2031 | | - treated as ‘<code class=css>0</code>’, and for flexbox items |
2032 | | - the preferred size is used in place of the <a |
2033 | | - href="#main-size-property"><i>main size property</i></a>. |
| 2024 | + <li> <strong>Determine the available main and cross space for the flexbox |
| 2025 | + items.</strong> For each dimension, if that dimension of the flexbox is a |
| 2026 | + <i>definite size</i>, use that; otherwise, subtract the flexbox's margin, |
| 2027 | + border, and padding from the space available to the flexbox in that |
| 2028 | + dimension and use that value. <span class=note>This might result in an |
| 2029 | + infinite value.</span> |
2034 | 2030 |
|
2035 | 2031 | <li> <strong>Determine the hypothetical main size of each item:</strong> |
2036 | 2032 | <ul> |
2037 | 2033 | <li> If the item has a <a href="#definite"><i>definite</i></a> preferred |
2038 | 2034 | size, that's the hypothetical size. |
2039 | 2035 |
|
2040 | 2036 | <li> Otherwise, if the flexbox's main-axis is parallel to the item's |
2041 | | - inline-axis, the hypothetical size is the item's preferred size, |
2042 | | - treating ‘<code class=css>auto</code>’ as ‘<code |
2043 | | - class=css>fit-content</code>’. |
2044 | | - |
2045 | | - <li> Otherwise, the item is laid out using <a |
| 2037 | + inline-axis, lay out the item using its preferred size and the |
| 2038 | + available space, treating ‘<code class=css>auto</code>’ as |
| 2039 | + ‘<code class=css>fit-content</code>’ unless the item's |
| 2040 | + writing mode is perpendicular to the flexbox's writing mode (in which |
| 2041 | + case <a |
| 2042 | + href="http://www.w3.org/TR/css3-writing-modes/#orthogonal-flows">the |
| 2043 | + rules for a box in an orthogonal flow</a> <a href="#CSS3-WRITING-MODES" |
| 2044 | + rel=biblioentry>[CSS3-WRITING-MODES]<!--{{!CSS3-WRITING-MODES}}--></a> |
| 2045 | + are in effect). If the preferred size is ‘<code |
| 2046 | + class=css>fill-available</code>’, or ‘<code |
| 2047 | + class=css>fit-content</code>’, and the flexbox is being sized |
| 2048 | + under a min-content or max-content main-size constraint, size the item |
| 2049 | + under that constraint instead. The hypothetical size is the item's |
| 2050 | + resulting measure. |
| 2051 | + |
| 2052 | + <li> Otherwise, lay out the item using the available space, treating |
| 2053 | + ‘<code class=css>auto</code>’ as ‘<code |
| 2054 | + class=css>fit-content</code>’ unless the item's writing mode is |
| 2055 | + perpendicular to the flexbox's writing mode (in which case <a |
2046 | 2056 | href="http://www.w3.org/TR/css3-writing-modes/#orthogonal-flows">the |
2047 | | - rules for a box in an orthogonal flow</a> as specified in <a |
2048 | | - href="#CSS3-WRITING-MODES" |
2049 | | - rel=biblioentry>[CSS3-WRITING-MODES]<!--{{!CSS3-WRITING-MODES}}--></a>, |
2050 | | - and the hypothetical size is the item's max-content extent. |
| 2057 | + rules for a box in an orthogonal flow</a> <a href="#CSS3-WRITING-MODES" |
| 2058 | + rel=biblioentry>[CSS3-WRITING-MODES]<!--{{!CSS3-WRITING-MODES}}--></a> |
| 2059 | + are in effect). If the preferred size is ‘<code |
| 2060 | + class=css>auto</code>’, ‘<code |
| 2061 | + class=css>fill-available</code>’, or ‘<code |
| 2062 | + class=css>fit-content</code>’, and the flexbox is being sized |
| 2063 | + under a min-content or max-content cross-size constraint, size the item |
| 2064 | + under that constraint instead. The hypothetical size is the item's |
| 2065 | + resulting max-content extent. |
2051 | 2066 | </ul> |
2052 | 2067 |
|
2053 | 2068 | <p> <em>Do not apply min/max-width/height constraints to the preferred |
2054 | 2069 | size of flexible lengths — those constraints are handled elsewhere |
2055 | 2070 | in this algorithm, and doing so will produce incorrect results.</em> |
2056 | 2071 |
|
| 2072 | + <li> <strong>Determine the main size of the flexbox</strong> using its <a |
| 2073 | + href="#main-size-property"><i>main size property</i></a>. In this |
| 2074 | + calculation, the <i>min content main size</i> of the flexbox is the |
| 2075 | + maximum of the flexbox's items' <i>min-content size contributions</i>, |
| 2076 | + and the <i>max content main size</i> of the flexbox is the sum of the |
| 2077 | + flexbox's items' <i>max-content size contributions</i>. For these |
| 2078 | + computations, ‘<code class=css>auto</code>’ margins are |
| 2079 | + treated as ‘<code class=css>0</code>’, and for flexbox items |
| 2080 | + the preferred size is used in place of the <a |
| 2081 | + href="#main-size-property"><i>main size property</i></a>. |
| 2082 | + |
2057 | 2083 | <li> <strong>Collect flexbox items into flexbox lines:</strong> |
2058 | 2084 | <ul> |
2059 | 2085 | <li> If the flexbox is single-line, collect all the flexbox items into a |
|
0 commit comments