@@ -288,7 +288,10 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
288288 < li > < a href ="#calc-type-checking "> < span class =secno > 8.1.2. </ span >
289289 Type Checking</ a >
290290
291- < li > < a href ="#calc-range "> < span class =secno > 8.1.3. </ span > Range
291+ < li > < a href ="#calc-computed-value "> < span class =secno > 8.1.3. </ span >
292+ Computed Value</ a >
293+
294+ < li > < a href ="#calc-range "> < span class =secno > 8.1.4. </ span > Range
292295 Checking</ a >
293296 </ ul >
294297
@@ -1364,30 +1367,6 @@ <h3 id=calc-notation><span class=secno>8.1. </span> Mathematical
13641367 href ="#percentage-value "> < var > <percentage> </ var > </ a > values that
13651368 resolve to one of the preceding types.
13661369
1367- < p > The computed value of a ‘< a href ="#calc "> < code
1368- class =css > calc()</ code > </ a > ’ expression is the expression with all
1369- components computed, with all multiplication/division subexpressions
1370- resolved, and with all addition/subtraction subexpressions resolved where
1371- both sides are the same type. Where percentages are not resolved at
1372- computed value, they are not resolved in ‘< a href ="#calc "> < code
1373- class =css > calc()</ code > </ a > ’ expressions, e.g. ‘< code
1374- class =css > height: calc(100% - 100% + 1em)</ code > ’ computes to ‘< code
1375- class =css > height: calc(0% + 1em)</ code > ’, not to ‘< code
1376- class =css > height: calc(1em)</ code > ’, and, due to containing a percentage
1377- relative to the height of a containing block that depends on this
1378- element's height, < a
1379- href ="http://www.w3.org/TR/CSS21/visudet.html#the-height-property "> is
1380- treated as ‘< code class =css > auto</ code > ’</ a > . < a href ="#CSS21 "
1381- rel =biblioentry > [CSS21]<!--{{!CSS21}}--> </ a > < span class =note > Thus, the
1382- computed value of a ‘< a href ="#calc "> < code
1383- class =css > calc()</ code > </ a > ’ expression can be represented as either a
1384- number or a tuple of a dimension and a percentage. </ span >
1385- <!-- http://lists.w3.org/Archives/Public/www-style/2010May/0001.html
1386- This has notes on how we should handle things when calc() is extended to
1387- handle unit mult/div. Related to this is <unit>mod<unit>, which can return
1388- 0 and thus introduce computed-time division-by-zero. -->
1389-
1390-
13911370 < div class =example >
13921371 < pre >
13931372section {
@@ -1446,12 +1425,6 @@ <h3 id=calc-notation><span class=secno>8.1. </span> Mathematical
14461425</ pre >
14471426 </ div >
14481427
1449- < p > Given the complexities of width and height calculations on table cells
1450- and table elements, math expressions involving percentages for widths and
1451- heights on table columns, table column groups, table rows, table row
1452- groups, and table cells in both auto and fixed layout tables MAY be
1453- treated as if ‘< code class =property > auto</ code > ’ had been specified.
1454-
14551428 < h4 id =calc-syntax > < span class =secno > 8.1.1. </ span > Syntax</ h4 >
14561429
14571430 < p > The expression language of these functions is described by the grammar
@@ -1561,7 +1534,41 @@ <h4 id=calc-type-checking><span class=secno>8.1.2. </span> Type Checking</h4>
15611534 - 5px + 10s)</ code > ’ or ‘< code class =css > calc(0 * 5px + 10s)</ code > ’
15621535 are both invalid due to the attempt to add a length and a time.
15631536
1564- < h4 id =calc-range > < span class =secno > 8.1.3. </ span > Range Checking</ h4 >
1537+ < h4 id =calc-computed-value > < span class =secno > 8.1.3. </ span > Computed Value</ h4 >
1538+
1539+ < p > The computed value of a ‘< a href ="#calc "> < code
1540+ class =css > calc()</ code > </ a > ’ expression is the expression with all
1541+ components computed, with all multiplication/division subexpressions
1542+ resolved, and with all addition/subtraction subexpressions resolved where
1543+ both sides are the same type.
1544+
1545+ < p > Where percentages are not resolved at computed value, they are not
1546+ resolved in ‘< a href ="#calc "> < code class =css > calc()</ code > </ a > ’
1547+ expressions, e.g. ‘< code class =css > calc(100% - 100% + 1em)</ code > ’
1548+ resolves to ‘< code class =css > calc(0% + 1em)</ code > ’, not to ‘< code
1549+ class =css > calc(1em)</ code > ’. If there are special rules for computing
1550+ percentages in a value (e.g. < a
1551+ href ="http://www.w3.org/TR/CSS21/visudet.html#the-height-property "> the
1552+ ‘< code class =property > height</ code > ’ property</ a > ), they apply
1553+ whenever a ‘< a href ="#calc "> < code class =css > calc()</ code > </ a > ’
1554+ expression contains percentages.
1555+
1556+ < p class =note > Thus, the computed value of a ‘< a href ="#calc "> < code
1557+ class =css > calc()</ code > </ a > ’ expression can be represented as either a
1558+ number or a tuple of a dimension and a percentage.
1559+ <!-- http://lists.w3.org/Archives/Public/www-style/2010May/0001.html
1560+ This has notes on how we should handle things when calc() is extended to
1561+ handle unit mult/div. Related to this is <unit>mod<unit>, which can return
1562+ 0 and thus introduce computed-time division-by-zero. -->
1563+
1564+
1565+ < p > Given the complexities of width and height calculations on table cells
1566+ and table elements, math expressions involving percentages for widths and
1567+ heights on table columns, table column groups, table rows, table row
1568+ groups, and table cells in both auto and fixed layout tables MAY be
1569+ treated as if ‘< code class =css > auto</ code > ’ had been specified.
1570+
1571+ < h4 id =calc-range > < span class =secno > 8.1.4. </ span > Range Checking</ h4 >
15651572
15661573 < p > The value resulting from an expression must be clamped to the range
15671574 allowed in the target context.
0 commit comments