#13069 added the simplification of Sum nodes containing an unresolved value and negate nodes.
For example, 1px - (1em + 1px) is simplified to -1em.
But this simplification can change the sign of zero, like in order: sign((-1 * 0px) - (1em - 1em * sibling-count())). If I am not mistaken, with the new simplification requirement, it simplifies to sign(-0px + -1em + (1em * sibling-count()), which resolves to sign(-0px - 1px + 1px) assuming 1em resolves to 1px and sibling-count() to 1. -0px - 1px + 1px results to 0. On the other hand, if it resolves to sign(-0px - 0px), -0px - 0px results to -0px.
0⁻ + 0⁻ or 0⁻ - 0⁺ produces 0⁻. All other additions or subtractions that would produce a zero produce 0⁺.
Note that signed zeros cannot be written in CSS. At least, they are not supposed to.
Also note that ordering calculation terms can have a similar effect.
edit: (1em - 1em) simplifies to 0em because units are the same, so added sibling-count() into play.
#13069 added the simplification of Sum nodes containing an unresolved value and negate nodes.
For example,
1px - (1em + 1px)is simplified to-1em.But this simplification can change the sign of zero, like in
order: sign((-1 * 0px) - (1em - 1em * sibling-count())). If I am not mistaken, with the new simplification requirement, it simplifies tosign(-0px + -1em + (1em * sibling-count()), which resolves tosign(-0px - 1px + 1px)assuming1emresolves to1pxandsibling-count()to1.-0px - 1px + 1pxresults to0. On the other hand, if it resolves tosign(-0px - 0px),-0px - 0pxresults to-0px.Note that signed zeros cannot be written in CSS. At least, they are not supposed to.
Also note that ordering calculation terms can have a similar effect.
edit:
(1em - 1em)simplifies to0embecause units are the same, so addedsibling-count()into play.