Skip to content

Commit

Permalink
[css-flexbox] Fix intrinsic sizing rules that are broken per <http://…
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Aug 23, 2015
1 parent b12a0af commit 2c446be
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions css-flexbox/Overview.bs
Expand Up @@ -1463,7 +1463,7 @@ The 'flex' Shorthand</h3>
It takes the same values as the 'width' property
(except ''flex-basis/auto'' is treated differently)
and an additional ''content'' keyword.
When omitted from the 'flex' shorthand, its specified value is ''0%''.
When omitted from the 'flex' shorthand, its specified value is ''0''.

If the specified 'flex-basis' is ''flex-basis/auto'',
the used <a>flex basis</a> is the computed value of the flex item’s <a>main size property</a>.
Expand Down Expand Up @@ -1538,7 +1538,7 @@ Common Values of 'flex'</h4>

<dt>''flex: &lt;positive-number>''
<dd>
Equivalent to ''flex: &lt;positive-number> 1 0%''.
Equivalent to ''flex: &lt;positive-number> 1 0''.
Makes the flex item flexible and sets the <a>flex basis</a> to zero,
resulting in an item that receives the specified proportion of the free space in the flex container.
If all items in the flex container use this pattern,
Expand Down Expand Up @@ -2655,9 +2655,9 @@ Intrinsic Sizes</h3>
<ol>
<li>
For each <a>flex item</a>,
subtract its <a>flex base size</a> from its <a>max-content contribution</a> size,
then divide by its <a>flex grow factor</a>, floored at 1,
or by its <a>scaled flex shrink factor</a> (if the result was negative, flooring the <a>flex shrink factor</a> at 1 if necessary).
subtract its <a>flex base size</a> from its <a>max-content contribution</a> size.
If that result is not zero, divide it by its <a>flex grow factor</a> (if the result was positive)
or by its <a>scaled flex shrink factor</a> (if the result was negative).
This is the item's <var>max-content flex fraction</var>.

<li>
Expand Down Expand Up @@ -2690,9 +2690,11 @@ Intrinsic Sizes</h3>
are the <a>cross size</a> of the flex container
after performing layout into the given available <a>main-axis</a> space and infinite available <a>cross-axis</a> space.

The main-size <a lt="min-content contribution">min-content</a>/<a>max-content contribution</a> of a <a>flex item</a>
is its outer <a>hypothetical main size</a>
when sized under a <a lt="min-content constraint">min-content</a>/<a>max-content constraint</a> (respectively).
The <strong>main-size <a lt="min-content contribution">min-content</a>/<a>max-content contribution</a> of a <a>flex item</a></strong>
is its outer <a lt="min-content size">min-content</a>/<a>max-content size</a>,
clamped by its <a>flex base size</a> as a maximum (if it is not growable)
and/or as a minimum (if it is not shrinkable),
and then further clamped by its <a lt="min main size property">min</a>/<a>max main size properties</a>.

See [[!CSS3-SIZING]] for a definition of the terms in this section.

Expand Down Expand Up @@ -3059,6 +3061,25 @@ Boris Zbarsky.
<h2 class="no-num" id="changes">Changes</h2>

This section documents the changes since previous publications.

<h3 id="changes-201505">
Changes since the 14 May 2015 LCWD</h3>

A <a href="http://dev.w3.org/csswg/css-flexbox-1/issues-lc-20150514">Disposition of Comments</a> is also available.

<h4 id="change-201505-substantive">
Substantive Changes and Bugfixes</h4>

<ul>
<li>Revert 'flex' shorthand <a href="change-2012-flex-basis-zero">change</a>
of omitted 'flex-basis' from ''0'' to ''0%'',
since that was a hacky way of solving an intrinsic size problem,
and isn't needed (and gives bad results)
given a correct implementation of [[#intrinsic-sizes]].
</ul>

<h4 id="change-201505-clarify">
Clarifications</h4>

<h3 id="changes-201409">
Changes since the 25 September 2014 LCWD</h3>
Expand Down

0 comments on commit 2c446be

Please sign in to comment.