@@ -1604,14 +1604,30 @@ Type Checking</h4>
16041604 are valid.
16051605
16061606 If percentages are accepted in the context in which the expression is placed,
1607- a <<percentage-token>> has the type of the value that percentages are relative to.
1608- For example, in the 'width' property, percentages have the <<length >> type,
1609- and in 'opacity' they have the <<number >> type.
1607+ and they are defined to be relative to another type besides <<number>> ,
1608+ a <<percentage-token >> is treated as that type.
1609+ For example, in the 'width' property, percentages have the <<length >> type.
16101610 A percentage only has the <<percentage>> type if in that context
16111611 <<percentage>> values are not used-value compatible with any other type.
16121612 If percentages are not normally allowed in place of the ''calc()'' ,
16131613 then a ''calc()'' expression containing percentages is invalid in that context.
16141614
1615+ Note: Note that <<percentage>> s relative to <<number>> s,
1616+ such as in 'opacity' ,
1617+ are not allowed in ''calc()'' .
1618+ Allowing this would cause significant problems with "unit algebra"
1619+ (allowing multiplication/division of <<dimension>> s),
1620+ and in every case so far,
1621+ doesn't provide any new functionality.
1622+ (For example, ''opacity: 25%'' is identical to ''opacity: .25'' ;
1623+ it's just a trivial syntax transform.)
1624+
1625+ Note: Altho there are a few properties in which a bare <<number>>
1626+ becomes a <<length>> at used-value time
1627+ (specifically, 'line-height' and 'tab-size' ),
1628+ <<number>> s never become "length-like" in ''calc()'' .
1629+ They always stay as <<number>> s.
1630+
16151631 Operators form sub-expressions, which gain types based on their arguments.
16161632 To make expressions simpler,
16171633 operators have restrictions on the types they accept.
0 commit comments