All Implemented Interfaces:
CSSValue
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).
See also the Document Object Model (DOM) Level 2 Style Specification.
DOM
- Level 2Field Summary | ||
---|---|---|
public static final short | CSS_UNKNOWN | The value is not a recognized CSS2 value. The value can only be
obtained by using the cssText attribute. |
public static final short | CSS_NUMBER | The value is a simple number. The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_PERCENTAGE | The value is a percentage. The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_EMS | The value is a length (ems). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_EXS | The value is a length (exs). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_PX | The value is a length (px). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_CM | The value is a length (cm). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_MM | The value is a length (mm). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_IN | The value is a length (in). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_PT | The value is a length (pt). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_PC | The value is a length (pc). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_DEG | The value is an angle (deg). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_RAD | The value is an angle (rad). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_GRAD | The value is an angle (grad). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_MS | The value is a time (ms). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_S | The value is a time (s). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_HZ | The value is a frequency (Hz). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_KHZ | The value is a frequency (kHz). The value can be obtained by using the
getFloatValue method. |
public static final short | CSS_DIMENSION | The value is a number with an unknown dimension. The value can be
obtained by using the getFloatValue method. |
public static final short | CSS_STRING | The value is a STRING. The value can be obtained by using the
getStringValue method. |
public static final short | CSS_URI | The value is a URI. The value can be obtained by using the
getStringValue method. |
public static final short | CSS_IDENT | The value is an identifier. The value can be obtained by using the
getStringValue method. |
public static final short | CSS_ATTR | The value is a attribute function. The value can be obtained by using
the getStringValue method. |
public static final short | CSS_COUNTER | The value is a counter or counters function. The value can be obtained
by using the getCounterValue method. |
public static final short | CSS_RECT | The value is a rect function. The value can be obtained by using the
getRectValue method. |
public static final short | CSS_RGBCOLOR | The value is a RGB color. The value can be obtained by using the
getRGBColorValue method. |
Method from org.w3c.dom.css.CSSPrimitiveValue Summary: |
---|
getCounterValue, getFloatValue, getPrimitiveType, getRGBColorValue, getRectValue, getStringValue, setFloatValue, setStringValue |
Method from org.w3c.dom.css.CSSPrimitiveValue Detail: |
---|
DOMException is
raised. Modification to the corresponding style property can be
achieved using the Counter interface. |
DOMException is raised. |
|
DOMException is raised.
Modification to the corresponding style property can be achieved
using the RGBColor interface. |
DOMException is raised.
Modification to the corresponding style property can be achieved
using the Rect interface. |
DOMException is raised. Some
properties (like 'font-family' or 'voice-family') convert a
whitespace separated list of idents to a string. |
DOMException will be raised. |
DOMException will be raised. |