Skip to content

Commit dbc652f

Browse files
committed
[css3-grid-layout] Sync grid baseline calculations with flexbox.
1 parent 22a949f commit dbc652f

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

css3-grid-layout/Overview.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ <h2 class="no-num no-toc" id=contents> Table of contents</h2>
310310

311311
<li><a href="#z-order"><span class=secno>7.4. </span> Z-axis Ordering:
312312
the ‘<code class=property>z-index</code>’ property</a>
313+
314+
<li><a href="#grid-baselines"><span class=secno>7.5. </span> Grid
315+
Baselines</a>
313316
</ul>
314317

315318
<li><a href="#layout-algorithm"><span class=secno>8. </span> Grid Layout
@@ -2480,6 +2483,43 @@ <h3 id=z-order><span class=secno>7.4. </span> Z-axis Ordering: the ‘<code
24802483
&lt;div id="E">E&lt;/div>
24812484
&lt;/div></pre>
24822485

2486+
<h3 id=grid-baselines><span class=secno>7.5. </span> Grid Baselines</h3>
2487+
2488+
<p> The baselines of a <a href="#grid-container"><i>grid container</i></a>
2489+
are determined as follows:
2490+
2491+
<ol>
2492+
<li> If any of the <a href="#grid-item"><i>grid items</i></a> whose areas
2493+
intersect the <a href="#grid-container"><i>grid container</i></a>’s
2494+
first row/column <a href="#baseline-participation">participate in
2495+
baseline alignment</a>, the grid container's baseline is the baseline of
2496+
those <a href="#grid-item"><i>grid items</i></a>.
2497+
2498+
<li> Otherwise, if the grid container has at least one <a
2499+
href="#grid-item"><i>grid item</i></a> whose area intersects the first
2500+
row/column, and the first such <a href="#grid-item"><i>grid item</i></a>
2501+
(in ‘<code class=property>order</code>’-modified document order) has
2502+
a baseline parallel to the relevant axis, the grid container's baseline
2503+
is that baseline.
2504+
2505+
<li> Otherwise, the grid container's baseline is <a
2506+
href="http://www.w3.org/TR/css3-writing-modes/#inline-alignment">synthesized</a>
2507+
from the first item's (in ‘<code
2508+
class=property>order</code>’-modified document order) content box, or,
2509+
failing that, from the grid container's content box.
2510+
</ol>
2511+
2512+
<p> When calculating the baseline according to the above rules, if the box
2513+
contributing a baseline has an ‘<code class=property>overflow</code>
2514+
value that allows scrolling, the box must be treated as being in its
2515+
initial scroll position for the purpose of determining its baseline.
2516+
2517+
<p> When <a
2518+
href="http://www.w3.org/TR/CSS21/tables.html#height-layout">determining
2519+
the baseline of a table cell</a>, a grid container provides a baseline
2520+
just as a line box or table-row does. <a href="#CSS21"
2521+
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
2522+
24832523
<h2 id=layout-algorithm><span class=secno>8. </span> Grid Layout Algorithm</h2>
24842524

24852525
<h3 id=algo-terms><span class=secno>8.1. </span> Definition of Terms for

css3-grid-layout/Overview.src.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,42 @@ <h3 id='z-order'>
19651965
&lt;div id="E">E&lt;/div>
19661966
&lt;/div></pre>
19671967

1968+
<h3 id='grid-baselines'>
1969+
Grid Baselines</h3>
1970+
1971+
<p>
1972+
The baselines of a <i>grid container</i> are determined as follows:
1973+
1974+
<ol>
1975+
<li>
1976+
If any of the <i>grid items</i> whose areas intersect the <i>grid container</i>’s first row/column
1977+
<a href="#baseline-participation">participate in baseline alignment</a>,
1978+
the grid container's baseline is the baseline of those <i>grid items</i>.
1979+
1980+
<li>
1981+
Otherwise, if the grid container has at least one <i>grid item</i> whose area intersects the first row/column,
1982+
and the first such <i>grid item</i> (in 'order'-modified document order) has a baseline
1983+
parallel to the relevant axis,
1984+
the grid container's baseline is that baseline.
1985+
1986+
<li>
1987+
Otherwise, the grid container's baseline is <a href="http://www.w3.org/TR/css3-writing-modes/#inline-alignment">synthesized</a>
1988+
from the first item's (in 'order'-modified document order) content box,
1989+
or, failing that, from the grid container's content box.
1990+
</ol>
1991+
1992+
<p>
1993+
When calculating the baseline according to the above rules,
1994+
if the box contributing a baseline has an 'overflow' value that allows scrolling,
1995+
the box must be treated as being in its initial scroll position
1996+
for the purpose of determining its baseline.
1997+
1998+
<p>
1999+
When <a href="http://www.w3.org/TR/CSS21/tables.html#height-layout">determining the baseline of a table cell</a>,
2000+
a grid container provides a baseline just as a line box or table-row does. [[!CSS21]]
2001+
2002+
2003+
19682004
<h2 id='layout-algorithm'>
19692005
Grid Layout Algorithm</h2>
19702006

0 commit comments

Comments
 (0)