Re: [csswg-drafts] [css-values-4] The rest of the JS math functions (#4688)

The CSS Working Group just discussed `Adding an infinity keyword`, and agreed to the following:

* `RESOLVED: no non-ASCII in Core CSS`
* `RESOLVED: add infinity and nan as new css math constants`

<details><summary>The full IRC log of that discussion</summary>
&lt;fremy> Topic: Adding an infinity keyword<br>
&lt;RossenTheReal> github, https://github.com/w3c/csswg-drafts/issues/4688<br>
&lt;RossenTheReal> github-issue, https://github.com/w3c/csswg-drafts/issues/4688<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/4688<br>
&lt;fremy> TabAtkins: now that we have a precedent for "e" and "pi"<br>
&lt;fremy> ... heycam mentioned it could be useful to add "infinity"<br>
&lt;fremy> ... it's not useful per se, but it would allow us to serialize infinite values coming from TypedOM<br>
&lt;fremy> ... instead of 1/0<br>
&lt;fremy> TabAtkins: Anyone has opinions on this?<br>
&lt;dbaron> Tab also mentions 1px/0 and the newer option infinity*1px<br>
&lt;fremy> oriol: could we add "NaN" too?<br>
&lt;fremy> TabAtkins: do we need NaN to serialize to infinity<br>
&lt;fremy> oriol: we currently we would need to serialize as 0/0 which is strange<br>
&lt;fremy> TabAtkins: I don't think we have to serialize these values at will, only when we have that as the result of a computation<br>
&lt;jensimmons> `grid-template-column: 1fr 1fr calc(infinity);` ??????<br>
&lt;fremy> TabAtkins: and we could say that NaN as a result of a computation is an infinity<br>
&lt;TabAtkins> s/could/already/<br>
&lt;fremy> heycam: Nothing to add, but yeah I find the current serialization annoying, and since we have this concept of values now, I'd like to use it<br>
&lt;fremy> TabAtkins: Just realized TypedOM allows injecting NaN anywhere, so we might actually need to serialize NaN anywhere<br>
&lt;fremy> TabAtkins: I'm then in favor of adding NaN as a keyword<br>
&lt;jensimmons> `margin-left: calc(-1*infinity);`  ???????<br>
&lt;leaverou> transitions to infinity would be ...interesting<br>
&lt;fremy> TabAtkins: (if we add any of them)<br>
&lt;fremy> TabAtkins: to answer to leaverou, we can already do that, we just would need to write as a calc() right now<br>
&lt;fremy> dbaron: Serialization would be lower case?<br>
&lt;fremy> TabAtkins: yeah, I'd serialize lowercase<br>
&lt;fantasai> s/I'd/CSS would/<br>
&lt;fremy> TabAtkins: but we could do either way, no strong opinion<br>
&lt;fantasai> s/lowercase/lowercase by default/<br>
&lt;fremy> jensimmons: what capabilities are we adding by allowing these keywords?<br>
&lt;chris> z-index: -infinity<br>
&lt;fremy> TabAtkins: none, you can already get those results today by doing computations<br>
&lt;fremy> TabAtkins: (we clamp to the maximum value if we need to)<br>
&lt;jensimmons> `margin-left: calc(-1*(1/0));` works today??<br>
&lt;fremy> TabAtkins: so, what's the room's feelings about this?<br>
&lt;TabAtkins> Yes it does<br>
&lt;astearns> it's defined, in any case<br>
&lt;fremy> chris: there are also people who want rational numbers, so outputting 1/0 as a returned value would give a bad precedent<br>
&lt;tantek_> -∞<br>
&lt;heycam> -oo<br>
&lt;fremy> chris: negative infinity would have to require a space, correct?<br>
&lt;chris> RESOLVED: no non-ASCII in Core CSS<br>
&lt;fremy> TabAtkins: yes, we would need to be careful, like usual for math in css<br>
&lt;fantasai> heycam++<br>
&lt;fremy> (the room seems to have too much fun)<br>
&lt;fremy> TabAtkins: since nobody objected, let's resolve to add them<br>
&lt;jfkthame> heycam, you need some negative letter-spacing there<br>
&lt;tantek_> could you list then explicitly in IRC?<br>
&lt;fremy> RESOLVED: add infinity and nan as new css math constants<br>
&lt;tantek_> I thought I heard NaN or nand?<br>
&lt;TabAtkins> calc(infinity), calc(-infinity), and calc(nan)<br>
&lt;chris> -moz-infinity<br>
&lt;fremy> myles: -infinity sounds odd<br>
&lt;myles> calc(negative-infinity)<br>
&lt;tantek_> -infinity-infinity<br>
&lt;jensimmons> calc(-1*infinity)<br>
&lt;fremy> TabAtkins: idents can start with dash<br>
&lt;tantek_> == 0?<br>
&lt;fremy> dbaron: but usually it's for vendor prefixes<br>
&lt;fremy> TabAtkins: (missed)<br>
&lt;fremy> RossenTheReal: let's move on<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4688#issuecomment-577134942 using your GitHub account

Received on Wednesday, 22 January 2020 11:18:50 UTC