Closed
Description
Several of the arithmetic methods are referring to this's unit
internal slot.
However, this
might be an instance of some other class than CSSUnitValue
.
As a result it won't have a unit
internal slot.
Example from step 2 of add(...values)
:
return a new CSSUnitValue whose unit internal slot is set to this’s unit internal slot
This affects the following methods:
- add(...values) method:
this
might be aCSSMathSum
object - min(...values):
this
might be aCSSMathMin
object - max(...values):
this
might be aCSSMathMax
object
The issue can be fixed by defining unit in the steps:
If all of the items in values are CSSUnitValues and have the same unit unit, return a new CSSUnitValue whose unit internal slot is set to unit