Skip to content

Commit 15fe334

Browse files
committed
[css-grid] Use synthesized border-box baseline for grid items without a natural baseline in the right axis. <#373> per WG resolution <https://lists.w3.org/Archives/Public/www-style/2016Sep/0000.html>
1 parent c30a655 commit 15fe334

File tree

2 files changed

+27
-34
lines changed

2 files changed

+27
-34
lines changed

css-flexbox/Overview.bs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,24 +2174,17 @@ Flex Container Baselines</h3>
21742174
the shared <a>alignment baseline</a> of those <a>flex items</a>.
21752175

21762176
2. Otherwise, if the flex container has at least one <a>flex item</a>,
2177-
and its first/last <a>flex item</a> has a baseline
2178-
parallel to the flex container's <a>main axis</a>,
21792177
the flex container's first/last <a>main-axis baseline set</a>
21802178
is <a lt="generate baselines">generated</a> from
2181-
its <a>alignment baseline</a>.
2182-
2183-
3. Otherwise, the flex container has no natural first/last main-axis <a>baseline set</a>,
2184-
and a synthesized first/last <a>baseline set</a>, if needed,
2185-
is <a lt="synthesize baselines">synthesized</a>
2186-
from the first/last item's border box,
2187-
or, failing that, from the flex container's content box.
2179+
the <a>alignment baseline</a> of the first/last <a>flex item</a>.
2180+
(If that item has no <a>alignment baseline</a>
2181+
parallel to the flex container's <a>main axis</a>,
2182+
then one is first <a lt="synthesized baseline">synthesized</a>
2183+
from its border edges.)
21882184

2189-
<!--
2190-
Logic behind this choice (because it's different than other baseline calculations):
2191-
If a flexbox has content, the baseline will definitely be inside the flexbox's content box.
2192-
Thus, using the *flexbox's* content box keeps this fairly consistent -
2193-
you don't suddenly jump outside the content box when you delete the last bit of content.
2194-
-->
2185+
3. Otherwise, the flex container has no first/last main-axis <a>baseline set</a>,
2186+
and one is <a lt="synthesize baselines">synthesized</a> if needed
2187+
according to the rules of its <a>alignment context</a>.
21952188

21962189
<dt>first/last <dfn export id="cross-axis-baseline"
21972190
lt="cross-axis baseline set|first cross-axis baseline set|last cross-axis baseline set">
@@ -2202,16 +2195,18 @@ Flex Container Baselines</h3>
22022195
its baselines are determined as follows:
22032196

22042197
1. If the flex container has at least one <a>flex item</a>,
2205-
and its first/last <a>flex item</a> has a first/last <a>baseline set</a>
2206-
parallel to the flex container's <a>cross axis</a>,
22072198
the flex container's first/last <a>cross-axis baseline set</a>
2208-
is that baseline set.
2199+
is <a lt="generate baselines">generated</a> from
2200+
the <a>alignment baseline</a> of the first/last <a>flex item</a>.
2201+
(If that item has no <a>alignment baseline</a>
2202+
parallel to the flex container's <a>cross axis</a>,
2203+
then one is first <a lt="synthesized baseline">synthesized</a>
2204+
from its border edges.)
2205+
2206+
2. Otherwise, the flex container has no first/last main-axis <a>baseline set</a>,
2207+
and one is <a lt="synthesize baselines">synthesized</a> if needed
2208+
according to the rules of its <a>alignment context</a>.
22092209

2210-
2. Otherwise, the flex container has no natural cross-axis <a>baseline set</a>,
2211-
and a synthesized first/last <a>baseline set</a>, if needed,
2212-
is <a lt="synthesize baselines">synthesized</a>
2213-
from the first/last item's border box,
2214-
or, failing that, from the flex container's content box.
22152210
</dl>
22162211

22172212
When calculating the baseline according to the above rules,

css-grid/Overview.bs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,20 +3514,18 @@ Grid Container Baselines</h3>
35143514
the shared <a>alignment baseline</a> of those <a>grid items</a>.
35153515

35163516
<li>
3517-
Otherwise, if the grid container has at least one <a>grid item</a> whose area intersects the first (last) row/column,
3518-
and the first (last) such <a>grid item</a> (in <a>grid order</a>)
3519-
has a baseline set parallel to the relevant axis,
3520-
the grid container's first (last) baseline set in that axis
3517+
Otherwise, if the grid container has at least one <a>grid item</a> whose area intersects the first (last) row,
3518+
the grid container's first (last) baseline set
35213519
is <a lt="generate baselines">generated</a> from
3522-
that <a>grid item</a>’s <a>alignment baseline</a>.
3520+
the <a>alignment baseline</a> of the first (last) such <a>grid item</a> (in <a>grid order</a>).
3521+
If the item has no <a>alignment baseline</a> in that axis,
3522+
then one is first <a lt="synthesize baselines">synthesized</a>
3523+
from its border edges.
35233524

35243525
<li>
3525-
Otherwise, the grid container has no natural first (last) <a>baseline set</a> in that axis,
3526-
and a synthesized first/last <a>baseline set</a>, if needed,
3527-
is <a lt="synthesize baselines">synthesized</a>
3528-
from the first (last) item's (in <a>grid order</a>) content box,
3529-
or, if there's no <a>grid item</a>,
3530-
from the grid container's content box.
3526+
Otherwise, the grid container has no first (last) <a>baseline set</a>,
3527+
and one is <a lt="synthesize baselines">synthesized</a> if needed
3528+
according to the rules of its <a>alignment context</a>.
35313529
</ol>
35323530

35333531
<dfn export lt="grid order|grid-modified document order">'grid-modified document order (grid order)</dfn>

0 commit comments

Comments
 (0)