Home | Trees | Indices | Help |
|
---|
|
object --+ | util.Base --+ | CSSValue --+ | CSSPrimitiveValue
represents a single CSS Value. 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. Might be obtained from the getPropertyCSSValue method of CSSStyleDeclaration.
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).
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
|||
cssValueType = 1 A (readonly) code defining the type of the value as defined above. |
|||
CSS_UNKNOWN = 0
|
|||
CSS_NUMBER = 1 A (readonly) code defining the type of the value as defined above. |
|||
CSS_PERCENTAGE = 2 A (readonly) code defining the type of the value as defined above. |
|||
CSS_EMS = 3
|
|||
CSS_EXS = 4
|
|||
CSS_PX = 5
|
|||
CSS_CM = 6
|
|||
CSS_MM = 7
|
|||
CSS_IN = 8
|
|||
CSS_PT = 9
|
|||
CSS_PC = 10
|
|||
CSS_DEG = 11
|
|||
CSS_RAD = 12
|
|||
CSS_GRAD = 13
|
|||
CSS_MS = 14
|
|||
CSS_S = 15
|
|||
CSS_HZ = 16
|
|||
CSS_KHZ = 17
|
|||
CSS_DIMENSION = 18
|
|||
CSS_STRING = 19
|
|||
CSS_URI = 20
|
|||
CSS_IDENT = 21
|
|||
CSS_ATTR = 22
|
|||
CSS_COUNTER = 23
|
|||
CSS_RECT = 24
|
|||
CSS_RGBCOLOR = 25
|
|||
CSS_RGBACOLOR = 26
|
|||
_floattypes =
|
|||
_stringtypes =
|
|||
_countertypes =
|
|||
_recttypes =
|
|||
_rbgtypes =
|
|||
_reNumDim = re.compile(r'
|
|||
_converter = {(CSS_CM, CSS_MM): lambda x: x* 10, (CSS_MM, CSS_
|
|||
Inherited from Inherited from Inherited from |
|
|||
primitiveType READONLY: The type of the value as defined by the constants specified above. |
|||
primitiveTypeString Name of primitive type of this value. |
|||
Inherited from Inherited from Inherited from |
|
|
(DOM method) 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.
returns not necessarily a float but some cases just an int e.g. if the value is 1px it return 1 and not 1.0 conversions might return strange values like 1.000000000001 |
(DOM method) 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.
|
(DOM method) This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised. Some properties (like 'font-family' or 'voice-family') convert a whitespace separated list of idents to a string. Only the actual value is returned so e.g. all the following return the actual value a: url(a), attr(a), "a", 'a' |
(DOM method) 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.
|
|
|
|
str(x)
|
|
_floattypes
|
_converter
|
|
primitiveTypeREADONLY: The type of the value as defined by the constants specified above.
|
primitiveTypeStringName of primitive type of this value.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Jul 09 15:30:06 2008 | http://epydoc.sourceforge.net |