Re: [css3-values][css3-transforms] relative length in functional notation

On 07/11/2012 01:45 PM, fantasai wrote:
> On 07/09/2012 05:37 PM, Kang-Hao (Kenny) Lu wrote:
>>
>> An undefined corner case for which I am asking the spec to define is
>> whether calc(0*100% + 1em) is the same as calc(1em), and I already did
>> the testing for browsers supporting calc(): No, calc(0*100% + 1em) is
>> treated as 'auto'.
>
> Hi Kenny,
> I think it's a fair point that css3-values clarify say whether percentages
> can be simplified away. We've added
>
> # Where percentages are not resolved at computed value, they are not
> # resolved in ‘calc()’ expressions, e.g. ‘height: calc(100% - 100% + 1em)’
> # computes to ‘height: calc(0% + 1em)’, not to ‘height: calc(1em)’, and,
> # due to containing a percentage relative to the height of a containing
> # block that depends on this element's height, is treated as ‘auto’. [CSS21]
>
> Let us know if this addresses your comment.

Actually, we tweaked this to be a bit more general to:

http://dev.w3.org/csswg/css3-values/#calc-computed-value
   # Where percentages are not resolved at computed value, they are not
   # resolved in ‘calc()’ expressions, e.g. ‘calc(100% - 100% + 1em)’
   # resolves to ‘calc(0% + 1em)’, not to ‘calc(1em)’.
   # If there are special rules for computing percentages in a value
   # (e.g. the ‘height’ property), they apply whenever a ‘calc()’
   # expression contains percentages.

~fantasai

Received on Wednesday, 11 July 2012 21:28:01 UTC