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

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

== [css-typed-om-1]Probably need to define the order of additions in add() step 3 ==
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.

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

Received on Friday, 16 February 2018 01:07:07 UTC