Skip to content

Commit 55bfb8a

Browse files
committed
[css-grid-1] More precisely define effect of fit-content() limits when accommodating spanning items. w3c#4549
1 parent fcce0c5 commit 55bfb8a

File tree

1 file changed

+62
-8
lines changed

1 file changed

+62
-8
lines changed

css-grid-1/Overview.bs

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,8 +4278,6 @@ Resolve Intrinsic Track Sizes</h3>
42784278
to the [=growth limits=] of tracks with
42794279
a <a>max track sizing function</a> of ''max-content'',
42804280
to accommodate these items' <a>max-content contributions</a>.
4281-
However, limit the growth of any ''fit-content()'' tracks
4282-
by their ''fit-content()'' argument.
42834281
</ol>
42844282

42854283
Repeat incrementally for items with greater spans until all items have been considered.
@@ -4370,10 +4368,15 @@ Distributing Extra Space Across Spanned Tracks</h4>
43704368
(and continuing to grow the unfrozen tracks as needed).
43714369

43724370
For [=base sizes=],
4373-
the |limit| is its [=growth limit=].
4371+
the |limit| is its [=growth limit=],
4372+
capped by its ''fit-content()'' argument if any.
43744373
For [=growth limits=],
4375-
the |limit| is infinity if it is marked as [=infinitely growable=],
4376-
and equal to the [=growth limit=] otherwise.
4374+
the |limit| is the [=growth limit=]
4375+
if the [=growth limit=] is finite
4376+
and the track is not [=infinitely growable=],
4377+
otherwise its ''fit-content()'' argument
4378+
if it has a ''fit-content()'' [=track sizing function=],
4379+
and infinity otherwise.
43774380

43784381
Note: If the |affected size| was a <a>growth limit</a>
43794382
and the track is not marked [=infinitely growable=],
@@ -4400,14 +4403,16 @@ Distributing Extra Space Across Spanned Tracks</h4>
44004403
<li>
44014404
when accommodating any contribution
44024405
into [=growth limits=]:
4403-
all |affected track|s.
4406+
any |affected track| that has an intrinsic [=max track sizing function=].
44044407
</ul>
44054408

44064409
For this purpose,
44074410
the [=max track sizing function=] of a ''fit-content()'' track
44084411
is treated as ''max-content''
4409-
until it reaches the limit specified as the ''fit-content()'' argument,
4410-
after which it is treated as having a <a>fixed sizing function</a> of that argument.
4412+
until the track reaches the limit specified as the ''fit-content()'' argument,
4413+
after which its [=max track sizing function=] is treated as being
4414+
a <a>fixed sizing function</a> of that argument
4415+
(which can change which tracks continue to receive space in this step).
44114416

44124417
Note: This step prioritizes the distribution of space
44134418
for accommodating |size contribution|s
@@ -4805,6 +4810,55 @@ Changes since the <a href="https://www.w3.org/TR/2020/CRD-css-grid-1-20201218/">
48054810
<a href="#change-2016-stretch-algo">earlier change</a>
48064811
to better incorporate ''justify-content/stretch'' handling into the algorithm.
48074812
(<a href="https://github.com/w3c/csswg-drafts/issues/5966">Issue 5966</a>)
4813+
4814+
<li id="change-2020-fit-content">
4815+
Defined more precisely how ''fit-content()'' limits track growth
4816+
when accommodating spanning items.
4817+
(<a href="https://github.com/w3c/csswg-drafts/issues/4549">Issue 4549</a>)
4818+
<blockquote>
4819+
<p><strong>For intrinsic maximums:</strong>
4820+
Next [=distribute extra space=]
4821+
to the [=growth limits=] of tracks with
4822+
a <a>max track sizing function</a> of ''max-content'',
4823+
to accommodate these items' <a>max-content contributions</a>.
4824+
<del>However, limit the growth of any ''fit-content()'' tracks
4825+
by their ''fit-content()'' argument.</del></p>
4826+
</blockquote>
4827+
<blockquote>
4828+
<p><strong>Distribute |space| up to limits:</strong> [&hellip;]</p>
4829+
4830+
<p>For [=base sizes=],
4831+
the |limit| is its [=growth limit=]<ins>,
4832+
capped by its ''fit-content()'' argument if any</ins>.
4833+
For [=growth limits=],
4834+
the |limit| is <del>infinity if it is marked as [=infinitely growable=],
4835+
and equal to the [=growth limit=] otherwise</del>
4836+
<ins>the [=growth limit=]
4837+
if the [=growth limit=] is finite
4838+
and the track is not [=infinitely growable=],
4839+
otherwise its ''fit-content()'' argument
4840+
if it has a ''fit-content()'' [=track sizing function=],
4841+
and infinity otherwise</ins>.</p>
4842+
</blockquote>
4843+
<blockquote>
4844+
<p><strong>Distribute |space| beyond limits:</strong> [&hellip;]</p>
4845+
<ul>
4846+
<li>
4847+
when accommodating any contribution
4848+
into [=growth limits=]:
4849+
<del>all |affected track|s</del>
4850+
<ins>any |affected track| that has an intrinsic [=max track sizing function=]</ins>.
4851+
</ul>
4852+
4853+
<p>For this purpose,
4854+
the [=max track sizing function=] of a ''fit-content()'' track
4855+
is treated as ''max-content''
4856+
until <del>it</del> <ins>the track</ins> reaches the limit specified as the ''fit-content()'' argument,
4857+
after which <del>it</del> <ins>its [=max track sizing function=]</ins>
4858+
is treated as <del>having</del> <ins>being</ins>
4859+
a <a>fixed sizing function</a> of that argument
4860+
<ins>(which can change which tracks continue to receive space in this step)</ins>.</p>
4861+
</blockquote>
48084862
</ul>
48094863

48104864
<h3 id="changes-202008">

0 commit comments

Comments
 (0)