Skip to content

Commit e12c781

Browse files
committed
[css-grid] Better heading structure for Grid Sizing Algo
1 parent 6334ff4 commit e12c781

2 files changed

Lines changed: 158 additions & 148 deletions

File tree

css-grid/Overview.bs

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,50 +2586,12 @@ Grid Baselines</h3>
25862586

25872587

25882588
<h2 id='layout-algorithm'>
2589-
Grid Sizing Algorithm</h2>
2589+
Grid Sizing</h2>
25902590

25912591
This section defines the <dfn export>grid sizing algorithm</dfn>,
25922592
which determines the size of all <a>grid tracks</a>
25932593
and, by extension, the entire grid.
25942594

2595-
<h3 id='algo-terms'>
2596-
Definition of Terms for use in Calculating Grid Track Sizes</h3>
2597-
2598-
<dl>
2599-
<dt><dfn>min track sizing function</dfn>
2600-
<dd>
2601-
If the track was sized with a ''minmax()'' function,
2602-
this is the first argument to that function.
2603-
Otherwise, it's the track's sizing function.
2604-
2605-
<dt><dfn>max track sizing function</dfn>
2606-
<dd>
2607-
If the track was sized with a ''minmax()'' function,
2608-
this is the second argument to that function.
2609-
Otherwise, it's the track's sizing function.
2610-
2611-
<dt><dfn>available space</dfn>
2612-
<dd>
2613-
The <a>grid container</a>’s content box size in the applicable dimension.
2614-
2615-
<dt><dfn>free space</dfn>
2616-
<dd>
2617-
Equal to the <a>available space</a> minus the sum of the <a>base sizes</a> of all the grid tracks,
2618-
clamped to a minimum of zero.
2619-
This value can change over the course of the algorithm,
2620-
as <a>base sizes</a> are adjusted.
2621-
2622-
If <a>available space</a> is <a>indefinite</a>,
2623-
the <a>free space</a> is <a>indefinite</a> as well.
2624-
2625-
<dt><dfn>span count</dfn>
2626-
<dd>
2627-
The number of <a>grid tracks</a> crossed by a <a>grid item</a> in the applicable dimension.
2628-
</dl>
2629-
2630-
<h3 id='algo-overview'>
2631-
Overall Sizing Algorithm</h3>
2632-
26332595
Each track has specified <a title="min track sizing function">minimum</a> and
26342596
<a title="max track sizing function">maximum</a> <a>sizing functions</a>
26352597
(which may be the same).
@@ -2643,6 +2605,9 @@ Overall Sizing Algorithm</h3>
26432605

26442606
The <a>grid sizing algorithm</a> defines how to resolve these sizing constraints into used track sizes.
26452607

2608+
<h3 id="algo-overview">
2609+
Grid Sizing Algorithm</h3>
2610+
26462611
<ol>
26472612
<li>
26482613
First, the <a>track sizing algorithm</a> is used to resolve the sizes of the <a>grid columns</a>.
@@ -2683,6 +2648,44 @@ Overall Sizing Algorithm</h3>
26832648
Once the size of each <a>grid area</a> is thus established,
26842649
the <a>grid items</a> are laid out into their respective containing blocks.
26852650

2651+
<h3 id='algo-terms'>
2652+
Track Sizing Terminology</h3>
2653+
2654+
<dl>
2655+
<dt><dfn>min track sizing function</dfn>
2656+
<dd>
2657+
If the track was sized with a ''minmax()'' function,
2658+
this is the first argument to that function.
2659+
Otherwise, it's the track's sizing function.
2660+
2661+
<dt><dfn>max track sizing function</dfn>
2662+
<dd>
2663+
If the track was sized with a ''minmax()'' function,
2664+
this is the second argument to that function.
2665+
Otherwise, it's the track's sizing function.
2666+
2667+
<dt><dfn>available space</dfn>
2668+
<dd>
2669+
The <a>grid container</a>’s content box size in the applicable dimension.
2670+
2671+
<dt><dfn>free space</dfn>
2672+
<dd>
2673+
Equal to the <a>available space</a> minus the sum of the <a>base sizes</a> of all the grid tracks,
2674+
clamped to a minimum of zero.
2675+
This value can change over the course of the algorithm,
2676+
as <a>base sizes</a> are adjusted.
2677+
2678+
If <a>available space</a> is <a>indefinite</a>,
2679+
the <a>free space</a> is <a>indefinite</a> as well.
2680+
2681+
<dt><dfn>span count</dfn>
2682+
<dd>
2683+
The number of <a>grid tracks</a> crossed by a <a>grid item</a> in the applicable dimension.
2684+
</dl>
2685+
2686+
<h3 id="algo-track-sizing">
2687+
Track Sizing Algorithm</h3>
2688+
26862689
The remainder of this section is the <dfn>track sizing algorithm</dfn>,
26872690
which calculates from the <a title="min track sizing function">min</a> and <a>max track sizing functions</a>
26882691
the used track size.
@@ -2697,9 +2700,9 @@ Overall Sizing Algorithm</h3>
26972700

26982701
<ol>
26992702
<li><a href="#algo-init">Initialize Track Sizes</a>
2700-
<li><a href="#algo-content">Resolve Content-Based Track Sizing Functions</a>
2701-
<li><a href="#algo-grow-tracks">Grow All Tracks To Their Max</a>
2702-
<li><a href="#algo-flex-tracks">Process Flexible Tracks</a>
2703+
<li><a href="#algo-content">Resolve Intrinsic Track Sizes</a>
2704+
<li><a href="#algo-grow-tracks">Maximize Tracks</a>
2705+
<li><a href="#algo-flex-tracks">Stretch Flexible Tracks</a>
27032706
</ol>
27042707

27052708
<h3 id="algo-init">
@@ -2741,7 +2744,7 @@ Initialize Track Sizes</h3>
27412744
</dl>
27422745

27432746
<h3 id="algo-content">
2744-
Resolve Content-Based Track Sizing Functions</h3>
2747+
Resolve Intrinsic Track Sizes</h3>
27452748

27462749
This step resolves intrinsic track <a>sizing functions</a> to absolute lengths.
27472750
First it resolves those sizes based on items that are contained wholly within a single track.
@@ -2900,7 +2903,7 @@ Resolve Content-Based Track Sizing Functions</h3>
29002903

29012904

29022905
<h3 id="algo-grow-tracks">
2903-
Grow All Tracks To Their Max</h3>
2906+
Maximize Tracks</h3>
29042907

29052908
If the <a>free space</a> is positive, distribute it equally to all tracks,
29062909
freezing tracks as they reach their <a>growth limits</a>
@@ -2913,7 +2916,7 @@ Grow All Tracks To Their Max</h3>
29132916
the <a>free space</a> is zero.
29142917

29152918
<h3 id="algo-flex-tracks">
2916-
Process Flexible Tracks</h3>
2919+
Stretch Flexible Tracks</h3>
29172920

29182921
This step sizes flexible tracks
29192922
using the largest value it can assign to an ''fr''

0 commit comments

Comments
 (0)