Created attachment 8776860 [details] getComputedStyle.html I attach the test html. For now, that returns "calc(0px + 10%)".
Just a few notes, the spec doesn't actually say this but this is what Chrome does and it seems sensible to spec. At the moment we seem to do: calc(300px + 0%) -> 300px BUT calc(0px + 10%) -> calc(0px + 10%) I'm not sure what the reasoning for this is (I looked up the changeset and bug and there was no explanation) but it seems like we should either always simplify or never.
(In reply to Brian Birtles (:birtles) from comment #1) > Just a few notes, the spec doesn't actually say this but this is what Chrome > does and it seems sensible to spec. > > At the moment we seem to do: > > calc(300px + 0%) -> 300px > BUT > calc(0px + 10%) -> calc(0px + 10%) There is actually some spec text for this although it as marked as being "under discussion". As it currently stands it would suggest we preserve zero values so that, `the calc() doesn’t suddenly "change shape" in the middle of a transition when one of the values happens to have a zero value temporarily.' I don't really understand the concern there but in any case, Gecko's behavior doesn't match that either so something will need to change here.  https://drafts.csswg.org/css-values/#calc-serialize
You need to log in before you can comment on or make changes to this bug.