@@ -1604,8 +1604,7 @@ Mathematical Expressions: ''calc()'', ''min()'', and ''max()''</h3>
16041604 <<angle>> ,
16051605 <<time>> ,
16061606 <<percentage>> ,
1607- <<number>> , or
1608- <<integer>>
1607+ or <<number>>
1609 1608 values are allowed.
16101609 Components of a [=math function=] can be literal values,
16111610 other [=math functions=] ,
@@ -1698,42 +1697,24 @@ Syntax</h4>
16981697<h4 id='calc-type-checking'>
16991698Type Checking</h4>
17001699
1701- A [=math function=] has a <dfn>resolved type</dfn> , which is one of
1702- <<length>> ,
1703- <<frequency>> ,
1704- <<angle>> ,
1705- <<time>> ,
1706- <<percentage>> ,
1707- or <<number>> .
1708- It can be used anywhere its [=resolved type=] is allowed.
1700+ A [=math function=] can be many possible types,
1701+ such as <<length>> , <<number>> , etc.,
1702+ depending on the expression it contains,
1703+ as defined in [[#type-checking-exprs]] .
1704+ It can be used anywhere a value of that type is allowed.
1705+
1706+ <div class=example>
1707+ For example, the 'width' property accepts <<length>> values,
1708+ so a [=math function=] that resolves to a <<length>> ,
1709+ such as ''calc(5px + 1em)'' ,
1710+ can be used in 'width' .
1711+ </div>
17091712
1710- Additionally, [=math function=] whose [=resolved type=] is <<number>>
1713+ Additionally, [=math function=] that resolve to <<number>>
17111714 can be used in any place that only accepts <<integer>> .
17121715 (It gets rounded to the nearest integer,
17131716 as specified in [[#calc-range]] .)
17141717
1715- The <a>resolved type</a> must be valid for where the [=math function=] is placed;
1716- otherwise, the expression is invalid.
1717-
1718- The <a>resolved type</a> of a [=math function=] is determined by the values and calculations it contains:
1719-
1720- * <<number-token>> s are of type <<number>> or <<integer>> .
1721- * A <<dimension-token>> ’s type is given by its unit
1722- (''cm'' is <<length>> , ''deg'' is <<angle>> , etc.).
1723- * Functions’ types are defined by their specification
1724- (nested ''calc()'' has its type determined by its own contents,
1725- ''attr()'' ’s type is determined by its <<type-or-unit>> argument,
1726- etc).
1727- * Larger calculations’ types are determined by the types of their arguments
1728- and the rules for their operation,
1729- as defined below.
1730-
1731- A ''calc()'' expression's <a>resolved type</a> is the <a>resolved type</a> of the calculation it contains.
1732- The <a>resolved type</a> of a ''min()'' or ''max()'' expression
1733- is the <a>resolved type</a> of any of the calculations it contains.
1734- If a ''min()'' or ''max()'' expression's arguments have different <a>resolved types</a> ,
1735- the expression is invalid.
1736-
17371718 Note: Because <<number-token>> s are always interpreted as <<number>> s or <<integer>> s,
17381719 "unitless 0" <<length>> s aren't supported in [=math functions=] .
17391720 That is, ''width: calc(0 + 5px);'' is invalid,
@@ -1929,7 +1910,7 @@ Range Checking</h4>
19291910 Note: This requires all contexts accepting ''calc()''
19301911 to define their allowable values as a closed (not open) interval.
19311912
1932- Additionally, if a [=math function=] whose [=resolved type=] is <<number>>
1913+ Additionally, if a [=math function=] that resolves to <<number>>
19331914 is used somewhere that only accepts <<integer>> ,
19341915 the [=computed value=] and [=used value=] are rounded to the nearest integer,
19351916 in the same manner as clamping, above.
0 commit comments