|
246 | 246 | </p> |
247 | 247 | <h1 class="p-name no-ref" id=title>CSS Flexible Box Layout Module Level 1</h1> |
248 | 248 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
249 | | - <span class=dt-updated><span class=value-title title=20140507>7 May 2014</span></span></span></h2> |
| 249 | + <span class=dt-updated><span class=value-title title=20140519>19 May 2014</span></span></span></h2> |
250 | 250 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-flexbox/>http://dev.w3.org/csswg/css-flexbox/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-flexbox-1/>http://www.w3.org/TR/css-flexbox-1/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/css-flexbox/>http://dev.w3.org/csswg/css-flexbox/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/ rel=previous>http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/</a><dd><a href=http://www.w3.org/TR/2012/WD-css3-flexbox-20120612/ rel=previous>http://www.w3.org/TR/2012/WD-css3-flexbox-20120612/</a><dd><a href=http://www.w3.org/TR/2012/WD-css3-flexbox-20120322/ rel=previous>http://www.w3.org/TR/2012/WD-css3-flexbox-20120322/</a><dd><a href=http://www.w3.org/TR/2011/WD-css3-flexbox-20111129/ rel=previous>http://www.w3.org/TR/2011/WD-css3-flexbox-20111129/</a><dd><a href=http://www.w3.org/TR/2011/WD-css3-flexbox-20110322/ rel=previous>http://www.w3.org/TR/2011/WD-css3-flexbox-20110322/</a><dd><a href=http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/ rel=previous>http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/</a> |
251 | 251 | <dt>Feedback:</dt> |
252 | 252 | <dd><a href="mailto:www-style@w3.org?subject=%5Bcss-flexbox%5D%20feedback">www-style@w3.org</a> |
@@ -770,16 +770,35 @@ <h3 class="heading settled heading" data-level=4.1 id=abspos-items><span class=s |
770 | 770 | <p>An absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> does not participate in flex layout |
771 | 771 | beyond the <a href=#algo-flex-order>reordering step</a>.</p> |
772 | 772 |
|
773 | | -<p>Its static position is calculated by first doing full flex layout without the absolutely-positioned children, |
774 | | - then positioning each absolutely-positioned child as if it were the sole <a data-link-type=dfn href=#flex-item title="flex item">flex item</a> |
775 | | - in the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>, |
776 | | - assuming both the child and the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> were fixed size boxes of their used size.</p> |
| 773 | +<p>The static position of an absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> |
| 774 | + is determined by the <a class=property data-link-type=propdesc title=justify-*>justify-*</a>/<a class=property data-link-type=propdesc title=align-*>align-*</a> properties set on the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> and the child:</p> |
| 775 | + |
| 776 | + <dl> |
| 777 | + <dt>In the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a> |
| 778 | + <dd> |
| 779 | + If the <a data-link-type=dfn href=#flex-container title="flex container’s">flex container’s</a> <a class=property data-link-type=propdesc href=#propdef-justify-content title=justify-content>justify-content</a> value |
| 780 | + would distribute a single <a data-link-type=dfn href=#flex-item title="flex item">flex item</a> |
| 781 | + to the start, center, or end side of the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a>, |
| 782 | + the static position in the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a> is the start, center, or end respectively. |
| 783 | + |
| 784 | + <dt>In the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a> |
| 785 | + <dd> |
| 786 | + If the child’s <a class=property data-link-type=propdesc href=#propdef-align-self title=align-self>align-self</a> value, |
| 787 | + if specified on a hypothetical single <a data-link-type=dfn href=#flex-item title="flex item">flex item</a> child of the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>, |
| 788 | + would align that hypothetical child to the start, center, or end side of the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a>, |
| 789 | + the static position in the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a> is the start, center, or end respectively. |
| 790 | + </dl> |
| 791 | + |
| 792 | +<p>Further, the absolutely-positioned child aligns its start, center, or end in the given axis |
| 793 | + (whichever position the static position was set to) |
| 794 | + to the static position.</p> |
777 | 795 |
|
778 | 796 | <div class=example> |
779 | | - For example, by default, the static position of an absolutely positioned child aligns it to the main-start/cross-start corner, |
780 | | - corresponding to the default values of <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-content title=align-content>align-content</a> on the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>. |
781 | | - Setting <span class=css data-link-type=maybe title=justify-content:center>justify-content:center</span> on the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>, however, |
782 | | - would center it in the main axis. |
| 797 | + The effect of this is that if you set, for example, |
| 798 | + <a class=css data-link-type=propdesc href=#propdef-align-content title=align-content>align-content: center;</a> on an absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>, |
| 799 | + the child will be centered in the <a data-link-type=dfn href=#flex-container title="flex container’s">flex container’s</a> <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a>. |
| 800 | + (The static position will be in the center of the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a>, |
| 801 | + and the child will align its center with the static position.) |
783 | 802 | </div> |
784 | 803 |
|
785 | 804 | <h3 class="heading settled heading" data-level=4.2 id=item-margins><span class=secno>4.2 </span><span class=content> |
@@ -959,8 +978,8 @@ <h3 class="heading settled heading" data-level=4.5 id=min-size-auto><span class= |
959 | 978 |
|
960 | 979 | <p>Otherwise, |
961 | 980 | this keyword computes to <span class=css data-link-type=maybe title=0>0</span> |
962 | | - (unless otherwise defined by a future specification).</p> |
963 | | - </dl> |
| 981 | + (unless otherwise defined by a future specification). |
| 982 | + </dl><p></p> |
964 | 983 |
|
965 | 984 | <div class=note id=min-size-opt><a class=self-link href=#min-size-opt></a> |
966 | 985 | <p> |
@@ -2218,8 +2237,8 @@ <h3 class="heading settled heading" data-level=9.4 id=cross-sizing><span class=s |
2218 | 2237 | (even if it’s a multi-line flex container), |
2219 | 2238 | then clamp the line’s cross-size to be within the container’s computed min and max cross-size properties. |
2220 | 2239 | <span class=note>Note that if CSS 2.1’s definition of min/max-width/height applied more generally, |
2221 | | - this behavior would fall out automatically.</span></p> |
2222 | | - </ol> |
| 2240 | + this behavior would fall out automatically.</span> |
| 2241 | + </ol><p></p> |
2223 | 2242 |
|
2224 | 2243 |
|
2225 | 2244 | <li id=algo-line-stretch><a class=self-link href=#algo-line-stretch></a> |
@@ -2393,13 +2412,13 @@ <h4 class="heading settled heading" data-level=9.7.1 id=resolve-flexible-lengths |
2393 | 2412 | the initial <a data-link-type=dfn href=#free-space title="free space">free space</a> multiplied by the item’s <a data-link-type=dfn href=#flex-grow-factor title="flex grow factor">flex grow factor</a>.</p> |
2394 | 2413 |
|
2395 | 2414 | <p>If the initial <a data-link-type=dfn href=#free-space title="free space">free space</a> is negative, |
2396 | | - first find the <dfn data-dfn-type=dfn data-noexport="" id=scaled-flex-factor-sum>scaled flex factor sum<a class=self-link href=#scaled-flex-factor-sum></a></dfn>,</p> |
| 2415 | + first find the <dfn data-dfn-type=dfn data-noexport="" id=scaled-flex-factor-sum>scaled flex factor sum<a class=self-link href=#scaled-flex-factor-sum></a></dfn>, |
2397 | 2416 | <code>max(1, ∑unfrozen flex factors)</code>. |
2398 | 2417 | Then, for each unfrozen flex item, |
2399 | 2418 | find its <dfn data-dfn-type=dfn data-noexport="" id=scaled-flex-factor>scaled flex factor<a class=self-link href=#scaled-flex-factor></a></dfn> by multipling its <a data-link-type=dfn href=#flex-shrink-factor title="flex shrink factor">flex shrink factor</a> by its <a data-link-type=dfn href=#flex-base-size title="flex base size">flex base size</a> |
2400 | 2419 | and normalizing so that the sum of these <a data-link-type=dfn href=#scaled-flex-factor title="scaled flex factors">scaled flex factors</a> equals the <var>scaled flex factor sum</var>. |
2401 | 2420 | Then, multiply each item’s <a data-link-type=dfn href=#flex-shrink-factor title="flex shrink factor">flex shrink factor</a> by the initial <a data-link-type=dfn href=#free-space title="free space">free space</a>, |
2402 | | - and let the result be its <a data-link-type=dfn href=#desired-free-space title="desired free space">desired free space</a>. |
| 2421 | + and let the result be its <a data-link-type=dfn href=#desired-free-space title="desired free space">desired free space</a>.</p> |
2403 | 2422 |
|
2404 | 2423 | <li> |
2405 | 2424 | <strong>Distribute <a data-link-type=dfn href=#free-space title="free space">free space</a>.</strong> |
|
0 commit comments