Closed svgeesus closed 3 years ago
I think there may be some confusion - there is no more specific JS type. All values with units are unified in a single type, CSSUnitValue, with CSSNumericValue as the superclass that allows for math functions to be represented. Angles are just a CSSUnitValue with one of the angle unit values, or a CSSNumericValue whose CSS type resolves to one of those units.
For example, note that the transform functions work the same way - all the arguments are CSSNumericValue, and we just check on constructing/setting that they resolve to the correct CSS type depending on the value.
(Oh whoops, I see I left out the text that verifies the value type on setting the h attribute in CSSLCH; it's meant to look the same as CSSHSL.)
In 4.6 CSSColorValue objects, the type for hue angles is given as (for example, from HSL)
I would like to understand why
CSSNumericValue
was chosen, when there seems to be a more suitable angle type. I don't see the benefit of the flexibility to use other subtypes liketime
orflex
here.