ZVON > References > DOM2 Reference

CSSPrimitiveValue (interface )


Own properties:
attributes  -  primitiveType
methods  -  getCounterValue, getFloatValue, getRectValue, getRGBColorValue, getStringValue, setFloatValue, setStringValue

Inherited properties:
attributes  -  cssText, cssValueType
methods  - 

Description:
The CSSPrimitiveValue interface represents a single CSS value. This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style property explicitly within the block. An instance of this interface might be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface. A CSSPrimitiveValue object only occurs in a context of a CSS property.
Conversions are allowed between absolute values (from millimeters to centimeters, from degrees to radians, and so on) but not between relative values. (For example, a pixel value cannot be converted to a centimeter value.) Percentage values can't be converted since they are relative to the parent value (or another property value). There is one exception for color percentage values: since a color percentage value is relative to the range 0-255, a color percentage value can be converted to a number; (see also the RGBColor interface).

An integer indicating which type of unit applies to the value:
  0 = CSS_UNKNOWN (of type unsigned short)
The value is not a recognized CSS2 value. The value can only be obtained by using the cssText attribute.
  1 = CSS_NUMBER (of type unsigned short)
The value is a simple number. The value can be obtained by using the getFloatValue() method.
  2 = CSS_PERCENTAGE (of type unsigned short)
The value is a percentage. The value can be obtained by using the getFloatValue() method.
  3 = CSS_EMS (of type unsigned short)
The value is a length (ems). The value can be obtained by using the getFloatValue() method.
  4 = CSS_EXS (of type unsigned short)
The value is a length (exs). The value can be obtained by using the getFloatValue() method.
  5 = CSS_PX (of type unsigned short)
The value is a length (px). The value can be obtained by using the getFloatValue() method.
  6 = CSS_CM (of type unsigned short)
The value is a length (cm). The value can be obtained by using the getFloatValue() method.
  7 = CSS_MM (of type unsigned short)
The value is a length (mm). The value can be obtained by using the getFloatValue method.
  8 = CSS_IN (of type unsigned short)
The value is a length (in). The value can be obtained by using the getFloatValue() method.
  9 = CSS_PT (of type unsigned short)
The value is a length (pt). The value can be obtained by using the getFloatValue method.
10 = CSS_PC (of type unsigned short)
The value is a length (pc). The value can be obtained by using the getFloatValue() method.
11 = CSS_DEG (of type unsigned short)
The value is an angle (deg). The value can be obtained by using the getFloatValue() method.
12 = CSS_RAD (of type unsigned short)
The value is an angle (rad). The value can be obtained by using the getFloatValue() method.
13 = CSS_GRAD (of type unsigned short)
The value is an angle (grad). The value can be obtained by using the getFloatValue() method.
14 = CSS_MS (of type unsigned short)
The value is a time (ms). The value can be obtained by using the getFloatValue() method.
15 = CSS_S (of type unsigned short)
The value is a time (s). The value can be obtained by using the getFloatValue() method.
16 = CSS_HZ (of type unsigned short)
The value is a frequency (Hz). The value can be obtained by using the getFloatValue() method.
17 = CSS_KHZ (of type unsigned short)
The value is a frequency (kHz). The value can be obtained by using the getFloatValue() method.
18 = CSS_DIMENSION (of type unsigned short)
The value is a number with an unknown dimension. The value can be obtained by using the getFloatValue() method.
19 = CSS_STRING (of type unsigned short)
The value is a STRING. The value can be obtained by using the getStringValue() method.
20 = CSS_URI (of type unsigned short)
The value is a URI. The value can be obtained by using the getStringValue() method.
21 = CSS_IDENT (of type unsigned short)
The value is an identifier. The value can be obtained by using the getStringValue() method.
22 = CSS_ATTR (of type unsigned short)
The value is a attribute function. The value can be obtained by using the getStringValue() method.
23 = CSS_COUNTER (of type unsigned short)
The value is a counter or counters function. The value can be obtained by using the getCounterValue() method.
24 = CSS_RECT (of type unsigned short)
The value is a rect function. The value can be obtained by using the getRectValue() method.
25 = CSS_RGBCOLOR (of type unsigned short)
The value is a RGB color. The value can be obtained by using the getRGBColorValue() method.