calc() multiplication brings "Invalid Property Value"
Reported by
t...@tobireif.com,
Feb 17 2018
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36 Steps to reproduce the problem: letter-spacing: calc(21.72px * 7.059px); What is the expected behavior? It should work. What went wrong? It brings "Invalid Property Value". Did this work before? N/A Does this work in other browsers? N/A Chrome version: 64.0.3282.167 Channel: stable OS Version: OS X 10.13.3 Flash Version:
,
Feb 17 2018
The values are generated by a lib, I can't simply leave off the "px" from one of the values. I can't find anything in the spec https://www.w3.org/TR/css-values-3/#calc-notation that says the browsers can must not resolve calc(5px * 10px) to 50px . The resulting value can't be in square-pixels anyways (since as you note CSS doesn't have area units), so I think returning 50px would not be an issue at all.
,
Feb 17 2018
The relevant section is https://www.w3.org/TR/css-values-3/#calc-type-checking: At *, check that at least one side is <number>... I don't think it makes sense to have unit * unit = unit; that would break a logical interpretation of the statement.
,
Feb 17 2018
> so I think returning 50px would not be an issue at all. Apart from violating the specification that would also violate basic mathematics/calculus. It would be also wrong to have a mathematically invalid exception just for the same-unit case. It would be even more wrong to coerce to whichever unit is the first/last one in case of mixed units.
,
Feb 17 2018
The status got set to WontFix and I hadn't commented since that 😀 It's fine. |
||
►
Sign in to add a comment |
||
Comment 1 by woxxom@gmail.com
, Feb 17 2018