Skip to content

Commit 8b46c2a

Browse files
committed
[css-align] Revert the swallowing of stretch by <item-position>, since combining it with <overflow-position> makes no sense.
--HG-- extra : rebase_source : 1bbc8427562798cf65e5f6e92baade7253335bbe
1 parent fe2a696 commit 8b46c2a

File tree

2 files changed

+62
-109
lines changed

2 files changed

+62
-109
lines changed

css-align/Overview.bs

+24-39
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Group: csswg
77
Status: WD
88
Date: 2014-12-18
99
ED: http://dev.w3.org/csswg/css-align/
10-
TR: http://www.w3.org/TR/css3-align/
11-
Editor: fantasai, Invited Expert, http://fantasai.inkedblade.net/contact
10+
TR: http://www.w3.org/TR/css-align-3/
11+
Editor: Elika J. Etemad, Invited Expert, http://fantasai.inkedblade.net/contact
1212
Editor: Tab Atkins Jr., Google, http://xanthir.com/contact/
1313
Previous Version: http://www.w3.org/TR/2013/WD-css3-align-20130514/
1414
Previous Version: http://www.w3.org/TR/2012/WD-css3-align-20120612/
@@ -154,7 +154,7 @@ Overview of Alignment Properties</h2>
154154

155155
Note: The '*-items' values don't affect the element itself.
156156
When set on a flex container or grid container,
157-
they specify the interpretation of any ''align/justify-self: auto'' used on the items in the container element.
157+
they specify the interpretation of any ''*-self: auto'' used on the items in the container element.
158158

159159
<h2 id='alignment-values'>
160160
Alignment Values</h2>
@@ -179,7 +179,7 @@ Alignment Values</h2>
179179
</dl>
180180

181181
<h3 id='positional-values'>
182-
Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self-end'', ''flex-start'', ''flex-end'', ''left'', ''right'', and ''<item-position>/stretch'' keywords</h3>
182+
Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self-end'', ''flex-start'', ''flex-end'', ''left'', and ''right'' keywords</h3>
183183

184184
The positional alignment keywords specify a position for an <a>alignment subject</a>
185185
with respect to its <a>alignment container</a>.
@@ -193,7 +193,7 @@ Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self
193193

194194
<pre class='prod'>
195195
<dfn>&lt;item-position></dfn> = center | start | end | self-start | self-end |
196-
flex-start | flex-end | left | right | stretch;
196+
flex-start | flex-end | left | right;
197197
<dfn>&lt;content-position></dfn> = center | start | end | flex-start | flex-end | left | right;
198198
</pre>
199199

@@ -204,18 +204,6 @@ Positional Alignment: the ''center'', ''start'', ''end'', ''self-start'', ''self
204204
<dt><dfn for="<item-position>, <content-position>">center</dfn>
205205
<dd>Centers the <a>alignment subject</a> within its <a>alignment container</a>.
206206

207-
<dt><dfn for="<item-position>">stretch</dfn>
208-
<dd>If the 'width' or 'height' (as appropriate) of the <a>alignment subject</a> is ''width/auto'',
209-
and its outer size is smaller than the <a>alignment container</a>,
210-
its used value is increased to the length necessary to make the <a>alignment subject</a>’s outer size
211-
as close to the size of the <a>alignment container</a> as possible,
212-
while still respecting the constraints imposed by 'max-height'/'max-width'.
213-
214-
The <a>alignment subject</a> is then aligned as per ''flex-start''.
215-
<span class='note'>(For layout modes other than flex layout, ''flex-start'' is identical to ''start''.)</span>
216-
217-
Issue: Should this value allow a fallback alignment, like the <<content-distribution>> values do?
218-
219207
<dt><dfn for="<item-position>, <content-position>">start</dfn>
220208
<dd>Aligns the <a>alignment subject</a> to be flush with the <a>alignment container</a>’s start edge.
221209

@@ -371,13 +359,16 @@ Distributed Alignment: the ''<content-distribution>/stretch'', ''space-between''
371359
<dt><dfn>stretch</dfn>
372360
<dd>
373361
If the combined size of the <a>alignment subjects</a> is less than the size of the <a>alignment container</a>,
374-
any ''width/auto''-sized <a>alignment subjects</a> have their size increased equally (not proportionally)
375-
so that the combined size exactly fills the <a>alignment container</a>,
376-
and then clamped by their 'max-width'/'max-height' constraints.
362+
any ''width/auto''-sized <a>alignment subjects</a> have their size increased equally (not proportionally),
363+
while still respecting the constraints imposed by 'max-height'/'max-width',
364+
so that the combined size exactly fills the <a>alignment container</a>.
377365

378366
Unless otherwise specified,
379367
this value falls back to ''flex-start''.
380368
<span class='note'>(For layout modes other than flex layout, ''flex-start'' is identical to ''start''.)</span>
369+
370+
Issue: Should this value allow a fallback alignment on 'align-self' and 'justify-self',
371+
like it does on 'align-content' and 'justify-content'?
381372
</dl>
382373

383374
<p class='issue'>
@@ -421,12 +412,6 @@ Overflow Alignment: the ''safe'' and ''true'' keywords</h3>
421412
<p class='issue'>
422413
Transplant example 10 from flexbox.
423414

424-
<p class='issue'>
425-
The current grammar constructions allow combining ''safe'' and ''true''
426-
with ''<item-position>/stretch'' for 'justify-self'/'align-self'
427-
but not with ''<content-position>/stretch'' for 'justify-content'/'align-content'.
428-
This is inconsistent.
429-
430415
<h2 id='content-distribution'>
431416
Content Distribution: the 'justify-content' and 'align-content' properties</h2>
432417

@@ -541,14 +526,14 @@ Baseline Content-Alignment</h3>
541526
A <a>flex item</a> participates in first (last) <a>baseline content-alignment</a>
542527
in its flex line if
543528
its computed 'align-content' is ''baseline'' (''last-baseline'')
544-
and its computed 'align-self' is ''<item-position>/stretch'' or ''start'' (''end'').
529+
and its computed 'align-self' is ''<content-distribution>/stretch'' or ''start'' (''end'').
545530

546531
<dt>Grid Items:
547532
<dd>
548533
A <a>grid item</a> participates in first (last) <a>baseline content-alignment</a>
549534
in either its row or column (whichever matches its <a>inline axis</a>)
550535
if its computed 'align-content' is ''baseline'' (''last-baseline''),
551-
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''<item-position>/stretch'' or ''start'' (''end'').
536+
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''<content-distribution>/stretch'' or ''start'' (''end'').
552537
</dl>
553538

554539
If a box spans multiple <a>shared alignment contexts</a>,
@@ -597,7 +582,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
597582

598583
<pre class="propdef">
599584
Name: justify-self
600-
Value: auto | <<baseline-position>> | [ <<overflow-position>>? && <<item-position>> ]
585+
Value: auto | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<item-position>> ]
601586
Initial: auto
602587
Applies to: block-level boxes, absolutely-positioned boxes, and grid items
603588
Inherited: no
@@ -646,7 +631,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
646631

647632
When neither margin in this dimension is ''margin/auto''
648633
and neither offset property in this dimension is ''top/auto'',
649-
values other than ''<item-position>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
634+
values other than ''<content-distribution>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
650635
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
651636
and 'justify-self' dictates alignment as follows:
652637

@@ -661,7 +646,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
661646
and the used value of the offset properties are not adjusted to correct for the over-constraint.
662647

663648
The ''justify-self/auto'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes,
664-
and equivalent to ''<item-position>/stretch'' on all other absolutely-positioned boxes.
649+
and equivalent to ''<content-distribution>/stretch'' on all other absolutely-positioned boxes.
665650
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
666651

667652
<dt>Table Cells:
@@ -698,7 +683,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
698683

699684
<pre class="propdef">
700685
Name: align-self
701-
Value: auto | <<baseline-position>> | [ <<overflow-position>>? && <<item-position>> ]
686+
Value: auto | stretch | <<baseline-position>> | [ <<overflow-position>>? && <<item-position>> ]
702687
Initial: auto
703688
Applies to: flex items, grid items, and absolutely-positioned boxes
704689
Inherited: no
@@ -733,7 +718,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
733718

734719
When neither margin in this dimension is ''margin/auto''
735720
and neither offset property in this dimension is ''top/auto'',
736-
values other than ''<item-position>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
721+
values other than ''<content-distribution>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
737722
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
738723
and 'align-self' dictates alignment as follows:
739724

@@ -748,7 +733,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
748733
and the used value of the offset properties are not adjusted to correct for the over-constraint.
749734

750735
The ''align-self/auto'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes,
751-
and equivalent to ''<item-position>/stretch'' on all other absolutely-positioned boxes.
736+
and equivalent to ''<content-distribution>/stretch'' on all other absolutely-positioned boxes.
752737
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
753738

754739
<dt>Table Cells:
@@ -826,7 +811,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
826811

827812
<pre class="propdef">
828813
Name: justify-items
829-
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ] | [ legacy && [ ''<content-position>/left'' | ''<content-position>/right'' | ''<content-position>/center'' ] ]
814+
Value: auto | stretch | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ] | [ legacy && [ ''<content-position>/left'' | ''<content-position>/right'' | ''<content-position>/center'' ] ]
830815
Initial: auto
831816
Applies to: block containers, flex containers, and grid containers
832817
Inherited: no
@@ -850,7 +835,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
850835
Otherwise, ''justify-items/auto'' computes to:
851836

852837
<ul>
853-
<li>''<item-position>/stretch'' for flex containers and grid containers
838+
<li>''<content-distribution>/stretch'' for flex containers and grid containers
854839
<li>''start'' for everything else
855840
</ul>
856841

@@ -870,7 +855,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
870855

871856
<pre class="propdef">
872857
Name: align-items
873-
Value: auto | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
858+
Value: auto | stretch | <<baseline-position>> | [ <<item-position>> && <<overflow-position>>? ]
874859
Initial: auto
875860
Applies to: block-level elements
876861
Inherited: no
@@ -891,7 +876,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
891876
Computes to:
892877

893878
<ul>
894-
<li>''<item-position>/stretch'' for flex containers and grid containers
879+
<li>''<content-distribution>/stretch'' for flex containers and grid containers
895880
<li>''start'' for everything else
896881
</ul>
897882
</dl>
@@ -1053,7 +1038,7 @@ Changes</h2>
10531038

10541039
* Added ''last-baseline'' keyword.
10551040
* Improved details of baseline alignment.
1056-
* Changed handling of ''justify-self/auto''/''<item-position>/stretch'' for block-level and abspos elements in 'justify-self'/'align-self' to be more powerful and less confusing.
1041+
* Changed handling of ''justify-self/auto''/''<content-distribution>/stretch'' for block-level and abspos elements in 'justify-self'/'align-self' to be more powerful and less confusing.
10571042
* Tightened up grammar combinations with <<overflow-position>> to be restricted to values that actually make sense.
10581043
* Various clarifications.
10591044

0 commit comments

Comments
 (0)