Support CSS math functions on flexible lengths
https://bugs.webkit.org/show_bug.cgi?id=265276
Summary Support CSS math functions on flexible lengths
Roman Komarov
Reported 2023-11-23 02:17:22 PST
To reproduce, go to https://codepen.io/kizu/pen/RwvyyOg or try using `calc(1fr)` in `grid-template-columns`. The `calc(1fr)` is treated as invalid, but it should be valid, as per specs (see it for the `<flex>` type): https://drafts.csswg.org/css-values-4/#calc-type-checking and as clarified by the spec editors: https://github.com/w3c/csswg-drafts/issues/6989 > Definitely a bug; `fr` units should be math'able just fine. That note is, indeed, just observing that `fr` is not a `<length>` so `calc(1px + 1fr)` is invalid, but `calc(1fr / 3)` should be just fine. Curiously, no other browser did fix this yet. Chromium has a bug open from 2019: https://bugs.chromium.org/p/chromium/issues/detail?id=993136&q=calc%20fr&can=2 and I did not find one for Firefox, so I did open it: https://bugzilla.mozilla.org/show_bug.cgi?id=1866236
Attachments
Roman Komarov
Comment 1 2023-11-23 04:54:47 PST
I did open a PR adding WPT tests for this: https://github.com/web-platform-tests/wpt/pull/43322
Radar WebKit Bug Importer
Comment 2 2023-11-30 02:18:14 PST
Note You need to log in before you can comment on or make changes to this bug.