CSSPrimitiveValue class
CSSPrimitiveValue class
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.
Inheritance: CSSPrimitiveValue
→
CSSValue
→
DOMObject
The CSSPrimitiveValue type exposes the following members:
Properties
Property | Description |
---|---|
css_text | A string representation of the current value. |
css_value_type | A code defining the type of the value. |
CSS_INHERIT | The value is inherited and the cssText contains “inherit”. |
CSS_PRIMITIVE_VALUE | The value is a primitive value and an instance of the CSSPrimitiveValue interface can be obtained by using binding-specific casting methods on this instance of the CSSValue interface. |
CSS_VALUE_LIST | The value is a CSSValue list and an instance of the CSSValueList interface can be obtained by using binding-specific casting methods on this instance of the CSSValue interface. |
CSS_CUSTOM | The value is a custom value. |
primitive_type | The type of the value as defined by the constants specified above. |
CSS_UNKNOWN | The value is not a recognized CSS2 value. The value can only be obtained by using the cssText attribute. |
CSS_NUMBER | The value is a simple number. The value can be obtained by using the getFloatValue method. |
CSS_PERCENTAGE | The value is a percentage. The value can be obtained by using the getFloatValue method. |
CSS_EMS | The value is a length (ems). The value can be obtained by using the getFloatValue method. |
CSS_EXS | The value is a length (exs). The value can be obtained by using the getFloatValue method. |
CSS_PX | The value is a length (px). The value can be obtained by using the getFloatValue method. |
CSS_CM | The value is a length (cm). The value can be obtained by using the getFloatValue method. |
CSS_MM | The value is a length (mm). The value can be obtained by using the getFloatValue method. |
CSS_IN | The value is a length (in). The value can be obtained by using the getFloatValue method. |
CSS_PT | The value is a length (pt). The value can be obtained by using the getFloatValue method. |
CSS_PC | The value is a length (pc). The value can be obtained by using the getFloatValue method. |
CSS_DEG | The value is an angle (deg). The value can be obtained by using the getFloatValue method. |
CSS_RAD | The value is an angle (rad). The value can be obtained by using the getFloatValue method. |
CSS_GRAD | The value is an angle (grad). The value can be obtained by using the getFloatValue method. |
CSS_MS | The value is a time (ms). The value can be obtained by using the getFloatValue method. |
CSS_S | The value is a time (s). The value can be obtained by using the getFloatValue method. |
CSS_HZ | The value is a frequency (Hz). The value can be obtained by using the getFloatValue method. |
CSS_KHZ | The value is a frequency (kHz). The value can be obtained by using the getFloatValue method. |
CSS_DIMENSION | The value is a number with an unknown dimension. The value can be obtained by using the getFloatValue method. |
CSS_REM | The value is a length (rem). The value can be obtained by using the getFloatValue method. |
CSS_CH | The value is a length (ch). The value can be obtained by using the getFloatValue method. |
CSS_STRING | The value is a STRING. The value can be obtained by using the getStringValue method. |
CSS_URI | The value is a URI. The value can be obtained by using the getStringValue method. |
CSS_IDENT | The value is an identifier. The value can be obtained by using the getStringValue method. |
CSS_ATTR | The value is a attribute function. The value can be obtained by using the getStringValue method. |
CSS_COUNTER | The value is a counter or counters function. The value can be obtained by using the GetCounterValue method. |
CSS_RECT | The value is a rect function. The value can be obtained by using the GetRectValue method. |
CSS_RGBCOLOR | The value is a RGB color. The value can be obtained by using the GetRGBColorValue method. |
CSS_DPI | The value is a dots per inch (dpi). |
CSS_DPCM | The value is a dots per centimeter (dpcm). |
CSS_DPPX | The value is a dots per ‘px’ unit (dppx). |
CSS_VW | The value is a percentage of the full viewport width. |
CSS_VH | The value is a percentage of the full viewport height. |
CSS_VMIN | The value is a percentage of the viewport width or height, whichever is smaller. |
CSS_VMAX | The value is a percentage of the viewport width or height, whichever is larger. |
Methods
Method | Description |
---|---|
get_platform_type | This method is used to retrieve ECMAScript object Type. |
set_float_value | A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised. |
get_float_value | This method is used to get a float value in a specified unit. If this CSS value doesn’t contain a float value or can’t be converted into the specified unit, a DOMException is raised. |
set_int_value | A method to set the int value with a specified unit. If the property attached with this value can not accept the specified unit or the int value, the value will be unchanged and a DOMException will be raised. |
get_int_value | This method is used to get an int value in a specified unit. If this CSS value doesn’t contain an int value or can’t be converted into the specified unit, a DOMException is raised. |
set_string_value | A method to set the string value with the specified unit. If the property attached to this value can’t accept the specified unit or the string value, the value will be unchanged and a DOMException will be raised. |
get_string_value | This method is used to get the string value. If the CSS value doesn’t contain a string value, a DOMException is raised. |
get_counter_value | This method is used to get the Counter value. If this CSS value doesn’t contain a counter value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Counter interface. |
get_rect_value | This method is used to get the Rect value. If this CSS value doesn’t contain a rect value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Rect interface. |
get_rgb_color_value | This method is used to get the RGB color. If this CSS value doesn’t contain a RGB color value, a DOMException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface. |
See Also
- module
aspose.svg.dom.css
- class
CSSPrimitiveValue
- class
CSSValue
- class
DOMObject