Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-values] All browsers handle calc() in <integer> incorrectly #3114

Closed
LeaVerou opened this issue Sep 15, 2018 · 4 comments
Closed

[css-values] All browsers handle calc() in <integer> incorrectly #3114

LeaVerou opened this issue Sep 15, 2018 · 4 comments

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Sep 15, 2018

Testcases:

z-index accepts <integer>.
grid-column-end accepts an <integer> after span.

calc() is allowed everywhere that an <integer> is accepted:

Additionally, math functions that resolve to can be used in any place that only accepts . (It gets rounded to the nearest integer, as specified in §8.1.4 Range Checking.)

However, no browser seems to support this properly (see linked test):

  • Blink, WebKit, Gecko support multiplication but not division
  • Edge does not seem to support calc() at all in grid-column-end, and supports multiplication but not division in z-index.
@LeaVerou LeaVerou changed the title [css-values][css-grid] All browsers handle calc() in grid-column-end incorrectly [css-values] All browsers handle calc() in <integer> incorrectly Sep 15, 2018
@SelenIT
Copy link
Collaborator

SelenIT commented Sep 16, 2018

AFAIK, browsers currently treat the result of division in calc() as number (even when the result has no fractional part), according to the previous level of the spec, so it is not accepted where <integer> is expected. I suppose the change request should be made for them to switch to the Level 4 behavior. It appears that Chrome and Mozilla already have such bugs filed.

@tabatkins
Copy link
Member

Right, this isn't a spec issue, just browser bugs due to them not yet following the spec. I'll close this issue; Chrome and Firefox already have bugs.

@FremyCompany I don't want to create a Microsoft account right now - you mind filing this as an Edge bug too?

@LeaVerou
Copy link
Member Author

@FremyCompany
Copy link
Contributor

Yes, we also have the "wrong" rounding behavior, this was mentioned when we made the spec change to allow calc for integers. Properties that don't allow calc() are of course another problem, that will eventually need to be updated too.

Thanks everyone for filing all the relevant bugs.

@fantasai fantasai added this to the css-grid-1 CR 2017-12-14+ milestone Jan 23, 2019
@fantasai fantasai removed this from the css-grid-1 CR 2017-12-14+ milestone Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants