According to Bug 594933 comment 28 and 29, the unit checking in the parsing code needs additional changes. For example, our code can parse calc(1 + 2) and calc(1px + 2px), but doesn't accept calc(1 + 2px), which ought to be accepted for line-height, stroke-dashoffset, and stroke-width. There is various code in the functions inside of ParseCalc that needs updating, and some comments also need updating. There's currently no spec for it, but it's better to handle this case.
Also, my understanding from bug 594933 is that other browser engines don't currently support this (I think that's silly, but it's also the reason I said fixing bug 594933 without this was OK). If that changes, somebody should update this bug to say so!
Duplicate of this bug: 1298537
(In reply to Boris Chiou [:boris] from comment #0) > For example, our code can parse calc(1 + 2) (To clarify something that confused me initially -- so, you're right that we do support that expression *for line-height*, but we don't support calc(number+number) or calc(integer+integer) in general, e.g. in the number-valued "opacity" property or the integer-valued "z-index" property. Bug 1296209 partly covers that. calc(1+2) only works for "line-height" via a custom "SetLineHeightCalcOps" calc-handling class that lives in nsRuleNode.cpp right now.)
What's possible for calc() and what not is outlined in https://drafts.csswg.org/css-values-3/#calc-notation. Sebastian
I believe that's extended in https://drafts.csswg.org/css-values-4/#calc-notation
You need to log in before you can comment on or make changes to this bug.