Skip to content

Commit 5042398

Browse files
committed
Fixed bug in flex() parsing.
1 parent 9b53216 commit 5042398

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

css3-flexbox/Overview.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
<h1 id=head-box-flexible>CSS Flexible Box Layout Module</h1>
2323

24-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 19 April 2011</h2>
24+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft, 14 June 2011</h2>
2525

2626
<dl>
2727
<dt>This version:
2828

29-
<dd><!-- <a href="http://www.w3.org/TR/2011/WD-css3-flexbox-20110419/">http://www.w3.org/TR/2011/WD-css3-flexbox-20110419/</a></dd> -->
29+
<dd><!-- <a href="http://www.w3.org/TR/2011/WD-css3-flexbox-20110614/">http://www.w3.org/TR/2011/WD-css3-flexbox-20110614/</a></dd> -->
3030
<a
3131
href="http://dev.w3.org/csswg/css3-flexbox/">http://dev.w3.org/csswg/css3-flexbox/</a>
3232

@@ -706,8 +706,8 @@ <h3 id=flex-function><span class=secno>5.3. </span> The &lsquo;<code
706706
href="#positive-flexibility"><i>positive flexibility</i></a> is set to
707707
the number, the <a href="#negative-flexibility"><i>negative
708708
flexibility</i></a> is set to &lsquo;<code class=css>0</code>&rsquo;,
709-
and the <i>preferred size</i> is set to &lsquo;<code
710-
class=css>auto</code>&rsquo;.
709+
and the <i>preferred size</i> is set to the &lt;length> or
710+
&lt;percentage>.
711711

712712
<li>Otherwise, the &lsquo;<code class=css>flex()</code>&rsquo; function
713713
is invalid.
@@ -846,9 +846,9 @@ <h2 id=flex-pack><span class=secno>6. </span> The &lsquo;<a
846846
847847
<img alt="In a horizontal flexbox, the measure axis is horizontal, while the length axis is vertical.">
848848
849-
<p>The measure axis is more interesting, as there are more places where things can potentially flex. As such, there are more controls for specifying how to distribute free space in this axis: the &lsquo;<code class=property>width</code>&rsquo; or &lsquo;<code class=property>height</code>&rsquo; property starts things off, modified by the &lsquo;<code class=property>flex</code>&rsquo; property; the &lsquo;<code class=property>margin</code>&rsquo; property gives individual control over spacing between <i>flexbox item</i>s; and the &lsquo;<code class=property>flex-pack</code>&rsquo; property gives a more flexbox-global level of control over the between-children spacing.</p>
849+
<p>The measure axis is more interesting, as there are more places where things can potentially flex. As such, there are more controls for specifying how to distribute free space in this axis: the 'width' or 'height' property starts things off, modified by the 'flex' property; the 'margin' property gives individual control over spacing between <i>flexbox item</i>s; and the 'flex-pack' property gives a more flexbox-global level of control over the between-children spacing.</p>
850850
851-
<p>In general terms, determining where to allocate free space in the measure axis starts by determining just how much free space there is. All the non-flexible lengths, and the preferred sizes of all the flexible widths or heights, are subtracted from the total width or height of the flexbox. If a positive length is left over, this is split up among all the flexible lengths according to their flexibility. Flexible margins automatically have a flexibility of 1, while widths or heights have their flexibility specified by the &lsquo;<code class=property>flex-grow</code>&rsquo; property.</p>
851+
<p>In general terms, determining where to allocate free space in the measure axis starts by determining just how much free space there is. All the non-flexible lengths, and the preferred sizes of all the flexible widths or heights, are subtracted from the total width or height of the flexbox. If a positive length is left over, this is split up among all the flexible lengths according to their flexibility. Flexible margins automatically have a flexibility of 1, while widths or heights have their flexibility specified by the 'flex-grow' property.</p>
852852
853853
<div class=example>
854854
<p>Three boxes, all with a preferred size of 0, will end up with sizes exactly proportional to their flex-grow values.</p>
@@ -863,16 +863,16 @@ <h2 id=flex-pack><span class=secno>6. </span> The &lsquo;<a
863863
<img alt="">
864864
</div>
865865
866-
<p>If none of the lengths are flexible, or if all the flexible widths or height have reached their maximum size (if &lsquo;<code class=property>max-width</code>&rsquo; or &lsquo;<code class=property>max-height</code>&rsquo; properties are in effect), then any leftover space is distributed according to the &lsquo;<code class=property>flex-pack</code>&rsquo; property between the margins of the <i>flexbox item</i>s.</p>
866+
<p>If none of the lengths are flexible, or if all the flexible widths or height have reached their maximum size (if 'max-width' or 'max-height' properties are in effect), then any leftover space is distributed according to the 'flex-pack' property between the margins of the <i>flexbox item</i>s.</p>
867867
868868
<div class=example>
869869
<p>If the flexbox is small enough, then the flexible child can absorb all the space...</p>
870870
<img>
871-
<p>...but if it gets large enough, there'll be extra space left over for &lsquo;<code class=property>flex-pack</code>&rsquo; to distribute.</p>
871+
<p>...but if it gets large enough, there'll be extra space left over for 'flex-pack' to distribute.</p>
872872
<img>
873873
</div>
874874
875-
<p>If the original calculation of how much free space was left gave a negative length (that is, if the preferred sizes of all the <i>flexbox item</i>s sum to a larger length than the width or height of the flexbox), then flexible margins get set to 0, &lsquo;<code class=property>flex-pack</code>&rsquo; has no effect, and <i>flexbox item</i>s with a non-zero &lsquo;<code class=property>flex-shrink</code>&rsquo; value split the responsibility for shrinking between themselves proportionally. Just like when they grow, their size starts from the preferred size, then combines that with the proportional share of (negative) space.</p>
875+
<p>If the original calculation of how much free space was left gave a negative length (that is, if the preferred sizes of all the <i>flexbox item</i>s sum to a larger length than the width or height of the flexbox), then flexible margins get set to 0, 'flex-pack' has no effect, and <i>flexbox item</i>s with a non-zero 'flex-shrink' value split the responsibility for shrinking between themselves proportionally. Just like when they grow, their size starts from the preferred size, then combines that with the proportional share of (negative) space.</p>
876876
877877
<div class=example>
878878
<p>When the children are too wide, the shrinkable elements reduce their size to fit...</p>
@@ -1355,15 +1355,15 @@ <h2 id=layout-interface><span class=secno>9. </span> Interface With Other
13551355
the following equation applies for calculating the width:
13561356
</p>
13571357
<blockquote>
1358-
<p>&lsquo;<code class=property>margin-left</code>&rsquo; + &lsquo;<code class=property>border-left-width</code>&rsquo; + &lsquo;<code class=property>padding-left</code>&rsquo; + &lsquo;<code class=property>width</code>&rsquo; + &lsquo;<code class=property>padding-right</code>&rsquo; + &lsquo;<code class=property>border-right-width</code>&rsquo; + &lsquo;<code class=property>margin-right</code>&rsquo; + scrollbar width (if any) = width of containing block
1358+
<p>'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' + scrollbar width (if any) = width of containing block
13591359
</p>
13601360
</blockquote>
1361-
<p>All children of &lsquo;<code class=property>box</code>&rsquo; elements are block-level. If inline-level elements are nested
1361+
<p>All children of 'box' elements are block-level. If inline-level elements are nested
13621362
inside boxes, they get wrapped in an anonymous block which then takes part in the
13631363
box layout.
13641364
13651365
</p><p>
1366-
If the width of a child of a flexible box is computed as &lsquo;<code class=property>auto</code>&rsquo;, then the used value
1366+
If the width of a child of a flexible box is computed as 'auto', then the used value
13671367
is the shrink-to-fit width. This calculation is done similarly to how the width of
13681368
a floating element is determined. Otherwise if the width has a computed value,
13691369
then that value is used as the width.
@@ -1372,24 +1372,24 @@ <h2 id=layout-interface><span class=secno>9. </span> Interface With Other
13721372
In a horizontally oriented box, the flexibility is then applied which may increase
13731373
or decrease the used width. In a vertically oriented box, the position and size
13741374
of the child may be adjusted by the value of the container's
1375-
<span class="property">&lsquo;<code class=property>box-align</code>&rsquo;</span> property.
1375+
<span class="property">'box-align'</span> property.
13761376
</p><p>
13771377
1378-
The <span class="property">&lsquo;<code class=property>min-width</code>&rsquo;</span>, <span class="property">&lsquo;<code class=property>min-height</code>&rsquo;</span>,
1379-
<span class="property">&lsquo;<code class=property>max-width</code>&rsquo;</span>, and <span class="property">&lsquo;<code class=property>max-height</code>&rsquo;</span>
1378+
The <span class="property">'min-width'</span>, <span class="property">'min-height'</span>,
1379+
<span class="property">'max-width'</span>, and <span class="property">'max-height'</span>
13801380
CSS properties act the same on boxes as on blocks.
13811381
</p><p>
13821382
13831383
The height of a child of a flexible box is determined in the same manner as specified
13841384
in the CSS specification. The used height may further be adjusted by the container's
1385-
<span class="property">&lsquo;<code class=property>box-align</code>&rsquo;</span> property in a horizontally
1385+
<span class="property">'box-align'</span> property in a horizontally
13861386
oriented box, or the flexibility in a vertically oriented box.
13871387
</p><p>
13881388
13891389
Note that it is possible for a horizontally oriented box that the height of a
13901390
flexible child containing an inline descendant will change when the flexibility is
13911391
applied. Similarly, in a vertically oriented box, the height of a child may change
1392-
based on the <span class="property">&lsquo;<code class=property>box-align</code>&rsquo;</span> property of the
1392+
based on the <span class="property">'box-align'</span> property of the
13931393
box.
13941394
</p>
13951395
-->
@@ -1416,10 +1416,10 @@ <h3 class=no-num id=normative>Normative references</h3>
14161416
<dt id=CSS21>[CSS21]
14171417

14181418
<dd>Bert Bos; et al. <a
1419-
href="http://www.w3.org/TR/2009/CR-CSS2-20090423"><cite>Cascading Style
1420-
Sheets Level 2 Revision 1 (CSS&#160;2.1) Specification.</cite></a> 23
1421-
April 2009. W3C Candidate Recommendation. (Work in progress.) URL: <a
1422-
href="http://www.w3.org/TR/2009/CR-CSS2-20090423">http://www.w3.org/TR/2009/CR-CSS2-20090423</a>
1419+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
1420+
Sheets Level 2 Revision 1 (CSS&#160;2.1) Specification.</cite></a> 7 June
1421+
2011. W3C Recommendation. URL: <a
1422+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
14231423
</dd>
14241424
<!---->
14251425

@@ -1538,12 +1538,12 @@ <h2 class=no-num id=property>Property index</h2>
15381538
<th>Media
15391539

15401540
<tbody>
1541-
<tr valign=baseline>
1541+
<tr>
15421542
<td><span class=property>display</span>
15431543

15441544
<td>flexbox | inline-flexbox
15451545

1546-
<tr valign=baseline>
1546+
<tr>
15471547
<td><a class=property href="#flex-align0">flex-align</a>
15481548

15491549
<td>auto | baseline
@@ -1558,7 +1558,7 @@ <h2 class=no-num id=property>Property index</h2>
15581558

15591559
<td>visual
15601560

1561-
<tr valign=baseline>
1561+
<tr>
15621562
<td><a class=property href="#flex-direction0">flex-direction</a>
15631563

15641564
<td>lr | rl | tb | bt | inline | inline-reverse | block | block-reverse
@@ -1573,7 +1573,7 @@ <h2 class=no-num id=property>Property index</h2>
15731573

15741574
<td>visual
15751575

1576-
<tr valign=baseline>
1576+
<tr>
15771577
<td><a class=property href="#flex-order0">flex-order</a>
15781578

15791579
<td>&lt;integer>
@@ -1588,7 +1588,7 @@ <h2 class=no-num id=property>Property index</h2>
15881588

15891589
<td>visual
15901590

1591-
<tr valign=baseline>
1591+
<tr>
15921592
<td><a class=property href="#flex-pack0">flex-pack</a>
15931593

15941594
<td>start | end | center | justify

css3-flexbox/Overview.src.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ <h3 id='flex-function'>
447447
is a &lt;length>, a &lt;percentage>, or a valid keyword for 'width'
448448
or 'height', the <i>positive flexibility</i> is set to the number, the
449449
<i>negative flexibility</i> is set to ''0'', and the <i>preferred size</i>
450-
is set to ''auto''.</li>
450+
is set to the &lt;length> or &lt;percentage>.</li>
451451

452452
<li>Otherwise, the ''flex()'' function is invalid.</li>
453453
</ul>

0 commit comments

Comments
 (0)