css-houdini-drafts icon indicating copy to clipboard operation
css-houdini-drafts copied to clipboard

[css-typed-om] Math functions that correspond css math functions declared in css-values-4

Open DevSDK opened this issue 2 years ago • 2 comments

Hi folks,

I noticed that CSS Typed OM Level 1 is now missing support for CSS math functions that are part of the CSS Values and Units Module Level 4.

I wonder if it was just missing or having some reason.

Thanks!

DevSDK avatar Apr 10 '23 04:04 DevSDK

I assume they are missing from Typed OM because they are serialized as numeric values. E.g. if you have transform: rotate(atan(1));, the atan(1) is serialized as CSSUnitValue with {value: 45, unit: 'deg'}.

Though for value creation it might make sense to add specific interfaces for the different mathematical functions. So the example from above could be created via a new CSSMathAtan(1).

But I'm just speculating. Maybe @tabatkins or @FremyCompany can shed some light on why the different math functions currently don't have their own interfaces in Typed OM.

Sebastian

SebastianZ avatar Apr 10 '23 20:04 SebastianZ

No, they're just missing because I haven't gotten to representing them. They can absolutely persist into any of the value stages that TypedOM can return.

tabatkins avatar Apr 14 '23 21:04 tabatkins