Skip to content

Commit 5b62f81

Browse files
committed
[css-tables] Change table-cell-child percentage-resolution based on Chrome compat issues
1 parent 28b5b27 commit 5b62f81

3 files changed

Lines changed: 71 additions & 3 deletions

File tree

css-tables-3/Overview.bs

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:css22; type:property; text:overflow
3434
spec:css22; type:property; text:white-space
3535
spec:css22; type:property; text:display
3636
spec:filter-effects-1; type:property; text:filter
37+
spec:css-sizing-3; type:property; text:box-sizing
3738
</pre>
3839

3940
<!--
@@ -1908,10 +1909,77 @@ spec:filter-effects-1; type:property; text:filter
19081909
if the cell is considered to have its height specified explicitly
19091910
or the child is absolutely positioned, see <a href="http://www.w3.org/TR/CSS2/visudet.html#the-height-property">CSS 2</a>.
19101911

1911-
It is further clarified that
1912+
For compat reasons, it is further clarified that
19121913
a cell is considered to have its height specified explicitly
1913-
if the computed height of the cell or any of its table ancestors is a length or percentage,
1914-
and that percentage does not <a>behave as auto</a>.
1914+
if the computed height of the cell is a length, or
1915+
if the computed height of its table-root ancestor is a length or percentage,
1916+
regardless of whether that percentage does <a>behave as auto</a> or not.
1917+
1918+
</div>
1919+
1920+
<div class="example">
1921+
To clarify the preceding statements, here is a table of the resulting "A" div height based on the value being used:
1922+
<xmp>
1923+
<section style="height: var(--wrapper-height)">
1924+
<table style="height: var(--table-height)">
1925+
<tr>
1926+
<td style="height: var(--table-cell-height)">
1927+
1928+
<div style="height:100%; background:yellow">A</div>
1929+
1930+
</td>
1931+
<td style="height: var(--other-table-cell-height)">
1932+
1933+
B<br>C
1934+
1935+
</td>
1936+
</tr>
1937+
</table>
1938+
</section>
1939+
</xmp>
1940+
1941+
<table border="1" rules="all" style="margin: auto; font-family: 'Consolas', monospace">
1942+
<thead>
1943+
<tr>
1944+
<th>--table-cell-height&nbsp;&nbsp;</th>
1945+
<th>--table-height&nbsp;&nbsp;</th>
1946+
<th>result&nbsp;&nbsp;</th>
1947+
</tr>
1948+
</thead>
1949+
1950+
<tbody>
1951+
<tr>
1952+
<td>&lt;length&gt;</td>
1953+
<td><i style="opacity:0.5">&lt;any&gt;</i></td>
1954+
<td><img src="images/percentage-heights-hundred-percent.png" width="23" height="29" style="vertical-align: middle" alt="100%" title="Percentage honored during second layout pass"></td>
1955+
</tr>
1956+
<tr>
1957+
<td><i style="opacity:0.5">&lt;any&gt;</i></td>
1958+
<td>&lt;length&gt;</td>
1959+
<td><img src="images/percentage-heights-hundred-percent.png" width="23" height="29" style="vertical-align: middle" alt="100%" title="Percentage honored during second layout pass"></td>
1960+
</tr>
1961+
<tr>
1962+
<td><i style="opacity:0.5">&lt;any&gt;</i></td>
1963+
<td>&lt;percentage&gt;</td>
1964+
<td><img src="images/percentage-heights-hundred-percent.png" width="23" height="29" style="vertical-align: middle" alt="100%" title="Percentage honored during second layout pass"></td>
1965+
</tr>
1966+
<tr>
1967+
<td>auto</td>
1968+
<td>auto</td>
1969+
<td><img src="images/percentage-heights-auto.png" width="23" height="29" style="vertical-align: middle" alt="auto" title="Percentage ignored; no second layout pass"></td>
1970+
</tr>
1971+
<tr>
1972+
<td>&lt;percentage&gt;</td>
1973+
<td>auto</td>
1974+
<td><img src="images/percentage-heights-auto.png" width="23" height="29" style="vertical-align: middle" alt="auto" title="Percentage ignored; no second layout pass"></td>
1975+
</tr>
1976+
</tbody>
1977+
</table>
1978+
1979+
Note that neither <code>--other-table-cell-height</code> nor <code>--wrapper-height</code> do influence the algorithm's outcome.
1980+
1981+
A previous version of this specification incorrectly stated that <code>--wrapper-height</code> was taken into account when the table had a percentage height,
1982+
but compat issues appeared when an implementation landed, and the behavior was then special-cased.
19151983

19161984
</div>
19171985

1.66 KB
Loading
1.77 KB
Loading

0 commit comments

Comments
 (0)