8000 [css-align-3] Switch from first (last) to first/last based on feedbac… · simonwuelker/csswg-drafts@7554be8 · GitHub
Skip to content

Commit 7554be8

Browse files
committed
[css-align-3] Switch from first (last) to first/last based on feedback from Rachel Andrews.
1 parent cf99268 commit 7554be8

1 file changed

Lines changed: 43 additions & 34 deletions

File tree

css-align-3/Overview.bs

Lines changed: 43 additions & 34 deletions
5CC0
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,9 @@ Baseline Content-Alignment</h3>
11651165
<dl>
11661166
<dt>Table Cells:
11671167
<dd>
1168-
A <a>table cell</a> participates in first (last) <a>baseline content-alignment</a>
1169-
in its startmost (endmost) row
1168+
A <a>table cell</a> participates in
1169+
first/last <a>baseline content-alignment</a>
1170+
in its startmost/endmost row
11701171
if its inline axis is parallel to that of the table itself and
11711172
its computed 'align-content' is ''first baseline'' (''last baseline'').
11721173

@@ -1177,16 +1178,19 @@ Baseline Content-Alignment</h3>
11771178

11781179
<dt>Flex Items:
11791180
<dd>
1180-
A <a>flex item</a> participates in first (last) <a>baseline content-alignment</a>
1181+
A <a>flex item</a> participates in
1182+
first/last <a>baseline content-alignment</a>
11811183
in its flex line if
1182-
its computed 'align-content' is ''first baseline'' (''last baseline'')
1184+
its computed 'align-content' is ''first baseline''/''last baseline''
11831185
and its <a>inline axis</a> is parallel to the <a>main axis</a>.
11841186

11851187
<dt>Grid Items:
11861188
<dd>
1187-
A <a>grid item</a> participates in first (last) <a>baseline content-alignment</a>
1188-
in its startmost (endmost) row or column (whichever is parallel to its <a>inline axis</a>)
1189-
and if its computed 'align-content' is ''first baseline'' (''last baseline'').
1189+
A <a>grid item</a> participates in
1190+
first/last <a>baseline content-alignment</a>
1191+
in its startmost/endmost row or column
1192+
(whichever is parallel to its <a>inline axis</a>)
1193+
and if its computed 'align-content' is ''first baseline''/''last baseline''.
11901194
</dl>
11911195

11921196
Additionally, if <a>self-alignment</a> applies to the box in an axis,
@@ -1195,8 +1199,8 @@ Baseline Content-Alignment</h3>
11951199
that is:
11961200

11971201
* The relevant <a>self-alignment property</a>
1198-
behaves as either ''align-self/stretch'' or ''self-start'' (''self-end'')
1199-
given a <a>baseline alignment preference</a> of ”first” (“last”).
1202+
behaves as either ''align-self/stretch'' or ''self-start''/''self-end''
1203+
given a <a>baseline alignment preference</a> of ”first”/“last”.
12001204
For this purpose,
12011205
the ''start'', ''end'', ''flex-start'', and ''flex-end'' values
12021206
are treated as either ''self-start'' or ''self-end'',
@@ -1672,16 +1676,19 @@ Baseline Self-Alignment</h3>
16721676
<dl>
16731677
<dt>Flex Items:
16741678
<dd>
1675-
A <a>flex item</a> participates in first (last) <a>baseline self-alignment</a> in its flex line
1676-
if its computed 'align-self' is ''first baseline'' (''last baseline'').
1679+
A <a>flex item</a> participates in
1680+
first/last <a>baseline self-alignment</a>
1681+
in its flex line
1682+
if its computed 'align-self' is ''first baseline''/''last baseline''.
16771683
See [[!CSS-FLEXBOX-1]] for details.
16781684

16791685
<dt>Grid Items:
16801686
<dd>
1681-
A <a>grid item</a> participates in first (last) <a>baseline self-alignment</a>
1682-
in its startmost (endmost) row or column
1687+
A <a>grid item</a> participates in
1688+
first/last <a>baseline self-alignment</a>
1689+
in its startmost/endmost row or column
16831690
if its 'align-self' or 'justify-self' property (respectively)
1684-
computes to ''first baseline'' (''last baseline'').
1691+
computes to ''first baseline''/''last baseline''.
16851692
</dl>
16861693

16871694
See [[#align-by-baseline]] for exact details.
@@ -2062,7 +2069,7 @@ Determining the Baselines of a Box</h2>
20622069
has a <dfn export lt="first baseline set|first baselines">first baseline set</dfn>
20632070
(and <dfn export lt="last baseline set|last baselines">last baseline set</dfn>)
20642071
that nominally corresponds to the <a>baseline set</a> of
2065-
the first (last) line of text within the box.
2072+
the first/last line of text within the box.
20662073
The <dfn export>alignment baseline</dfn> is one of these,
20672074
usually the dominant baseline associated with the <a>shared alignment context</a>.
20682075
(See the 'dominant-baseline' and 'alignment-baseline' properties in [[CSS-INLINE-3]].)
@@ -2073,12 +2080,12 @@ Determining the Baselines of a Box</h2>
20732080
<dl>
20742081
<dt>block containers
20752082
<dd>
2076-
The first (last) [=baseline set=] of a <a>block container</a>
2077-
is <a>generated</a> from the dominant first (last) baseline
2078-
of the first (last) in-flow line box in the block container,
2079-
or is taken from the first (last) in-flow block-level child in the block container
2080-
that contributes a set of first (last) baselines,
2081-
whichever comes first (last).
2083+
The first/last [=baseline set=] of a <a>block container</a>
2084+
is <a>generated</a> from the dominant first/last baseline
2085+
of the first/last in-flow line box in the block container,
2086+
or is taken from the first/last in-flow block-level child in the block container
2087+
that contributes a set of first/last baselines,
2088+
whichever comes first/last.
20822089
If there is no such line box or child,
20832090
then the block container has no [=baseline set=].
20842091

@@ -2104,21 +2111,23 @@ Determining the Baselines of a Box</h2>
21042111

21052112
<dt>tables
21062113
<dd>
2107-
The first (last) [=baseline set=] of a table box
2108-
is the first (last) [=baseline set=] of its first (last) row.
2114+
The first/last [=baseline set=] of a table box
2115+
is the first/last [=baseline set=] of its first/last row.
21092116

2110-
When finding the first (last) baseline set of an inline-block,
2117+
When finding the first/last baseline set of an inline-block,
21112118
any baselines contributed by table boxes must be skipped.
21122119
(This quirk is a legacy behavior from [[CSS2]].)
21132120

21142121
<dt>table rows
21152122
<dd>
2116-
If any cells in the row participate in ''first baseline'' (''last baseline'') alignment along the [=inline axis=],
2117-
the first (last) [=baseline set=] of the row
2123+
If any cells in the row participate in
2124+
''first baseline''/''last baseline'' alignment
2125+
along the [=inline axis=],
2126+
the first/last [=baseline set=] of the row
21182127
is <a>generated</a> from their shared <a>alignment baseline</a>
21192128
and the row's <a>first available font</a>,
21202129
after alignment has been performed.
2121-
Otherwise, the first (last) [=baseline set=] of the row
2130+
Otherwise, the first/last [=baseline set=] of the row
21222131
is <a>synthesized</a> from the lowest and highest content edges of the cells in the row.
21232132
[[!CSS2]]
21242133

@@ -2163,8 +2172,8 @@ Determining the Baselines of a Box</h2>
21632172
it and all its in-flow descendants with a scrolling mechanism (see the 'overflow' property)
21642173
must be considered as if scrolled to their initial scroll position.
21652174
Furthermore, if, in the case of a <a>scroll container</a> box,
2166-
the resulting position of a first (last) baseline
2167-
is past a box's end (start) border edge,
2175+
the resulting position of a first/last baseline
2176+
is past a box's end/start border edge,
21682177
its position is clamped to that border edge.
21692178

21702179
<h3 id='baseline-terms'>
@@ -2211,8 +2220,8 @@ Baseline Alignment Grouping</h3>
22112220
See [[CSS-INLINE-3]].
22122221

22132222
If a box spans multiple <a>shared alignment contexts</a>,
2214-
then it participates in first (last) baseline alignment
2215-
within its start-most (end-most) <a>shared alignment context</a> along that axis.
2223+
then it participates in first/last baseline alignment
2224+
within its start-most/end-most <a>shared alignment context</a> along that axis.
22162225
For example, a table cell spanning three rows
22172226
participates in <a>first-baseline alignment</a>
22182227
with the table cells in the first row that it spans,
@@ -2245,11 +2254,11 @@ Aligning Boxes by Baseline</h3>
22452254
Position the aligned <a>baseline-sharing group</a> within the [=alignment container=]
22462255
according to the <a>fallback alignment</a> associated with the
22472256
specified <a>baseline alignment preference</a>.
2248-
For first (last) <a>baseline content-alignment</a>,
2257+
For first/last <a>baseline content-alignment</a>,
22492258
then add the minimum necessary extra space
2250-
between the [=alignment container’s=] start (end) content edge
2259+
between the [=alignment container’s=] start/end content edge
22512260
and the [=alignment subject’s=] edge
2252-
to align the start (end) margin edges of all the [=alignment containers=]
2261+
to align the start/end margin edges of all the [=alignment containers=]
22532262
in the [=alignment context=]
22542263
while maintaining baseline alignment within the [=baseline-sharing group=].
22552264

0 commit comments

Comments
 (0)