Skip to content

Commit 4a3bdfe

Browse files
committed
[css-grid] Fold in handling of Microsoft's SpanGroupInWhichMaxBreadthWasMadeFinite into rewritten algo. See <http://lists.w3.org/Archives/Public/www-style/2014Mar/0500.html> for explanation.
--HG-- extra : rebase_source : e74e8905ddeb03a30766d168ef0bff074c39eb23
1 parent 0bf0dbf commit 4a3bdfe

2 files changed

Lines changed: 78 additions & 76 deletions

File tree

css-grid/Overview.bs

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,7 @@ Resolve Content-Based Track Sizing Functions: Second Try</h3>
32933293

32943294
<ol>
32953295
<li>
3296+
<strong>Size tracks to fit non-spanning items:</strong>
32963297
For each track with an intrinsic <i>track sizing function</i>,
32973298
consider the items in it with a span of 1:
32983299
<ul>
@@ -3308,32 +3309,32 @@ Resolve Content-Based Track Sizing Functions: Second Try</h3>
33083309
to the maximum of the items’ <i>max-size contributions</i>.
33093310
</ul>
33103311
<li>
3312+
<strong>Increase sizes to accommodate spanning items:</strong>
33113313
Next, consider the items with a span of 2
33123314
that do not span a track with a <i>flexible sizing function</i>:
33133315
<ol>
3314-
<li>
3315-
First increase the <i>base size</i> of any tracks
3316-
with a <i>min track sizing function</i> of ''min-content''
3317-
by <a href="#extra-space">distributing extra space</a>
3318-
as needed to any tracks with intrinsic <i>min track sizing functions</i>
3319-
to account for these items' <i>min-size contributions</i>.
3320-
<li>
3321-
Next increase the <i>base size</i> of any tracks
3322-
with a <i>min track sizing function</i> of ''max-content''
3323-
by <a href="#extra-space">distributing extra space</a>
3324-
as needed to any tracks with ''max-content'' <i>min track sizing functions</i>
3316+
<li><strong>For min-content minimums:</strong>
3317+
First increase the <i>base size</i> of tracks with
3318+
a <i>min track sizing function</i> of ''min-content'' or ''max-content''
3319+
by <a href="#extra-space">distributing extra space</a> as needed
3320+
account for these items' <i>min-size contributions</i>.
3321+
<li><strong>For max-content minimums:</strong>
3322+
Next continue to increase the <i>base size</i> of tracks with
3323+
a <i>min track sizing function</i> of ''max-content''
3324+
by <a href="#extra-space">distributing extra space</a> as needed
33253325
to account for these items' <i>max-size contributions</i>.
3326-
<li>
3327-
Third increase the <i>growth limit</i> of any tracks
3328-
with a <i>max track sizing function</i> of ''min-content''
3329-
by <a href="#extra-space">distributing extra space</a>
3330-
as needed to any tracks with intrinsic <i>max track sizing functions</i>
3326+
<li><strong>For min-content maximums:</strong>
3327+
Third increase the <i>growth limit</i> of tracks with
3328+
a <i>max track sizing function</i> of ''min-content'' or ''max-content''
3329+
by <a href="#extra-space">distributing extra space</a> as needed
33313330
to account for these items' <i>min-size contributions</i>.
3332-
<li>
3333-
Lastly increase the <i>growth limit</i> of any tracks
3334-
with a <i>max track sizing function</i> of ''max-content''
3335-
by <a href="#extra-space">distributing extra space</a>
3336-
as needed to any tracks with ''max-content'' <i>max track sizing functions</i>
3331+
Mark any tracks whose <i>growth limit</i> changed
3332+
from infinite to finite in this step
3333+
as infinitely growable for the next step.
3334+
<li><strong>For max-content maximums:</strong>
3335+
Lastly continue to increase the <i>growth limit</i> of tracks with
3336+
a <i>max track sizing function</i> of ''max-content''
3337+
by <a href="#extra-space">distributing extra space</a> as needed
33373338
to account for these items' <i>max-size contributions</i>.
33383339
</ol>
33393340

@@ -3352,33 +3353,34 @@ Resolve Content-Based Track Sizing Functions: Second Try</h3>
33523353
For each considered item,
33533354
<ol>
33543355
<li>
3355-
Subtract the corresponding sizes of all spanned tracks
3356-
from its size contribution to find the item's remaining size contribution.
3356+
Subtract the corresponding size (<i>base size</i> or <i>growth limit</i>) of each spanned track
3357+
from the item's size contribution to find the the item's remaining size contribution.
33573358
(For infinite <i>growth limits</i>, use the track's <i>base size</i> instead.)
33583359
This is the space to distribute.
33593360
<pre><var>extra-space</var> = <var>size-contribution</var> - ∑<var>track-sizes</var></pre>
3360-
<p class="issue">The MS algorithm treats things that were infinity (and are no longer) specially here.
3361-
Don't yet understand why.
33623361
<li>
33633362
Distribute the space equally to the tracked increase of each spanned track with an affected size,
3364-
freezing maxed-out tracks as they hit their maximums.
3363+
freezing tracks as they reach their <i>growth limits</i>.
33653364
<pre><var>track-size-increase</var> = max(<var>track-size-increase</var>, <var>share-of-extra-space</var>)</pre>
3365+
If a track is marked as infinitely growable in this phase,
3366+
treat its <i>growth limit</i> as infinite for this calculation.
33663367
<li>
3367-
If space remains after all tracks max out, continue to increase&hellip;
3368+
If space remains after all tracks are frozen,
3369+
unfreeze and continue to increase&hellip;
33683370
<ul>
33693371
<li>
3370-
when handling ''min-content'' <i>base sizes</i>,
3371-
any affected track that happens to also have an intrinsic <i>max track sizing function</i>;
3372+
when handling ''min-content'' <i>base sizes</i>:
3373+
any affected track that happens to also have an intrinsic <i>max track sizing function</i>,
33723374
else all affected tracks.
33733375
<li>
3374-
when handling ''max-content'' <i>base sizes</i>,
3375-
any affected track that happens to also have a ''max-content'' <i>max track sizing function</i>;
3376+
when handling ''max-content'' <i>base sizes</i>:
3377+
any affected track that happens to also have a ''max-content'' <i>max track sizing function</i>,
33763378
else all affected tracks.
3377-
<li>when handling any intrinsic <i>growth limit</i>,
3379+
<li>when handling any intrinsic <i>growth limit</i>:
33783380
all affected tracks.
33793381
</ul>
33803382
<li>
3381-
Update the tracks' affected <i>base sizes</i> and <i>growth limits</i>
3383+
Update the tracks' affected sizes
33823384
by folding in the calculated increase
33833385
so that the next round of space distribution will account for the increase.
33843386
(If the <i>growth limit</i> is infinite,

0 commit comments

Comments
 (0)