@@ -542,17 +542,27 @@ <h4>The 'calc', 'min' and 'max' functions</h4>
542542</pre>
543543-->
544544
545+ < p > Division by zero is a parse error.
546+
547+ <!--
548+ <p>Values inside a calc() expression must all be either (a)
549+ numbers or (b) legal values for the property, or values that
550+ would be legal if it weren't for range restrictions (such
551+ as the restriction that 'width' accepts only positive values).
552+ -->
545553
546554< p > The semantic constraints are as follows: The context of the
547- expression imposes a target type, which is one of length, frequency,
548- angle, time, or number. Any PERCENTAGE token in the expression also
549- has that type. The NUMBER tokens obviously are of type number, and the
550- DIMENSION tokens have types that depend on their units (cm, px, deg,
555+ expression imposes a < em > target type</ em > , which is one of length, frequency,
556+ angle, time, or number. Any PERCENTAGE token in the expression has the
557+ target type. The NUMBER tokens are of type number, and the DIMENSION
558+ tokens have types of their units ('cm' is length, ' deg' is angle
551559etc.). At each operator, the types of the left and right side have to
552- be compared and, if compatible, they yield a result type, roughly as
560+ be compared and, if compatible, they yield a < em > result type</ em > , roughly as
553561follows (the following ignores precedence rules on the operators for
554562simplicity):
555563
564+
565+
556566< ol >
557567< li > At ",", "+", "-":< br >
558568 check: both sides have the same type< br >
@@ -565,7 +575,6 @@ <h4>The 'calc', 'min' and 'max' functions</h4>
565575</ ol >
566576
567577
568-
569578< h3 > <string></ h3 >
570579
571580< p > Strings are denoted by < dfn > <string></ dfn > in the value
0 commit comments