- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Fri, 24 Jan 2020 14:42:52 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `mod() mode`, and agreed to the following: * `RESOLVED: the mod() and rem() functions are to be added to CSS, one with math behavor, the other with JS behavior` <details><summary>The full IRC log of that discussion</summary> <fremy> Topic: mod() mode<br> <astearns> github: https://github.com/w3c/csswg-drafts/issues/2513<br> <TabAtkins> https://en.wikipedia.org/wiki/Modulo_operation#In_programming_languages<br> <fremy> TabAtkins: I was thinking about this, and looking at the wikipedia article...<br> <fremy> TabAtkins: there is a lot of divergence<br> <fremy> TabAtkins: but there is one constant<br> <fremy> TabAtkins: if a language has a pair, mod works like Math and % works like JS<br> <fantasai> s/%/rem/<br> <fremy> TabAtkins: in particular, <<<<>>>> language does this, because they came to the same conclusion<br> <heycam> q+<br> <fremy> TabAtkins: so my proposal, is to add the two functions<br> <fantasai> s/<<<>>>>/Web Assembly/<br> <fremy> leaverou: why are we adding functions and not an operator<br> <fremy> TabAtkins: more complex<br> <leaverou> s/why are we adding functions and not an operator/why are these functions and not operators?/<br> <fremy> TabAtkins: and also it's not an operator in all languages anyway<br> <fantasai> I support Tab's proposal fwiw<br> <fremy> myles: why dont' we want mod to be like js?<br> <florian> +1<br> <florian> s/+1/+1 to tab's proposal/<br> <fremy> TabAtkins: javascript doesn't have a function, just an operator that works like rem<br> <fremy> myles: but then we make CSS more powerful than JS, while JS was intended to be math-complete while CSS is not<br> <fremy> hober: I think the point of this exercise was to reduce differences in differences between the platform languages<br> <fremy> hober: I'm confused why we want to introduce inconsistencies<br> <RossenF2F> q?<br> <fremy> hober: It might be reasonable to ask somebody from TC39 to consider adding the other function, and mimick their response<br> <fremy> TabAtkins: I don't believe it's correct to say that we want to minimize the difference between the two languages<br> <fremy> TabAtkins: our goal is to give designers the functions they need to get the layouts they want<br> <fremy> TabAtkins: which is why we didn't add the hyperbolic functions because there are no known use case<br> <fremy> TabAtkins: and to reply to the "more powerful question", we already do that<br> <fremy> TabAtkins: for instance, we have a more complex round function, and that is useful because rouding is important to us<br> <fremy> TabAtkins: so I don't want to say we should not innovate beyond JS<br> <fremy> TabAtkins: but we should only do it if there's an use case<br> <astearns> ack heycam<br> <astearns> Zakim, close queue<br> <Zakim> ok, astearns, the speaker queue is closed<br> <fremy> heycam: If we really wanted to match JS, we would do an operator, not a mod function in the first place<br> <fremy> heycam: but I was on the queue to say something else<br> <fremy> heycam: it's confusing to have an unit called rem, and a function called rem<br> <fremy> heycam: I would like to avoid it<br> <fremy> myles: an author might think it gives you the size of a rem<br> <fremy> TabAtkins: it would not work, and authors would realize that<br> <astearns> ack fantasai<br> <Zakim> fantasai, you wanted to point out that JS doesn't have a mod function, it has a % operator, so either way we have to pick a name, picking rem() as that name is perfectly fine<br> <fremy> fantasai: also, I want to point out that log doesn't do console.log<br> <fremy> fantasai: also, I agree, % is not a function in JS, not a function<br> <myles> q?<br> <fremy> fantasai: so, if we add a mod() function we don't have to match JS, we can do something useful<br> <fremy> myles: log is a very different example, because we just cannot console.log in JS<br> <fremy> myles: but here we are doing the same thing<br> <fremy> TabAtkins: we have functions that can absorb css timing resolutions from houdini<br> <fremy> TabAtkins: the paint api when it gets called gives you timing information<br> <fremy> astearns: I don't think this is gonna get narrowed down today<br> <fremy> TabAtkins: but, we want to check if we can ship this<br> <fremy> TabAtkins: so can we strawpoll or record objections?<br> <fremy> <debate on the options between people><br> <fremy> RossenF2F: the new option is that we have both mod and rem<br> <fremy> florian: I think we should just have a decision yes or no on the adoption of this approval<br> <fremy> astearns: yeah, let's do this<br> <fremy> hober: I am worried about the form of this strawpol<br> <fremy> hober: because we are not agreeing on an alternative<br> <fremy> astearns: yes, but if we say no, we don't do anything and defer for another day<br> <TabAtkins> 1. Resolve to add mod() (math behavior) and rem() (JS behavior)<br> <TabAtkins> 2. Continue thinking about the desired mod-ish behavior in the issue, resolve sometime later.<br> <fantasai> 1<br> <florian> 1<br> <TabAtkins> 1<br> <faceless> 1<br> <leaverou> 1<br> <hober> 2<br> <dbaron> 1<br> <RossenF2F> 1<br> <fremy> 1<br> <tantek> 1 because YOLO<br> <stantonm> 1<br> <rachelandrew> 1<br> <astearns> abstain<br> <jfkthame> 1<br> <heycam> 1<br> <fremy> 15/22 said 1<br> <RossenF2F> mod(15/22)<br> <fremy> astearns: proposed resolution is thus to add both mod() and rem()<br> <fremy> astearns: does anybody object?<br> <TabAtkins> It's 13 for option 1, 1 for option 2<br> <fremy> RESOLVED: the mod() and rem() functions are to be added to CSS, one with math behavor, the other with JS behavior<br> <TabAtkins> ScribeNick: TabAtkins<br> <leaverou> Chris can't vote due to lack of connectivity, but he votes 1<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2513#issuecomment-578158390 using your GitHub account
Received on Friday, 24 January 2020 14:42:54 UTC