Re: [csswg-drafts] [css-values] Make top-level NaN be IACVT instead of ∞ (#7067)

I just noticed that Chrome v100 implemented this behavior for `calc(1px/0)` (by error?) and noticed that this is the intended behavior for the draft spec.

I strongly disagree with this decision, because I actually built a CSS grid system which depend on divide by zero causing calc() to be invalid, thereby setting the property to its initial value.

See here: http://miragecraft.com/projects/razorgrid.html

Setting `--span` to `-1` causes my flip switch which is `calc((var(--span)+1)/(var(--span)+1))` to become invalid, while all other values causes it to stay at 1, this lets me change `flex-basis` to `auto` only when `--span: -1` without affecting calc() result for all other `--span` values.

So as you can see, dividing zero causing calc() to be invalid is actually a useful behavior, while making the value go to infinity is not.

So the argument that going to infinity is picking the most blatant of two wrongs is incorrect, because it's possible - as I just demonstrated - that a developer can intentionally divide a value by zero to force the property to go to the initial value.

-- 
GitHub Notification of comment by miragecraft
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7067#issuecomment-1087050979 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 4 April 2022 02:38:04 UTC