Skip to content

[css-typed-om-1]Probably need to define the order of additions in add() step 3 #677

@bzbarsky

Description

@bzbarsky

https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-add step 3 says:

If all of the items in values are CSSUnitValues and have the same unit, return a new CSSUnitValue whose unit internal slot is set to this’s unit internal slot, and value internal slot is set to the sum of the value internal slots of the items in values.

Unfortunately you are adding doubles here. If there are more than 3 things in the list, you have to deal with the fact that floating-point addition is not associative and that the answer will depend on the order you perform your additions in. Ideally this spec would define the order.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions