Skip to content

[css-values-4] Casing of 'infinity' and 'nan' keywords #4698

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

Closed
tabatkins opened this issue Jan 24, 2020 · 2 comments
Closed

[css-values-4] Casing of 'infinity' and 'nan' keywords #4698

tabatkins opened this issue Jan 24, 2020 · 2 comments

Comments

@tabatkins
Copy link
Member

We just resolved to add "infinity", "-infinity", and "NaN" keywords to calc(), to aid in serializing infinite/NaN values.

It's obvious that, like in the rest of CSS, these are recognized ASCII case-insensitively; "InFiNiTy" is perfectly valid and produces an infinity value. But what casing should we serialize these values with?

I think it's reasonable to mandate that "NaN" is serialized with that exact casing. It's a weird term, and it's always spelled that exact way; I've never seen it written as "nan", which is what you'd get from the default keyword-serialization rules.

I'm less sure we should do anything for the infinities. Javascript happens to spell them with an initial cap, as Infinity and -Infinity, but this isn't remotely a universal practice. I think we can get away with these serializing per the normal rules, as "infinity" and "-infinity".

I've currently written the spec to reflect these two; if nobody objects we can just leave it as I wrote it.

@tabatkins tabatkins added the css-values-4 Current Work label Jan 24, 2020
@Crissov
Copy link
Contributor

Crissov commented Jan 24, 2020

… or use not-a-number or non-number, or multiple more explicit values like division-by-zero, but that would be unfamiliar to JS developers.

@tabatkins
Copy link
Member Author

Insofar as people care about such values at all, sticking close to the existing universal terminology is probably ideal.

Anyway, no objections in three weeks, I'll go ahead and close. People can feel free to object again when they start implementing. ^_^

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

2 participants