@@ -570,6 +570,9 @@ Subgrids</h3>
570
570
results in the subgrid getting [=masonry layout=] in its [=inline axis=] .
571
571
</div>
572
572
573
+ A [=subgrid=] that is a [=masonry container=]
574
+ can be referred to as a <dfn export>submasonry</dfn> .
575
+
573
576
<h3 id="repeat-notation">
574
577
Track Repetition: the ''repeat()'' notation</h3>
575
578
@@ -632,9 +635,6 @@ Grid Axis Track Sizing</h3>
632
635
* All items with an [=automatic grid position=] contribute
633
636
(regardless of whether they are ultimately placed in that track).
634
637
635
- ISSUE(10053): Subgrids need special handling in order to avoid excessive performance costs.
636
-
637
-
638
638
<div class="example">
639
639
For example, suppose there are two columns in the [=grid axis=]
640
640
and that
@@ -678,6 +678,20 @@ Grid Axis Track Sizing</h3>
678
678
or all items are the same size
679
679
(or matching multiples of that size, in the case of spanning items).
680
680
681
+ <h4 id="track-sizing-subgrid">
682
+ Subgrid Item Contributions</h4>
683
+
684
+ When sizing the tracks of either a regular [=grid container=] or a [=masonry container=] ,
685
+ a [=submasonry=] has special handling of items that have an [=automatic grid position=] :
686
+ * Any such item is placed into every possible grid track
687
+ that could be spanned by the [=submasonry=] .
688
+ (If the submasonry has a [=definite grid position=] , thus only the spanned tracks;
689
+ if it has an [=automatic grid position=] , then all tracks in the parent grid.)
690
+ * Any such item receives the largest margin/border/padding contribution
691
+ of each edge at which it could hypothetically be placed.
692
+ If the item spans the entire subgrid, it receives both.
693
+ (See <a href="https://www.w3.org/TR/css-grid-2/#subgrid-item-contribution">CSS Grid Layout §9</a> .)
694
+
681
695
<h4 id="track-sizing-performance">
682
696
Optimized Track Sizing</h4>
683
697
@@ -691,15 +705,13 @@ Optimized Track Sizing</h4>
691
705
Separate all the [=masonry items=] into <dfn>item groups</dfn> , according to the following properties:
692
706
693
707
* the span of the item
694
- * the placement of the item, i.e. whether it an [=automatic grid position=] , or a [=definite grid position=] --
695
- and if so, what that definite position is
708
+ * the placement of the item,
709
+ i.e. which tracks it is allowed to be placed in
696
710
* the item's [=baseline-sharing group=]
697
711
698
712
Note: For example, an item with span 2 placed in the second track
699
713
will be in a different group than an item with span 2 that has an [=automatic grid position=] .
700
714
701
- ISSUE(10053): Subgrids need special handling in order to avoid excessive performance costs.
702
-
703
715
<li>
704
716
For each [=item group=] , synthesize a <dfn>virtual masonry item</dfn>
705
717
that has the maximum of every intrinsic size contribution
0 commit comments