Skip to content

Commit

Permalink
[css-grid-1] Ensure that 'take from a baseline-aligned item' and 'tak…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
tabatkins committed Jul 6, 2020
1 parent 2e3a7f5 commit a74f96f
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions css-grid-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3639,31 +3639,37 @@ Grid Container Baselines</h3>

<ol>
<li>
If any of the <a>grid items</a> whose areas intersect the <a>grid container</a>’s first (last) row
participate in <a>baseline alignment</a>,
If the [=grid container=] does not contain any [=grid items=],
the grid container has no first (last) <a>baseline set</a>,
and one is <a lt="synthesize baselines">synthesized</a> if needed
according to the rules of its <a>alignment context</a>.
Exit from this algorithm.

<li>
Otherwise,
find the first (last) row of the [=grid container=]
containing at least one [=grid item=].

If any of the [=grid items=] intersecting this row
participate in [=baseline alignment=],
the grid container's <a>baseline set</a>
is <a lt="generate baselines">generated</a> from
the shared <a>alignment baseline</a> of those <a>grid items</a>.

<li>
Otherwise, if the grid container has at least one <a>grid item</a>,
Otherwise,
the grid container's first (last) baseline set
is <a lt="generate baselines">generated</a> from
the <a>alignment baseline</a> of the first (last) <a>grid item</a>
in row-major <a>grid order</a> (according to the <a>writing mode</a> of the <a>grid container</a>).
If the item has no <a>alignment baseline</a> in the grid's inline axis,
in <a>grid order</a> (according to the <a>writing mode</a> of the <a>grid container</a>).
If the [=grid item=] has no <a>alignment baseline</a> in the grid's inline axis,
then one is first <a lt="synthesize baselines">synthesized</a>
from its border edges.

<li>
Otherwise, the grid container has no first (last) <a>baseline set</a>,
and one is <a lt="synthesize baselines">synthesized</a> if needed
according to the rules of its <a>alignment context</a>.
</ol>

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

Expand Down

0 comments on commit a74f96f

Please sign in to comment.