Re: [css-houdini-drafts] [css-typed-om] What should CSSNumericValue.type() do?

The Working Group just discussed `What should CSSNumericValue.type() do?`, and agreed to the following resolutions:

* `RESOLVED: type() will be a map of units to powers`

<details><summary>The full IRC log of that discussion</summary>
&lt;nainar> Topic: What should CSSNumericValue.type() do?<br>
&lt;nainar> Github: https://github.com/w3c/css-houdini-drafts/issues/482<br>
&lt;nainar> TabAtkins: before calc stuff type was easy - returned string with unit or generic thing like length<br>
&lt;nainar> TabAtkins: difficult due to calc stuff. Map of type to power.<br>
&lt;nainar> TabAtkins: Q now is what form is type in JS. Simple answer: object literal from type to integer powers.<br>
&lt;nainar> dbaron: omitt things that are 0?<br>
&lt;nainar> TabAtkins: Not always. Type maps keeps track of 0 things. Cant add pixel to s/s<br>
&lt;nainar> TabAtkins: incompatible expression .<br>
&lt;nainar> TabAtkins: one type thaat is pixel. Other one is a mathdivide of s/s<br>
&lt;nainar> dbaron: its unitless?<br>
&lt;nainar> TabAtkins: its unit is still time?<br>
&lt;nainar> dbaron: ...<br>
&lt;nainar> TabAtkins: I remember preserving zero types for a reason...<br>
&lt;nainar> TabAtkins: If I can remember why there may have been zero types at one point.<br>
&lt;nainar> dbaron: will there be a simple way to access abstract dimension of unit?<br>
&lt;nainar> dbaron: eg px diided by em. Remember that px/em but abstractally itss unitless<br>
&lt;nainar> TabAtkins: yes that is what the type map tracks and returns<br>
&lt;TabAtkins> https://drafts.css-houdini.org/css-typed-om/#numeric-typing<br>
&lt;nainar> TabAtkins: describes how to produce a type from various things...<br>
&lt;nainar> TabAtkins: maps categories to powers<br>
&lt;nainar> TabAtkins: One limitaation - general caswe - where you are trying to handles % correctly.  Hvave to do type inference to see if expression is avllid. There are some compocated div case that shoudl work but are rejected by my expression<br>
&lt;nainar> dbaron: this is becaue you arent converting % to what it si equivalent to<br>
&lt;nainar> TabAtkins: So i nedto checkthat if % wa converted to a valid typed would it be a valid type?<br>
&lt;nainar> TabAtkins: Just returning a map is simple and does job - in simple cases it is more complicated than needed. this addressed general case?<br>
&lt;nainar> fremy: Can we get a helper that gets type and returns whether the map is of that type?<br>
&lt;nainar> TabAtkins: Yes to and to Sum fucntion takes input and throws if it cant convert.<br>
&lt;nainar> RESOLVED: type() will be a map of units to powers<br>
</details>


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

Received on Thursday, 9 November 2017 18:01:25 UTC