|
|
The <code> CSSPrimitiveValue </code> interface represents a single <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#values"> CSS value </a> . 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 properties explicitly within the block. An instance of this interface can be obtained from the <code> getPropertyCSSValue </code> method of the <code> CSSStyleDeclaration </code> interface.
| enum |
An integer indicating which type of unit applies to the value.
| unsigned short |
[const]
The type of the value as defined by the constants specified above.
| void |
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 <code> DOMException </code> will be raised.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
Parameters:
| unitType | A unit code as defined above. The unit code can only be a float unit type (e.g. <code> NUMBER </code> , <code> PERCENTAGE </code> , <code> CSS_EMS </code> , <code> CSS_EXS </code> , <code> CSS_PX </code> , <code> CSS_PX </code> , <code> CSS_CM </code> , <code> CSS_MM </code> , <code> CSS_IN </code> , <code> CSS_PT </code> , <code> CSS_PC </code> , <code> CSS_DEG </code> , <code> CSS_RAD </code> , <code> CSS_GRAD </code> , <code> CSS_MS </code> , <code> CSS_S </code> , <code> CSS_HZ </code> , <code> CSS_KHZ </code> , <code> CSS_DIMENSION </code> ). |
| floatValue | The new float value. |
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, attached, property, doesn't, support, the, float, value, or, the, unit, type.
| float |
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 <code> DOMException </code> is raised.
Parameters:
| unitType | A unit code to get the float value. The unit code can only be a float unit type (e.g. <code> CSS_NUMBER </code> , <code> CSS_PERCENTAGE </code> , <code> CSS_EMS </code> , <code> CSS_EXS </code> , <code> CSS_PX </code> , <code> CSS_PX </code> , <code> CSS_CM </code> , <code> CSS_MM </code> , <code> CSS_IN </code> , <code> CSS_PT </code> , <code> CSS_PC </code> , <code> CSS_DEG </code> , <code> CSS_RAD </code> , <code> CSS_GRAD </code> , <code> CSS_MS </code> , <code> CSS_S </code> , <code> CSS_HZ </code> , <code> CSS_KHZ </code> , <code> CSS_DIMENSION </code> ). |
Returns: The float value in the specified unit.
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, CSS, value, doesn't, contain, a, float, value, or, if, the, float, value, can't, be, converted, into, the, specified, unit.
| void |
A method to set the string value with a 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 <code> DOMException </code> will be raised.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.
Parameters:
| stringType | A string code as defined above. The string code can only be a string unit type (e.g. <code> CSS_URI </code> , <code> CSS_IDENT </code> , <code> CSS_INHERIT </code> and <code> CSS_ATTR </code> ). |
| stringValue | The new string value. If the <code> stringType </code> is equal to <code> CSS_INHERIT </code> , the <code> stringValue </code> should be <code> inherit </code> . |
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, CSS, value, doesn't, contain, a, string, value, or, if, the, string, value, can't, be, converted, into, the, specified, unit.
| DOM::DOMString |
This method is used to get the string value in a specified unit. If the CSS value doesn't contain a string value, a <code> DOMException </code> is raised.
Returns: The string value in the current unit. The current <code> valueType </code> can only be a string unit type (e.g. <code> CSS_URI </code> , <code> CSS_IDENT </code> and <code> CSS_ATTR </code> ).
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, CSS, value, doesn't, contain, a, string, value.
| Counter |
This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a <code> DOMException </code> is raised. Modification to the corresponding style property can be achieved using the <code> Counter </code> interface.
Returns: The Counter value.
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, CSS, value, doesn't, contain, a, Counter, value.
| Rect |
This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a <code> DOMException </code> is raised. Modification to the corresponding style property can be achieved using the <code> Rect </code> interface.
Returns: The Rect value.
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, CSS, value, doesn't, contain, a, Rect, value.
| RGBColor |
This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a <code> DOMException </code> is raised. Modification to the corresponding style property can be achieved using the <code> RGBColor </code> interface.
Returns: the RGB color value.
Throws: DOMException, INVALID_ACCESS_ERR:, Raises, if, the, attached, property, can't, return, a, RGB, color, value.
| Generated by: ssk@tauon.ph.unimelb.EDU.AU on Wed May 23 05:55:52 2001, using kdoc 2.0a35. |