[css-houdini-drafts] [css-typed-om] need to define (or link to?) concept of unioning unit maps

dbaron has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] need to define (or link to?) concept of unioning unit maps ==
The [rules for creating a sum value](https://drafts.css-houdini.org/css-typed-om-1/#create-a-sum-value) from a `CSSNumericValue` have wording in the part about processing a `CSSMathProduct` that says:

> Let item be a tuple with its value set to the product of the values of item1 and item2, and its unit map set to the union of the unit maps of item1 and item2, with all entries with a zero value removed.

The concept of how to union unit maps isn't defined (or at least it isn't a link here), and I didn't see a definition where unit maps are defined.

It seems like unioning unit maps should merge identical units, for example unioning `["px" → 1]` and `["px" → 2]` should yield `["px" → 3]`.  Likewise, unioning `["px" → 1]` and `["px" → -1]` should yield `[]`.   I don't think those follow from a straightforward interpretation of the word "union", but I think they are what is expected.  (I think the straightforward interpretation of "union" does work when the types are different, though.)

Given that, I also wonder if the concept should be called multiplying rather than unioning.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/578 using your GitHub account

Received on Sunday, 28 January 2018 06:32:35 UTC