Skip to content

Commit a74f96f

Browse files
committed
[css-grid-1] Ensure that 'take from a baseline-aligned item' and 'take from first item in any row' conditions apply together, so if there's no items in the first row you'll still pay attention to the baseline-aligned items in the second row. Separately, rearrange the text so that these conditions read more clearly. Part of #3645.
1 parent 2e3a7f5 commit a74f96f

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

css-grid-1/Overview.bs

+18-12
Original file line numberDiff line numberDiff line change
@@ -3639,31 +3639,37 @@ Grid Container Baselines</h3>
36393639

36403640
<ol>
36413641
<li>
3642-
If any of the <a>grid items</a> whose areas intersect the <a>grid container</a>’s first (last) row
3643-
participate in <a>baseline alignment</a>,
3642+
If the [=grid container=] does not contain any [=grid items=],
3643+
the grid container has no first (last) <a>baseline set</a>,
3644+
and one is <a lt="synthesize baselines">synthesized</a> if needed
3645+
according to the rules of its <a>alignment context</a>.
3646+
Exit from this algorithm.
3647+
3648+
<li>
3649+
Otherwise,
3650+
find the first (last) row of the [=grid container=]
3651+
containing at least one [=grid item=].
3652+
3653+
If any of the [=grid items=] intersecting this row
3654+
participate in [=baseline alignment=],
36443655
the grid container's <a>baseline set</a>
36453656
is <a lt="generate baselines">generated</a> from
36463657
the shared <a>alignment baseline</a> of those <a>grid items</a>.
36473658

3648-
<li>
3649-
Otherwise, if the grid container has at least one <a>grid item</a>,
3659+
Otherwise,
36503660
the grid container's first (last) baseline set
36513661
is <a lt="generate baselines">generated</a> from
36523662
the <a>alignment baseline</a> of the first (last) <a>grid item</a>
3653-
in row-major <a>grid order</a> (according to the <a>writing mode</a> of the <a>grid container</a>).
3654-
If the item has no <a>alignment baseline</a> in the grid's inline axis,
3663+
in <a>grid order</a> (according to the <a>writing mode</a> of the <a>grid container</a>).
3664+
If the [=grid item=] has no <a>alignment baseline</a> in the grid's inline axis,
36553665
then one is first <a lt="synthesize baselines">synthesized</a>
36563666
from its border edges.
3657-
3658-
<li>
3659-
Otherwise, the grid container has no first (last) <a>baseline set</a>,
3660-
and one is <a lt="synthesize baselines">synthesized</a> if needed
3661-
according to the rules of its <a>alignment context</a>.
36623667
</ol>
36633668

36643669
<dfn export lt="grid order|grid-modified document order">Grid-modified document order (grid order)</dfn>
36653670
is the order in which <a>grid items</a> are encountered
3666-
when traversing the grid's <a>grid cells</a>.
3671+
when traversing the grid's <a>grid cells</a>
3672+
in row-major order.
36673673
If two items are encountered at the same time,
36683674
they are taken in <a>order-modified document order</a>.
36693675

0 commit comments

Comments
 (0)