Skip to content

Commit f5276c3

Browse files
committed
[css-grid] Sync fragmentation section to Flexbox (which has more developed rules).
1 parent 8ab29e8 commit f5276c3

1 file changed

Lines changed: 59 additions & 8 deletions

File tree

css-grid/Overview.bs

Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,14 +3058,68 @@ Find the Size of an ''fr''</h4>
30583058
<h2 id='pagination'>
30593059
Fragmenting Grid Layout</h2>
30603060

3061-
Grid containers break across fragment containers (fragmentainers) [[!CSS3-BREAK]] between
3062-
grid rows. The break-* properties do not apply to grid areas. When fragmentating grid containers
3063-
the goal is to minimize the number of grid areas that get fragmented due to their grid row
3064-
being fragmented.
3061+
3062+
<p>
3063+
<a>Grid containers</a> can break across pages
3064+
between rows
3065+
and inside items.
3066+
The <a property lt="break-before">break-*</a> properties apply to grid containers
3067+
as normal for the formatting context in which they participate.
3068+
This section defines how they apply to grid items
3069+
and the contents of grid items.
3070+
3071+
<p>
3072+
The following breaking rules refer to the fragmentation container as the “page”.
3073+
The same rules apply to any other fragmentation containers.
3074+
(Substitute “page” with the appropriate fragmentation container type as needed.)
3075+
See the CSS3 Fragmentation Module [[!CSS3-BREAK]].
3076+
3077+
<p>
3078+
The exact layout of a fragmented grid container is not defined in this level of Grid Layout.
3079+
However, breaks inside a grid container are subject to the following rules:
3080+
3081+
<ul>
3082+
<li>
3083+
The 'break-before' and 'break-after' properties on flex items
3084+
are propagated to their grid row.
3085+
The 'break-before' property on the first row
3086+
and the 'break-after' property on the last row
3087+
are propagated to the grid container.
3088+
3089+
<li>
3090+
A forced break inside a grid item effectively increases the size of its contents;
3091+
it does not trigger a forced break inside sibling items.
3092+
3093+
<li>
3094+
<a href="http://www.w3.org/TR/css3-break/#btw-blocks">Class A break opportunities</a> occur between rows,
3095+
and <a href="http://www.w3.org/TR/css3-break/#end-block">Class C break opportunities</a> occur between the first/last row and the flex container's content edges.
3096+
[[!CSS3-BREAK]]
3097+
3098+
<li>
3099+
When a grid container is continued after a break,
3100+
the space available to its <a>grid items</a>
3101+
(in the block flow direction of the fragmentation context)
3102+
is reduced by the space consumed by grid container fragments on previous pages.
3103+
The space consumed by a grid container fragment is
3104+
the size of its content box on that page.
3105+
If as a result of this adjustment the available space becomes negative,
3106+
it is set to zero.
3107+
3108+
<li>
3109+
Aside from the rearrangement of items imposed by the previous point,
3110+
UAs should attempt to minimize distortation of the grid container
3111+
with respect to unfragmented flow.
3112+
</ul>
3113+
30653114

30663115
<h3 id="fragmentation-alg">
30673116
Sample Fragmentation Algorithm</h3>
30683117

3118+
<p class="issue">
3119+
This is just a rough draft.
3120+
This section needs to be severely cross-checked with the [[CSS3-FLEXBOX]] algorithm.
3121+
Feedback overall is welcome; please reference the rules above instead as implementation guidance.
3122+
30693123
<ol>
30703124
<li>
30713125
Layout the grid following the <a section href="#layout-algorithm"></a> by using the
@@ -3075,10 +3129,6 @@ Sample Fragmentation Algorithm</h3>
30753129
<li>
30763130
Layout the grid container using the values resolved in the previous step.
30773131

3078-
<li>
3079-
If a grid row extends past the current fragment and it is not the first grid row in
3080-
this fragment; push it to the next fragment. Do this even if the grid row has no items.
3081-
30823132
<li>
30833133
If a grid area dimensions change due to fragmentation (do not include items that
30843134
span rows in this decision), increase the grid row as necessary for rows that either:
@@ -3131,6 +3181,7 @@ Changes</h2>
31313181
<a href=http://www.w3.org/TR/2014/WD-css3-grid-layout-20140513/>13 May 2014 Working Draft</a>.
31323182

31333183
<ul>
3184+
<li>Added first draft of grid container <a href="#pagination">fragmenting rules</a>.
31343185
<li>Applied 'align-content' and 'justify-content' to the <a>grid tracks</a> rather than to the <a>grid</a> as a monolithic unit, to allow justification of grid items across the grid container.
31353186
<li>Removed <css>stack</css> value from 'grid-auto-flow'.
31363187
<li>Added ''auto'' keyword to ''repeat()'' function for auto-filled tracks.

0 commit comments

Comments
 (0)