Skip to content

Commit 3a21311

Browse files
committed
[css-flexbox] Update changes section with exact diffs.
--HG-- extra : rebase_source : 467027ecd6b91504cd457ffa38f596cf9c8857c2
1 parent 9767f8a commit 3a21311

2 files changed

Lines changed: 676 additions & 16 deletions

File tree

css-flexbox/Overview.bs

Lines changed: 321 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,37 +2799,301 @@ Boris Zbarsky.
27992799
The following significant changes were made since the
28002800
<a href="http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/">18 September 2012 Candidate Recommendation</a>:
28012801
<ul>
2802-
<li>
2802+
<li class="issue">
28032803
Reverted the initial value of 'min-width'/'min-height' back to being ''0'' (not <a value for=width>auto</a>).
2804+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-17">Issue 17</a>)
2805+
<li class="issue">
2806+
Changed the behavior of the new ''min-width/auto'' initial value of 'min-width'/'min-height' to
2807+
<ul>
2808+
<li>Take into account whether 'overflow' is ''visible'', since when 'overflow' is explicitly handled, it is confusing (and unnecessary) to force enough size to show all the content.
2809+
<li>Take into account the specified 'width'/'height', so that the implied minimum is never greater than the specified size.
2810+
<li>Compute to itself (not to ''min-content'') on flex items, since they are no longer equivalent (due to above changes).
2811+
</ul>
2812+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-19">Issue 19</a>)
2813+
<blockquote>
2814+
<dl>
2815+
<dt>auto
2816+
<dd>
2817+
<del>
2818+
<p>When used as the value of a flex item's min main size property,
2819+
this keyword indicates a minimum of the min-content size,
2820+
to help ensure that the item is large enough to fit its contents.
2821+
<p class='note'>
2822+
It is intended that this will compute to the ''min-content'' keyword
2823+
when the specification defining it (<a href="http://www.w3.org/TR/css3-writing-modes/#intrinsic-sizing">Writing Modes Appendix D</a>) is sufficiently mature.
2824+
</del>
2825+
<ins>
2826+
<p>On a <a>flex item</a> whose 'overflow' is not ''overflow/visible'',
2827+
this keyword specifies as the minimum size the smaller of:
2828+
2829+
<ul>
2830+
<li>the <a>min-content size</a>, or
2831+
<li>the computed 'width'/'height', if that value is <a>definite</a>.
2832+
</ul>
2833+
</ins>
2834+
</dl>
2835+
</blockquote>
28042836
<li>
28052837
Specified that percentage margins/paddings on flex items are resolved against their respective dimensions,
28062838
not the inline dimension of the containing block like blocks do.
2839+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-16">Issue 16</a>)
2840+
<blockquote>
2841+
<ins>
2842+
<p>Percentage margins and paddings on <i>flex items</i> are always resolved against their respective dimensions;
2843+
unlike blocks, they do not always resolve against the inline dimension of their containing block.
2844+
</ins>
2845+
</blockquote>
28072846
<li>
2808-
<a href="#algo-main-item">Allow intrinsic aspect ratios to inform the main-size calculation.</a>
2847+
Pass definiteness of a single-line flex container's size through to any stretched items.
2848+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-3">Issue 3</a>)
2849+
<blockquote>
2850+
<ins>
2851+
<p>
2852+
As a special case for handling stretched <i>flex items</i>,
2853+
if a <i>single-line</i> <i>flex container</i> has a definite cross size,
2854+
the outer <i>cross size</i> of any <i>flex items</i> with ''align-self: stretch''
2855+
is the flex container's inner cross size (clamped to the <i>flex item</i>’s min and max <i>cross size</i>)
2856+
and is considered <i>definite</i>.
2857+
</ins>
2858+
</blockquote>
2859+
<li>Allow percentages inside a stretched auto-height flex item to resolve by requiring a relayout pass.
2860+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-3">Issue 3</a>)
2861+
<blockquote>
2862+
<ins>
2863+
<p>If the flex item has ''align-self: stretch'', redo layout for its contents, treating this used size as its definite cross size so that percentage-sized children can be resolved.
2864+
2865+
<p class="note">Note that this step does not affect the main size of the flex item, even if it has an intrinsic aspect ratio.
2866+
</ins>
2867+
</blockquote>
28092868
<li>
2810-
<a href="#intrinsic-sizes">Defined the intrinsic sizes of flex containers.</a>
2869+
Allow intrinsic aspect ratios to inform the <a href="#algo-main-item">main-size calculation.</a>
2870+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-8">Issue 8</a>)
2871+
<blockquote>
2872+
<ins>
2873+
<p>If the flex item has ...
2874+
<ul>
2875+
<li>an intrinsic aspect ratio,
2876+
<li>a <a>flex basis</a> of <a value for=width>auto</a>, and
2877+
<li>a definite <i>cross size</i>
2878+
</ul>
2879+
<p>then the <i>flex base size</i> is calculated from its inner <i>cross size</i>
2880+
and the <i>flex item</i>&rsquo;s intrinsic aspect ratio.
2881+
</ins>
2882+
</blockquote>
2883+
<li>
2884+
Define <i>hypothetical main size</i> when the <i>main size</i> depends on the <i>cross size</i>.
2885+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-23">Issue 23</a>)
2886+
<blockquote>
2887+
<p><ins>If a <i>cross size</i> is needed to determine the <i>main size</i>
2888+
(e.g. when the <i>flex item</i>’s <i>main size</i> is in its block axis)
2889+
and the <i>flex item</i>’s cross size is ''auto'' and not <i>definite</i>,
2890+
in this calculation use ''fit-content'' as the <i>flex item</i>’s <i>cross size</i>.</ins>
2891+
</blockquote>
2892+
<li>
2893+
Defined the <a href="#intrinsic-sizes">intrinsic sizes of flex containers.</a>
2894+
<blockquote>
2895+
<p><strong>Determine the main size of the flex container</strong> using its main size property. <del>In this calculation, the min content main size of the flex container is the maximum of the flex container's items' min-content size contributions, and the max content main size of the flex container is the sum of the flex container's items' max-content size contributions. The min-content/max-content main size contribution of an item is its outer hypothetical main size when sized under a min-content/max-content constraint (respectively).</del> For this computation, ‘auto’ margins on flex items are treated as ‘0’.
2896+
</blockquote>
2897+
<blockquote>
2898+
<ins>
2899+
<!--
2900+
<h3 id='intrinsic-sizes'>
2901+
Intrinsic Sizes</h3>
2902+
-->
2903+
<p>
2904+
The <i>max-content main size</i> of a <i>flex container</i>
2905+
is the sum of the flex container's items' <i>max-size contributions</i> in the <i>main axis</i>.
2906+
The <i>min-content main size</i> of a <i>single-line</i> flex container
2907+
is the sum of the flex container's items' <i>min-size contributions</i> in the <i>main axis</i>;
2908+
for a <i>multi-line</i> container,
2909+
it is the largest of those contributions.
2910+
2911+
<p>
2912+
The <i>min-content cross size</i> and <i>max-content cross size</i> of a flex container
2913+
are the cross size of the flex container
2914+
after performing layout into the given available <i>main-axis</i> space and infinite available <i>cross-axis</i> space.
2915+
2916+
<p>
2917+
The main-size <i title="min-size contribution">min-content</i>/<i>max-size contribution</i> of a <i>flex item</i>
2918+
is its outer <i>hypothetical main size</i>
2919+
when sized under a <i title="min-size constraint">min-content</i>/<i>max-size constraint</i> (respectively).
2920+
2921+
<p>
2922+
See [[!CSS3-SIZING]] for a definition of the terms in this section.
2923+
</ins>
2924+
</blockquote>
28112925
<li>
28122926
Correct an omission in the flex-line size determination, so a <i>single-line</i> flexbox will size to its contents if it doesn't have a definite size.
2927+
<blockquote>
2928+
<p>
2929+
If the flex container has only one <i>flex line</i>
2930+
(even if it's a <i>multi-line</i> <i>flex container</i>)
2931+
<ins>and has a <i>definite</i> <i>cross size</i></ins>,
2932+
the <i>cross size</i> of the <i>flex line</i>
2933+
is the <i>flex container</i>'s inner <i>cross size</i>.
2934+
</blockquote>
28132935
<li>
28142936
Flex lines have their size floored at 0.
2937+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-2">Issue 2</a>)
2938+
<blockquote>
2939+
<p>The used cross-size of the flex line is the larger largest of the numbers found in the previous two steps<ins> and zero</ins>.
2940+
</blockquote>
28152941
<li>
28162942
Flex items paint like inline blocks rather than blocks.
2943+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-18">Issue 18</a>)
2944+
<blockquote>
2945+
<p>
2946+
<i>Flex items</i> paint exactly the same as <del>block-level elements in the normal flow</del> <ins>inline blocks [[!CSS21]]</ins>.
2947+
</blockquote>
28172948
<li>
2818-
An omitted 'flex-basis' component of the 'flex' shorthand now resolves to ''0%'' instead of ''0px''.
2949+
An omitted 'flex-basis' component of the 'flex' shorthand now resolves to ''0%'' instead of ''0px''. Because percentages resolved against indefinite sizes behave as ''auto'', this gives better behavior in shrink-wrapped flex containers.
2950+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-20">Issue 20</a>)
2951+
<blockquote>
2952+
<p>When omitted from the 'flex' shorthand, its specified value is <ins>''0%''</ins> <del>the length zero</ins>.
2953+
</blockquote>
2954+
<blockquote>
2955+
<dl>
2956+
<dt>''flex: &lt;positive-number>''
2957+
<dd>Equivalent to ''flex: &lt;positive-number> 1 <del>0px</del><ins>0%</ins>''.
2958+
</dl>
2959+
</blockquote>
28192960
<li>
28202961
Defined that an unresolvable percentage <i>flex base size</i> is treated as <a value for=width>auto</a>.
2962+
<blockquote>
2963+
<p>percentage values of 'flex-basis' are resolved against
2964+
the flex item's containing block, i.e. its flex container,
2965+
and if that containing block's size is <a>indefinite</a>,
2966+
the result is <del>undefined</del> <ins>the same as a <i>main size</i> of <a value for=width>auto</a></ins>.
2967+
</blockquote>
28212968
<li>
28222969
Simplified the static position of abspos children of <a>flex containers</a> to be consistent with Grid Layout.
2970+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-6">Issue 6</a>)
2971+
<blockquote>
2972+
<p>An absolutely-positioned child of a <i>flex container</i> does not participate in flex layout
2973+
beyond the <a href="#algo-flex-order">reordering step</a>.
2974+
2975+
<del>
2976+
<p>
2977+
However, if both 'left' and 'right' or both 'top' and 'bottom' are ''auto'',
2978+
then the used value of those properties
2979+
are computed from its <dfn id='flex-item-static-position'>static position</dfn>, as follows:
2980+
2981+
<p>
2982+
If both 'left' and 'right' are ''auto'',
2983+
the <i>flex item</i> must be positioned so that
2984+
its <i>main-start</i> or <i>cross-start</i> edge
2985+
(whichever is in the horizontal axis)
2986+
is aligned with the <i>static position</i>.
2987+
If both 'top' and 'bottom' are ''auto'',
2988+
the <i>flex item</i> must be positioned so that
2989+
its <i>main-start</i> or <i>cross-start</i> edge
2990+
(whichever is in the vertical axis)
2991+
is aligned with the <i>static position</i>.
2992+
2993+
<p>
2994+
In the <i>main axis</i>,
2995+
2996+
<ol>
2997+
<li>
2998+
If there is a subsequent in-flow <i>flex item</i> on the same <i>flex line</i>,
2999+
the <i>static position</i> is the outer <i>main-start</i> edge of that <i>flex item</i>.
3000+
3001+
<li>
3002+
Otherwise, if there is a preceding in-flow <i>flex item</i> on the same <i>flex line</i>,
3003+
the <i>static position</i> is the outer <i>main-end</i> edge of that <i>flex item</i>.
3004+
3005+
<li>
3006+
Otherwise, the <i>static position</i> is determined
3007+
by the value of 'justify-content' on the <i>flex container</i>
3008+
as if the <i>static position</i> were represented by a zero-sized flex item.
3009+
</ol>
3010+
3011+
<p>
3012+
In the <i>cross axis</i>,
3013+
3014+
<ol>
3015+
<li>
3016+
If there is a preceding in-flow <i>flex item</i>,
3017+
the <i>static position</i> is the <i>cross-start</i> edge of the <i>flex line</i>
3018+
that item is in.
3019+
<li>
3020+
Otherwise, the <i>static position</i> is the <i>cross-start</i> edge of the first <i>flex line</i>.
3021+
</ol>
3022+
3023+
<p class='note'>
3024+
The static position is intended to more-or-less match the position of
3025+
an anonymous 0&times;0 in-flow ''align-self/flex-start''-aligned
3026+
flex item that participates in flex layout,
3027+
the primary difference being that any packing spaces due to
3028+
''justify-content: space-around'' or ''justify-content: space-between''
3029+
are suppressed around the hypothetical item:
3030+
between it and the next item if there is a real item after it,
3031+
else between it and the previous item (if any) if there isn't.
3032+
</del>
3033+
<ins>
3034+
<p>Its static position is calculated by first doing full flex layout without the absolutely-positioned children,
3035+
then positioning each absolutely-positioned child as if it were the sole <a>flex item</a>
3036+
in the <a>flex container</a>,
3037+
assuming both the child and the <a>flex container</a> were fixed size boxes of their used size.
3038+
<div class='example'>
3039+
For example, by default, the static position of an absolutely positioned child aligns it to the main-start/cross-start corner,
3040+
corresponding to the default values of 'justify-content' and 'align-content' on the <a>flex container</a>.
3041+
Setting ''justify-content:center'' on the <a>flex container</a>, however,
3042+
would center it in the main axis.
3043+
</div>
3044+
</ins>
3045+
</blockquote>
3046+
<li>
3047+
Changed algorithm for <a href="#resolve-flexible-lengths">resolving flexible lengths</a> to make behavior continuous as the sum of the flex factors approaches zero. (No change for a sum &ge; 1.)
3048+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-30">Issue 30</a>)
3049+
Replaces <a href="http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#resolve-flexible-lengths">this wording</a> with <a href="#resolve-flexible-lengths">this one</a>.
28233050
</ul>
28243051

28253052
<p>The following significant clarifications were also made:
28263053
<ul>
28273054
<li>
2828-
Absolutely positioned children of a flex container are no longer called "flex items" (to avoid terminology confusion).
3055+
Absolutely positioned children of a flex container are no longer called "flex items" (to avoid terminology confusion). (??)
3056+
<blockquote>
3057+
<table class="definition">
3058+
<tr>
3059+
<th>Name:
3060+
<td>order
3061+
<tr>
3062+
<th>Applies to:
3063+
<td><i>flex items</i> <ins>and absolutely-positioned children of <i>flex containers</i>
3064+
</table>
3065+
</blockquote>
3066+
<blockquote>
3067+
<p>Re-order the flex items <ins>and absolutely positioned flex container children</ins> according to their 'order'.
3068+
</blockquote>
28293069
<li>
28303070
Clarified that 'float' still affects the computed 'display' (which may affect box-fixup rules that run prior to flex item determination).
3071+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-7">Issue 7</a>)
3072+
<blockquote>
3073+
<p>'float' and 'clear' have no effect on a <i>flex item</i><ins>,
3074+
and do not take it out-of-flow.
3075+
However, the 'float' property can still affect box generation
3076+
by influencing the 'display' property's computed value.</ins>
3077+
</blockquote>
3078+
<li>
3079+
Clarify what is meant by “white space”. (<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-26">Issue 26</a>)
3080+
<blockquote>
3081+
<p>However, an anonymous flex item that contains only
3082+
<a href="http://www.w3.org/TR/CSS21/text.html#white-space-prop">white space</a>
3083+
<ins>(i.e. characters that can be affected by the 'white-space' property)</ins>
3084+
is not rendered, as if it were ''display:none''.
3085+
</blockquote>
28313086
<li>
28323087
Clarified that table anonymous box generation occurs in place of computed value conversion for internal table elements.
3088+
<li>
3089+
Clarified interaction of flex item determination with 'display-inside' / 'display-outside' (the new longhands of 'display' defined in the <a href="http://www.w3.org/TR/css-display/">CSS Display Module Level 3</a>.
3090+
<blockquote>
3091+
<ins><p>If the specified 'display-outside' of an in-flow child of an element that generates a <a>flex container</a>
3092+
is ''inline-level'',
3093+
it computes to ''block-level''.
3094+
(This effectively converts any inline 'display' values to their block equivalents.)
3095+
</ins>
3096+
</blockquote>
28333097
<li>
28343098
Clarified that 'overflow' applies to flex containers.
28353099
<li>
@@ -2838,13 +3102,63 @@ Boris Zbarsky.
28383102
Clarify that <a value for=align-self>stretch</a> checks for the <em>computed</em> value of the cross-size property being <a value for=width>auto</a>,
28393103
which means that percentage cross-sizes that behave as <a value for=width>auto</a>
28403104
(because they don't resolve against definite sizes) aren't stretched.
3105+
(<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-5">Issue 5</a>)
3106+
<blockquote>
3107+
<dl>
3108+
<dt>stretch
3109+
<dd>
3110+
<p>
3111+
If the <i>cross size property</i> of the <i>flex item</i> <del>is</del> <ins>computes to</ins> <a value for=width>auto</a>,
3112+
its used value is &hellip;
3113+
</dl>
3114+
</blockquote>
3115+
<blockquote>
3116+
<p><strong>Determine the used cross size of each flex item.</strong>
3117+
If a flex item has ''align-self: stretch'',
3118+
its <ins>computed</ins> cross size property is <a value for=width>auto</a>,
3119+
and &hellip;
3120+
</blockquote>
3121+
<li>
3122+
Clarify that the rules of the formatting context are used for determining the flex container's main size.
3123+
<blockquote>
3124+
<strong>Determine the main size of the flex container</strong> using <ins>the rules of the formatting context in which it participates</ins> <del>its main size property</del>.
3125+
</blockquote>
28413126
<li>
28423127
Clarified that 'order'-modified document order is used instead of raw document order when painting.
28433128
(This was already stated in the 'order' section, but not in the section explicitly about painting order.)
28443129
<li>
2845-
Clarified where zero-main-size flex items go when they're at the end of a line.
3130+
Clarified line-breaking to precisely handle negatively-sized flex items and zero-size items at the end of a line. (<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-1">Issue 1</a>)
3131+
<blockquote>
3132+
<p> Otherwise,
3133+
starting from the first uncollected item,
3134+
collect <ins>consecutive items one by one
3135+
until the first time that the <em>next</em> collected item
3136+
would not fit into the flex container's inner main size,
3137+
or until a forced break is encountered.
3138+
If the very first uncollected item wouldn't fit,
3139+
collect just it into the line</ins>
3140+
<del>as many consecutive flex items as will fit
3141+
or until a forced break is encountered
3142+
(but collect at least one)
3143+
into the flex container's inner main size into a flex line</del>.
3144+
</blockquote>
3145+
<blockquote>
3146+
<p class="note">Note that <del>items with zero main size will never start a line unless they're the very first items in the flex container, or they're preceded by a forced break.</del> The "collect as many" line will collect <del>them</del> <ins>zero-sized flex items</ins> onto the end of the previous line even if the last non-zero item exactly "filled up" the line.
3147+
</blockquote>
28463148
<li>
2847-
Clarified that flex container cross sizes are still clamped by the flex container's min/max properties.
3149+
Clarified that flex container cross sizes are still clamped by the flex container's min/max properties. (<a href="http://dev.w3.org/csswg/css-flexbox-1/issues-cr-2012#issue-24">Issue 24</a>)
3150+
<blockquote>
3151+
<ul>
3152+
<li>
3153+
If the cross size property is a <i>definite</i> size,
3154+
use that,
3155+
<ins>clamped by the min and max cross size properties of the <a>flex container</a></ins>.
3156+
<li>
3157+
Otherwise,
3158+
use the sum of the flex lines' cross sizes,
3159+
<ins>clamped by the min and max cross size properties of the <a>flex container</a></ins>.
3160+
</ul>
3161+
</blockquote>
28483162
</ul>
28493163

28503164
<p>A <a href="http://dev.w3.org/csswg/css3-flexbox/issues-cr-2012">Disposition of Candidate Recommendation Comments</a> is available.

0 commit comments

Comments
 (0)