Skip to content
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

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

Closed
dbaron opened this issue Jan 28, 2018 · 1 comment
Closed

Comments

@dbaron
Copy link
Member

dbaron commented Jan 28, 2018

The rules for creating 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.

@darrnshn
Copy link
Collaborator

Yep, the wording is a bit confusing here. Also see #520 .

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