Skip to content

Commit dcbb207

Browse files
committed
More constraints for width/height calculation. Still need to handle
minmax better. Probably need to define 'max-content' and 'min-content' outside of the list.
1 parent 3945b5f commit dcbb207

1 file changed

Lines changed: 30 additions & 17 deletions

File tree

css3-layout/new.src.html

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,12 +1097,12 @@ <h3 id="grid-templates">
10971097
<var>M</var> rows, the implicit template is equivalent to
10981098
<var>M</var> strings of <var>N</var> asterisks:
10991099

1100-
<pre>
1101-
"***&hellip;***"
1102-
"***&hellip;***"
1103-
&#8942;
1104-
"***&hellip;***"
1105-
</pre>
1100+
<blockquote>
1101+
<p><code>"***</code>&hellip;<code>***"</code><br>
1102+
<code>"***</code>&hellip;<code>***"</code><br>
1103+
&#8942;<br>
1104+
<code>"***</code>&hellip;<code>***"</code>
1105+
</blockquote>
11061106

11071107
<p class=note>Note that an element is a grid element in this case if
11081108
'grid-columns' and 'grid-rows' are not both ''auto''.
@@ -1316,9 +1316,11 @@ <h3>Default slots</h3>
13161316
default. If there is no asterisk, then the first letter in the
13171317
template defines the default slot.
13181318

1319-
<p class=example>For example, if the template is defined by
1319+
<div class=example>
1320+
<p>For example, if the template is defined by
13201321
'grid-template: "..." "..c" "abb" "abb"', then “c” is the default
13211322
slot.
1323+
</div>
13221324

13231325
<p>If the grid has an <em>implicit template</em> (i.e.,
13241326
'grid-template' is ''none''), then the default slot is the single,
@@ -1408,12 +1410,12 @@ <h4 id="computed-values-grid-rows-and-columns">
14081410

14091411

14101412
<h3 id="slot-sizes">
1411-
Calculating the widths and heights of the slots</h3>
1413+
Calculating the size of the grid</h3>
14121414

14131415
<p>The UA must choose the widths and heights of all columns and rows
14141416
such that the following constraints are satisfied.
14151417

1416-
<ul>
1418+
<ol>
14171419
<li>If the element has an a-priori known content height, then the
14181420
sum of the heights of all rows must be equal to the element's
14191421
height.
@@ -1452,15 +1454,26 @@ <h3 id="slot-sizes">
14521454
the preferred intrinsic width of that slot, as defined in
14531455
[[!CSS3BOX]], plus the slot's horizontal padding, border and margin.
14541456

1457+
<li>Each <em>vertical</em> slot that spans at least one column with
1458+
a width specified as 'max-content', 'min-content' or 'fit-content',
1459+
must have a width at least as large as the slot's <em>block
1460+
dimension.</em>
1461+
1462+
<li>Each <em>horizontal</em> slot that spans at least one row with a
1463+
height specified as 'max-content', 'min-content' or 'fit-content',
1464+
must have a height at least as large as the slot's <em>block
1465+
dimension.</em>
1466+
14551467
<li>Each <em>vertical</em> slot that spans at least one row with a
1456-
height specified as 'min-content' must be at least as high as the
1457-
preferred minimum height of that slot, as defined in [[!CSS3BOX]],
1458-
plus the slot's vertical padding, border and margin.
1468+
height specified as 'min-content' or 'fit-content' must be at least
1469+
as high as the preferred minimum height of that slot, as defined in
1470+
[[!CSS3BOX]], plus the slot's vertical padding, border and margin.
14591471

1460-
<li>Each <em>horizontal</em> slot that spans at least one columns
1461-
with a height specified as 'min-content' must be at least as wide as
1462-
the preferred minimum width of that slot, as defined in
1463-
[[!CSS3BOX]], plus the slot's horizontal padding, border and margin.
1472+
<li>Each <em>horizontal</em> slot that spans at least one column
1473+
with a width specified as 'min-content' or 'fit-content' must be at
1474+
least as wide as the preferred minimum width of that slot, as
1475+
defined in [[!CSS3BOX]], plus the slot's horizontal padding, border
1476+
and margin.
14641477

14651478

14661479
<li>All rows with a height specified as '*' must have the same
@@ -1483,7 +1496,7 @@ <h3 id="slot-sizes">
14831496
w<sub>j</sub> = W<sub>j</sub> * W<sub>i</sub>. (I.e., their widths
14841497
are proportional to their number of 'fr' units.)
14851498

1486-
</ul>
1499+
</ol>
14871500

14881501
<p>If it is impossible to choose such widths and heights, then try
14891502
without constraint 1. If it is still impossible, try without

0 commit comments

Comments
 (0)