Skip to content

Commit 690cd93

Browse files
committed
[css-grid] Fix row-locked auto-positioning to handle sparse vs. dense correctly..
1 parent d13dcc0 commit 690cd93

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed

css-grid/Overview.bs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,10 +2308,20 @@ Grid Item Placement Algorithm</h3>
23082308

23092309
For each <a>grid item</a> with a <a>definite row position</a>
23102310
(that is, the 'grid-row-start' and 'grid-row-end' properties define a <a>definite grid position</a>),
2311-
in <a>order-modified document order</a>,
2312-
set the row-start line of its <a>placement</a>
2313-
to the earliest (smallest positive index) line index
2314-
that ensures this item’s <a>grid area</a> will not overlap any <a>occupied</a> grid cells.
2311+
in <a>order-modified document order</a>:
2312+
2313+
: “sparse” packing (omitted ''dense'' keyword)
2314+
::
2315+
Set the row-start line of its <a>placement</a>
2316+
to the earliest (smallest positive index) line index
2317+
that ensures this item’s <a>grid area</a> will not overlap any <a>occupied</a> grid cells
2318+
and that is past any <a>grid items</a> previously placed in this row by this step.
2319+
2320+
: “dense” packing (''dense'' specified)
2321+
::
2322+
Set the row-start line of its <a>placement</a>
2323+
to the earliest (smallest positive index) line index
2324+
that ensures this item’s <a>grid area</a> will not overlap any <a>occupied</a> grid cells.
23152325

23162326
2. <b>Determine the number of columns in the implicit grid.</b>
23172327

css-grid/Overview.html

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4395,12 +4395,41 @@ <h3 class="heading settled" data-level="9.5" id="auto-placement-algo"><span clas
43954395

43964396
<p>For each <a data-link-type="dfn" href="#grid-item">grid item</a> with a <a data-link-type="dfn" href="#definite-grid-position">definite row position</a>
43974397
(that is, the <a class="property" data-link-type="propdesc" href="#propdef-grid-row-start">grid-row-start</a> and <a class="property" data-link-type="propdesc" href="#propdef-grid-row-end">grid-row-end</a> properties define a <a data-link-type="dfn" href="#definite-grid-position">definite grid position</a>),
4398-
in <a data-link-type="dfn" href="http://dev.w3.org/csswg/css-flexbox-1/#order-modified-document-order">order-modified document order</a>,
4399-
set the row-start line of its <a data-link-type="dfn" href="#grid-placement">placement</a>
4398+
in <a data-link-type="dfn" href="http://dev.w3.org/csswg/css-flexbox-1/#order-modified-document-order">order-modified document order</a>:</p>
4399+
4400+
4401+
4402+
<dl>
4403+
<dt data-md="">
4404+
<p>“sparse” packing (omitted <a class="css" data-link-type="maybe" href="#valdef-grid-auto-flow-dense">dense</a> keyword)</p>
4405+
4406+
4407+
</dt>
4408+
<dd data-md="">
4409+
4410+
<p>Set the row-start line of its <a data-link-type="dfn" href="#grid-placement">placement</a>
4411+
to the earliest (smallest positive index) line index
4412+
that ensures this item’s <a data-link-type="dfn" href="#grid-area">grid area</a> will not overlap any <a data-link-type="dfn" href="#occupied">occupied</a> grid cells
4413+
and that is past any <a data-link-type="dfn" href="#grid-item">grid items</a> previously placed in this row by this step.</p>
4414+
4415+
4416+
4417+
</dd>
4418+
<dt data-md="">
4419+
<p>“dense” packing (<a class="css" data-link-type="maybe" href="#valdef-grid-auto-flow-dense">dense</a> specified)</p>
4420+
4421+
4422+
</dt>
4423+
<dd data-md="">
4424+
4425+
<p>Set the row-start line of its <a data-link-type="dfn" href="#grid-placement">placement</a>
44004426
to the earliest (smallest positive index) line index
44014427
that ensures this item’s <a data-link-type="dfn" href="#grid-area">grid area</a> will not overlap any <a data-link-type="dfn" href="#occupied">occupied</a> grid cells.</p>
4402-
4428+
44034429

4430+
</dd>
4431+
</dl>
4432+
44044433

44054434
</li>
44064435
<li data-md="">

0 commit comments

Comments
 (0)