The Typed OM is an extension to the existing CSS Object Model (CSSOM) that exposes CSS values as typed JavaScript objects, instead of a simple strings like they are today. Trying to convert strings in to meaningful types and back today can have a big performance overhead, so this will allow us to work with CSS values in a much more performant way
With the Typed OM, CSS values are now members of a new base class, CSSStyleValue
. There are a number of subclasses of the CSSStyleValue
that more precisely describe a type of CSS Value:
CSSKeywordValue
- CSS Keywords and other identifiers (like
inherit
orgrid
) CSSPositionValue
- Position (
x
andy
) values CSSImageValue
- An object representing the value properties for an image
CSSUnitValue
- Numeric values that can be expressed as a single value with single unit (like
50px
) or a single value or percentage without a unit CSSMathValue
- Complicated numeric values, like you would find with
calc
,min
, andmax
. This includes subclassesCSSMathSum
,CSSMathProduct
,CSSMathMin
,CSSMathMax
,CSSMathNegate
, andCSSMathInvert
CSSTransformValue
- A list of CSS transforms consisting of
CSSTransformComponent
s, includingCSSTranslate
,CSSRotate
,CSSScale
,CSSSkew
,CSSSkewX
,CSSSkewY
,CSSPerspective
, and/orCSSMatrixComponent