Description
There are a number of cases where layout algorithms in CSS (and perhaps other things) care about whether a value has a percentage. In particular, values that have a percentage are treated differently when there's nothing for the percentage to resolve against: inside of something with auto
height a height: calc(30px)
is a fixed value but a height: calc(30px + 0%)
is treated as height: auto
.
With calc()
as it was specified in css-values-3, this could essentially be implemented as part of the type computation; a calc()
expression could effectively be either a <length>
or a <length-percentage>
as its toplevel type, and those that were <length-percentage>
act as though they have a percent.
Newer levels of the specification introduce features that make this approach insufficient:
- division by values with units
sign()
progress()
and related functionscalc-size()
(I think this is clearly defined for calc-size()
because it's very important there, but I don't think it's clearly defined for the other cases.)
It should be clearer whether these other things "erase" the percentage-ness of their arguments when they erase the types of those arguments, or whether they still produce toplevel values that are treated as having a percentage.